diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..e328461 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,20 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "/usr/include/opus", + "${workspaceFolder}/external/sourcesdk/include", + "${workspaceFolder}/external/celt-e18de77/include", + "${workspaceFolder}/external/SILK_SDK_SRC_FLP_v1.0.9/interface", + "${workspaceFolder}/external/snappy-1.1.9", + "${workspaceFolder}/demboyz" + ], + "defines": [], + "compilerPath": "/usr/bin/clang", + "cStandard": "c17", + "intelliSenseMode": "linux-clang-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/demboyz/base/CRC.h b/demboyz/base/CRC.h new file mode 100644 index 0000000..e20db35 --- /dev/null +++ b/demboyz/base/CRC.h @@ -0,0 +1,2066 @@ +/** + @file CRC.h + @author Daniel Bahr + @version 1.1.0.0 + @copyright + @parblock + CRC++ + Copyright (c) 2021, Daniel Bahr + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of CRC++ nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + @endparblock +*/ + +/* + CRC++ can be configured by setting various #defines before #including this header file: + + #define crcpp_uint8 - Specifies the type used to store CRCs that have a width of 8 bits or less. + This type is not used in CRC calculations. Defaults to ::std::uint8_t. + #define crcpp_uint16 - Specifies the type used to store CRCs that have a width between 9 and 16 bits (inclusive). + This type is not used in CRC calculations. Defaults to ::std::uint16_t. + #define crcpp_uint32 - Specifies the type used to store CRCs that have a width between 17 and 32 bits (inclusive). + This type is not used in CRC calculations. Defaults to ::std::uint32_t. + #define crcpp_uint64 - Specifies the type used to store CRCs that have a width between 33 and 64 bits (inclusive). + This type is not used in CRC calculations. Defaults to ::std::uint64_t. + #define crcpp_size - This type is used for loop iteration and function signatures only. Defaults to ::std::size_t. + #define CRCPP_USE_NAMESPACE - Define to place all CRC++ code within the ::CRCPP namespace. + #define CRCPP_BRANCHLESS - Define to enable a branchless CRC implementation. The branchless implementation uses a single integer + multiplication in the bit-by-bit calculation instead of a small conditional. The branchless implementation + may be faster on processor architectures which support single-instruction integer multiplication. + #define CRCPP_USE_CPP11 - Define to enables C++11 features (move semantics, constexpr, static_assert, etc.). + #define CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS - Define to include definitions for little-used CRCs. +*/ + +#ifndef CRCPP_CRC_H_ +#define CRCPP_CRC_H_ + +#include // Includes CHAR_BIT +#ifdef CRCPP_USE_CPP11 +#include // Includes ::std::size_t +#include // Includes ::std::uint8_t, ::std::uint16_t, ::std::uint32_t, ::std::uint64_t +#else +#include // Includes size_t +#include // Includes uint8_t, uint16_t, uint32_t, uint64_t +#endif +#include // Includes ::std::numeric_limits +#include // Includes ::std::move + +#ifndef crcpp_uint8 +# ifdef CRCPP_USE_CPP11 + /// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions. +# define crcpp_uint8 ::std::uint8_t +# else + /// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions. +# define crcpp_uint8 uint8_t +# endif +#endif + +#ifndef crcpp_uint16 +# ifdef CRCPP_USE_CPP11 + /// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions. +# define crcpp_uint16 ::std::uint16_t +# else + /// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions. +# define crcpp_uint16 uint16_t +# endif +#endif + +#ifndef crcpp_uint32 +# ifdef CRCPP_USE_CPP11 + /// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions. +# define crcpp_uint32 ::std::uint32_t +# else + /// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions. +# define crcpp_uint32 uint32_t +# endif +#endif + +#ifndef crcpp_uint64 +# ifdef CRCPP_USE_CPP11 + /// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions. +# define crcpp_uint64 ::std::uint64_t +# else + /// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions. +# define crcpp_uint64 uint64_t +# endif +#endif + +#ifndef crcpp_size +# ifdef CRCPP_USE_CPP11 + /// @brief Unsigned size definition, used for specifying data sizes. +# define crcpp_size ::std::size_t +# else + /// @brief Unsigned size definition, used for specifying data sizes. +# define crcpp_size size_t +# endif +#endif + +#ifdef CRCPP_USE_CPP11 + /// @brief Compile-time expression definition. +# define crcpp_constexpr constexpr +#else + /// @brief Compile-time expression definition. +# define crcpp_constexpr const +#endif + +#ifdef CRCPP_USE_NAMESPACE +namespace CRCPP +{ +#endif + +/** + @brief Static class for computing CRCs. + @note This class supports computation of full and multi-part CRCs, using a bit-by-bit algorithm or a + byte-by-byte lookup table. The CRCs are calculated using as many optimizations as is reasonable. + If compiling with C++11, the constexpr keyword is used liberally so that many calculations are + performed at compile-time instead of at runtime. +*/ +class CRC +{ +public: + // Forward declaration + template + struct Table; + + /** + @brief CRC parameters. + */ + template + struct Parameters + { + CRCType polynomial; ///< CRC polynomial + CRCType initialValue; ///< Initial CRC value + CRCType finalXOR; ///< Value to XOR with the final CRC + bool reflectInput; ///< true to reflect all input bytes + bool reflectOutput; ///< true to reflect the output CRC (reflection occurs before the final XOR) + + Table MakeTable() const; + }; + + /** + @brief CRC lookup table. After construction, the CRC parameters are fixed. + @note A CRC table can be used for multiple CRC calculations. + */ + template + struct Table + { + // Constructors are intentionally NOT marked explicit. + Table(const Parameters & parameters); + +#ifdef CRCPP_USE_CPP11 + Table(Parameters && parameters); +#endif + + const Parameters & GetParameters() const; + + const CRCType * GetTable() const; + + CRCType operator[](unsigned char index) const; + + private: + void InitTable(); + + Parameters parameters; ///< CRC parameters used to construct the table + CRCType table[1 << CHAR_BIT]; ///< CRC lookup table + }; + + // The number of bits in CRCType must be at least as large as CRCWidth. + // CRCType must be an unsigned integer type or a custom type with operator overloads. + template + static CRCType Calculate(const void * data, crcpp_size size, const Parameters & parameters); + + template + static CRCType Calculate(const void * data, crcpp_size size, const Parameters & parameters, CRCType crc); + + template + static CRCType Calculate(const void * data, crcpp_size size, const Table & lookupTable); + + template + static CRCType Calculate(const void * data, crcpp_size size, const Table & lookupTable, CRCType crc); + + template + static CRCType CalculateBits(const void * data, crcpp_size size, const Parameters & parameters); + + template + static CRCType CalculateBits(const void * data, crcpp_size size, const Parameters & parameters, CRCType crc); + + template + static CRCType CalculateBits(const void * data, crcpp_size size, const Table & lookupTable); + + template + static CRCType CalculateBits(const void * data, crcpp_size size, const Table & lookupTable, CRCType crc); + + // Common CRCs up to 64 bits. + // Note: Check values are the computed CRCs when given an ASCII input of "123456789" (without null terminator) +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + static const Parameters< crcpp_uint8, 4> & CRC_4_ITU(); + static const Parameters< crcpp_uint8, 5> & CRC_5_EPC(); + static const Parameters< crcpp_uint8, 5> & CRC_5_ITU(); + static const Parameters< crcpp_uint8, 5> & CRC_5_USB(); + static const Parameters< crcpp_uint8, 6> & CRC_6_CDMA2000A(); + static const Parameters< crcpp_uint8, 6> & CRC_6_CDMA2000B(); + static const Parameters< crcpp_uint8, 6> & CRC_6_ITU(); + static const Parameters< crcpp_uint8, 6> & CRC_6_NR(); + static const Parameters< crcpp_uint8, 7> & CRC_7(); +#endif + static const Parameters< crcpp_uint8, 8> & CRC_8(); +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + static const Parameters< crcpp_uint8, 8> & CRC_8_EBU(); + static const Parameters< crcpp_uint8, 8> & CRC_8_MAXIM(); + static const Parameters< crcpp_uint8, 8> & CRC_8_WCDMA(); + static const Parameters< crcpp_uint8, 8> & CRC_8_LTE(); + static const Parameters & CRC_10(); + static const Parameters & CRC_10_CDMA2000(); + static const Parameters & CRC_11(); + static const Parameters & CRC_11_NR(); + static const Parameters & CRC_12_CDMA2000(); + static const Parameters & CRC_12_DECT(); + static const Parameters & CRC_12_UMTS(); + static const Parameters & CRC_13_BBC(); + static const Parameters & CRC_15(); + static const Parameters & CRC_15_MPT1327(); +#endif + static const Parameters & CRC_16_ARC(); + static const Parameters & CRC_16_BUYPASS(); + static const Parameters & CRC_16_CCITTFALSE(); +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + static const Parameters & CRC_16_CDMA2000(); + static const Parameters & CRC_16_CMS(); + static const Parameters & CRC_16_DECTR(); + static const Parameters & CRC_16_DECTX(); + static const Parameters & CRC_16_DNP(); +#endif + static const Parameters & CRC_16_GENIBUS(); + static const Parameters & CRC_16_KERMIT(); +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + static const Parameters & CRC_16_MAXIM(); + static const Parameters & CRC_16_MODBUS(); + static const Parameters & CRC_16_T10DIF(); + static const Parameters & CRC_16_USB(); +#endif + static const Parameters & CRC_16_X25(); + static const Parameters & CRC_16_XMODEM(); +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + static const Parameters & CRC_17_CAN(); + static const Parameters & CRC_21_CAN(); + static const Parameters & CRC_24(); + static const Parameters & CRC_24_FLEXRAYA(); + static const Parameters & CRC_24_FLEXRAYB(); + static const Parameters & CRC_24_LTEA(); + static const Parameters & CRC_24_LTEB(); + static const Parameters & CRC_24_NRC(); + static const Parameters & CRC_30(); +#endif + static const Parameters & CRC_32(); + static const Parameters & CRC_32_BZIP2(); +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + static const Parameters & CRC_32_C(); +#endif + static const Parameters & CRC_32_MPEG2(); + static const Parameters & CRC_32_POSIX(); +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + static const Parameters & CRC_32_Q(); + static const Parameters & CRC_40_GSM(); + static const Parameters & CRC_64(); +#endif + +#ifdef CRCPP_USE_CPP11 + CRC() = delete; + CRC(const CRC & other) = delete; + CRC & operator=(const CRC & other) = delete; + CRC(CRC && other) = delete; + CRC & operator=(CRC && other) = delete; +#endif + +private: +#ifndef CRCPP_USE_CPP11 + CRC(); + CRC(const CRC & other); + CRC & operator=(const CRC & other); +#endif + + template + static IntegerType Reflect(IntegerType value, crcpp_uint16 numBits); + + template + static CRCType Finalize(CRCType remainder, CRCType finalXOR, bool reflectOutput); + + template + static CRCType UndoFinalize(CRCType remainder, CRCType finalXOR, bool reflectOutput); + + template + static CRCType CalculateRemainder(const void * data, crcpp_size size, const Parameters & parameters, CRCType remainder); + + template + static CRCType CalculateRemainder(const void * data, crcpp_size size, const Table & lookupTable, CRCType remainder); + + template + static CRCType CalculateRemainderBits(unsigned char byte, crcpp_size numBits, const Parameters & parameters, CRCType remainder); +}; + +/** + @brief Returns a CRC lookup table construct using these CRC parameters. + @note This function primarily exists to allow use of the auto keyword instead of instantiating + a table directly, since template parameters are not inferred in constructors. + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC lookup table +*/ +template +inline CRC::Table CRC::Parameters::MakeTable() const +{ + // This should take advantage of RVO and optimize out the copy. + return CRC::Table(*this); +} + +/** + @brief Constructs a CRC table from a set of CRC parameters + @param[in] params CRC parameters + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC +*/ +template +inline CRC::Table::Table(const Parameters & params) : + parameters(params) +{ + InitTable(); +} + +#ifdef CRCPP_USE_CPP11 +/** + @brief Constructs a CRC table from a set of CRC parameters + @param[in] params CRC parameters + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC +*/ +template +inline CRC::Table::Table(Parameters && params) : + parameters(::std::move(params)) +{ + InitTable(); +} +#endif + +/** + @brief Gets the CRC parameters used to construct the CRC table + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC parameters +*/ +template +inline const CRC::Parameters & CRC::Table::GetParameters() const +{ + return parameters; +} + +/** + @brief Gets the CRC table + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC table +*/ +template +inline const CRCType * CRC::Table::GetTable() const +{ + return table; +} + +/** + @brief Gets an entry in the CRC table + @param[in] index Index into the CRC table + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC table entry +*/ +template +inline CRCType CRC::Table::operator[](unsigned char index) const +{ + return table[index]; +} + +/** + @brief Initializes a CRC table. + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC +*/ +template +inline void CRC::Table::InitTable() +{ + // For masking off the bits for the CRC (in the event that the number of bits in CRCType is larger than CRCWidth) + static crcpp_constexpr CRCType BIT_MASK((CRCType(1) << (CRCWidth - CRCType(1))) | + ((CRCType(1) << (CRCWidth - CRCType(1))) - CRCType(1))); + + // The conditional expression is used to avoid a -Wshift-count-overflow warning. + static crcpp_constexpr CRCType SHIFT((CHAR_BIT >= CRCWidth) ? static_cast(CHAR_BIT - CRCWidth) : 0); + + CRCType crc; + unsigned char byte = 0; + + // Loop over each dividend (each possible number storable in an unsigned char) + do + { + crc = CRC::CalculateRemainder(&byte, sizeof(byte), parameters, CRCType(0)); + + // This mask might not be necessary; all unit tests pass with this line commented out, + // but that might just be a coincidence based on the CRC parameters used for testing. + // In any case, this is harmless to leave in and only adds a single machine instruction per loop iteration. + crc &= BIT_MASK; + + if (!parameters.reflectInput && CRCWidth < CHAR_BIT) + { + // Undo the special operation at the end of the CalculateRemainder() + // function for non-reflected CRCs < CHAR_BIT. + crc = static_cast(crc << SHIFT); + } + + table[byte] = crc; + } + while (++byte); +} + +/** + @brief Computes a CRC. + @param[in] data Data over which CRC will be computed + @param[in] size Size of the data, in bytes + @param[in] parameters CRC parameters + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC +*/ +template +inline CRCType CRC::Calculate(const void * data, crcpp_size size, const Parameters & parameters) +{ + CRCType remainder = CalculateRemainder(data, size, parameters, parameters.initialValue); + + // No need to mask the remainder here; the mask will be applied in the Finalize() function. + + return Finalize(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); +} +/** + @brief Appends additional data to a previous CRC calculation. + @note This function can be used to compute multi-part CRCs. + @param[in] data Data over which CRC will be computed + @param[in] size Size of the data, in bytes + @param[in] parameters CRC parameters + @param[in] crc CRC from a previous calculation + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC +*/ +template +inline CRCType CRC::Calculate(const void * data, crcpp_size size, const Parameters & parameters, CRCType crc) +{ + CRCType remainder = UndoFinalize(crc, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); + + remainder = CalculateRemainder(data, size, parameters, remainder); + + // No need to mask the remainder here; the mask will be applied in the Finalize() function. + + return Finalize(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); +} + +/** + @brief Computes a CRC via a lookup table. + @param[in] data Data over which CRC will be computed + @param[in] size Size of the data, in bytes + @param[in] lookupTable CRC lookup table + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC +*/ +template +inline CRCType CRC::Calculate(const void * data, crcpp_size size, const Table & lookupTable) +{ + const Parameters & parameters = lookupTable.GetParameters(); + + CRCType remainder = CalculateRemainder(data, size, lookupTable, parameters.initialValue); + + // No need to mask the remainder here; the mask will be applied in the Finalize() function. + + return Finalize(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); +} + +/** + @brief Appends additional data to a previous CRC calculation using a lookup table. + @note This function can be used to compute multi-part CRCs. + @param[in] data Data over which CRC will be computed + @param[in] size Size of the data, in bytes + @param[in] lookupTable CRC lookup table + @param[in] crc CRC from a previous calculation + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC +*/ +template +inline CRCType CRC::Calculate(const void * data, crcpp_size size, const Table & lookupTable, CRCType crc) +{ + const Parameters & parameters = lookupTable.GetParameters(); + + CRCType remainder = UndoFinalize(crc, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); + + remainder = CalculateRemainder(data, size, lookupTable, remainder); + + // No need to mask the remainder here; the mask will be applied in the Finalize() function. + + return Finalize(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); +} + +/** + @brief Computes a CRC. + @param[in] data Data over which CRC will be computed + @param[in] size Size of the data, in bits + @param[in] parameters CRC parameters + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC +*/ +template +inline CRCType CRC::CalculateBits(const void * data, crcpp_size size, const Parameters & parameters) +{ + CRCType remainder = parameters.initialValue; + + // Calculate the remainder on a whole number of bytes first, then call + // a special-case function for the remaining bits. + crcpp_size wholeNumberOfBytes = size / CHAR_BIT; + if (wholeNumberOfBytes > 0) + { + remainder = CalculateRemainder(data, wholeNumberOfBytes, parameters, remainder); + } + + crcpp_size remainingNumberOfBits = size % CHAR_BIT; + if (remainingNumberOfBits != 0) + { + unsigned char lastByte = *(reinterpret_cast(data) + wholeNumberOfBytes); + remainder = CalculateRemainderBits(lastByte, remainingNumberOfBits, parameters, remainder); + } + + // No need to mask the remainder here; the mask will be applied in the Finalize() function. + + return Finalize(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); +} +/** + @brief Appends additional data to a previous CRC calculation. + @note This function can be used to compute multi-part CRCs. + @param[in] data Data over which CRC will be computed + @param[in] size Size of the data, in bits + @param[in] parameters CRC parameters + @param[in] crc CRC from a previous calculation + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC +*/ +template +inline CRCType CRC::CalculateBits(const void * data, crcpp_size size, const Parameters & parameters, CRCType crc) +{ + CRCType remainder = UndoFinalize(crc, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); + + // Calculate the remainder on a whole number of bytes first, then call + // a special-case function for the remaining bits. + crcpp_size wholeNumberOfBytes = size / CHAR_BIT; + if (wholeNumberOfBytes > 0) + { + remainder = CalculateRemainder(data, wholeNumberOfBytes, parameters, parameters.initialValue); + } + + crcpp_size remainingNumberOfBits = size % CHAR_BIT; + if (remainingNumberOfBits != 0) + { + unsigned char lastByte = *(reinterpret_cast(data) + wholeNumberOfBytes); + remainder = CalculateRemainderBits(lastByte, remainingNumberOfBits, parameters, remainder); + } + + // No need to mask the remainder here; the mask will be applied in the Finalize() function. + + return Finalize(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); +} + +/** + @brief Computes a CRC via a lookup table. + @param[in] data Data over which CRC will be computed + @param[in] size Size of the data, in bits + @param[in] lookupTable CRC lookup table + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC +*/ +template +inline CRCType CRC::CalculateBits(const void * data, crcpp_size size, const Table & lookupTable) +{ + const Parameters & parameters = lookupTable.GetParameters(); + + CRCType remainder = parameters.initialValue; + + // Calculate the remainder on a whole number of bytes first, then call + // a special-case function for the remaining bits. + crcpp_size wholeNumberOfBytes = size / CHAR_BIT; + if (wholeNumberOfBytes > 0) + { + remainder = CalculateRemainder(data, wholeNumberOfBytes, lookupTable, remainder); + } + + crcpp_size remainingNumberOfBits = size % CHAR_BIT; + if (remainingNumberOfBits != 0) + { + unsigned char lastByte = *(reinterpret_cast(data) + wholeNumberOfBytes); + remainder = CalculateRemainderBits(lastByte, remainingNumberOfBits, parameters, remainder); + } + + // No need to mask the remainder here; the mask will be applied in the Finalize() function. + + return Finalize(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); +} + +/** + @brief Appends additional data to a previous CRC calculation using a lookup table. + @note This function can be used to compute multi-part CRCs. + @param[in] data Data over which CRC will be computed + @param[in] size Size of the data, in bits + @param[in] lookupTable CRC lookup table + @param[in] crc CRC from a previous calculation + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC +*/ +template +inline CRCType CRC::CalculateBits(const void * data, crcpp_size size, const Table & lookupTable, CRCType crc) +{ + const Parameters & parameters = lookupTable.GetParameters(); + + CRCType remainder = UndoFinalize(crc, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); + + // Calculate the remainder on a whole number of bytes first, then call + // a special-case function for the remaining bits. + crcpp_size wholeNumberOfBytes = size / CHAR_BIT; + if (wholeNumberOfBytes > 0) + { + remainder = CalculateRemainder(data, wholeNumberOfBytes, lookupTable, parameters.initialValue); + } + + crcpp_size remainingNumberOfBits = size % CHAR_BIT; + if (remainingNumberOfBits > 0) + { + unsigned char lastByte = *(reinterpret_cast(data) + wholeNumberOfBytes); + remainder = CalculateRemainderBits(lastByte, remainingNumberOfBits, parameters, remainder); + } + + // No need to mask the remainder here; the mask will be applied in the Finalize() function. + + return Finalize(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput); +} + +/** + @brief Reflects (i.e. reverses the bits within) an integer value. + @param[in] value Value to reflect + @param[in] numBits Number of bits in the integer which will be reflected + @tparam IntegerType Integer type of the value being reflected + @return Reflected value +*/ +template +inline IntegerType CRC::Reflect(IntegerType value, crcpp_uint16 numBits) +{ + IntegerType reversedValue(0); + + for (crcpp_uint16 i = 0; i < numBits; ++i) + { + reversedValue = static_cast((reversedValue << 1) | (value & 1)); + value = static_cast(value >> 1); + } + + return reversedValue; +} + +/** + @brief Computes the final reflection and XOR of a CRC remainder. + @param[in] remainder CRC remainder to reflect and XOR + @param[in] finalXOR Final value to XOR with the remainder + @param[in] reflectOutput true to reflect each byte of the remainder before the XOR + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return Final CRC +*/ +template +inline CRCType CRC::Finalize(CRCType remainder, CRCType finalXOR, bool reflectOutput) +{ + // For masking off the bits for the CRC (in the event that the number of bits in CRCType is larger than CRCWidth) + static crcpp_constexpr CRCType BIT_MASK = (CRCType(1) << (CRCWidth - CRCType(1))) | + ((CRCType(1) << (CRCWidth - CRCType(1))) - CRCType(1)); + + if (reflectOutput) + { + remainder = Reflect(remainder, CRCWidth); + } + + return (remainder ^ finalXOR) & BIT_MASK; +} + +/** + @brief Undoes the process of computing the final reflection and XOR of a CRC remainder. + @note This function allows for computation of multi-part CRCs + @note Calling UndoFinalize() followed by Finalize() (or vice versa) will always return the original remainder value: + + CRCType x = ...; + CRCType y = Finalize(x, finalXOR, reflectOutput); + CRCType z = UndoFinalize(y, finalXOR, reflectOutput); + assert(x == z); + + @param[in] crc Reflected and XORed CRC + @param[in] finalXOR Final value XORed with the remainder + @param[in] reflectOutput true if the remainder is to be reflected + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return Un-finalized CRC remainder +*/ +template +inline CRCType CRC::UndoFinalize(CRCType crc, CRCType finalXOR, bool reflectOutput) +{ + // For masking off the bits for the CRC (in the event that the number of bits in CRCType is larger than CRCWidth) + static crcpp_constexpr CRCType BIT_MASK = (CRCType(1) << (CRCWidth - CRCType(1))) | + ((CRCType(1) << (CRCWidth - CRCType(1))) - CRCType(1)); + + crc = (crc & BIT_MASK) ^ finalXOR; + + if (reflectOutput) + { + crc = Reflect(crc, CRCWidth); + } + + return crc; +} + +/** + @brief Computes a CRC remainder. + @param[in] data Data over which the remainder will be computed + @param[in] size Size of the data, in bytes + @param[in] parameters CRC parameters + @param[in] remainder Running CRC remainder. Can be an initial value or the result of a previous CRC remainder calculation. + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC remainder +*/ +template +inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const Parameters & parameters, CRCType remainder) +{ +#ifdef CRCPP_USE_CPP11 + // This static_assert is put here because this function will always be compiled in no matter what + // the template parameters are and whether or not a table lookup or bit-by-bit algorithm is used. + static_assert(::std::numeric_limits::digits >= CRCWidth, "CRCType is too small to contain a CRC of width CRCWidth."); +#else + // Catching this compile-time error is very important. Sadly, the compiler error will be very cryptic, but it's + // better than nothing. + enum { static_assert_failed_CRCType_is_too_small_to_contain_a_CRC_of_width_CRCWidth = 1 / (::std::numeric_limits::digits >= CRCWidth ? 1 : 0) }; +#endif + + const unsigned char * current = reinterpret_cast(data); + + // Slightly different implementations based on the parameters. The current implementations try to eliminate as much + // computation from the inner loop (looping over each bit) as possible. + if (parameters.reflectInput) + { + CRCType polynomial = CRC::Reflect(parameters.polynomial, CRCWidth); + while (size--) + { + remainder = static_cast(remainder ^ *current++); + + // An optimizing compiler might choose to unroll this loop. + for (crcpp_size i = 0; i < CHAR_BIT; ++i) + { +#ifdef CRCPP_BRANCHLESS + // Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following: + // if (remainder & 1) + // remainder = (remainder >> 1) ^ polynomial; + // else + // remainder >>= 1; + remainder = static_cast((remainder >> 1) ^ ((remainder & 1) * polynomial)); +#else + remainder = static_cast((remainder & 1) ? ((remainder >> 1) ^ polynomial) : (remainder >> 1)); +#endif + } + } + } + else if (CRCWidth >= CHAR_BIT) + { + static crcpp_constexpr CRCType CRC_WIDTH_MINUS_ONE(CRCWidth - CRCType(1)); +#ifndef CRCPP_BRANCHLESS + static crcpp_constexpr CRCType CRC_HIGHEST_BIT_MASK(CRCType(1) << CRC_WIDTH_MINUS_ONE); +#endif + // The conditional expression is used to avoid a -Wshift-count-overflow warning. + static crcpp_constexpr CRCType SHIFT((CRCWidth >= CHAR_BIT) ? static_cast(CRCWidth - CHAR_BIT) : 0); + + while (size--) + { + remainder = static_cast(remainder ^ (static_cast(*current++) << SHIFT)); + + // An optimizing compiler might choose to unroll this loop. + for (crcpp_size i = 0; i < CHAR_BIT; ++i) + { +#ifdef CRCPP_BRANCHLESS + // Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following: + // if (remainder & CRC_HIGHEST_BIT_MASK) + // remainder = (remainder << 1) ^ parameters.polynomial; + // else + // remainder <<= 1; + remainder = static_cast((remainder << 1) ^ (((remainder >> CRC_WIDTH_MINUS_ONE) & 1) * parameters.polynomial)); +#else + remainder = static_cast((remainder & CRC_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ parameters.polynomial) : (remainder << 1)); +#endif + } + } + } + else + { + static crcpp_constexpr CRCType CHAR_BIT_MINUS_ONE(CHAR_BIT - 1); +#ifndef CRCPP_BRANCHLESS + static crcpp_constexpr CRCType CHAR_BIT_HIGHEST_BIT_MASK(CRCType(1) << CHAR_BIT_MINUS_ONE); +#endif + // The conditional expression is used to avoid a -Wshift-count-overflow warning. + static crcpp_constexpr CRCType SHIFT((CHAR_BIT >= CRCWidth) ? static_cast(CHAR_BIT - CRCWidth) : 0); + + CRCType polynomial = static_cast(parameters.polynomial << SHIFT); + remainder = static_cast(remainder << SHIFT); + + while (size--) + { + remainder = static_cast(remainder ^ *current++); + + // An optimizing compiler might choose to unroll this loop. + for (crcpp_size i = 0; i < CHAR_BIT; ++i) + { +#ifdef CRCPP_BRANCHLESS + // Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following: + // if (remainder & CHAR_BIT_HIGHEST_BIT_MASK) + // remainder = (remainder << 1) ^ polynomial; + // else + // remainder <<= 1; + remainder = static_cast((remainder << 1) ^ (((remainder >> CHAR_BIT_MINUS_ONE) & 1) * polynomial)); +#else + remainder = static_cast((remainder & CHAR_BIT_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ polynomial) : (remainder << 1)); +#endif + } + } + + remainder = static_cast(remainder >> SHIFT); + } + + return remainder; +} + +/** + @brief Computes a CRC remainder using lookup table. + @param[in] data Data over which the remainder will be computed + @param[in] size Size of the data, in bytes + @param[in] lookupTable CRC lookup table + @param[in] remainder Running CRC remainder. Can be an initial value or the result of a previous CRC remainder calculation. + @tparam CRCType Integer type for storing the CRC result + @tparam CRCWidth Number of bits in the CRC + @return CRC remainder +*/ +template +inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const Table & lookupTable, CRCType remainder) +{ + const unsigned char * current = reinterpret_cast(data); + + if (lookupTable.GetParameters().reflectInput) + { + while (size--) + { +#if defined(WIN32) || defined(_WIN32) || defined(WINCE) + // Disable warning about data loss when doing (remainder >> CHAR_BIT) when + // remainder is one byte long. The algorithm is still correct in this case, + // though it's possible that one additional machine instruction will be executed. +# pragma warning (push) +# pragma warning (disable : 4333) +#endif + remainder = static_cast((remainder >> CHAR_BIT) ^ lookupTable[static_cast(remainder ^ *current++)]); +#if defined(WIN32) || defined(_WIN32) || defined(WINCE) +# pragma warning (pop) +#endif + } + } + else if (CRCWidth >= CHAR_BIT) + { + // The conditional expression is used to avoid a -Wshift-count-overflow warning. + static crcpp_constexpr CRCType SHIFT((CRCWidth >= CHAR_BIT) ? static_cast(CRCWidth - CHAR_BIT) : 0); + + while (size--) + { + remainder = static_cast((remainder << CHAR_BIT) ^ lookupTable[static_cast((remainder >> SHIFT) ^ *current++)]); + } + } + else + { + // The conditional expression is used to avoid a -Wshift-count-overflow warning. + static crcpp_constexpr CRCType SHIFT((CHAR_BIT >= CRCWidth) ? static_cast(CHAR_BIT - CRCWidth) : 0); + + remainder = static_cast(remainder << SHIFT); + + while (size--) + { + // Note: no need to mask here since remainder is guaranteed to fit in a single byte. + remainder = lookupTable[static_cast(remainder ^ *current++)]; + } + + remainder = static_cast(remainder >> SHIFT); + } + + return remainder; +} + +template +inline CRCType CRC::CalculateRemainderBits(unsigned char byte, crcpp_size numBits, const Parameters & parameters, CRCType remainder) +{ + // Slightly different implementations based on the parameters. The current implementations try to eliminate as much + // computation from the inner loop (looping over each bit) as possible. + if (parameters.reflectInput) + { + CRCType polynomial = CRC::Reflect(parameters.polynomial, CRCWidth); + remainder = static_cast(remainder ^ byte); + + // An optimizing compiler might choose to unroll this loop. + for (crcpp_size i = 0; i < numBits; ++i) + { +#ifdef CRCPP_BRANCHLESS + // Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following: + // if (remainder & 1) + // remainder = (remainder >> 1) ^ polynomial; + // else + // remainder >>= 1; + remainder = static_cast((remainder >> 1) ^ ((remainder & 1) * polynomial)); +#else + remainder = static_cast((remainder & 1) ? ((remainder >> 1) ^ polynomial) : (remainder >> 1)); +#endif + } + } + else if (CRCWidth >= CHAR_BIT) + { + static crcpp_constexpr CRCType CRC_WIDTH_MINUS_ONE(CRCWidth - CRCType(1)); +#ifndef CRCPP_BRANCHLESS + static crcpp_constexpr CRCType CRC_HIGHEST_BIT_MASK(CRCType(1) << CRC_WIDTH_MINUS_ONE); +#endif + // The conditional expression is used to avoid a -Wshift-count-overflow warning. + static crcpp_constexpr CRCType SHIFT((CRCWidth >= CHAR_BIT) ? static_cast(CRCWidth - CHAR_BIT) : 0); + + remainder = static_cast(remainder ^ (static_cast(byte) << SHIFT)); + + // An optimizing compiler might choose to unroll this loop. + for (crcpp_size i = 0; i < numBits; ++i) + { +#ifdef CRCPP_BRANCHLESS + // Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following: + // if (remainder & CRC_HIGHEST_BIT_MASK) + // remainder = (remainder << 1) ^ parameters.polynomial; + // else + // remainder <<= 1; + remainder = static_cast((remainder << 1) ^ (((remainder >> CRC_WIDTH_MINUS_ONE) & 1) * parameters.polynomial)); +#else + remainder = static_cast((remainder & CRC_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ parameters.polynomial) : (remainder << 1)); +#endif + } + } + else + { + static crcpp_constexpr CRCType CHAR_BIT_MINUS_ONE(CHAR_BIT - 1); +#ifndef CRCPP_BRANCHLESS + static crcpp_constexpr CRCType CHAR_BIT_HIGHEST_BIT_MASK(CRCType(1) << CHAR_BIT_MINUS_ONE); +#endif + // The conditional expression is used to avoid a -Wshift-count-overflow warning. + static crcpp_constexpr CRCType SHIFT((CHAR_BIT >= CRCWidth) ? static_cast(CHAR_BIT - CRCWidth) : 0); + + CRCType polynomial = static_cast(parameters.polynomial << SHIFT); + remainder = static_cast((remainder << SHIFT) ^ byte); + + // An optimizing compiler might choose to unroll this loop. + for (crcpp_size i = 0; i < numBits; ++i) + { +#ifdef CRCPP_BRANCHLESS + // Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following: + // if (remainder & CHAR_BIT_HIGHEST_BIT_MASK) + // remainder = (remainder << 1) ^ polynomial; + // else + // remainder <<= 1; + remainder = static_cast((remainder << 1) ^ (((remainder >> CHAR_BIT_MINUS_ONE) & 1) * polynomial)); +#else + remainder = static_cast((remainder & CHAR_BIT_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ polynomial) : (remainder << 1)); +#endif + } + + remainder = static_cast(remainder >> SHIFT); + } + + return remainder; +} + +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS +/** + @brief Returns a set of parameters for CRC-4 ITU. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-4 ITU has the following parameters and check value: + - polynomial = 0x3 + - initial value = 0x0 + - final XOR = 0x0 + - reflect input = true + - reflect output = true + - check value = 0x7 + @return CRC-4 ITU parameters +*/ +inline const CRC::Parameters & CRC::CRC_4_ITU() +{ + static const Parameters parameters = { 0x3, 0x0, 0x0, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-5 EPC. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-5 EPC has the following parameters and check value: + - polynomial = 0x09 + - initial value = 0x09 + - final XOR = 0x00 + - reflect input = false + - reflect output = false + - check value = 0x00 + @return CRC-5 EPC parameters +*/ +inline const CRC::Parameters & CRC::CRC_5_EPC() +{ + static const Parameters parameters = { 0x09, 0x09, 0x00, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-5 ITU. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-5 ITU has the following parameters and check value: + - polynomial = 0x15 + - initial value = 0x00 + - final XOR = 0x00 + - reflect input = true + - reflect output = true + - check value = 0x07 + @return CRC-5 ITU parameters +*/ +inline const CRC::Parameters & CRC::CRC_5_ITU() +{ + static const Parameters parameters = { 0x15, 0x00, 0x00, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-5 USB. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-5 USB has the following parameters and check value: + - polynomial = 0x05 + - initial value = 0x1F + - final XOR = 0x1F + - reflect input = true + - reflect output = true + - check value = 0x19 + @return CRC-5 USB parameters +*/ +inline const CRC::Parameters & CRC::CRC_5_USB() +{ + static const Parameters parameters = { 0x05, 0x1F, 0x1F, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-6 CDMA2000-A. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-6 CDMA2000-A has the following parameters and check value: + - polynomial = 0x27 + - initial value = 0x3F + - final XOR = 0x00 + - reflect input = false + - reflect output = false + - check value = 0x0D + @return CRC-6 CDMA2000-A parameters +*/ +inline const CRC::Parameters & CRC::CRC_6_CDMA2000A() +{ + static const Parameters parameters = { 0x27, 0x3F, 0x00, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-6 CDMA2000-B. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-6 CDMA2000-A has the following parameters and check value: + - polynomial = 0x07 + - initial value = 0x3F + - final XOR = 0x00 + - reflect input = false + - reflect output = false + - check value = 0x3B + @return CRC-6 CDMA2000-B parameters +*/ +inline const CRC::Parameters & CRC::CRC_6_CDMA2000B() +{ + static const Parameters parameters = { 0x07, 0x3F, 0x00, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-6 ITU. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-6 ITU has the following parameters and check value: + - polynomial = 0x03 + - initial value = 0x00 + - final XOR = 0x00 + - reflect input = true + - reflect output = true + - check value = 0x06 + @return CRC-6 ITU parameters +*/ +inline const CRC::Parameters & CRC::CRC_6_ITU() +{ + static const Parameters parameters = { 0x03, 0x00, 0x00, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-6 NR. + @note The parameters are static and are delayed-constructed to reduce memory + footprint. + @note CRC-6 NR has the following parameters and check value: + - polynomial = 0x21 + - initial value = 0x00 + - final XOR = 0x00 + - reflect input = false + - reflect output = false + - check value = 0x15 + @return CRC-6 NR parameters +*/ +inline const CRC::Parameters & CRC::CRC_6_NR() +{ + static const Parameters parameters = { 0x21, 0x00, 0x00, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-7 JEDEC. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-7 JEDEC has the following parameters and check value: + - polynomial = 0x09 + - initial value = 0x00 + - final XOR = 0x00 + - reflect input = false + - reflect output = false + - check value = 0x75 + @return CRC-7 JEDEC parameters +*/ +inline const CRC::Parameters & CRC::CRC_7() +{ + static const Parameters parameters = { 0x09, 0x00, 0x00, false, false }; + return parameters; +} +#endif // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + +/** + @brief Returns a set of parameters for CRC-8 SMBus. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-8 SMBus has the following parameters and check value: + - polynomial = 0x07 + - initial value = 0x00 + - final XOR = 0x00 + - reflect input = false + - reflect output = false + - check value = 0xF4 + @return CRC-8 SMBus parameters +*/ +inline const CRC::Parameters & CRC::CRC_8() +{ + static const Parameters parameters = { 0x07, 0x00, 0x00, false, false }; + return parameters; +} + +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS +/** + @brief Returns a set of parameters for CRC-8 EBU (aka CRC-8 AES). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-8 EBU has the following parameters and check value: + - polynomial = 0x1D + - initial value = 0xFF + - final XOR = 0x00 + - reflect input = true + - reflect output = true + - check value = 0x97 + @return CRC-8 EBU parameters +*/ +inline const CRC::Parameters & CRC::CRC_8_EBU() +{ + static const Parameters parameters = { 0x1D, 0xFF, 0x00, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-8 MAXIM (aka CRC-8 DOW-CRC). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-8 MAXIM has the following parameters and check value: + - polynomial = 0x31 + - initial value = 0x00 + - final XOR = 0x00 + - reflect input = true + - reflect output = true + - check value = 0xA1 + @return CRC-8 MAXIM parameters +*/ +inline const CRC::Parameters & CRC::CRC_8_MAXIM() +{ + static const Parameters parameters = { 0x31, 0x00, 0x00, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-8 WCDMA. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-8 WCDMA has the following parameters and check value: + - polynomial = 0x9B + - initial value = 0x00 + - final XOR = 0x00 + - reflect input = true + - reflect output = true + - check value = 0x25 + @return CRC-8 WCDMA parameters +*/ +inline const CRC::Parameters & CRC::CRC_8_WCDMA() +{ + static const Parameters parameters = { 0x9B, 0x00, 0x00, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-8 LTE. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-8 LTE has the following parameters and check value: + - polynomial = 0x9B + - initial value = 0x00 + - final XOR = 0x00 + - reflect input = false + - reflect output = false + - check value = 0xEA + @return CRC-8 LTE parameters +*/ +inline const CRC::Parameters & CRC::CRC_8_LTE() +{ + static const Parameters parameters = { 0x9B, 0x00, 0x00, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-10 ITU. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-10 ITU has the following parameters and check value: + - polynomial = 0x233 + - initial value = 0x000 + - final XOR = 0x000 + - reflect input = false + - reflect output = false + - check value = 0x199 + @return CRC-10 ITU parameters +*/ +inline const CRC::Parameters & CRC::CRC_10() +{ + static const Parameters parameters = { 0x233, 0x000, 0x000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-10 CDMA2000. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-10 CDMA2000 has the following parameters and check value: + - polynomial = 0x3D9 + - initial value = 0x3FF + - final XOR = 0x000 + - reflect input = false + - reflect output = false + - check value = 0x233 + @return CRC-10 CDMA2000 parameters +*/ +inline const CRC::Parameters & CRC::CRC_10_CDMA2000() +{ + static const Parameters parameters = { 0x3D9, 0x3FF, 0x000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-11 FlexRay. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-11 FlexRay has the following parameters and check value: + - polynomial = 0x385 + - initial value = 0x01A + - final XOR = 0x000 + - reflect input = false + - reflect output = false + - check value = 0x5A3 + @return CRC-11 FlexRay parameters +*/ +inline const CRC::Parameters & CRC::CRC_11() +{ + static const Parameters parameters = { 0x385, 0x01A, 0x000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-11 NR. + @note The parameters are static and are delayed-constructed to reduce memory + footprint. + @note CRC-11 NR has the following parameters and check value: + - polynomial = 0x621 + - initial value = 0x000 + - final XOR = 0x000 + - reflect input = false + - reflect output = false + - check value = 0x5CA + @return CRC-11 NR parameters +*/ +inline const CRC::Parameters & CRC::CRC_11_NR() +{ + static const Parameters parameters = { 0x621, 0x000, 0x000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-12 CDMA2000. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-12 CDMA2000 has the following parameters and check value: + - polynomial = 0xF13 + - initial value = 0xFFF + - final XOR = 0x000 + - reflect input = false + - reflect output = false + - check value = 0xD4D + @return CRC-12 CDMA2000 parameters +*/ +inline const CRC::Parameters & CRC::CRC_12_CDMA2000() +{ + static const Parameters parameters = { 0xF13, 0xFFF, 0x000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-12 DECT (aka CRC-12 X-CRC). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-12 DECT has the following parameters and check value: + - polynomial = 0x80F + - initial value = 0x000 + - final XOR = 0x000 + - reflect input = false + - reflect output = false + - check value = 0xF5B + @return CRC-12 DECT parameters +*/ +inline const CRC::Parameters & CRC::CRC_12_DECT() +{ + static const Parameters parameters = { 0x80F, 0x000, 0x000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-12 UMTS (aka CRC-12 3GPP). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-12 UMTS has the following parameters and check value: + - polynomial = 0x80F + - initial value = 0x000 + - final XOR = 0x000 + - reflect input = false + - reflect output = true + - check value = 0xDAF + @return CRC-12 UMTS parameters +*/ +inline const CRC::Parameters & CRC::CRC_12_UMTS() +{ + static const Parameters parameters = { 0x80F, 0x000, 0x000, false, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-13 BBC. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-13 BBC has the following parameters and check value: + - polynomial = 0x1CF5 + - initial value = 0x0000 + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0x04FA + @return CRC-13 BBC parameters +*/ +inline const CRC::Parameters & CRC::CRC_13_BBC() +{ + static const Parameters parameters = { 0x1CF5, 0x0000, 0x0000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-15 CAN. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-15 CAN has the following parameters and check value: + - polynomial = 0x4599 + - initial value = 0x0000 + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0x059E + @return CRC-15 CAN parameters +*/ +inline const CRC::Parameters & CRC::CRC_15() +{ + static const Parameters parameters = { 0x4599, 0x0000, 0x0000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-15 MPT1327. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-15 MPT1327 has the following parameters and check value: + - polynomial = 0x6815 + - initial value = 0x0000 + - final XOR = 0x0001 + - reflect input = false + - reflect output = false + - check value = 0x2566 + @return CRC-15 MPT1327 parameters +*/ +inline const CRC::Parameters & CRC::CRC_15_MPT1327() +{ + static const Parameters parameters = { 0x6815, 0x0000, 0x0001, false, false }; + return parameters; +} +#endif // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + +/** + @brief Returns a set of parameters for CRC-16 ARC (aka CRC-16 IBM, CRC-16 LHA). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 ARC has the following parameters and check value: + - polynomial = 0x8005 + - initial value = 0x0000 + - final XOR = 0x0000 + - reflect input = true + - reflect output = true + - check value = 0xBB3D + @return CRC-16 ARC parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_ARC() +{ + static const Parameters parameters = { 0x8005, 0x0000, 0x0000, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 BUYPASS (aka CRC-16 VERIFONE, CRC-16 UMTS). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 BUYPASS has the following parameters and check value: + - polynomial = 0x8005 + - initial value = 0x0000 + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0xFEE8 + @return CRC-16 BUYPASS parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_BUYPASS() +{ + static const Parameters parameters = { 0x8005, 0x0000, 0x0000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 CCITT FALSE. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 CCITT FALSE has the following parameters and check value: + - polynomial = 0x1021 + - initial value = 0xFFFF + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0x29B1 + @return CRC-16 CCITT FALSE parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_CCITTFALSE() +{ + static const Parameters parameters = { 0x1021, 0xFFFF, 0x0000, false, false }; + return parameters; +} + +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS +/** + @brief Returns a set of parameters for CRC-16 CDMA2000. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 CDMA2000 has the following parameters and check value: + - polynomial = 0xC867 + - initial value = 0xFFFF + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0x4C06 + @return CRC-16 CDMA2000 parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_CDMA2000() +{ + static const Parameters parameters = { 0xC867, 0xFFFF, 0x0000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 CMS. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 CMS has the following parameters and check value: + - polynomial = 0x8005 + - initial value = 0xFFFF + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0xAEE7 + @return CRC-16 CMS parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_CMS() +{ + static const Parameters parameters = { 0x8005, 0xFFFF, 0x0000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 DECT-R (aka CRC-16 R-CRC). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 DECT-R has the following parameters and check value: + - polynomial = 0x0589 + - initial value = 0x0000 + - final XOR = 0x0001 + - reflect input = false + - reflect output = false + - check value = 0x007E + @return CRC-16 DECT-R parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_DECTR() +{ + static const Parameters parameters = { 0x0589, 0x0000, 0x0001, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 DECT-X (aka CRC-16 X-CRC). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 DECT-X has the following parameters and check value: + - polynomial = 0x0589 + - initial value = 0x0000 + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0x007F + @return CRC-16 DECT-X parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_DECTX() +{ + static const Parameters parameters = { 0x0589, 0x0000, 0x0000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 DNP. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 DNP has the following parameters and check value: + - polynomial = 0x3D65 + - initial value = 0x0000 + - final XOR = 0xFFFF + - reflect input = true + - reflect output = true + - check value = 0xEA82 + @return CRC-16 DNP parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_DNP() +{ + static const Parameters parameters = { 0x3D65, 0x0000, 0xFFFF, true, true }; + return parameters; +} +#endif // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + +/** + @brief Returns a set of parameters for CRC-16 GENIBUS (aka CRC-16 EPC, CRC-16 I-CODE, CRC-16 DARC). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 GENIBUS has the following parameters and check value: + - polynomial = 0x1021 + - initial value = 0xFFFF + - final XOR = 0xFFFF + - reflect input = false + - reflect output = false + - check value = 0xD64E + @return CRC-16 GENIBUS parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_GENIBUS() +{ + static const Parameters parameters = { 0x1021, 0xFFFF, 0xFFFF, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 KERMIT (aka CRC-16 CCITT, CRC-16 CCITT-TRUE). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 KERMIT has the following parameters and check value: + - polynomial = 0x1021 + - initial value = 0x0000 + - final XOR = 0x0000 + - reflect input = true + - reflect output = true + - check value = 0x2189 + @return CRC-16 KERMIT parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_KERMIT() +{ + static const Parameters parameters = { 0x1021, 0x0000, 0x0000, true, true }; + return parameters; +} + +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS +/** + @brief Returns a set of parameters for CRC-16 MAXIM. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 MAXIM has the following parameters and check value: + - polynomial = 0x8005 + - initial value = 0x0000 + - final XOR = 0xFFFF + - reflect input = true + - reflect output = true + - check value = 0x44C2 + @return CRC-16 MAXIM parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_MAXIM() +{ + static const Parameters parameters = { 0x8005, 0x0000, 0xFFFF, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 MODBUS. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 MODBUS has the following parameters and check value: + - polynomial = 0x8005 + - initial value = 0xFFFF + - final XOR = 0x0000 + - reflect input = true + - reflect output = true + - check value = 0x4B37 + @return CRC-16 MODBUS parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_MODBUS() +{ + static const Parameters parameters = { 0x8005, 0xFFFF, 0x0000, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 T10-DIF. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 T10-DIF has the following parameters and check value: + - polynomial = 0x8BB7 + - initial value = 0x0000 + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0xD0DB + @return CRC-16 T10-DIF parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_T10DIF() +{ + static const Parameters parameters = { 0x8BB7, 0x0000, 0x0000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 USB. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 USB has the following parameters and check value: + - polynomial = 0x8005 + - initial value = 0xFFFF + - final XOR = 0xFFFF + - reflect input = true + - reflect output = true + - check value = 0xB4C8 + @return CRC-16 USB parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_USB() +{ + static const Parameters parameters = { 0x8005, 0xFFFF, 0xFFFF, true, true }; + return parameters; +} + +#endif // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + +/** + @brief Returns a set of parameters for CRC-16 X-25 (aka CRC-16 IBM-SDLC, CRC-16 ISO-HDLC, CRC-16 B). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 X-25 has the following parameters and check value: + - polynomial = 0x1021 + - initial value = 0xFFFF + - final XOR = 0xFFFF + - reflect input = true + - reflect output = true + - check value = 0x906E + @return CRC-16 X-25 parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_X25() +{ + static const Parameters parameters = { 0x1021, 0xFFFF, 0xFFFF, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-16 XMODEM (aka CRC-16 ZMODEM, CRC-16 ACORN, CRC-16 LTE). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-16 XMODEM has the following parameters and check value: + - polynomial = 0x1021 + - initial value = 0x0000 + - final XOR = 0x0000 + - reflect input = false + - reflect output = false + - check value = 0x31C3 + @return CRC-16 XMODEM parameters +*/ +inline const CRC::Parameters & CRC::CRC_16_XMODEM() +{ + static const Parameters parameters = { 0x1021, 0x0000, 0x0000, false, false }; + return parameters; +} + +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS +/** + @brief Returns a set of parameters for CRC-17 CAN. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-17 CAN has the following parameters and check value: + - polynomial = 0x1685B + - initial value = 0x00000 + - final XOR = 0x00000 + - reflect input = false + - reflect output = false + - check value = 0x04F03 + @return CRC-17 CAN parameters +*/ +inline const CRC::Parameters & CRC::CRC_17_CAN() +{ + static const Parameters parameters = { 0x1685B, 0x00000, 0x00000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-21 CAN. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-21 CAN has the following parameters and check value: + - polynomial = 0x102899 + - initial value = 0x000000 + - final XOR = 0x000000 + - reflect input = false + - reflect output = false + - check value = 0x0ED841 + @return CRC-21 CAN parameters +*/ +inline const CRC::Parameters & CRC::CRC_21_CAN() +{ + static const Parameters parameters = { 0x102899, 0x000000, 0x000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-24 OPENPGP. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-24 OPENPGP has the following parameters and check value: + - polynomial = 0x864CFB + - initial value = 0xB704CE + - final XOR = 0x000000 + - reflect input = false + - reflect output = false + - check value = 0x21CF02 + @return CRC-24 OPENPGP parameters +*/ +inline const CRC::Parameters & CRC::CRC_24() +{ + static const Parameters parameters = { 0x864CFB, 0xB704CE, 0x000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-24 FlexRay-A. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-24 FlexRay-A has the following parameters and check value: + - polynomial = 0x5D6DCB + - initial value = 0xFEDCBA + - final XOR = 0x000000 + - reflect input = false + - reflect output = false + - check value = 0x7979BD + @return CRC-24 FlexRay-A parameters +*/ +inline const CRC::Parameters & CRC::CRC_24_FLEXRAYA() +{ + static const Parameters parameters = { 0x5D6DCB, 0xFEDCBA, 0x000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-24 FlexRay-B. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-24 FlexRay-B has the following parameters and check value: + - polynomial = 0x5D6DCB + - initial value = 0xABCDEF + - final XOR = 0x000000 + - reflect input = false + - reflect output = false + - check value = 0x1F23B8 + @return CRC-24 FlexRay-B parameters +*/ +inline const CRC::Parameters & CRC::CRC_24_FLEXRAYB() +{ + static const Parameters parameters = { 0x5D6DCB, 0xABCDEF, 0x000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-24 LTE-A/NR-A. + @note The parameters are static and are delayed-constructed to reduce memory + footprint. + @note CRC-24 LTE-A has the following parameters and check value: + - polynomial = 0x864CFB + - initial value = 0x000000 + - final XOR = 0x000000 + - reflect input = false + - reflect output = false + - check value = 0xCDE703 + @return CRC-24 LTE-A parameters +*/ +inline const CRC::Parameters & CRC::CRC_24_LTEA() +{ + static const Parameters parameters = { 0x864CFB, 0x000000, 0x000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-24 LTE-B/NR-B. + @note The parameters are static and are delayed-constructed to reduce memory + footprint. + @note CRC-24 LTE-B has the following parameters and check value: + - polynomial = 0x800063 + - initial value = 0x000000 + - final XOR = 0x000000 + - reflect input = false + - reflect output = false + - check value = 0x23EF52 + @return CRC-24 LTE-B parameters +*/ +inline const CRC::Parameters & CRC::CRC_24_LTEB() +{ + static const Parameters parameters = { 0x800063, 0x000000, 0x000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-24 NR-C. + @note The parameters are static and are delayed-constructed to reduce memory + footprint. + @note CRC-24 NR-C has the following parameters and check value: + - polynomial = 0xB2B117 + - initial value = 0x000000 + - final XOR = 0x000000 + - reflect input = false + - reflect output = false + - check value = 0xF48279 + @return CRC-24 NR-C parameters +*/ +inline const CRC::Parameters & CRC::CRC_24_NRC() +{ + static const Parameters parameters = { 0xB2B117, 0x000000, 0x000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-30 CDMA. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-30 CDMA has the following parameters and check value: + - polynomial = 0x2030B9C7 + - initial value = 0x3FFFFFFF + - final XOR = 0x00000000 + - reflect input = false + - reflect output = false + - check value = 0x3B3CB540 + @return CRC-30 CDMA parameters +*/ +inline const CRC::Parameters & CRC::CRC_30() +{ + static const Parameters parameters = { 0x2030B9C7, 0x3FFFFFFF, 0x00000000, false, false }; + return parameters; +} +#endif // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + +/** + @brief Returns a set of parameters for CRC-32 (aka CRC-32 ADCCP, CRC-32 PKZip). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-32 has the following parameters and check value: + - polynomial = 0x04C11DB7 + - initial value = 0xFFFFFFFF + - final XOR = 0xFFFFFFFF + - reflect input = true + - reflect output = true + - check value = 0xCBF43926 + @return CRC-32 parameters +*/ +inline const CRC::Parameters & CRC::CRC_32() +{ + static const Parameters parameters = { 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true, true }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-32 BZIP2 (aka CRC-32 AAL5, CRC-32 DECT-B, CRC-32 B-CRC). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-32 BZIP2 has the following parameters and check value: + - polynomial = 0x04C11DB7 + - initial value = 0xFFFFFFFF + - final XOR = 0xFFFFFFFF + - reflect input = false + - reflect output = false + - check value = 0xFC891918 + @return CRC-32 BZIP2 parameters +*/ +inline const CRC::Parameters & CRC::CRC_32_BZIP2() +{ + static const Parameters parameters = { 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, false, false }; + return parameters; +} + +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS +/** + @brief Returns a set of parameters for CRC-32 C (aka CRC-32 ISCSI, CRC-32 Castagnoli, CRC-32 Interlaken). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-32 C has the following parameters and check value: + - polynomial = 0x1EDC6F41 + - initial value = 0xFFFFFFFF + - final XOR = 0xFFFFFFFF + - reflect input = true + - reflect output = true + - check value = 0xE3069283 + @return CRC-32 C parameters +*/ +inline const CRC::Parameters & CRC::CRC_32_C() +{ + static const Parameters parameters = { 0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true }; + return parameters; +} +#endif + +/** + @brief Returns a set of parameters for CRC-32 MPEG-2. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-32 MPEG-2 has the following parameters and check value: + - polynomial = 0x04C11DB7 + - initial value = 0xFFFFFFFF + - final XOR = 0x00000000 + - reflect input = false + - reflect output = false + - check value = 0x0376E6E7 + @return CRC-32 MPEG-2 parameters +*/ +inline const CRC::Parameters & CRC::CRC_32_MPEG2() +{ + static const Parameters parameters = { 0x04C11DB7, 0xFFFFFFFF, 0x00000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-32 POSIX. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-32 POSIX has the following parameters and check value: + - polynomial = 0x04C11DB7 + - initial value = 0x00000000 + - final XOR = 0xFFFFFFFF + - reflect input = false + - reflect output = false + - check value = 0x765E7680 + @return CRC-32 POSIX parameters +*/ +inline const CRC::Parameters & CRC::CRC_32_POSIX() +{ + static const Parameters parameters = { 0x04C11DB7, 0x00000000, 0xFFFFFFFF, false, false }; + return parameters; +} + +#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS +/** + @brief Returns a set of parameters for CRC-32 Q. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-32 Q has the following parameters and check value: + - polynomial = 0x814141AB + - initial value = 0x00000000 + - final XOR = 0x00000000 + - reflect input = false + - reflect output = false + - check value = 0x3010BF7F + @return CRC-32 Q parameters +*/ +inline const CRC::Parameters & CRC::CRC_32_Q() +{ + static const Parameters parameters = { 0x814141AB, 0x00000000, 0x00000000, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-40 GSM. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-40 GSM has the following parameters and check value: + - polynomial = 0x0004820009 + - initial value = 0x0000000000 + - final XOR = 0xFFFFFFFFFF + - reflect input = false + - reflect output = false + - check value = 0xD4164FC646 + @return CRC-40 GSM parameters +*/ +inline const CRC::Parameters & CRC::CRC_40_GSM() +{ + static const Parameters parameters = { 0x0004820009, 0x0000000000, 0xFFFFFFFFFF, false, false }; + return parameters; +} + +/** + @brief Returns a set of parameters for CRC-64 ECMA. + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-64 ECMA has the following parameters and check value: + - polynomial = 0x42F0E1EBA9EA3693 + - initial value = 0x0000000000000000 + - final XOR = 0x0000000000000000 + - reflect input = false + - reflect output = false + - check value = 0x6C40DF5F0B497347 + @return CRC-64 ECMA parameters +*/ +inline const CRC::Parameters & CRC::CRC_64() +{ + static const Parameters parameters = { 0x42F0E1EBA9EA3693, 0x0000000000000000, 0x0000000000000000, false, false }; + return parameters; +} +#endif // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS + +#ifdef CRCPP_USE_NAMESPACE +} +#endif + +#endif // CRCPP_CRC_H_ diff --git a/demboyz/base/json.hpp b/demboyz/base/json.hpp new file mode 100644 index 0000000..a70aaf8 --- /dev/null +++ b/demboyz/base/json.hpp @@ -0,0 +1,25447 @@ +/* + __ _____ _____ _____ + __| | __| | | | JSON for Modern C++ +| | |__ | | | | | | version 3.9.1 +|_____|_____|_____|_|___| https://github.com/nlohmann/json + +Licensed under the MIT License . +SPDX-License-Identifier: MIT +Copyright (c) 2013-2019 Niels Lohmann . + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#define NLOHMANN_JSON_VERSION_MAJOR 3 +#define NLOHMANN_JSON_VERSION_MINOR 9 +#define NLOHMANN_JSON_VERSION_PATCH 1 + +#include // all_of, find, for_each +#include // nullptr_t, ptrdiff_t, size_t +#include // hash, less +#include // initializer_list +#include // istream, ostream +#include // random_access_iterator_tag +#include // unique_ptr +#include // accumulate +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap +#include // vector + +// #include + + +#include + +// #include + + +#include // transform +#include // array +#include // forward_list +#include // inserter, front_inserter, end +#include // map +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray + +// #include + + +#include // exception +#include // runtime_error +#include // to_string + +// #include + + +#include // size_t + +namespace nlohmann +{ +namespace detail +{ +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // pair +// #include +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + * + * To the extent possible under law, the author(s) have dedicated all + * copyright and related and neighboring rights to this software to + * the public domain worldwide. This software is distributed without + * any warranty. + * + * For details, see . + * SPDX-License-Identifier: CC0-1.0 + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 13) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 13 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(_MSC_VER) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP \ +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +#if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 +#elif (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 +#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 +#endif + +// disable float-equal warnings on GCC/clang +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdocumentation" +#endif + +// allow to disable exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +// allow to override assert +#if !defined(JSON_ASSERT) + #include // assert + #define JSON_ASSERT(x) assert(x) +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer, \ + class BinaryType> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + +// Macros to simplify conversion from/to types + +#define NLOHMANN_JSON_EXPAND( x ) x +#define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME +#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \ + NLOHMANN_JSON_PASTE64, \ + NLOHMANN_JSON_PASTE63, \ + NLOHMANN_JSON_PASTE62, \ + NLOHMANN_JSON_PASTE61, \ + NLOHMANN_JSON_PASTE60, \ + NLOHMANN_JSON_PASTE59, \ + NLOHMANN_JSON_PASTE58, \ + NLOHMANN_JSON_PASTE57, \ + NLOHMANN_JSON_PASTE56, \ + NLOHMANN_JSON_PASTE55, \ + NLOHMANN_JSON_PASTE54, \ + NLOHMANN_JSON_PASTE53, \ + NLOHMANN_JSON_PASTE52, \ + NLOHMANN_JSON_PASTE51, \ + NLOHMANN_JSON_PASTE50, \ + NLOHMANN_JSON_PASTE49, \ + NLOHMANN_JSON_PASTE48, \ + NLOHMANN_JSON_PASTE47, \ + NLOHMANN_JSON_PASTE46, \ + NLOHMANN_JSON_PASTE45, \ + NLOHMANN_JSON_PASTE44, \ + NLOHMANN_JSON_PASTE43, \ + NLOHMANN_JSON_PASTE42, \ + NLOHMANN_JSON_PASTE41, \ + NLOHMANN_JSON_PASTE40, \ + NLOHMANN_JSON_PASTE39, \ + NLOHMANN_JSON_PASTE38, \ + NLOHMANN_JSON_PASTE37, \ + NLOHMANN_JSON_PASTE36, \ + NLOHMANN_JSON_PASTE35, \ + NLOHMANN_JSON_PASTE34, \ + NLOHMANN_JSON_PASTE33, \ + NLOHMANN_JSON_PASTE32, \ + NLOHMANN_JSON_PASTE31, \ + NLOHMANN_JSON_PASTE30, \ + NLOHMANN_JSON_PASTE29, \ + NLOHMANN_JSON_PASTE28, \ + NLOHMANN_JSON_PASTE27, \ + NLOHMANN_JSON_PASTE26, \ + NLOHMANN_JSON_PASTE25, \ + NLOHMANN_JSON_PASTE24, \ + NLOHMANN_JSON_PASTE23, \ + NLOHMANN_JSON_PASTE22, \ + NLOHMANN_JSON_PASTE21, \ + NLOHMANN_JSON_PASTE20, \ + NLOHMANN_JSON_PASTE19, \ + NLOHMANN_JSON_PASTE18, \ + NLOHMANN_JSON_PASTE17, \ + NLOHMANN_JSON_PASTE16, \ + NLOHMANN_JSON_PASTE15, \ + NLOHMANN_JSON_PASTE14, \ + NLOHMANN_JSON_PASTE13, \ + NLOHMANN_JSON_PASTE12, \ + NLOHMANN_JSON_PASTE11, \ + NLOHMANN_JSON_PASTE10, \ + NLOHMANN_JSON_PASTE9, \ + NLOHMANN_JSON_PASTE8, \ + NLOHMANN_JSON_PASTE7, \ + NLOHMANN_JSON_PASTE6, \ + NLOHMANN_JSON_PASTE5, \ + NLOHMANN_JSON_PASTE4, \ + NLOHMANN_JSON_PASTE3, \ + NLOHMANN_JSON_PASTE2, \ + NLOHMANN_JSON_PASTE1)(__VA_ARGS__)) +#define NLOHMANN_JSON_PASTE2(func, v1) func(v1) +#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2) +#define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3) +#define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4) +#define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5) +#define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6) +#define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7) +#define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8) +#define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9) +#define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10) +#define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) +#define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) +#define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) +#define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) +#define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) +#define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) +#define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) +#define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) +#define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) +#define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) +#define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) +#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) +#define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) +#define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) +#define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) +#define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) +#define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) +#define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) +#define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) +#define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) +#define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) +#define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) +#define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) +#define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) +#define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) +#define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) +#define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) +#define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) +#define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) +#define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) +#define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) +#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) +#define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) +#define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) +#define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) +#define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) +#define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) +#define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) +#define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) +#define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) +#define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) +#define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) +#define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) +#define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) +#define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) +#define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) +#define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) +#define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) +#define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) +#define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) +#define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) +#define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) +#define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) + +#define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1; +#define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1); + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \ + friend void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + friend void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE +@since version 3.9.0 +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \ + inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +#ifndef JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_USE_IMPLICIT_CONVERSIONS 1 +#endif + +#if JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_EXPLICIT +#else + #define JSON_EXPLICIT explicit +#endif + + +namespace nlohmann +{ +namespace detail +{ +//////////////// +// exceptions // +//////////////// + +/*! +@brief general exception of the @ref basic_json class + +This class is an extension of `std::exception` objects with a member @a id for +exception ids. It is used as the base class for all exceptions thrown by the +@ref basic_json class. This class can hence be used as "wildcard" to catch +exceptions. + +Subclasses: +- @ref parse_error for exceptions indicating a parse error +- @ref invalid_iterator for exceptions indicating errors with iterators +- @ref type_error for exceptions indicating executing a member function with + a wrong type +- @ref out_of_range for exceptions indicating access out of the defined range +- @ref other_error for exceptions indicating other library errors + +@internal +@note To have nothrow-copy-constructible exceptions, we internally use + `std::runtime_error` which can cope with arbitrary-length error messages. + Intermediate strings are built with static functions and then passed to + the actual constructor. +@endinternal + +@liveexample{The following code shows how arbitrary library exceptions can be +caught.,exception} + +@since version 3.0.0 +*/ +class exception : public std::exception +{ + public: + /// returns the explanatory string + JSON_HEDLEY_RETURNS_NON_NULL + const char* what() const noexcept override + { + return m.what(); + } + + /// the id of the exception + const int id; + + protected: + JSON_HEDLEY_NON_NULL(3) + exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} + + static std::string name(const std::string& ename, int id_) + { + return "[json.exception." + ename + "." + std::to_string(id_) + "] "; + } + + private: + /// an exception object as storage for error messages + std::runtime_error m; +}; + +/*! +@brief exception indicating a parse error + +This exception is thrown by the library when a parse error occurs. Parse errors +can occur during the deserialization of JSON text, CBOR, MessagePack, as well +as when using JSON Patch. + +Member @a byte holds the byte index of the last read character in the input +file. + +Exceptions have ids 1xx. + +name / id | example message | description +------------------------------ | --------------- | ------------------------- +json.exception.parse_error.101 | parse error at 2: unexpected end of input; expected string literal | This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member @a byte indicates the error position. +json.exception.parse_error.102 | parse error at 14: missing or wrong low surrogate | JSON uses the `\uxxxx` format to describe Unicode characters. Code points above above 0xFFFF are split into two `\uxxxx` entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point. +json.exception.parse_error.103 | parse error: code points above 0x10FFFF are invalid | Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid. +json.exception.parse_error.104 | parse error: JSON patch must be an array of objects | [RFC 6902](https://tools.ietf.org/html/rfc6902) requires a JSON Patch document to be a JSON document that represents an array of objects. +json.exception.parse_error.105 | parse error: operation must have string member 'op' | An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors. +json.exception.parse_error.106 | parse error: array index '01' must not begin with '0' | An array index in a JSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)) may be `0` or any number without a leading `0`. +json.exception.parse_error.107 | parse error: JSON pointer must be empty or begin with '/' - was: 'foo' | A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a `/` character. +json.exception.parse_error.108 | parse error: escape character '~' must be followed with '0' or '1' | In a JSON Pointer, only `~0` and `~1` are valid escape sequences. +json.exception.parse_error.109 | parse error: array index 'one' is not a number | A JSON Pointer array index must be a number. +json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vector | When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read. +json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xF8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read. +json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read. +json.exception.parse_error.114 | parse error: Unsupported BSON record type 0x0F | The parsing of the corresponding BSON record type is not implemented (yet). +json.exception.parse_error.115 | parse error at byte 5: syntax error while parsing UBJSON high-precision number: invalid number text: 1A | A UBJSON high-precision number could not be parsed. + +@note For an input with n bytes, 1 is the index of the first character and n+1 + is the index of the terminating null byte or the end of file. This also + holds true when reading a byte vector (CBOR or MessagePack). + +@liveexample{The following code shows how a `parse_error` exception can be +caught.,parse_error} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class parse_error : public exception +{ + public: + /*! + @brief create a parse error exception + @param[in] id_ the id of the exception + @param[in] pos the position where the error occurred (or with + chars_read_total=0 if the position cannot be + determined) + @param[in] what_arg the explanatory string + @return parse_error object + */ + static parse_error create(int id_, const position_t& pos, const std::string& what_arg) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + position_string(pos) + ": " + what_arg; + return parse_error(id_, pos.chars_read_total, w.c_str()); + } + + static parse_error create(int id_, std::size_t byte_, const std::string& what_arg) + { + std::string w = exception::name("parse_error", id_) + "parse error" + + (byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") + + ": " + what_arg; + return parse_error(id_, byte_, w.c_str()); + } + + /*! + @brief byte index of the parse error + + The byte index of the last read character in the input file. + + @note For an input with n bytes, 1 is the index of the first character and + n+1 is the index of the terminating null byte or the end of file. + This also holds true when reading a byte vector (CBOR or MessagePack). + */ + const std::size_t byte; + + private: + parse_error(int id_, std::size_t byte_, const char* what_arg) + : exception(id_, what_arg), byte(byte_) {} + + static std::string position_string(const position_t& pos) + { + return " at line " + std::to_string(pos.lines_read + 1) + + ", column " + std::to_string(pos.chars_read_current_line); + } +}; + +/*! +@brief exception indicating errors with iterators + +This exception is thrown if iterators passed to a library function do not match +the expected semantics. + +Exceptions have ids 2xx. + +name / id | example message | description +----------------------------------- | --------------- | ------------------------- +json.exception.invalid_iterator.201 | iterators are not compatible | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. +json.exception.invalid_iterator.202 | iterator does not fit current value | In an erase or insert function, the passed iterator @a pos does not belong to the JSON value for which the function was called. It hence does not define a valid position for the deletion/insertion. +json.exception.invalid_iterator.203 | iterators do not fit current value | Either iterator passed to function @ref erase(IteratorType first, IteratorType last) does not belong to the JSON value from which values shall be erased. It hence does not define a valid range to delete values from. +json.exception.invalid_iterator.204 | iterators out of range | When an iterator range for a primitive type (number, boolean, or string) is passed to a constructor or an erase function, this range has to be exactly (@ref begin(), @ref end()), because this is the only way the single stored value is expressed. All other ranges are invalid. +json.exception.invalid_iterator.205 | iterator out of range | When an iterator for a primitive type (number, boolean, or string) is passed to an erase function, the iterator has to be the @ref begin() iterator, because it is the only way to address the stored value. All other iterators are invalid. +json.exception.invalid_iterator.206 | cannot construct with iterators from null | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) belong to a JSON null value and hence to not define a valid range. +json.exception.invalid_iterator.207 | cannot use key() for non-object iterators | The key() member function can only be used on iterators belonging to a JSON object, because other types do not have a concept of a key. +json.exception.invalid_iterator.208 | cannot use operator[] for object iterators | The operator[] to specify a concrete offset cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. +json.exception.invalid_iterator.209 | cannot use offsets with object iterators | The offset operators (+, -, +=, -=) cannot be used on iterators belonging to a JSON object, because JSON objects are unordered. +json.exception.invalid_iterator.210 | iterators do not fit | The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid. +json.exception.invalid_iterator.211 | passed iterators may not belong to container | The iterator range passed to the insert function must not be a subrange of the container to insert to. +json.exception.invalid_iterator.212 | cannot compare iterators of different containers | When two iterators are compared, they must belong to the same container. +json.exception.invalid_iterator.213 | cannot compare order of object iterators | The order of object iterators cannot be compared, because JSON objects are unordered. +json.exception.invalid_iterator.214 | cannot get value | Cannot get value for iterator: Either the iterator belongs to a null value or it is an iterator to a primitive type (number, boolean, or string), but the iterator is different to @ref begin(). + +@liveexample{The following code shows how an `invalid_iterator` exception can be +caught.,invalid_iterator} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class invalid_iterator : public exception +{ + public: + static invalid_iterator create(int id_, const std::string& what_arg) + { + std::string w = exception::name("invalid_iterator", id_) + what_arg; + return invalid_iterator(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + invalid_iterator(int id_, const char* what_arg) + : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating executing a member function with a wrong type + +This exception is thrown in case of a type error; that is, a library function is +executed on a JSON value whose type does not match the expected semantics. + +Exceptions have ids 3xx. + +name / id | example message | description +----------------------------- | --------------- | ------------------------- +json.exception.type_error.301 | cannot create object from initializer list | To create an object from an initializer list, the initializer list must consist only of a list of pairs whose first element is a string. When this constraint is violated, an array is created instead. +json.exception.type_error.302 | type must be object, but is array | During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types. +json.exception.type_error.303 | incompatible ReferenceType for get_ref, actual type is object | To retrieve a reference to a value stored in a @ref basic_json object with @ref get_ref, the type of the reference must match the value type. For instance, for a JSON array, the @a ReferenceType must be @ref array_t &. +json.exception.type_error.304 | cannot use at() with string | The @ref at() member functions can only be executed for certain JSON types. +json.exception.type_error.305 | cannot use operator[] with string | The @ref operator[] member functions can only be executed for certain JSON types. +json.exception.type_error.306 | cannot use value() with string | The @ref value() member functions can only be executed for certain JSON types. +json.exception.type_error.307 | cannot use erase() with string | The @ref erase() member functions can only be executed for certain JSON types. +json.exception.type_error.308 | cannot use push_back() with string | The @ref push_back() and @ref operator+= member functions can only be executed for certain JSON types. +json.exception.type_error.309 | cannot use insert() with | The @ref insert() member functions can only be executed for certain JSON types. +json.exception.type_error.310 | cannot use swap() with number | The @ref swap() member functions can only be executed for certain JSON types. +json.exception.type_error.311 | cannot use emplace_back() with string | The @ref emplace_back() member function can only be executed for certain JSON types. +json.exception.type_error.312 | cannot use update() with string | The @ref update() member functions can only be executed for certain JSON types. +json.exception.type_error.313 | invalid value to unflatten | The @ref unflatten function converts an object whose keys are JSON Pointers back into an arbitrary nested JSON value. The JSON Pointers must not overlap, because then the resulting value would not be well defined. +json.exception.type_error.314 | only objects can be unflattened | The @ref unflatten function only works for an object whose keys are JSON Pointers. +json.exception.type_error.315 | values in object must be primitive | The @ref unflatten function only works for an object whose keys are JSON Pointers and whose values are primitive. +json.exception.type_error.316 | invalid UTF-8 byte at index 10: 0x7E | The @ref dump function only works with UTF-8 encoded strings; that is, if you assign a `std::string` to a JSON value, make sure it is UTF-8 encoded. | +json.exception.type_error.317 | JSON value cannot be serialized to requested format | The dynamic type of the object cannot be represented in the requested serialization format (e.g. a raw `true` or `null` JSON object cannot be serialized to BSON) | + +@liveexample{The following code shows how a `type_error` exception can be +caught.,type_error} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref out_of_range for exceptions indicating access out of the defined range +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class type_error : public exception +{ + public: + static type_error create(int id_, const std::string& what_arg) + { + std::string w = exception::name("type_error", id_) + what_arg; + return type_error(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating access out of the defined range + +This exception is thrown in case a library function is called on an input +parameter that exceeds the expected range, for instance in case of array +indices or nonexisting object keys. + +Exceptions have ids 4xx. + +name / id | example message | description +------------------------------- | --------------- | ------------------------- +json.exception.out_of_range.401 | array index 3 is out of range | The provided array index @a i is larger than @a size-1. +json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it. +json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object. +json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved. +json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value. +json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF. +json.exception.out_of_range.407 | number overflow serializing '9223372036854775808' | UBJSON and BSON only support integer numbers up to 9223372036854775807. (until version 3.8.0) | +json.exception.out_of_range.408 | excessive array size: 8658170730974374167 | The size (following `#`) of an UBJSON array or object exceeds the maximal capacity. | +json.exception.out_of_range.409 | BSON key cannot contain code point U+0000 (at byte 2) | Key identifiers to be serialized to BSON cannot contain code point U+0000, since the key is stored as zero-terminated c-string | + +@liveexample{The following code shows how an `out_of_range` exception can be +caught.,out_of_range} + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref other_error for exceptions indicating other library errors + +@since version 3.0.0 +*/ +class out_of_range : public exception +{ + public: + static out_of_range create(int id_, const std::string& what_arg) + { + std::string w = exception::name("out_of_range", id_) + what_arg; + return out_of_range(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; + +/*! +@brief exception indicating other library errors + +This exception is thrown in case of errors that cannot be classified with the +other exception types. + +Exceptions have ids 5xx. + +name / id | example message | description +------------------------------ | --------------- | ------------------------- +json.exception.other_error.501 | unsuccessful: {"op":"test","path":"/baz", "value":"bar"} | A JSON Patch operation 'test' failed. The unsuccessful operation is also printed. + +@sa - @ref exception for the base class of the library exceptions +@sa - @ref parse_error for exceptions indicating a parse error +@sa - @ref invalid_iterator for exceptions indicating errors with iterators +@sa - @ref type_error for exceptions indicating executing a member function with + a wrong type +@sa - @ref out_of_range for exceptions indicating access out of the defined range + +@liveexample{The following code shows how an `other_error` exception can be +caught.,other_error} + +@since version 3.0.0 +*/ +class other_error : public exception +{ + public: + static other_error create(int id_, const std::string& what_arg) + { + std::string w = exception::name("other_error", id_) + what_arg; + return other_error(id_, w.c_str()); + } + + private: + JSON_HEDLEY_NON_NULL(3) + other_error(int id_, const char* what_arg) : exception(id_, what_arg) {} +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type + +namespace nlohmann +{ +namespace detail +{ +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +template +using uncvref_t = typename std::remove_cv::type>::type; + +// implementation of C++14 index_sequence and affiliates +// source: https://stackoverflow.com/a/32223343 +template +struct index_sequence +{ + using type = index_sequence; + using value_type = std::size_t; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +template +struct merge_and_renumber; + +template +struct merge_and_renumber, index_sequence> + : index_sequence < I1..., (sizeof...(I1) + I2)... > {}; + +template +struct make_index_sequence + : merge_and_renumber < typename make_index_sequence < N / 2 >::type, + typename make_index_sequence < N - N / 2 >::type > {}; + +template<> struct make_index_sequence<0> : index_sequence<> {}; +template<> struct make_index_sequence<1> : index_sequence<0> {}; + +template +using index_sequence_for = make_index_sequence; + +// dispatch utility (taken from ranges-v3) +template struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template +struct static_const +{ + static constexpr T value{}; +}; + +template +constexpr T static_const::value; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // numeric_limits +#include // false_type, is_constructible, is_integral, is_same, true_type +#include // declval + +// #include + + +#include // random_access_iterator_tag + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; +} // namespace detail +} // namespace nlohmann + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +struct iterator_types {}; + +template +struct iterator_types < + It, + void_t> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template +struct iterator_traits +{ +}; + +template +struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> + : iterator_types +{ +}; + +template +struct iterator_traits::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + + +#include + +// #include + + +// https://en.cppreference.com/w/cpp/experimental/is_detected +namespace nlohmann +{ +namespace detail +{ +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template class Op, class... Args> +using is_detected = typename detector::value_t; + +template class Op, class... Args> +using detected_t = typename detector::type; + +template class Op, class... Args> +using detected_or = detector; + +template class Op, class... Args> +using detected_or_t = typename detected_or::type; + +template class Op, class... Args> +using is_detected_exact = std::is_same>; + +template class Op, class... Args> +using is_detected_convertible = + std::is_convertible, To>; +} // namespace detail +} // namespace nlohmann + +// #include +#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ +#define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + +#include // int64_t, uint64_t +#include // map +#include // allocator +#include // string +#include // vector + +/*! +@brief namespace for Niels Lohmann +@see https://github.com/nlohmann +@since version 1.0.0 +*/ +namespace nlohmann +{ +/*! +@brief default JSONSerializer template argument + +This serializer ignores the template arguments and uses ADL +([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) +for serialization. +*/ +template +struct adl_serializer; + +template class ObjectType = + std::map, + template class ArrayType = std::vector, + class StringType = std::string, class BooleanType = bool, + class NumberIntegerType = std::int64_t, + class NumberUnsignedType = std::uint64_t, + class NumberFloatType = double, + template class AllocatorType = std::allocator, + template class JSONSerializer = + adl_serializer, + class BinaryType = std::vector> +class basic_json; + +/*! +@brief JSON Pointer + +A JSON pointer defines a string syntax for identifying a specific value +within a JSON document. It can be used with functions `at` and +`operator[]`. Furthermore, JSON pointers are the base for JSON patches. + +@sa [RFC 6901](https://tools.ietf.org/html/rfc6901) + +@since version 2.0.0 +*/ +template +class json_pointer; + +/*! +@brief default JSON class + +This type is the default specialization of the @ref basic_json class which +uses the standard template types. + +@since version 1.0.0 +*/ +using json = basic_json<>; + +template +struct ordered_map; + +/*! +@brief ordered JSON class + +This type preserves the insertion order of object keys. + +@since version 3.9.0 +*/ +using ordered_json = basic_json; + +} // namespace nlohmann + +#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + +namespace nlohmann +{ +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ +namespace detail +{ +///////////// +// helpers // +///////////// + +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + +template struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json : std::true_type {}; + +////////////////////// +// json_ref helpers // +////////////////////// + +template +class json_ref; + +template +struct is_json_ref : std::false_type {}; + +template +struct is_json_ref> : std::true_type {}; + +////////////////////////// +// aliases for detected // +////////////////////////// + +template +using mapped_type_t = typename T::mapped_type; + +template +using key_type_t = typename T::key_type; + +template +using value_type_t = typename T::value_type; + +template +using difference_type_t = typename T::difference_type; + +template +using pointer_t = typename T::pointer; + +template +using reference_t = typename T::reference; + +template +using iterator_category_t = typename T::iterator_category; + +template +using iterator_t = typename T::iterator; + +template +using to_json_function = decltype(T::to_json(std::declval()...)); + +template +using from_json_function = decltype(T::from_json(std::declval()...)); + +template +using get_template_function = decltype(std::declval().template get()); + +// trait checking if JSONSerializer::from_json(json const&, udt&) exists +template +struct has_from_json : std::false_type {}; + +// trait checking if j.get is valid +// use this trait instead of std::is_constructible or std::is_convertible, +// both rely on, or make use of implicit conversions, and thus fail when T +// has several constructors/operator= (see https://github.com/nlohmann/json/issues/958) +template +struct is_getable +{ + static constexpr bool value = is_detected::value; +}; + +template +struct has_from_json < BasicJsonType, T, + enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if JSONSerializer::from_json(json const&) exists +// this overload is used for non-default-constructible user-defined-types +template +struct has_non_default_from_json : std::false_type {}; + +template +struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if BasicJsonType::json_serializer::to_json exists +// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion. +template +struct has_to_json : std::false_type {}; + +template +struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + + +/////////////////// +// is_ functions // +/////////////////// + +template +struct is_iterator_traits : std::false_type {}; + +template +struct is_iterator_traits> +{ + private: + using traits = iterator_traits; + + public: + static constexpr auto value = + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value; +}; + +// source: https://stackoverflow.com/a/37193089/4116453 + +template +struct is_complete_type : std::false_type {}; + +template +struct is_complete_type : std::true_type {}; + +template +struct is_compatible_object_type_impl : std::false_type {}; + +template +struct is_compatible_object_type_impl < + BasicJsonType, CompatibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + + using object_t = typename BasicJsonType::object_t; + + // macOS's is_constructible does not play well with nonesuch... + static constexpr bool value = + std::is_constructible::value && + std::is_constructible::value; +}; + +template +struct is_compatible_object_type + : is_compatible_object_type_impl {}; + +template +struct is_constructible_object_type_impl : std::false_type {}; + +template +struct is_constructible_object_type_impl < + BasicJsonType, ConstructibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + static constexpr bool value = + (std::is_default_constructible::value && + (std::is_move_assignable::value || + std::is_copy_assignable::value) && + (std::is_constructible::value && + std::is_same < + typename object_t::mapped_type, + typename ConstructibleObjectType::mapped_type >::value)) || + (has_from_json::value || + has_non_default_from_json < + BasicJsonType, + typename ConstructibleObjectType::mapped_type >::value); +}; + +template +struct is_constructible_object_type + : is_constructible_object_type_impl {}; + +template +struct is_compatible_string_type_impl : std::false_type {}; + +template +struct is_compatible_string_type_impl < + BasicJsonType, CompatibleStringType, + enable_if_t::value >> +{ + static constexpr auto value = + std::is_constructible::value; +}; + +template +struct is_compatible_string_type + : is_compatible_string_type_impl {}; + +template +struct is_constructible_string_type_impl : std::false_type {}; + +template +struct is_constructible_string_type_impl < + BasicJsonType, ConstructibleStringType, + enable_if_t::value >> +{ + static constexpr auto value = + std::is_constructible::value; +}; + +template +struct is_constructible_string_type + : is_constructible_string_type_impl {}; + +template +struct is_compatible_array_type_impl : std::false_type {}; + +template +struct is_compatible_array_type_impl < + BasicJsonType, CompatibleArrayType, + enable_if_t < is_detected::value&& + is_detected::value&& +// This is needed because json_reverse_iterator has a ::iterator type... +// Therefore it is detected as a CompatibleArrayType. +// The real fix would be to have an Iterable concept. + !is_iterator_traits < + iterator_traits>::value >> +{ + static constexpr bool value = + std::is_constructible::value; +}; + +template +struct is_compatible_array_type + : is_compatible_array_type_impl {}; + +template +struct is_constructible_array_type_impl : std::false_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t::value >> + : std::true_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t < !std::is_same::value&& + std::is_default_constructible::value&& +(std::is_move_assignable::value || + std::is_copy_assignable::value)&& +is_detected::value&& +is_detected::value&& +is_complete_type < +detected_t>::value >> +{ + static constexpr bool value = + // This is needed because json_reverse_iterator has a ::iterator type, + // furthermore, std::back_insert_iterator (and other iterators) have a + // base class `iterator`... Therefore it is detected as a + // ConstructibleArrayType. The real fix would be to have an Iterable + // concept. + !is_iterator_traits>::value && + + (std::is_same::value || + has_from_json::value || + has_non_default_from_json < + BasicJsonType, typename ConstructibleArrayType::value_type >::value); +}; + +template +struct is_constructible_array_type + : is_constructible_array_type_impl {}; + +template +struct is_compatible_integer_type_impl : std::false_type {}; + +template +struct is_compatible_integer_type_impl < + RealIntegerType, CompatibleNumberIntegerType, + enable_if_t < std::is_integral::value&& + std::is_integral::value&& + !std::is_same::value >> +{ + // is there an assert somewhere on overflows? + using RealLimits = std::numeric_limits; + using CompatibleLimits = std::numeric_limits; + + static constexpr auto value = + std::is_constructible::value && + CompatibleLimits::is_integer && + RealLimits::is_signed == CompatibleLimits::is_signed; +}; + +template +struct is_compatible_integer_type + : is_compatible_integer_type_impl {}; + +template +struct is_compatible_type_impl: std::false_type {}; + +template +struct is_compatible_type_impl < + BasicJsonType, CompatibleType, + enable_if_t::value >> +{ + static constexpr bool value = + has_to_json::value; +}; + +template +struct is_compatible_type + : is_compatible_type_impl {}; + +// https://en.cppreference.com/w/cpp/types/conjunction +template struct conjunction : std::true_type { }; +template struct conjunction : B1 { }; +template +struct conjunction +: std::conditional, B1>::type {}; + +template +struct is_constructible_tuple : std::false_type {}; + +template +struct is_constructible_tuple> : conjunction...> {}; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // array +#include // size_t +#include // uint8_t +#include // string + +namespace nlohmann +{ +namespace detail +{ +/////////////////////////// +// JSON type enumeration // +/////////////////////////// + +/*! +@brief the JSON type enumeration + +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. + +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. + +@sa @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type + +@since version 1.0.0 +*/ +enum class value_t : std::uint8_t +{ + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function +}; + +/*! +@brief comparison operator for JSON types + +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. + +@since version 1.0.0 +*/ +inline bool operator<(const value_t lhs, const value_t rhs) noexcept +{ + static constexpr std::array order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; + + const auto l_index = static_cast(lhs); + const auto r_index = static_cast(rhs); + return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; +} +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +template +void from_json(const BasicJsonType& j, typename std::nullptr_t& n) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_null())) + { + JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name()))); + } + n = nullptr; +} + +// overloads for basic_json template parameters +template < typename BasicJsonType, typename ArithmeticType, + enable_if_t < std::is_arithmetic::value&& + !std::is_same::value, + int > = 0 > +void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) +{ + switch (static_cast(j)) + { + case value_t::number_unsigned: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::number_integer: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::number_float: + { + val = static_cast(*j.template get_ptr()); + break; + } + + default: + JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()))); + } +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_boolean())) + { + JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name()))); + } + b = *j.template get_ptr(); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_string())) + { + JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); + } + s = *j.template get_ptr(); +} + +template < + typename BasicJsonType, typename ConstructibleStringType, + enable_if_t < + is_constructible_string_type::value&& + !std::is_same::value, + int > = 0 > +void from_json(const BasicJsonType& j, ConstructibleStringType& s) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_string())) + { + JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); + } + + s = *j.template get_ptr(); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::number_float_t& val) +{ + get_arithmetic_value(j, val); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::number_unsigned_t& val) +{ + get_arithmetic_value(j, val); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::number_integer_t& val) +{ + get_arithmetic_value(j, val); +} + +template::value, int> = 0> +void from_json(const BasicJsonType& j, EnumType& e) +{ + typename std::underlying_type::type val; + get_arithmetic_value(j, val); + e = static_cast(val); +} + +// forward_list doesn't have an insert method +template::value, int> = 0> +void from_json(const BasicJsonType& j, std::forward_list& l) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + l.clear(); + std::transform(j.rbegin(), j.rend(), + std::front_inserter(l), [](const BasicJsonType & i) + { + return i.template get(); + }); +} + +// valarray doesn't have an insert method +template::value, int> = 0> +void from_json(const BasicJsonType& j, std::valarray& l) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + l.resize(j.size()); + std::transform(j.begin(), j.end(), std::begin(l), + [](const BasicJsonType & elem) + { + return elem.template get(); + }); +} + +template +auto from_json(const BasicJsonType& j, T (&arr)[N]) +-> decltype(j.template get(), void()) +{ + for (std::size_t i = 0; i < N; ++i) + { + arr[i] = j.at(i).template get(); + } +} + +template +void from_json_array_impl(const BasicJsonType& j, typename BasicJsonType::array_t& arr, priority_tag<3> /*unused*/) +{ + arr = *j.template get_ptr(); +} + +template +auto from_json_array_impl(const BasicJsonType& j, std::array& arr, + priority_tag<2> /*unused*/) +-> decltype(j.template get(), void()) +{ + for (std::size_t i = 0; i < N; ++i) + { + arr[i] = j.at(i).template get(); + } +} + +template +auto from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, priority_tag<1> /*unused*/) +-> decltype( + arr.reserve(std::declval()), + j.template get(), + void()) +{ + using std::end; + + ConstructibleArrayType ret; + ret.reserve(j.size()); + std::transform(j.begin(), j.end(), + std::inserter(ret, end(ret)), [](const BasicJsonType & i) + { + // get() returns *this, this won't call a from_json + // method when value_type is BasicJsonType + return i.template get(); + }); + arr = std::move(ret); +} + +template +void from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, + priority_tag<0> /*unused*/) +{ + using std::end; + + ConstructibleArrayType ret; + std::transform( + j.begin(), j.end(), std::inserter(ret, end(ret)), + [](const BasicJsonType & i) + { + // get() returns *this, this won't call a from_json + // method when value_type is BasicJsonType + return i.template get(); + }); + arr = std::move(ret); +} + +template < typename BasicJsonType, typename ConstructibleArrayType, + enable_if_t < + is_constructible_array_type::value&& + !is_constructible_object_type::value&& + !is_constructible_string_type::value&& + !std::is_same::value&& + !is_basic_json::value, + int > = 0 > +auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr) +-> decltype(from_json_array_impl(j, arr, priority_tag<3> {}), +j.template get(), +void()) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + + std::string(j.type_name()))); + } + + from_json_array_impl(j, arr, priority_tag<3> {}); +} + +template +void from_json(const BasicJsonType& j, typename BasicJsonType::binary_t& bin) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_binary())) + { + JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(j.type_name()))); + } + + bin = *j.template get_ptr(); +} + +template::value, int> = 0> +void from_json(const BasicJsonType& j, ConstructibleObjectType& obj) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_object())) + { + JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name()))); + } + + ConstructibleObjectType ret; + auto inner_object = j.template get_ptr(); + using value_type = typename ConstructibleObjectType::value_type; + std::transform( + inner_object->begin(), inner_object->end(), + std::inserter(ret, ret.begin()), + [](typename BasicJsonType::object_t::value_type const & p) + { + return value_type(p.first, p.second.template get()); + }); + obj = std::move(ret); +} + +// overload for arithmetic types, not chosen for basic_json template arguments +// (BooleanType, etc..); note: Is it really necessary to provide explicit +// overloads for boolean_t etc. in case of a custom BooleanType which is not +// an arithmetic type? +template < typename BasicJsonType, typename ArithmeticType, + enable_if_t < + std::is_arithmetic::value&& + !std::is_same::value&& + !std::is_same::value&& + !std::is_same::value&& + !std::is_same::value, + int > = 0 > +void from_json(const BasicJsonType& j, ArithmeticType& val) +{ + switch (static_cast(j)) + { + case value_t::number_unsigned: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::number_integer: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::number_float: + { + val = static_cast(*j.template get_ptr()); + break; + } + case value_t::boolean: + { + val = static_cast(*j.template get_ptr()); + break; + } + + default: + JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()))); + } +} + +template +void from_json(const BasicJsonType& j, std::pair& p) +{ + p = {j.at(0).template get(), j.at(1).template get()}; +} + +template +void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_sequence /*unused*/) +{ + t = std::make_tuple(j.at(Idx).template get::type>()...); +} + +template +void from_json(const BasicJsonType& j, std::tuple& t) +{ + from_json_tuple_impl(j, t, index_sequence_for {}); +} + +template < typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator, + typename = enable_if_t < !std::is_constructible < + typename BasicJsonType::string_t, Key >::value >> +void from_json(const BasicJsonType& j, std::map& m) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + m.clear(); + for (const auto& p : j) + { + if (JSON_HEDLEY_UNLIKELY(!p.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); + } + m.emplace(p.at(0).template get(), p.at(1).template get()); + } +} + +template < typename BasicJsonType, typename Key, typename Value, typename Hash, typename KeyEqual, typename Allocator, + typename = enable_if_t < !std::is_constructible < + typename BasicJsonType::string_t, Key >::value >> +void from_json(const BasicJsonType& j, std::unordered_map& m) +{ + if (JSON_HEDLEY_UNLIKELY(!j.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()))); + } + m.clear(); + for (const auto& p : j) + { + if (JSON_HEDLEY_UNLIKELY(!p.is_array())) + { + JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name()))); + } + m.emplace(p.at(0).template get(), p.at(1).template get()); + } +} + +struct from_json_fn +{ + template + auto operator()(const BasicJsonType& j, T& val) const + noexcept(noexcept(from_json(j, val))) + -> decltype(from_json(j, val), void()) + { + return from_json(j, val); + } +}; +} // namespace detail + +/// namespace to hold default `from_json` function +/// to see why this is required: +/// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html +namespace +{ +constexpr const auto& from_json = detail::static_const::value; +} // namespace +} // namespace nlohmann + +// #include + + +#include // copy +#include // begin, end +#include // string +#include // tuple, get +#include // is_same, is_constructible, is_floating_point, is_enum, underlying_type +#include // move, forward, declval, pair +#include // valarray +#include // vector + +// #include + + +#include // size_t +#include // input_iterator_tag +#include // string, to_string +#include // tuple_size, get, tuple_element + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +void int_to_string( string_type& target, std::size_t value ) +{ + // For ADL + using std::to_string; + target = to_string(value); +} +template class iteration_proxy_value +{ + public: + using difference_type = std::ptrdiff_t; + using value_type = iteration_proxy_value; + using pointer = value_type * ; + using reference = value_type & ; + using iterator_category = std::input_iterator_tag; + using string_type = typename std::remove_cv< typename std::remove_reference().key() ) >::type >::type; + + private: + /// the iterator + IteratorType anchor; + /// an index for arrays (used to create key names) + std::size_t array_index = 0; + /// last stringified array index + mutable std::size_t array_index_last = 0; + /// a string representation of the array index + mutable string_type array_index_str = "0"; + /// an empty string (to return a reference for primitive values) + const string_type empty_str = ""; + + public: + explicit iteration_proxy_value(IteratorType it) noexcept : anchor(it) {} + + /// dereference operator (needed for range-based for) + iteration_proxy_value& operator*() + { + return *this; + } + + /// increment operator (needed for range-based for) + iteration_proxy_value& operator++() + { + ++anchor; + ++array_index; + + return *this; + } + + /// equality operator (needed for InputIterator) + bool operator==(const iteration_proxy_value& o) const + { + return anchor == o.anchor; + } + + /// inequality operator (needed for range-based for) + bool operator!=(const iteration_proxy_value& o) const + { + return anchor != o.anchor; + } + + /// return key of the iterator + const string_type& key() const + { + JSON_ASSERT(anchor.m_object != nullptr); + + switch (anchor.m_object->type()) + { + // use integer array index as key + case value_t::array: + { + if (array_index != array_index_last) + { + int_to_string( array_index_str, array_index ); + array_index_last = array_index; + } + return array_index_str; + } + + // use key from the object + case value_t::object: + return anchor.key(); + + // use an empty key for all primitive types + default: + return empty_str; + } + } + + /// return value of the iterator + typename IteratorType::reference value() const + { + return anchor.value(); + } +}; + +/// proxy class for the items() function +template class iteration_proxy +{ + private: + /// the container to iterate + typename IteratorType::reference container; + + public: + /// construct iteration proxy from a container + explicit iteration_proxy(typename IteratorType::reference cont) noexcept + : container(cont) {} + + /// return iterator begin (needed for range-based for) + iteration_proxy_value begin() noexcept + { + return iteration_proxy_value(container.begin()); + } + + /// return iterator end (needed for range-based for) + iteration_proxy_value end() noexcept + { + return iteration_proxy_value(container.end()); + } +}; +// Structured Bindings Support +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +template = 0> +auto get(const nlohmann::detail::iteration_proxy_value& i) -> decltype(i.key()) +{ + return i.key(); +} +// Structured Bindings Support +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +template = 0> +auto get(const nlohmann::detail::iteration_proxy_value& i) -> decltype(i.value()) +{ + return i.value(); +} +} // namespace detail +} // namespace nlohmann + +// The Addition to the STD Namespace is required to add +// Structured Bindings Support to the iteration_proxy_value class +// For further reference see https://blog.tartanllama.xyz/structured-bindings/ +// And see https://github.com/nlohmann/json/pull/1391 +namespace std +{ +#if defined(__clang__) + // Fix: https://github.com/nlohmann/json/issues/1401 + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wmismatched-tags" +#endif +template +class tuple_size<::nlohmann::detail::iteration_proxy_value> + : public std::integral_constant {}; + +template +class tuple_element> +{ + public: + using type = decltype( + get(std::declval < + ::nlohmann::detail::iteration_proxy_value> ())); +}; +#if defined(__clang__) + #pragma clang diagnostic pop +#endif +} // namespace std + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +////////////////// +// constructors // +////////////////// + +template struct external_constructor; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, typename BasicJsonType::boolean_t b) noexcept + { + j.m_type = value_t::boolean; + j.m_value = b; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, const typename BasicJsonType::string_t& s) + { + j.m_type = value_t::string; + j.m_value = s; + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, typename BasicJsonType::string_t&& s) + { + j.m_type = value_t::string; + j.m_value = std::move(s); + j.assert_invariant(); + } + + template < typename BasicJsonType, typename CompatibleStringType, + enable_if_t < !std::is_same::value, + int > = 0 > + static void construct(BasicJsonType& j, const CompatibleStringType& str) + { + j.m_type = value_t::string; + j.m_value.string = j.template create(str); + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, const typename BasicJsonType::binary_t& b) + { + j.m_type = value_t::binary; + typename BasicJsonType::binary_t value{b}; + j.m_value = value; + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, typename BasicJsonType::binary_t&& b) + { + j.m_type = value_t::binary; + typename BasicJsonType::binary_t value{std::move(b)}; + j.m_value = value; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, typename BasicJsonType::number_float_t val) noexcept + { + j.m_type = value_t::number_float; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, typename BasicJsonType::number_unsigned_t val) noexcept + { + j.m_type = value_t::number_unsigned; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, typename BasicJsonType::number_integer_t val) noexcept + { + j.m_type = value_t::number_integer; + j.m_value = val; + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, const typename BasicJsonType::array_t& arr) + { + j.m_type = value_t::array; + j.m_value = arr; + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, typename BasicJsonType::array_t&& arr) + { + j.m_type = value_t::array; + j.m_value = std::move(arr); + j.assert_invariant(); + } + + template < typename BasicJsonType, typename CompatibleArrayType, + enable_if_t < !std::is_same::value, + int > = 0 > + static void construct(BasicJsonType& j, const CompatibleArrayType& arr) + { + using std::begin; + using std::end; + j.m_type = value_t::array; + j.m_value.array = j.template create(begin(arr), end(arr)); + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, const std::vector& arr) + { + j.m_type = value_t::array; + j.m_value = value_t::array; + j.m_value.array->reserve(arr.size()); + for (const bool x : arr) + { + j.m_value.array->push_back(x); + } + j.assert_invariant(); + } + + template::value, int> = 0> + static void construct(BasicJsonType& j, const std::valarray& arr) + { + j.m_type = value_t::array; + j.m_value = value_t::array; + j.m_value.array->resize(arr.size()); + if (arr.size() > 0) + { + std::copy(std::begin(arr), std::end(arr), j.m_value.array->begin()); + } + j.assert_invariant(); + } +}; + +template<> +struct external_constructor +{ + template + static void construct(BasicJsonType& j, const typename BasicJsonType::object_t& obj) + { + j.m_type = value_t::object; + j.m_value = obj; + j.assert_invariant(); + } + + template + static void construct(BasicJsonType& j, typename BasicJsonType::object_t&& obj) + { + j.m_type = value_t::object; + j.m_value = std::move(obj); + j.assert_invariant(); + } + + template < typename BasicJsonType, typename CompatibleObjectType, + enable_if_t < !std::is_same::value, int > = 0 > + static void construct(BasicJsonType& j, const CompatibleObjectType& obj) + { + using std::begin; + using std::end; + + j.m_type = value_t::object; + j.m_value.object = j.template create(begin(obj), end(obj)); + j.assert_invariant(); + } +}; + +///////////// +// to_json // +///////////// + +template::value, int> = 0> +void to_json(BasicJsonType& j, T b) noexcept +{ + external_constructor::construct(j, b); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, const CompatibleString& s) +{ + external_constructor::construct(j, s); +} + +template +void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s) +{ + external_constructor::construct(j, std::move(s)); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, FloatType val) noexcept +{ + external_constructor::construct(j, static_cast(val)); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noexcept +{ + external_constructor::construct(j, static_cast(val)); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noexcept +{ + external_constructor::construct(j, static_cast(val)); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, EnumType e) noexcept +{ + using underlying_type = typename std::underlying_type::type; + external_constructor::construct(j, static_cast(e)); +} + +template +void to_json(BasicJsonType& j, const std::vector& e) +{ + external_constructor::construct(j, e); +} + +template < typename BasicJsonType, typename CompatibleArrayType, + enable_if_t < is_compatible_array_type::value&& + !is_compatible_object_type::value&& + !is_compatible_string_type::value&& + !std::is_same::value&& + !is_basic_json::value, + int > = 0 > +void to_json(BasicJsonType& j, const CompatibleArrayType& arr) +{ + external_constructor::construct(j, arr); +} + +template +void to_json(BasicJsonType& j, const typename BasicJsonType::binary_t& bin) +{ + external_constructor::construct(j, bin); +} + +template::value, int> = 0> +void to_json(BasicJsonType& j, const std::valarray& arr) +{ + external_constructor::construct(j, std::move(arr)); +} + +template +void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr) +{ + external_constructor::construct(j, std::move(arr)); +} + +template < typename BasicJsonType, typename CompatibleObjectType, + enable_if_t < is_compatible_object_type::value&& !is_basic_json::value, int > = 0 > +void to_json(BasicJsonType& j, const CompatibleObjectType& obj) +{ + external_constructor::construct(j, obj); +} + +template +void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj) +{ + external_constructor::construct(j, std::move(obj)); +} + +template < + typename BasicJsonType, typename T, std::size_t N, + enable_if_t < !std::is_constructible::value, + int > = 0 > +void to_json(BasicJsonType& j, const T(&arr)[N]) +{ + external_constructor::construct(j, arr); +} + +template < typename BasicJsonType, typename T1, typename T2, enable_if_t < std::is_constructible::value&& std::is_constructible::value, int > = 0 > +void to_json(BasicJsonType& j, const std::pair& p) +{ + j = { p.first, p.second }; +} + +// for https://github.com/nlohmann/json/pull/1134 +template>::value, int> = 0> +void to_json(BasicJsonType& j, const T& b) +{ + j = { {b.key(), b.value()} }; +} + +template +void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence /*unused*/) +{ + j = { std::get(t)... }; +} + +template::value, int > = 0> +void to_json(BasicJsonType& j, const T& t) +{ + to_json_tuple_impl(j, t, make_index_sequence::value> {}); +} + +struct to_json_fn +{ + template + auto operator()(BasicJsonType& j, T&& val) const noexcept(noexcept(to_json(j, std::forward(val)))) + -> decltype(to_json(j, std::forward(val)), void()) + { + return to_json(j, std::forward(val)); + } +}; +} // namespace detail + +/// namespace to hold default `to_json` function +namespace +{ +constexpr const auto& to_json = detail::static_const::value; +} // namespace +} // namespace nlohmann + + +namespace nlohmann +{ + +template +struct adl_serializer +{ + /*! + @brief convert a JSON value to any value type + + This function is usually called by the `get()` function of the + @ref basic_json class (either explicit or via conversion operators). + + @param[in] j JSON value to read from + @param[in,out] val value to write to + */ + template + static auto from_json(BasicJsonType&& j, ValueType& val) noexcept( + noexcept(::nlohmann::from_json(std::forward(j), val))) + -> decltype(::nlohmann::from_json(std::forward(j), val), void()) + { + ::nlohmann::from_json(std::forward(j), val); + } + + /*! + @brief convert any value type to a JSON value + + This function is usually called by the constructors of the @ref basic_json + class. + + @param[in,out] j JSON value to write to + @param[in] val value to read from + */ + template + static auto to_json(BasicJsonType& j, ValueType&& val) noexcept( + noexcept(::nlohmann::to_json(j, std::forward(val)))) + -> decltype(::nlohmann::to_json(j, std::forward(val)), void()) + { + ::nlohmann::to_json(j, std::forward(val)); + } +}; + +} // namespace nlohmann + +// #include + + +#include // uint8_t +#include // tie +#include // move + +namespace nlohmann +{ + +/*! +@brief an internal type for a backed binary type + +This type extends the template parameter @a BinaryType provided to `basic_json` +with a subtype used by BSON and MessagePack. This type exists so that the user +does not have to specify a type themselves with a specific naming scheme in +order to override the binary type. + +@tparam BinaryType container to store bytes (`std::vector` by + default) + +@since version 3.8.0 +*/ +template +class byte_container_with_subtype : public BinaryType +{ + public: + /// the type of the underlying container + using container_type = BinaryType; + + byte_container_with_subtype() noexcept(noexcept(container_type())) + : container_type() + {} + + byte_container_with_subtype(const container_type& b) noexcept(noexcept(container_type(b))) + : container_type(b) + {} + + byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b)))) + : container_type(std::move(b)) + {} + + byte_container_with_subtype(const container_type& b, std::uint8_t subtype) noexcept(noexcept(container_type(b))) + : container_type(b) + , m_subtype(subtype) + , m_has_subtype(true) + {} + + byte_container_with_subtype(container_type&& b, std::uint8_t subtype) noexcept(noexcept(container_type(std::move(b)))) + : container_type(std::move(b)) + , m_subtype(subtype) + , m_has_subtype(true) + {} + + bool operator==(const byte_container_with_subtype& rhs) const + { + return std::tie(static_cast(*this), m_subtype, m_has_subtype) == + std::tie(static_cast(rhs), rhs.m_subtype, rhs.m_has_subtype); + } + + bool operator!=(const byte_container_with_subtype& rhs) const + { + return !(rhs == *this); + } + + /*! + @brief sets the binary subtype + + Sets the binary subtype of the value, also flags a binary JSON value as + having a subtype, which has implications for serialization. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref subtype() -- return the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + void set_subtype(std::uint8_t subtype) noexcept + { + m_subtype = subtype; + m_has_subtype = true; + } + + /*! + @brief return the binary subtype + + Returns the numerical subtype of the value if it has a subtype. If it does + not have a subtype, this function will return size_t(-1) as a sentinel + value. + + @return the numerical subtype of the binary value + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + constexpr std::uint8_t subtype() const noexcept + { + return m_subtype; + } + + /*! + @brief return whether the value has a subtype + + @return whether the value has a subtype + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref subtype() -- return the binary subtype + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref clear_subtype() -- clears the binary subtype + + @since version 3.8.0 + */ + constexpr bool has_subtype() const noexcept + { + return m_has_subtype; + } + + /*! + @brief clears the binary subtype + + Clears the binary subtype and flags the value as not having a subtype, which + has implications for serialization; for instance MessagePack will prefer the + bin family over the ext family. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @sa @ref subtype() -- return the binary subtype + @sa @ref set_subtype() -- sets the binary subtype + @sa @ref has_subtype() -- returns whether or not the binary value has a + subtype + + @since version 3.8.0 + */ + void clear_subtype() noexcept + { + m_subtype = 0; + m_has_subtype = false; + } + + private: + std::uint8_t m_subtype = 0; + bool m_has_subtype = false; +}; + +} // namespace nlohmann + +// #include + +// #include + +// #include + +// #include + + +#include // size_t, uint8_t +#include // hash + +namespace nlohmann +{ +namespace detail +{ + +// boost::hash_combine +inline std::size_t combine(std::size_t seed, std::size_t h) noexcept +{ + seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U); + return seed; +} + +/*! +@brief hash a JSON value + +The hash function tries to rely on std::hash where possible. Furthermore, the +type of the JSON value is taken into account to have different hash values for +null, 0, 0U, and false, etc. + +@tparam BasicJsonType basic_json specialization +@param j JSON value to hash +@return hash value of j +*/ +template +std::size_t hash(const BasicJsonType& j) +{ + using string_t = typename BasicJsonType::string_t; + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + + const auto type = static_cast(j.type()); + switch (j.type()) + { + case BasicJsonType::value_t::null: + case BasicJsonType::value_t::discarded: + { + return combine(type, 0); + } + + case BasicJsonType::value_t::object: + { + auto seed = combine(type, j.size()); + for (const auto& element : j.items()) + { + const auto h = std::hash {}(element.key()); + seed = combine(seed, h); + seed = combine(seed, hash(element.value())); + } + return seed; + } + + case BasicJsonType::value_t::array: + { + auto seed = combine(type, j.size()); + for (const auto& element : j) + { + seed = combine(seed, hash(element)); + } + return seed; + } + + case BasicJsonType::value_t::string: + { + const auto h = std::hash {}(j.template get_ref()); + return combine(type, h); + } + + case BasicJsonType::value_t::boolean: + { + const auto h = std::hash {}(j.template get()); + return combine(type, h); + } + + case BasicJsonType::value_t::number_integer: + { + const auto h = std::hash {}(j.template get()); + return combine(type, h); + } + + case nlohmann::detail::value_t::number_unsigned: + { + const auto h = std::hash {}(j.template get()); + return combine(type, h); + } + + case nlohmann::detail::value_t::number_float: + { + const auto h = std::hash {}(j.template get()); + return combine(type, h); + } + + case nlohmann::detail::value_t::binary: + { + auto seed = combine(type, j.get_binary().size()); + const auto h = std::hash {}(j.get_binary().has_subtype()); + seed = combine(seed, h); + seed = combine(seed, j.get_binary().subtype()); + for (const auto byte : j.get_binary()) + { + seed = combine(seed, std::hash {}(byte)); + } + return seed; + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } +} + +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // generate_n +#include // array +#include // ldexp +#include // size_t +#include // uint8_t, uint16_t, uint32_t, uint64_t +#include // snprintf +#include // memcpy +#include // back_inserter +#include // numeric_limits +#include // char_traits, string +#include // make_pair, move + +// #include + +// #include + + +#include // array +#include // size_t +#include //FILE * +#include // strlen +#include // istream +#include // begin, end, iterator_traits, random_access_iterator_tag, distance, next +#include // shared_ptr, make_shared, addressof +#include // accumulate +#include // string, char_traits +#include // enable_if, is_base_of, is_pointer, is_integral, remove_pointer +#include // pair, declval + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +/// the supported input formats +enum class input_format_t { json, cbor, msgpack, ubjson, bson }; + +//////////////////// +// input adapters // +//////////////////// + +/*! +Input adapter for stdio file access. This adapter read only 1 byte and do not use any + buffer. This adapter is a very low level adapter. +*/ +class file_input_adapter +{ + public: + using char_type = char; + + JSON_HEDLEY_NON_NULL(2) + explicit file_input_adapter(std::FILE* f) noexcept + : m_file(f) + {} + + // make class move-only + file_input_adapter(const file_input_adapter&) = delete; + file_input_adapter(file_input_adapter&&) = default; + file_input_adapter& operator=(const file_input_adapter&) = delete; + file_input_adapter& operator=(file_input_adapter&&) = delete; + + std::char_traits::int_type get_character() noexcept + { + return std::fgetc(m_file); + } + + private: + /// the file pointer to read from + std::FILE* m_file; +}; + + +/*! +Input adapter for a (caching) istream. Ignores a UFT Byte Order Mark at +beginning of input. Does not support changing the underlying std::streambuf +in mid-input. Maintains underlying std::istream and std::streambuf to support +subsequent use of standard std::istream operations to process any input +characters following those used in parsing the JSON input. Clears the +std::istream flags; any input errors (e.g., EOF) will be detected by the first +subsequent call for input from the std::istream. +*/ +class input_stream_adapter +{ + public: + using char_type = char; + + ~input_stream_adapter() + { + // clear stream flags; we use underlying streambuf I/O, do not + // maintain ifstream flags, except eof + if (is != nullptr) + { + is->clear(is->rdstate() & std::ios::eofbit); + } + } + + explicit input_stream_adapter(std::istream& i) + : is(&i), sb(i.rdbuf()) + {} + + // delete because of pointer members + input_stream_adapter(const input_stream_adapter&) = delete; + input_stream_adapter& operator=(input_stream_adapter&) = delete; + input_stream_adapter& operator=(input_stream_adapter&& rhs) = delete; + + input_stream_adapter(input_stream_adapter&& rhs) noexcept : is(rhs.is), sb(rhs.sb) + { + rhs.is = nullptr; + rhs.sb = nullptr; + } + + // std::istream/std::streambuf use std::char_traits::to_int_type, to + // ensure that std::char_traits::eof() and the character 0xFF do not + // end up as the same value, eg. 0xFFFFFFFF. + std::char_traits::int_type get_character() + { + auto res = sb->sbumpc(); + // set eof manually, as we don't use the istream interface. + if (JSON_HEDLEY_UNLIKELY(res == EOF)) + { + is->clear(is->rdstate() | std::ios::eofbit); + } + return res; + } + + private: + /// the associated input stream + std::istream* is = nullptr; + std::streambuf* sb = nullptr; +}; + +// General-purpose iterator-based adapter. It might not be as fast as +// theoretically possible for some containers, but it is extremely versatile. +template +class iterator_input_adapter +{ + public: + using char_type = typename std::iterator_traits::value_type; + + iterator_input_adapter(IteratorType first, IteratorType last) + : current(std::move(first)), end(std::move(last)) {} + + typename std::char_traits::int_type get_character() + { + if (JSON_HEDLEY_LIKELY(current != end)) + { + auto result = std::char_traits::to_int_type(*current); + std::advance(current, 1); + return result; + } + else + { + return std::char_traits::eof(); + } + } + + private: + IteratorType current; + IteratorType end; + + template + friend struct wide_string_input_helper; + + bool empty() const + { + return current == end; + } + +}; + + +template +struct wide_string_input_helper; + +template +struct wide_string_input_helper +{ + // UTF-32 + static void fill_buffer(BaseInputAdapter& input, + std::array::int_type, 4>& utf8_bytes, + size_t& utf8_bytes_index, + size_t& utf8_bytes_filled) + { + utf8_bytes_index = 0; + + if (JSON_HEDLEY_UNLIKELY(input.empty())) + { + utf8_bytes[0] = std::char_traits::eof(); + utf8_bytes_filled = 1; + } + else + { + // get the current character + const auto wc = input.get_character(); + + // UTF-32 to UTF-8 encoding + if (wc < 0x80) + { + utf8_bytes[0] = static_cast::int_type>(wc); + utf8_bytes_filled = 1; + } + else if (wc <= 0x7FF) + { + utf8_bytes[0] = static_cast::int_type>(0xC0u | ((static_cast(wc) >> 6u) & 0x1Fu)); + utf8_bytes[1] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 2; + } + else if (wc <= 0xFFFF) + { + utf8_bytes[0] = static_cast::int_type>(0xE0u | ((static_cast(wc) >> 12u) & 0x0Fu)); + utf8_bytes[1] = static_cast::int_type>(0x80u | ((static_cast(wc) >> 6u) & 0x3Fu)); + utf8_bytes[2] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 3; + } + else if (wc <= 0x10FFFF) + { + utf8_bytes[0] = static_cast::int_type>(0xF0u | ((static_cast(wc) >> 18u) & 0x07u)); + utf8_bytes[1] = static_cast::int_type>(0x80u | ((static_cast(wc) >> 12u) & 0x3Fu)); + utf8_bytes[2] = static_cast::int_type>(0x80u | ((static_cast(wc) >> 6u) & 0x3Fu)); + utf8_bytes[3] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 4; + } + else + { + // unknown character + utf8_bytes[0] = static_cast::int_type>(wc); + utf8_bytes_filled = 1; + } + } + } +}; + +template +struct wide_string_input_helper +{ + // UTF-16 + static void fill_buffer(BaseInputAdapter& input, + std::array::int_type, 4>& utf8_bytes, + size_t& utf8_bytes_index, + size_t& utf8_bytes_filled) + { + utf8_bytes_index = 0; + + if (JSON_HEDLEY_UNLIKELY(input.empty())) + { + utf8_bytes[0] = std::char_traits::eof(); + utf8_bytes_filled = 1; + } + else + { + // get the current character + const auto wc = input.get_character(); + + // UTF-16 to UTF-8 encoding + if (wc < 0x80) + { + utf8_bytes[0] = static_cast::int_type>(wc); + utf8_bytes_filled = 1; + } + else if (wc <= 0x7FF) + { + utf8_bytes[0] = static_cast::int_type>(0xC0u | ((static_cast(wc) >> 6u))); + utf8_bytes[1] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 2; + } + else if (0xD800 > wc || wc >= 0xE000) + { + utf8_bytes[0] = static_cast::int_type>(0xE0u | ((static_cast(wc) >> 12u))); + utf8_bytes[1] = static_cast::int_type>(0x80u | ((static_cast(wc) >> 6u) & 0x3Fu)); + utf8_bytes[2] = static_cast::int_type>(0x80u | (static_cast(wc) & 0x3Fu)); + utf8_bytes_filled = 3; + } + else + { + if (JSON_HEDLEY_UNLIKELY(!input.empty())) + { + const auto wc2 = static_cast(input.get_character()); + const auto charcode = 0x10000u + (((static_cast(wc) & 0x3FFu) << 10u) | (wc2 & 0x3FFu)); + utf8_bytes[0] = static_cast::int_type>(0xF0u | (charcode >> 18u)); + utf8_bytes[1] = static_cast::int_type>(0x80u | ((charcode >> 12u) & 0x3Fu)); + utf8_bytes[2] = static_cast::int_type>(0x80u | ((charcode >> 6u) & 0x3Fu)); + utf8_bytes[3] = static_cast::int_type>(0x80u | (charcode & 0x3Fu)); + utf8_bytes_filled = 4; + } + else + { + utf8_bytes[0] = static_cast::int_type>(wc); + utf8_bytes_filled = 1; + } + } + } + } +}; + +// Wraps another input apdater to convert wide character types into individual bytes. +template +class wide_string_input_adapter +{ + public: + using char_type = char; + + wide_string_input_adapter(BaseInputAdapter base) + : base_adapter(base) {} + + typename std::char_traits::int_type get_character() noexcept + { + // check if buffer needs to be filled + if (utf8_bytes_index == utf8_bytes_filled) + { + fill_buffer(); + + JSON_ASSERT(utf8_bytes_filled > 0); + JSON_ASSERT(utf8_bytes_index == 0); + } + + // use buffer + JSON_ASSERT(utf8_bytes_filled > 0); + JSON_ASSERT(utf8_bytes_index < utf8_bytes_filled); + return utf8_bytes[utf8_bytes_index++]; + } + + private: + BaseInputAdapter base_adapter; + + template + void fill_buffer() + { + wide_string_input_helper::fill_buffer(base_adapter, utf8_bytes, utf8_bytes_index, utf8_bytes_filled); + } + + /// a buffer for UTF-8 bytes + std::array::int_type, 4> utf8_bytes = {{0, 0, 0, 0}}; + + /// index to the utf8_codes array for the next valid byte + std::size_t utf8_bytes_index = 0; + /// number of valid bytes in the utf8_codes array + std::size_t utf8_bytes_filled = 0; +}; + + +template +struct iterator_input_adapter_factory +{ + using iterator_type = IteratorType; + using char_type = typename std::iterator_traits::value_type; + using adapter_type = iterator_input_adapter; + + static adapter_type create(IteratorType first, IteratorType last) + { + return adapter_type(std::move(first), std::move(last)); + } +}; + +template +struct is_iterator_of_multibyte +{ + using value_type = typename std::iterator_traits::value_type; + enum + { + value = sizeof(value_type) > 1 + }; +}; + +template +struct iterator_input_adapter_factory::value>> +{ + using iterator_type = IteratorType; + using char_type = typename std::iterator_traits::value_type; + using base_adapter_type = iterator_input_adapter; + using adapter_type = wide_string_input_adapter; + + static adapter_type create(IteratorType first, IteratorType last) + { + return adapter_type(base_adapter_type(std::move(first), std::move(last))); + } +}; + +// General purpose iterator-based input +template +typename iterator_input_adapter_factory::adapter_type input_adapter(IteratorType first, IteratorType last) +{ + using factory_type = iterator_input_adapter_factory; + return factory_type::create(first, last); +} + +// Convenience shorthand from container to iterator +template +auto input_adapter(const ContainerType& container) -> decltype(input_adapter(begin(container), end(container))) +{ + // Enable ADL + using std::begin; + using std::end; + + return input_adapter(begin(container), end(container)); +} + +// Special cases with fast paths +inline file_input_adapter input_adapter(std::FILE* file) +{ + return file_input_adapter(file); +} + +inline input_stream_adapter input_adapter(std::istream& stream) +{ + return input_stream_adapter(stream); +} + +inline input_stream_adapter input_adapter(std::istream&& stream) +{ + return input_stream_adapter(stream); +} + +using contiguous_bytes_input_adapter = decltype(input_adapter(std::declval(), std::declval())); + +// Null-delimited strings, and the like. +template < typename CharT, + typename std::enable_if < + std::is_pointer::value&& + !std::is_array::value&& + std::is_integral::type>::value&& + sizeof(typename std::remove_pointer::type) == 1, + int >::type = 0 > +contiguous_bytes_input_adapter input_adapter(CharT b) +{ + auto length = std::strlen(reinterpret_cast(b)); + const auto* ptr = reinterpret_cast(b); + return input_adapter(ptr, ptr + length); +} + +template +auto input_adapter(T (&array)[N]) -> decltype(input_adapter(array, array + N)) +{ + return input_adapter(array, array + N); +} + +// This class only handles inputs of input_buffer_adapter type. +// It's required so that expressions like {ptr, len} can be implicitely casted +// to the correct adapter. +class span_input_adapter +{ + public: + template < typename CharT, + typename std::enable_if < + std::is_pointer::value&& + std::is_integral::type>::value&& + sizeof(typename std::remove_pointer::type) == 1, + int >::type = 0 > + span_input_adapter(CharT b, std::size_t l) + : ia(reinterpret_cast(b), reinterpret_cast(b) + l) {} + + template::iterator_category, std::random_access_iterator_tag>::value, + int>::type = 0> + span_input_adapter(IteratorType first, IteratorType last) + : ia(input_adapter(first, last)) {} + + contiguous_bytes_input_adapter&& get() + { + return std::move(ia); + } + + private: + contiguous_bytes_input_adapter ia; +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include +#include // string +#include // move +#include // vector + +// #include + +// #include + + +namespace nlohmann +{ + +/*! +@brief SAX interface + +This class describes the SAX interface used by @ref nlohmann::json::sax_parse. +Each function is called in different situations while the input is parsed. The +boolean return value informs the parser whether to continue processing the +input. +*/ +template +struct json_sax +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + /*! + @brief a null value was read + @return whether parsing should proceed + */ + virtual bool null() = 0; + + /*! + @brief a boolean value was read + @param[in] val boolean value + @return whether parsing should proceed + */ + virtual bool boolean(bool val) = 0; + + /*! + @brief an integer number was read + @param[in] val integer value + @return whether parsing should proceed + */ + virtual bool number_integer(number_integer_t val) = 0; + + /*! + @brief an unsigned integer number was read + @param[in] val unsigned integer value + @return whether parsing should proceed + */ + virtual bool number_unsigned(number_unsigned_t val) = 0; + + /*! + @brief an floating-point number was read + @param[in] val floating-point value + @param[in] s raw token value + @return whether parsing should proceed + */ + virtual bool number_float(number_float_t val, const string_t& s) = 0; + + /*! + @brief a string was read + @param[in] val string value + @return whether parsing should proceed + @note It is safe to move the passed string. + */ + virtual bool string(string_t& val) = 0; + + /*! + @brief a binary string was read + @param[in] val binary value + @return whether parsing should proceed + @note It is safe to move the passed binary. + */ + virtual bool binary(binary_t& val) = 0; + + /*! + @brief the beginning of an object was read + @param[in] elements number of object elements or -1 if unknown + @return whether parsing should proceed + @note binary formats may report the number of elements + */ + virtual bool start_object(std::size_t elements) = 0; + + /*! + @brief an object key was read + @param[in] val object key + @return whether parsing should proceed + @note It is safe to move the passed string. + */ + virtual bool key(string_t& val) = 0; + + /*! + @brief the end of an object was read + @return whether parsing should proceed + */ + virtual bool end_object() = 0; + + /*! + @brief the beginning of an array was read + @param[in] elements number of array elements or -1 if unknown + @return whether parsing should proceed + @note binary formats may report the number of elements + */ + virtual bool start_array(std::size_t elements) = 0; + + /*! + @brief the end of an array was read + @return whether parsing should proceed + */ + virtual bool end_array() = 0; + + /*! + @brief a parse error occurred + @param[in] position the position in the input where the error occurs + @param[in] last_token the last read token + @param[in] ex an exception object describing the error + @return whether parsing should proceed (must return false) + */ + virtual bool parse_error(std::size_t position, + const std::string& last_token, + const detail::exception& ex) = 0; + + virtual ~json_sax() = default; +}; + + +namespace detail +{ +/*! +@brief SAX implementation to create a JSON value from SAX events + +This class implements the @ref json_sax interface and processes the SAX events +to create a JSON value which makes it basically a DOM parser. The structure or +hierarchy of the JSON value is managed by the stack `ref_stack` which contains +a pointer to the respective array or object for each recursion depth. + +After successful parsing, the value that is passed by reference to the +constructor contains the parsed value. + +@tparam BasicJsonType the JSON type +*/ +template +class json_sax_dom_parser +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + /*! + @param[in, out] r reference to a JSON value that is manipulated while + parsing + @param[in] allow_exceptions_ whether parse errors yield exceptions + */ + explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_exceptions_ = true) + : root(r), allow_exceptions(allow_exceptions_) + {} + + // make class move-only + json_sax_dom_parser(const json_sax_dom_parser&) = delete; + json_sax_dom_parser(json_sax_dom_parser&&) = default; + json_sax_dom_parser& operator=(const json_sax_dom_parser&) = delete; + json_sax_dom_parser& operator=(json_sax_dom_parser&&) = default; + ~json_sax_dom_parser() = default; + + bool null() + { + handle_value(nullptr); + return true; + } + + bool boolean(bool val) + { + handle_value(val); + return true; + } + + bool number_integer(number_integer_t val) + { + handle_value(val); + return true; + } + + bool number_unsigned(number_unsigned_t val) + { + handle_value(val); + return true; + } + + bool number_float(number_float_t val, const string_t& /*unused*/) + { + handle_value(val); + return true; + } + + bool string(string_t& val) + { + handle_value(val); + return true; + } + + bool binary(binary_t& val) + { + handle_value(std::move(val)); + return true; + } + + bool start_object(std::size_t len) + { + ref_stack.push_back(handle_value(BasicJsonType::value_t::object)); + + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, + "excessive object size: " + std::to_string(len))); + } + + return true; + } + + bool key(string_t& val) + { + // add null at given key and store the reference for later + object_element = &(ref_stack.back()->m_value.object->operator[](val)); + return true; + } + + bool end_object() + { + ref_stack.pop_back(); + return true; + } + + bool start_array(std::size_t len) + { + ref_stack.push_back(handle_value(BasicJsonType::value_t::array)); + + if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, + "excessive array size: " + std::to_string(len))); + } + + return true; + } + + bool end_array() + { + ref_stack.pop_back(); + return true; + } + + template + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, + const Exception& ex) + { + errored = true; + static_cast(ex); + if (allow_exceptions) + { + JSON_THROW(ex); + } + return false; + } + + constexpr bool is_errored() const + { + return errored; + } + + private: + /*! + @invariant If the ref stack is empty, then the passed value will be the new + root. + @invariant If the ref stack contains a value, then it is an array or an + object to which we can add elements + */ + template + JSON_HEDLEY_RETURNS_NON_NULL + BasicJsonType* handle_value(Value&& v) + { + if (ref_stack.empty()) + { + root = BasicJsonType(std::forward(v)); + return &root; + } + + JSON_ASSERT(ref_stack.back()->is_array() || ref_stack.back()->is_object()); + + if (ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->emplace_back(std::forward(v)); + return &(ref_stack.back()->m_value.array->back()); + } + + JSON_ASSERT(ref_stack.back()->is_object()); + JSON_ASSERT(object_element); + *object_element = BasicJsonType(std::forward(v)); + return object_element; + } + + /// the parsed JSON value + BasicJsonType& root; + /// stack to model hierarchy of values + std::vector ref_stack {}; + /// helper to hold the reference for the next object element + BasicJsonType* object_element = nullptr; + /// whether a syntax error occurred + bool errored = false; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; +}; + +template +class json_sax_dom_callback_parser +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using parser_callback_t = typename BasicJsonType::parser_callback_t; + using parse_event_t = typename BasicJsonType::parse_event_t; + + json_sax_dom_callback_parser(BasicJsonType& r, + const parser_callback_t cb, + const bool allow_exceptions_ = true) + : root(r), callback(cb), allow_exceptions(allow_exceptions_) + { + keep_stack.push_back(true); + } + + // make class move-only + json_sax_dom_callback_parser(const json_sax_dom_callback_parser&) = delete; + json_sax_dom_callback_parser(json_sax_dom_callback_parser&&) = default; + json_sax_dom_callback_parser& operator=(const json_sax_dom_callback_parser&) = delete; + json_sax_dom_callback_parser& operator=(json_sax_dom_callback_parser&&) = default; + ~json_sax_dom_callback_parser() = default; + + bool null() + { + handle_value(nullptr); + return true; + } + + bool boolean(bool val) + { + handle_value(val); + return true; + } + + bool number_integer(number_integer_t val) + { + handle_value(val); + return true; + } + + bool number_unsigned(number_unsigned_t val) + { + handle_value(val); + return true; + } + + bool number_float(number_float_t val, const string_t& /*unused*/) + { + handle_value(val); + return true; + } + + bool string(string_t& val) + { + handle_value(val); + return true; + } + + bool binary(binary_t& val) + { + handle_value(std::move(val)); + return true; + } + + bool start_object(std::size_t len) + { + // check callback for object start + const bool keep = callback(static_cast(ref_stack.size()), parse_event_t::object_start, discarded); + keep_stack.push_back(keep); + + auto val = handle_value(BasicJsonType::value_t::object, true); + ref_stack.push_back(val.second); + + // check object limit + if (ref_stack.back() && JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, "excessive object size: " + std::to_string(len))); + } + + return true; + } + + bool key(string_t& val) + { + BasicJsonType k = BasicJsonType(val); + + // check callback for key + const bool keep = callback(static_cast(ref_stack.size()), parse_event_t::key, k); + key_keep_stack.push_back(keep); + + // add discarded value at given key and store the reference for later + if (keep && ref_stack.back()) + { + object_element = &(ref_stack.back()->m_value.object->operator[](val) = discarded); + } + + return true; + } + + bool end_object() + { + if (ref_stack.back() && !callback(static_cast(ref_stack.size()) - 1, parse_event_t::object_end, *ref_stack.back())) + { + // discard object + *ref_stack.back() = discarded; + } + + JSON_ASSERT(!ref_stack.empty()); + JSON_ASSERT(!keep_stack.empty()); + ref_stack.pop_back(); + keep_stack.pop_back(); + + if (!ref_stack.empty() && ref_stack.back() && ref_stack.back()->is_structured()) + { + // remove discarded value + for (auto it = ref_stack.back()->begin(); it != ref_stack.back()->end(); ++it) + { + if (it->is_discarded()) + { + ref_stack.back()->erase(it); + break; + } + } + } + + return true; + } + + bool start_array(std::size_t len) + { + const bool keep = callback(static_cast(ref_stack.size()), parse_event_t::array_start, discarded); + keep_stack.push_back(keep); + + auto val = handle_value(BasicJsonType::value_t::array, true); + ref_stack.push_back(val.second); + + // check array limit + if (ref_stack.back() && JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) && len > ref_stack.back()->max_size())) + { + JSON_THROW(out_of_range::create(408, "excessive array size: " + std::to_string(len))); + } + + return true; + } + + bool end_array() + { + bool keep = true; + + if (ref_stack.back()) + { + keep = callback(static_cast(ref_stack.size()) - 1, parse_event_t::array_end, *ref_stack.back()); + if (!keep) + { + // discard array + *ref_stack.back() = discarded; + } + } + + JSON_ASSERT(!ref_stack.empty()); + JSON_ASSERT(!keep_stack.empty()); + ref_stack.pop_back(); + keep_stack.pop_back(); + + // remove discarded value + if (!keep && !ref_stack.empty() && ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->pop_back(); + } + + return true; + } + + template + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, + const Exception& ex) + { + errored = true; + static_cast(ex); + if (allow_exceptions) + { + JSON_THROW(ex); + } + return false; + } + + constexpr bool is_errored() const + { + return errored; + } + + private: + /*! + @param[in] v value to add to the JSON value we build during parsing + @param[in] skip_callback whether we should skip calling the callback + function; this is required after start_array() and + start_object() SAX events, because otherwise we would call the + callback function with an empty array or object, respectively. + + @invariant If the ref stack is empty, then the passed value will be the new + root. + @invariant If the ref stack contains a value, then it is an array or an + object to which we can add elements + + @return pair of boolean (whether value should be kept) and pointer (to the + passed value in the ref_stack hierarchy; nullptr if not kept) + */ + template + std::pair handle_value(Value&& v, const bool skip_callback = false) + { + JSON_ASSERT(!keep_stack.empty()); + + // do not handle this value if we know it would be added to a discarded + // container + if (!keep_stack.back()) + { + return {false, nullptr}; + } + + // create value + auto value = BasicJsonType(std::forward(v)); + + // check callback + const bool keep = skip_callback || callback(static_cast(ref_stack.size()), parse_event_t::value, value); + + // do not handle this value if we just learnt it shall be discarded + if (!keep) + { + return {false, nullptr}; + } + + if (ref_stack.empty()) + { + root = std::move(value); + return {true, &root}; + } + + // skip this value if we already decided to skip the parent + // (https://github.com/nlohmann/json/issues/971#issuecomment-413678360) + if (!ref_stack.back()) + { + return {false, nullptr}; + } + + // we now only expect arrays and objects + JSON_ASSERT(ref_stack.back()->is_array() || ref_stack.back()->is_object()); + + // array + if (ref_stack.back()->is_array()) + { + ref_stack.back()->m_value.array->push_back(std::move(value)); + return {true, &(ref_stack.back()->m_value.array->back())}; + } + + // object + JSON_ASSERT(ref_stack.back()->is_object()); + // check if we should store an element for the current key + JSON_ASSERT(!key_keep_stack.empty()); + const bool store_element = key_keep_stack.back(); + key_keep_stack.pop_back(); + + if (!store_element) + { + return {false, nullptr}; + } + + JSON_ASSERT(object_element); + *object_element = std::move(value); + return {true, object_element}; + } + + /// the parsed JSON value + BasicJsonType& root; + /// stack to model hierarchy of values + std::vector ref_stack {}; + /// stack to manage which values to keep + std::vector keep_stack {}; + /// stack to manage which object keys to keep + std::vector key_keep_stack {}; + /// helper to hold the reference for the next object element + BasicJsonType* object_element = nullptr; + /// whether a syntax error occurred + bool errored = false; + /// callback function + const parser_callback_t callback = nullptr; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; + /// a discarded value for the callback + BasicJsonType discarded = BasicJsonType::value_t::discarded; +}; + +template +class json_sax_acceptor +{ + public: + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + + bool null() + { + return true; + } + + bool boolean(bool /*unused*/) + { + return true; + } + + bool number_integer(number_integer_t /*unused*/) + { + return true; + } + + bool number_unsigned(number_unsigned_t /*unused*/) + { + return true; + } + + bool number_float(number_float_t /*unused*/, const string_t& /*unused*/) + { + return true; + } + + bool string(string_t& /*unused*/) + { + return true; + } + + bool binary(binary_t& /*unused*/) + { + return true; + } + + bool start_object(std::size_t /*unused*/ = std::size_t(-1)) + { + return true; + } + + bool key(string_t& /*unused*/) + { + return true; + } + + bool end_object() + { + return true; + } + + bool start_array(std::size_t /*unused*/ = std::size_t(-1)) + { + return true; + } + + bool end_array() + { + return true; + } + + bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const detail::exception& /*unused*/) + { + return false; + } +}; +} // namespace detail + +} // namespace nlohmann + +// #include + + +#include // array +#include // localeconv +#include // size_t +#include // snprintf +#include // strtof, strtod, strtold, strtoll, strtoull +#include // initializer_list +#include // char_traits, string +#include // move +#include // vector + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +/////////// +// lexer // +/////////// + +template +class lexer_base +{ + public: + /// token types for the parser + enum class token_type + { + uninitialized, ///< indicating the scanner is uninitialized + literal_true, ///< the `true` literal + literal_false, ///< the `false` literal + literal_null, ///< the `null` literal + value_string, ///< a string -- use get_string() for actual value + value_unsigned, ///< an unsigned integer -- use get_number_unsigned() for actual value + value_integer, ///< a signed integer -- use get_number_integer() for actual value + value_float, ///< an floating point number -- use get_number_float() for actual value + begin_array, ///< the character for array begin `[` + begin_object, ///< the character for object begin `{` + end_array, ///< the character for array end `]` + end_object, ///< the character for object end `}` + name_separator, ///< the name separator `:` + value_separator, ///< the value separator `,` + parse_error, ///< indicating a parse error + end_of_input, ///< indicating the end of the input buffer + literal_or_value ///< a literal or the begin of a value (only for diagnostics) + }; + + /// return name of values of type token_type (only used for errors) + JSON_HEDLEY_RETURNS_NON_NULL + JSON_HEDLEY_CONST + static const char* token_type_name(const token_type t) noexcept + { + switch (t) + { + case token_type::uninitialized: + return ""; + case token_type::literal_true: + return "true literal"; + case token_type::literal_false: + return "false literal"; + case token_type::literal_null: + return "null literal"; + case token_type::value_string: + return "string literal"; + case token_type::value_unsigned: + case token_type::value_integer: + case token_type::value_float: + return "number literal"; + case token_type::begin_array: + return "'['"; + case token_type::begin_object: + return "'{'"; + case token_type::end_array: + return "']'"; + case token_type::end_object: + return "'}'"; + case token_type::name_separator: + return "':'"; + case token_type::value_separator: + return "','"; + case token_type::parse_error: + return ""; + case token_type::end_of_input: + return "end of input"; + case token_type::literal_or_value: + return "'[', '{', or a literal"; + // LCOV_EXCL_START + default: // catch non-enum values + return "unknown token"; + // LCOV_EXCL_STOP + } + } +}; +/*! +@brief lexical analysis + +This class organizes the lexical analysis during JSON deserialization. +*/ +template +class lexer : public lexer_base +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using char_type = typename InputAdapterType::char_type; + using char_int_type = typename std::char_traits::int_type; + + public: + using token_type = typename lexer_base::token_type; + + explicit lexer(InputAdapterType&& adapter, bool ignore_comments_ = false) + : ia(std::move(adapter)) + , ignore_comments(ignore_comments_) + , decimal_point_char(static_cast(get_decimal_point())) + {} + + // delete because of pointer members + lexer(const lexer&) = delete; + lexer(lexer&&) = default; + lexer& operator=(lexer&) = delete; + lexer& operator=(lexer&&) = default; + ~lexer() = default; + + private: + ///////////////////// + // locales + ///////////////////// + + /// return the locale-dependent decimal point + JSON_HEDLEY_PURE + static char get_decimal_point() noexcept + { + const auto* loc = localeconv(); + JSON_ASSERT(loc != nullptr); + return (loc->decimal_point == nullptr) ? '.' : *(loc->decimal_point); + } + + ///////////////////// + // scan functions + ///////////////////// + + /*! + @brief get codepoint from 4 hex characters following `\u` + + For input "\u c1 c2 c3 c4" the codepoint is: + (c1 * 0x1000) + (c2 * 0x0100) + (c3 * 0x0010) + c4 + = (c1 << 12) + (c2 << 8) + (c3 << 4) + (c4 << 0) + + Furthermore, the possible characters '0'..'9', 'A'..'F', and 'a'..'f' + must be converted to the integers 0x0..0x9, 0xA..0xF, 0xA..0xF, resp. The + conversion is done by subtracting the offset (0x30, 0x37, and 0x57) + between the ASCII value of the character and the desired integer value. + + @return codepoint (0x0000..0xFFFF) or -1 in case of an error (e.g. EOF or + non-hex character) + */ + int get_codepoint() + { + // this function only makes sense after reading `\u` + JSON_ASSERT(current == 'u'); + int codepoint = 0; + + const auto factors = { 12u, 8u, 4u, 0u }; + for (const auto factor : factors) + { + get(); + + if (current >= '0' && current <= '9') + { + codepoint += static_cast((static_cast(current) - 0x30u) << factor); + } + else if (current >= 'A' && current <= 'F') + { + codepoint += static_cast((static_cast(current) - 0x37u) << factor); + } + else if (current >= 'a' && current <= 'f') + { + codepoint += static_cast((static_cast(current) - 0x57u) << factor); + } + else + { + return -1; + } + } + + JSON_ASSERT(0x0000 <= codepoint && codepoint <= 0xFFFF); + return codepoint; + } + + /*! + @brief check if the next byte(s) are inside a given range + + Adds the current byte and, for each passed range, reads a new byte and + checks if it is inside the range. If a violation was detected, set up an + error message and return false. Otherwise, return true. + + @param[in] ranges list of integers; interpreted as list of pairs of + inclusive lower and upper bound, respectively + + @pre The passed list @a ranges must have 2, 4, or 6 elements; that is, + 1, 2, or 3 pairs. This precondition is enforced by an assertion. + + @return true if and only if no range violation was detected + */ + bool next_byte_in_range(std::initializer_list ranges) + { + JSON_ASSERT(ranges.size() == 2 || ranges.size() == 4 || ranges.size() == 6); + add(current); + + for (auto range = ranges.begin(); range != ranges.end(); ++range) + { + get(); + if (JSON_HEDLEY_LIKELY(*range <= current && current <= *(++range))) + { + add(current); + } + else + { + error_message = "invalid string: ill-formed UTF-8 byte"; + return false; + } + } + + return true; + } + + /*! + @brief scan a string literal + + This function scans a string according to Sect. 7 of RFC 7159. While + scanning, bytes are escaped and copied into buffer token_buffer. Then the + function returns successfully, token_buffer is *not* null-terminated (as it + may contain \0 bytes), and token_buffer.size() is the number of bytes in the + string. + + @return token_type::value_string if string could be successfully scanned, + token_type::parse_error otherwise + + @note In case of errors, variable error_message contains a textual + description. + */ + token_type scan_string() + { + // reset token_buffer (ignore opening quote) + reset(); + + // we entered the function by reading an open quote + JSON_ASSERT(current == '\"'); + + while (true) + { + // get next character + switch (get()) + { + // end of file while parsing string + case std::char_traits::eof(): + { + error_message = "invalid string: missing closing quote"; + return token_type::parse_error; + } + + // closing quote + case '\"': + { + return token_type::value_string; + } + + // escapes + case '\\': + { + switch (get()) + { + // quotation mark + case '\"': + add('\"'); + break; + // reverse solidus + case '\\': + add('\\'); + break; + // solidus + case '/': + add('/'); + break; + // backspace + case 'b': + add('\b'); + break; + // form feed + case 'f': + add('\f'); + break; + // line feed + case 'n': + add('\n'); + break; + // carriage return + case 'r': + add('\r'); + break; + // tab + case 't': + add('\t'); + break; + + // unicode escapes + case 'u': + { + const int codepoint1 = get_codepoint(); + int codepoint = codepoint1; // start with codepoint1 + + if (JSON_HEDLEY_UNLIKELY(codepoint1 == -1)) + { + error_message = "invalid string: '\\u' must be followed by 4 hex digits"; + return token_type::parse_error; + } + + // check if code point is a high surrogate + if (0xD800 <= codepoint1 && codepoint1 <= 0xDBFF) + { + // expect next \uxxxx entry + if (JSON_HEDLEY_LIKELY(get() == '\\' && get() == 'u')) + { + const int codepoint2 = get_codepoint(); + + if (JSON_HEDLEY_UNLIKELY(codepoint2 == -1)) + { + error_message = "invalid string: '\\u' must be followed by 4 hex digits"; + return token_type::parse_error; + } + + // check if codepoint2 is a low surrogate + if (JSON_HEDLEY_LIKELY(0xDC00 <= codepoint2 && codepoint2 <= 0xDFFF)) + { + // overwrite codepoint + codepoint = static_cast( + // high surrogate occupies the most significant 22 bits + (static_cast(codepoint1) << 10u) + // low surrogate occupies the least significant 15 bits + + static_cast(codepoint2) + // there is still the 0xD800, 0xDC00 and 0x10000 noise + // in the result so we have to subtract with: + // (0xD800 << 10) + DC00 - 0x10000 = 0x35FDC00 + - 0x35FDC00u); + } + else + { + error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF"; + return token_type::parse_error; + } + } + else + { + error_message = "invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF"; + return token_type::parse_error; + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(0xDC00 <= codepoint1 && codepoint1 <= 0xDFFF)) + { + error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF"; + return token_type::parse_error; + } + } + + // result of the above calculation yields a proper codepoint + JSON_ASSERT(0x00 <= codepoint && codepoint <= 0x10FFFF); + + // translate codepoint into bytes + if (codepoint < 0x80) + { + // 1-byte characters: 0xxxxxxx (ASCII) + add(static_cast(codepoint)); + } + else if (codepoint <= 0x7FF) + { + // 2-byte characters: 110xxxxx 10xxxxxx + add(static_cast(0xC0u | (static_cast(codepoint) >> 6u))); + add(static_cast(0x80u | (static_cast(codepoint) & 0x3Fu))); + } + else if (codepoint <= 0xFFFF) + { + // 3-byte characters: 1110xxxx 10xxxxxx 10xxxxxx + add(static_cast(0xE0u | (static_cast(codepoint) >> 12u))); + add(static_cast(0x80u | ((static_cast(codepoint) >> 6u) & 0x3Fu))); + add(static_cast(0x80u | (static_cast(codepoint) & 0x3Fu))); + } + else + { + // 4-byte characters: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + add(static_cast(0xF0u | (static_cast(codepoint) >> 18u))); + add(static_cast(0x80u | ((static_cast(codepoint) >> 12u) & 0x3Fu))); + add(static_cast(0x80u | ((static_cast(codepoint) >> 6u) & 0x3Fu))); + add(static_cast(0x80u | (static_cast(codepoint) & 0x3Fu))); + } + + break; + } + + // other characters after escape + default: + error_message = "invalid string: forbidden character after backslash"; + return token_type::parse_error; + } + + break; + } + + // invalid control characters + case 0x00: + { + error_message = "invalid string: control character U+0000 (NUL) must be escaped to \\u0000"; + return token_type::parse_error; + } + + case 0x01: + { + error_message = "invalid string: control character U+0001 (SOH) must be escaped to \\u0001"; + return token_type::parse_error; + } + + case 0x02: + { + error_message = "invalid string: control character U+0002 (STX) must be escaped to \\u0002"; + return token_type::parse_error; + } + + case 0x03: + { + error_message = "invalid string: control character U+0003 (ETX) must be escaped to \\u0003"; + return token_type::parse_error; + } + + case 0x04: + { + error_message = "invalid string: control character U+0004 (EOT) must be escaped to \\u0004"; + return token_type::parse_error; + } + + case 0x05: + { + error_message = "invalid string: control character U+0005 (ENQ) must be escaped to \\u0005"; + return token_type::parse_error; + } + + case 0x06: + { + error_message = "invalid string: control character U+0006 (ACK) must be escaped to \\u0006"; + return token_type::parse_error; + } + + case 0x07: + { + error_message = "invalid string: control character U+0007 (BEL) must be escaped to \\u0007"; + return token_type::parse_error; + } + + case 0x08: + { + error_message = "invalid string: control character U+0008 (BS) must be escaped to \\u0008 or \\b"; + return token_type::parse_error; + } + + case 0x09: + { + error_message = "invalid string: control character U+0009 (HT) must be escaped to \\u0009 or \\t"; + return token_type::parse_error; + } + + case 0x0A: + { + error_message = "invalid string: control character U+000A (LF) must be escaped to \\u000A or \\n"; + return token_type::parse_error; + } + + case 0x0B: + { + error_message = "invalid string: control character U+000B (VT) must be escaped to \\u000B"; + return token_type::parse_error; + } + + case 0x0C: + { + error_message = "invalid string: control character U+000C (FF) must be escaped to \\u000C or \\f"; + return token_type::parse_error; + } + + case 0x0D: + { + error_message = "invalid string: control character U+000D (CR) must be escaped to \\u000D or \\r"; + return token_type::parse_error; + } + + case 0x0E: + { + error_message = "invalid string: control character U+000E (SO) must be escaped to \\u000E"; + return token_type::parse_error; + } + + case 0x0F: + { + error_message = "invalid string: control character U+000F (SI) must be escaped to \\u000F"; + return token_type::parse_error; + } + + case 0x10: + { + error_message = "invalid string: control character U+0010 (DLE) must be escaped to \\u0010"; + return token_type::parse_error; + } + + case 0x11: + { + error_message = "invalid string: control character U+0011 (DC1) must be escaped to \\u0011"; + return token_type::parse_error; + } + + case 0x12: + { + error_message = "invalid string: control character U+0012 (DC2) must be escaped to \\u0012"; + return token_type::parse_error; + } + + case 0x13: + { + error_message = "invalid string: control character U+0013 (DC3) must be escaped to \\u0013"; + return token_type::parse_error; + } + + case 0x14: + { + error_message = "invalid string: control character U+0014 (DC4) must be escaped to \\u0014"; + return token_type::parse_error; + } + + case 0x15: + { + error_message = "invalid string: control character U+0015 (NAK) must be escaped to \\u0015"; + return token_type::parse_error; + } + + case 0x16: + { + error_message = "invalid string: control character U+0016 (SYN) must be escaped to \\u0016"; + return token_type::parse_error; + } + + case 0x17: + { + error_message = "invalid string: control character U+0017 (ETB) must be escaped to \\u0017"; + return token_type::parse_error; + } + + case 0x18: + { + error_message = "invalid string: control character U+0018 (CAN) must be escaped to \\u0018"; + return token_type::parse_error; + } + + case 0x19: + { + error_message = "invalid string: control character U+0019 (EM) must be escaped to \\u0019"; + return token_type::parse_error; + } + + case 0x1A: + { + error_message = "invalid string: control character U+001A (SUB) must be escaped to \\u001A"; + return token_type::parse_error; + } + + case 0x1B: + { + error_message = "invalid string: control character U+001B (ESC) must be escaped to \\u001B"; + return token_type::parse_error; + } + + case 0x1C: + { + error_message = "invalid string: control character U+001C (FS) must be escaped to \\u001C"; + return token_type::parse_error; + } + + case 0x1D: + { + error_message = "invalid string: control character U+001D (GS) must be escaped to \\u001D"; + return token_type::parse_error; + } + + case 0x1E: + { + error_message = "invalid string: control character U+001E (RS) must be escaped to \\u001E"; + return token_type::parse_error; + } + + case 0x1F: + { + error_message = "invalid string: control character U+001F (US) must be escaped to \\u001F"; + return token_type::parse_error; + } + + // U+0020..U+007F (except U+0022 (quote) and U+005C (backspace)) + case 0x20: + case 0x21: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x3A: + case 0x3B: + case 0x3C: + case 0x3D: + case 0x3E: + case 0x3F: + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + case 0x5A: + case 0x5B: + case 0x5D: + case 0x5E: + case 0x5F: + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x7A: + case 0x7B: + case 0x7C: + case 0x7D: + case 0x7E: + case 0x7F: + { + add(current); + break; + } + + // U+0080..U+07FF: bytes C2..DF 80..BF + case 0xC2: + case 0xC3: + case 0xC4: + case 0xC5: + case 0xC6: + case 0xC7: + case 0xC8: + case 0xC9: + case 0xCA: + case 0xCB: + case 0xCC: + case 0xCD: + case 0xCE: + case 0xCF: + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + case 0xD4: + case 0xD5: + case 0xD6: + case 0xD7: + case 0xD8: + case 0xD9: + case 0xDA: + case 0xDB: + case 0xDC: + case 0xDD: + case 0xDE: + case 0xDF: + { + if (JSON_HEDLEY_UNLIKELY(!next_byte_in_range({0x80, 0xBF}))) + { + return token_type::parse_error; + } + break; + } + + // U+0800..U+0FFF: bytes E0 A0..BF 80..BF + case 0xE0: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+1000..U+CFFF: bytes E1..EC 80..BF 80..BF + // U+E000..U+FFFF: bytes EE..EF 80..BF 80..BF + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + case 0xE8: + case 0xE9: + case 0xEA: + case 0xEB: + case 0xEC: + case 0xEE: + case 0xEF: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+D000..U+D7FF: bytes ED 80..9F 80..BF + case 0xED: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x80, 0x9F, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF + case 0xF0: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF + case 0xF1: + case 0xF2: + case 0xF3: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF + case 0xF4: + { + if (JSON_HEDLEY_UNLIKELY(!(next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF})))) + { + return token_type::parse_error; + } + break; + } + + // remaining bytes (80..C1 and F5..FF) are ill-formed + default: + { + error_message = "invalid string: ill-formed UTF-8 byte"; + return token_type::parse_error; + } + } + } + } + + /*! + * @brief scan a comment + * @return whether comment could be scanned successfully + */ + bool scan_comment() + { + switch (get()) + { + // single-line comments skip input until a newline or EOF is read + case '/': + { + while (true) + { + switch (get()) + { + case '\n': + case '\r': + case std::char_traits::eof(): + case '\0': + return true; + + default: + break; + } + } + } + + // multi-line comments skip input until */ is read + case '*': + { + while (true) + { + switch (get()) + { + case std::char_traits::eof(): + case '\0': + { + error_message = "invalid comment; missing closing '*/'"; + return false; + } + + case '*': + { + switch (get()) + { + case '/': + return true; + + default: + { + unget(); + continue; + } + } + } + + default: + continue; + } + } + } + + // unexpected character after reading '/' + default: + { + error_message = "invalid comment; expecting '/' or '*' after '/'"; + return false; + } + } + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(float& f, const char* str, char** endptr) noexcept + { + f = std::strtof(str, endptr); + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(double& f, const char* str, char** endptr) noexcept + { + f = std::strtod(str, endptr); + } + + JSON_HEDLEY_NON_NULL(2) + static void strtof(long double& f, const char* str, char** endptr) noexcept + { + f = std::strtold(str, endptr); + } + + /*! + @brief scan a number literal + + This function scans a string according to Sect. 6 of RFC 7159. + + The function is realized with a deterministic finite state machine derived + from the grammar described in RFC 7159. Starting in state "init", the + input is read and used to determined the next state. Only state "done" + accepts the number. State "error" is a trap state to model errors. In the + table below, "anything" means any character but the ones listed before. + + state | 0 | 1-9 | e E | + | - | . | anything + ---------|----------|----------|----------|---------|---------|----------|----------- + init | zero | any1 | [error] | [error] | minus | [error] | [error] + minus | zero | any1 | [error] | [error] | [error] | [error] | [error] + zero | done | done | exponent | done | done | decimal1 | done + any1 | any1 | any1 | exponent | done | done | decimal1 | done + decimal1 | decimal2 | decimal2 | [error] | [error] | [error] | [error] | [error] + decimal2 | decimal2 | decimal2 | exponent | done | done | done | done + exponent | any2 | any2 | [error] | sign | sign | [error] | [error] + sign | any2 | any2 | [error] | [error] | [error] | [error] | [error] + any2 | any2 | any2 | done | done | done | done | done + + The state machine is realized with one label per state (prefixed with + "scan_number_") and `goto` statements between them. The state machine + contains cycles, but any cycle can be left when EOF is read. Therefore, + the function is guaranteed to terminate. + + During scanning, the read bytes are stored in token_buffer. This string is + then converted to a signed integer, an unsigned integer, or a + floating-point number. + + @return token_type::value_unsigned, token_type::value_integer, or + token_type::value_float if number could be successfully scanned, + token_type::parse_error otherwise + + @note The scanner is independent of the current locale. Internally, the + locale's decimal point is used instead of `.` to work with the + locale-dependent converters. + */ + token_type scan_number() // lgtm [cpp/use-of-goto] + { + // reset token_buffer to store the number's bytes + reset(); + + // the type of the parsed number; initially set to unsigned; will be + // changed if minus sign, decimal point or exponent is read + token_type number_type = token_type::value_unsigned; + + // state (init): we just found out we need to scan a number + switch (current) + { + case '-': + { + add(current); + goto scan_number_minus; + } + + case '0': + { + add(current); + goto scan_number_zero; + } + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + // all other characters are rejected outside scan_number() + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + +scan_number_minus: + // state: we just parsed a leading minus sign + number_type = token_type::value_integer; + switch (get()) + { + case '0': + { + add(current); + goto scan_number_zero; + } + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + default: + { + error_message = "invalid number; expected digit after '-'"; + return token_type::parse_error; + } + } + +scan_number_zero: + // state: we just parse a zero (maybe with a leading minus sign) + switch (get()) + { + case '.': + { + add(decimal_point_char); + goto scan_number_decimal1; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_any1: + // state: we just parsed a number 0-9 (maybe with a leading minus sign) + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any1; + } + + case '.': + { + add(decimal_point_char); + goto scan_number_decimal1; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_decimal1: + // state: we just parsed a decimal point + number_type = token_type::value_float; + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_decimal2; + } + + default: + { + error_message = "invalid number; expected digit after '.'"; + return token_type::parse_error; + } + } + +scan_number_decimal2: + // we just parsed at least one number after a decimal point + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_decimal2; + } + + case 'e': + case 'E': + { + add(current); + goto scan_number_exponent; + } + + default: + goto scan_number_done; + } + +scan_number_exponent: + // we just parsed an exponent + number_type = token_type::value_float; + switch (get()) + { + case '+': + case '-': + { + add(current); + goto scan_number_sign; + } + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + { + error_message = + "invalid number; expected '+', '-', or digit after exponent"; + return token_type::parse_error; + } + } + +scan_number_sign: + // we just parsed an exponent sign + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + { + error_message = "invalid number; expected digit after exponent sign"; + return token_type::parse_error; + } + } + +scan_number_any2: + // we just parsed a number after the exponent or exponent sign + switch (get()) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + { + add(current); + goto scan_number_any2; + } + + default: + goto scan_number_done; + } + +scan_number_done: + // unget the character after the number (we only read it to know that + // we are done scanning a number) + unget(); + + char* endptr = nullptr; + errno = 0; + + // try to parse integers first and fall back to floats + if (number_type == token_type::value_unsigned) + { + const auto x = std::strtoull(token_buffer.data(), &endptr, 10); + + // we checked the number format before + JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); + + if (errno == 0) + { + value_unsigned = static_cast(x); + if (value_unsigned == x) + { + return token_type::value_unsigned; + } + } + } + else if (number_type == token_type::value_integer) + { + const auto x = std::strtoll(token_buffer.data(), &endptr, 10); + + // we checked the number format before + JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); + + if (errno == 0) + { + value_integer = static_cast(x); + if (value_integer == x) + { + return token_type::value_integer; + } + } + } + + // this code is reached if we parse a floating-point number or if an + // integer conversion above failed + strtof(value_float, token_buffer.data(), &endptr); + + // we checked the number format before + JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); + + return token_type::value_float; + } + + /*! + @param[in] literal_text the literal text to expect + @param[in] length the length of the passed literal text + @param[in] return_type the token type to return on success + */ + JSON_HEDLEY_NON_NULL(2) + token_type scan_literal(const char_type* literal_text, const std::size_t length, + token_type return_type) + { + JSON_ASSERT(std::char_traits::to_char_type(current) == literal_text[0]); + for (std::size_t i = 1; i < length; ++i) + { + if (JSON_HEDLEY_UNLIKELY(std::char_traits::to_char_type(get()) != literal_text[i])) + { + error_message = "invalid literal"; + return token_type::parse_error; + } + } + return return_type; + } + + ///////////////////// + // input management + ///////////////////// + + /// reset token_buffer; current character is beginning of token + void reset() noexcept + { + token_buffer.clear(); + token_string.clear(); + token_string.push_back(std::char_traits::to_char_type(current)); + } + + /* + @brief get next character from the input + + This function provides the interface to the used input adapter. It does + not throw in case the input reached EOF, but returns a + `std::char_traits::eof()` in that case. Stores the scanned characters + for use in error messages. + + @return character read from the input + */ + char_int_type get() + { + ++position.chars_read_total; + ++position.chars_read_current_line; + + if (next_unget) + { + // just reset the next_unget variable and work with current + next_unget = false; + } + else + { + current = ia.get_character(); + } + + if (JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) + { + token_string.push_back(std::char_traits::to_char_type(current)); + } + + if (current == '\n') + { + ++position.lines_read; + position.chars_read_current_line = 0; + } + + return current; + } + + /*! + @brief unget current character (read it again on next get) + + We implement unget by setting variable next_unget to true. The input is not + changed - we just simulate ungetting by modifying chars_read_total, + chars_read_current_line, and token_string. The next call to get() will + behave as if the unget character is read again. + */ + void unget() + { + next_unget = true; + + --position.chars_read_total; + + // in case we "unget" a newline, we have to also decrement the lines_read + if (position.chars_read_current_line == 0) + { + if (position.lines_read > 0) + { + --position.lines_read; + } + } + else + { + --position.chars_read_current_line; + } + + if (JSON_HEDLEY_LIKELY(current != std::char_traits::eof())) + { + JSON_ASSERT(!token_string.empty()); + token_string.pop_back(); + } + } + + /// add a character to token_buffer + void add(char_int_type c) + { + token_buffer.push_back(static_cast(c)); + } + + public: + ///////////////////// + // value getters + ///////////////////// + + /// return integer value + constexpr number_integer_t get_number_integer() const noexcept + { + return value_integer; + } + + /// return unsigned integer value + constexpr number_unsigned_t get_number_unsigned() const noexcept + { + return value_unsigned; + } + + /// return floating-point value + constexpr number_float_t get_number_float() const noexcept + { + return value_float; + } + + /// return current string value (implicitly resets the token; useful only once) + string_t& get_string() + { + return token_buffer; + } + + ///////////////////// + // diagnostics + ///////////////////// + + /// return position of last read token + constexpr position_t get_position() const noexcept + { + return position; + } + + /// return the last read token (for errors only). Will never contain EOF + /// (an arbitrary value that is not a valid char value, often -1), because + /// 255 may legitimately occur. May contain NUL, which should be escaped. + std::string get_token_string() const + { + // escape control characters + std::string result; + for (const auto c : token_string) + { + if (static_cast(c) <= '\x1F') + { + // escape control characters + std::array cs{{}}; + (std::snprintf)(cs.data(), cs.size(), "", static_cast(c)); + result += cs.data(); + } + else + { + // add character as is + result.push_back(static_cast(c)); + } + } + + return result; + } + + /// return syntax error message + JSON_HEDLEY_RETURNS_NON_NULL + constexpr const char* get_error_message() const noexcept + { + return error_message; + } + + ///////////////////// + // actual scanner + ///////////////////// + + /*! + @brief skip the UTF-8 byte order mark + @return true iff there is no BOM or the correct BOM has been skipped + */ + bool skip_bom() + { + if (get() == 0xEF) + { + // check if we completely parse the BOM + return get() == 0xBB && get() == 0xBF; + } + + // the first character is not the beginning of the BOM; unget it to + // process is later + unget(); + return true; + } + + void skip_whitespace() + { + do + { + get(); + } + while (current == ' ' || current == '\t' || current == '\n' || current == '\r'); + } + + token_type scan() + { + // initially, skip the BOM + if (position.chars_read_total == 0 && !skip_bom()) + { + error_message = "invalid BOM; must be 0xEF 0xBB 0xBF if given"; + return token_type::parse_error; + } + + // read next character and ignore whitespace + skip_whitespace(); + + // ignore comments + while (ignore_comments && current == '/') + { + if (!scan_comment()) + { + return token_type::parse_error; + } + + // skip following whitespace + skip_whitespace(); + } + + switch (current) + { + // structural characters + case '[': + return token_type::begin_array; + case ']': + return token_type::end_array; + case '{': + return token_type::begin_object; + case '}': + return token_type::end_object; + case ':': + return token_type::name_separator; + case ',': + return token_type::value_separator; + + // literals + case 't': + { + std::array true_literal = {{'t', 'r', 'u', 'e'}}; + return scan_literal(true_literal.data(), true_literal.size(), token_type::literal_true); + } + case 'f': + { + std::array false_literal = {{'f', 'a', 'l', 's', 'e'}}; + return scan_literal(false_literal.data(), false_literal.size(), token_type::literal_false); + } + case 'n': + { + std::array null_literal = {{'n', 'u', 'l', 'l'}}; + return scan_literal(null_literal.data(), null_literal.size(), token_type::literal_null); + } + + // string + case '\"': + return scan_string(); + + // number + case '-': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + return scan_number(); + + // end of input (the null byte is needed when parsing from + // string literals) + case '\0': + case std::char_traits::eof(): + return token_type::end_of_input; + + // error + default: + error_message = "invalid literal"; + return token_type::parse_error; + } + } + + private: + /// input adapter + InputAdapterType ia; + + /// whether comments should be ignored (true) or signaled as errors (false) + const bool ignore_comments = false; + + /// the current character + char_int_type current = std::char_traits::eof(); + + /// whether the next get() call should just return current + bool next_unget = false; + + /// the start position of the current token + position_t position {}; + + /// raw input token string (for error messages) + std::vector token_string {}; + + /// buffer for variable-length tokens (numbers, strings) + string_t token_buffer {}; + + /// a description of occurred lexer errors + const char* error_message = ""; + + // number values + number_integer_t value_integer = 0; + number_unsigned_t value_unsigned = 0; + number_float_t value_float = 0; + + /// the decimal point + const char_int_type decimal_point_char = '.'; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // size_t +#include // declval +#include // string + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +using null_function_t = decltype(std::declval().null()); + +template +using boolean_function_t = + decltype(std::declval().boolean(std::declval())); + +template +using number_integer_function_t = + decltype(std::declval().number_integer(std::declval())); + +template +using number_unsigned_function_t = + decltype(std::declval().number_unsigned(std::declval())); + +template +using number_float_function_t = decltype(std::declval().number_float( + std::declval(), std::declval())); + +template +using string_function_t = + decltype(std::declval().string(std::declval())); + +template +using binary_function_t = + decltype(std::declval().binary(std::declval())); + +template +using start_object_function_t = + decltype(std::declval().start_object(std::declval())); + +template +using key_function_t = + decltype(std::declval().key(std::declval())); + +template +using end_object_function_t = decltype(std::declval().end_object()); + +template +using start_array_function_t = + decltype(std::declval().start_array(std::declval())); + +template +using end_array_function_t = decltype(std::declval().end_array()); + +template +using parse_error_function_t = decltype(std::declval().parse_error( + std::declval(), std::declval(), + std::declval())); + +template +struct is_sax +{ + private: + static_assert(is_basic_json::value, + "BasicJsonType must be of type basic_json<...>"); + + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using exception_t = typename BasicJsonType::exception; + + public: + static constexpr bool value = + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value && + is_detected_exact::value; +}; + +template +struct is_sax_static_asserts +{ + private: + static_assert(is_basic_json::value, + "BasicJsonType must be of type basic_json<...>"); + + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using exception_t = typename BasicJsonType::exception; + + public: + static_assert(is_detected_exact::value, + "Missing/invalid function: bool null()"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool boolean(bool)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool boolean(bool)"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool number_integer(number_integer_t)"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool number_unsigned(number_unsigned_t)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool number_float(number_float_t, const string_t&)"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool string(string_t&)"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool binary(binary_t&)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool start_object(std::size_t)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool key(string_t&)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool end_object()"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool start_array(std::size_t)"); + static_assert(is_detected_exact::value, + "Missing/invalid function: bool end_array()"); + static_assert( + is_detected_exact::value, + "Missing/invalid function: bool parse_error(std::size_t, const " + "std::string&, const exception&)"); +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +namespace nlohmann +{ +namespace detail +{ + +/// how to treat CBOR tags +enum class cbor_tag_handler_t +{ + error, ///< throw a parse_error exception in case of a tag + ignore ///< ignore tags +}; + +/*! +@brief determine system byte order + +@return true if and only if system's byte order is little endian + +@note from https://stackoverflow.com/a/1001328/266378 +*/ +static inline bool little_endianess(int num = 1) noexcept +{ + return *reinterpret_cast(&num) == 1; +} + + +/////////////////// +// binary reader // +/////////////////// + +/*! +@brief deserialization of CBOR, MessagePack, and UBJSON values +*/ +template> +class binary_reader +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using json_sax_t = SAX; + using char_type = typename InputAdapterType::char_type; + using char_int_type = typename std::char_traits::int_type; + + public: + /*! + @brief create a binary reader + + @param[in] adapter input adapter to read from + */ + explicit binary_reader(InputAdapterType&& adapter) : ia(std::move(adapter)) + { + (void)detail::is_sax_static_asserts {}; + } + + // make class move-only + binary_reader(const binary_reader&) = delete; + binary_reader(binary_reader&&) = default; + binary_reader& operator=(const binary_reader&) = delete; + binary_reader& operator=(binary_reader&&) = default; + ~binary_reader() = default; + + /*! + @param[in] format the binary format to parse + @param[in] sax_ a SAX event processor + @param[in] strict whether to expect the input to be consumed completed + @param[in] tag_handler how to treat CBOR tags + + @return + */ + JSON_HEDLEY_NON_NULL(3) + bool sax_parse(const input_format_t format, + json_sax_t* sax_, + const bool strict = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + sax = sax_; + bool result = false; + + switch (format) + { + case input_format_t::bson: + result = parse_bson_internal(); + break; + + case input_format_t::cbor: + result = parse_cbor_internal(true, tag_handler); + break; + + case input_format_t::msgpack: + result = parse_msgpack_internal(); + break; + + case input_format_t::ubjson: + result = parse_ubjson_internal(); + break; + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + + // strict mode: next byte must be EOF + if (result && strict) + { + if (format == input_format_t::ubjson) + { + get_ignore_noop(); + } + else + { + get(); + } + + if (JSON_HEDLEY_UNLIKELY(current != std::char_traits::eof())) + { + return sax->parse_error(chars_read, get_token_string(), + parse_error::create(110, chars_read, exception_message(format, "expected end of input; last byte: 0x" + get_token_string(), "value"))); + } + } + + return result; + } + + private: + ////////// + // BSON // + ////////// + + /*! + @brief Reads in a BSON-object and passes it to the SAX-parser. + @return whether a valid BSON-value was passed to the SAX parser + */ + bool parse_bson_internal() + { + std::int32_t document_size{}; + get_number(input_format_t::bson, document_size); + + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(std::size_t(-1)))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_bson_element_list(/*is_array*/false))) + { + return false; + } + + return sax->end_object(); + } + + /*! + @brief Parses a C-style string from the BSON input. + @param[in, out] result A reference to the string variable where the read + string is to be stored. + @return `true` if the \x00-byte indicating the end of the string was + encountered before the EOF; false` indicates an unexpected EOF. + */ + bool get_bson_cstr(string_t& result) + { + auto out = std::back_inserter(result); + while (true) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::bson, "cstring"))) + { + return false; + } + if (current == 0x00) + { + return true; + } + *out++ = static_cast(current); + } + } + + /*! + @brief Parses a zero-terminated string of length @a len from the BSON + input. + @param[in] len The length (including the zero-byte at the end) of the + string to be read. + @param[in, out] result A reference to the string variable where the read + string is to be stored. + @tparam NumberType The type of the length @a len + @pre len >= 1 + @return `true` if the string was successfully parsed + */ + template + bool get_bson_string(const NumberType len, string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(len < 1)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "string length must be at least 1, is " + std::to_string(len), "string"))); + } + + return get_string(input_format_t::bson, len - static_cast(1), result) && get() != std::char_traits::eof(); + } + + /*! + @brief Parses a byte array input of length @a len from the BSON input. + @param[in] len The length of the byte array to be read. + @param[in, out] result A reference to the binary variable where the read + array is to be stored. + @tparam NumberType The type of the length @a len + @pre len >= 0 + @return `true` if the byte array was successfully parsed + */ + template + bool get_bson_binary(const NumberType len, binary_t& result) + { + if (JSON_HEDLEY_UNLIKELY(len < 0)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::bson, "byte array length cannot be negative, is " + std::to_string(len), "binary"))); + } + + // All BSON binary values have a subtype + std::uint8_t subtype{}; + get_number(input_format_t::bson, subtype); + result.set_subtype(subtype); + + return get_binary(input_format_t::bson, len, result); + } + + /*! + @brief Read a BSON document element of the given @a element_type. + @param[in] element_type The BSON element type, c.f. http://bsonspec.org/spec.html + @param[in] element_type_parse_position The position in the input stream, + where the `element_type` was read. + @warning Not all BSON element types are supported yet. An unsupported + @a element_type will give rise to a parse_error.114: + Unsupported BSON record type 0x... + @return whether a valid BSON-object/array was passed to the SAX parser + */ + bool parse_bson_element_internal(const char_int_type element_type, + const std::size_t element_type_parse_position) + { + switch (element_type) + { + case 0x01: // double + { + double number{}; + return get_number(input_format_t::bson, number) && sax->number_float(static_cast(number), ""); + } + + case 0x02: // string + { + std::int32_t len{}; + string_t value; + return get_number(input_format_t::bson, len) && get_bson_string(len, value) && sax->string(value); + } + + case 0x03: // object + { + return parse_bson_internal(); + } + + case 0x04: // array + { + return parse_bson_array(); + } + + case 0x05: // binary + { + std::int32_t len{}; + binary_t value; + return get_number(input_format_t::bson, len) && get_bson_binary(len, value) && sax->binary(value); + } + + case 0x08: // boolean + { + return sax->boolean(get() != 0); + } + + case 0x0A: // null + { + return sax->null(); + } + + case 0x10: // int32 + { + std::int32_t value{}; + return get_number(input_format_t::bson, value) && sax->number_integer(value); + } + + case 0x12: // int64 + { + std::int64_t value{}; + return get_number(input_format_t::bson, value) && sax->number_integer(value); + } + + default: // anything else not supported (yet) + { + std::array cr{{}}; + (std::snprintf)(cr.data(), cr.size(), "%.2hhX", static_cast(element_type)); + return sax->parse_error(element_type_parse_position, std::string(cr.data()), parse_error::create(114, element_type_parse_position, "Unsupported BSON record type 0x" + std::string(cr.data()))); + } + } + } + + /*! + @brief Read a BSON element list (as specified in the BSON-spec) + + The same binary layout is used for objects and arrays, hence it must be + indicated with the argument @a is_array which one is expected + (true --> array, false --> object). + + @param[in] is_array Determines if the element list being read is to be + treated as an object (@a is_array == false), or as an + array (@a is_array == true). + @return whether a valid BSON-object/array was passed to the SAX parser + */ + bool parse_bson_element_list(const bool is_array) + { + string_t key; + + while (auto element_type = get()) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::bson, "element list"))) + { + return false; + } + + const std::size_t element_type_parse_position = chars_read; + if (JSON_HEDLEY_UNLIKELY(!get_bson_cstr(key))) + { + return false; + } + + if (!is_array && !sax->key(key)) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_bson_element_internal(element_type, element_type_parse_position))) + { + return false; + } + + // get_bson_cstr only appends + key.clear(); + } + + return true; + } + + /*! + @brief Reads an array from the BSON input and passes it to the SAX-parser. + @return whether a valid BSON-array was passed to the SAX parser + */ + bool parse_bson_array() + { + std::int32_t document_size{}; + get_number(input_format_t::bson, document_size); + + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(std::size_t(-1)))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_bson_element_list(/*is_array*/true))) + { + return false; + } + + return sax->end_array(); + } + + ////////// + // CBOR // + ////////// + + /*! + @param[in] get_char whether a new character should be retrieved from the + input (true) or whether the last read character should + be considered instead (false) + @param[in] tag_handler how CBOR tags should be treated + + @return whether a valid CBOR value was passed to the SAX parser + */ + bool parse_cbor_internal(const bool get_char, + const cbor_tag_handler_t tag_handler) + { + switch (get_char ? get() : current) + { + // EOF + case std::char_traits::eof(): + return unexpect_eof(input_format_t::cbor, "value"); + + // Integer 0x00..0x17 (0..23) + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + return sax->number_unsigned(static_cast(current)); + + case 0x18: // Unsigned integer (one-byte uint8_t follows) + { + std::uint8_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_unsigned(number); + } + + case 0x19: // Unsigned integer (two-byte uint16_t follows) + { + std::uint16_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_unsigned(number); + } + + case 0x1A: // Unsigned integer (four-byte uint32_t follows) + { + std::uint32_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_unsigned(number); + } + + case 0x1B: // Unsigned integer (eight-byte uint64_t follows) + { + std::uint64_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_unsigned(number); + } + + // Negative integer -1-0x00..-1-0x17 (-1..-24) + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + return sax->number_integer(static_cast(0x20 - 1 - current)); + + case 0x38: // Negative integer (one-byte uint8_t follows) + { + std::uint8_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_integer(static_cast(-1) - number); + } + + case 0x39: // Negative integer -1-n (two-byte uint16_t follows) + { + std::uint16_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_integer(static_cast(-1) - number); + } + + case 0x3A: // Negative integer -1-n (four-byte uint32_t follows) + { + std::uint32_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_integer(static_cast(-1) - number); + } + + case 0x3B: // Negative integer -1-n (eight-byte uint64_t follows) + { + std::uint64_t number{}; + return get_number(input_format_t::cbor, number) && sax->number_integer(static_cast(-1) + - static_cast(number)); + } + + // Binary data (0x00..0x17 bytes follow) + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: // Binary data (one-byte uint8_t for n follows) + case 0x59: // Binary data (two-byte uint16_t for n follow) + case 0x5A: // Binary data (four-byte uint32_t for n follow) + case 0x5B: // Binary data (eight-byte uint64_t for n follow) + case 0x5F: // Binary data (indefinite length) + { + binary_t b; + return get_cbor_binary(b) && sax->binary(b); + } + + // UTF-8 string (0x00..0x17 bytes follow) + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: // UTF-8 string (one-byte uint8_t for n follows) + case 0x79: // UTF-8 string (two-byte uint16_t for n follow) + case 0x7A: // UTF-8 string (four-byte uint32_t for n follow) + case 0x7B: // UTF-8 string (eight-byte uint64_t for n follow) + case 0x7F: // UTF-8 string (indefinite length) + { + string_t s; + return get_cbor_string(s) && sax->string(s); + } + + // array (0x00..0x17 data items follow) + case 0x80: + case 0x81: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + case 0x8A: + case 0x8B: + case 0x8C: + case 0x8D: + case 0x8E: + case 0x8F: + case 0x90: + case 0x91: + case 0x92: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + return get_cbor_array(static_cast(static_cast(current) & 0x1Fu), tag_handler); + + case 0x98: // array (one-byte uint8_t for n follows) + { + std::uint8_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_array(static_cast(len), tag_handler); + } + + case 0x99: // array (two-byte uint16_t for n follow) + { + std::uint16_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_array(static_cast(len), tag_handler); + } + + case 0x9A: // array (four-byte uint32_t for n follow) + { + std::uint32_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_array(static_cast(len), tag_handler); + } + + case 0x9B: // array (eight-byte uint64_t for n follow) + { + std::uint64_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_array(static_cast(len), tag_handler); + } + + case 0x9F: // array (indefinite length) + return get_cbor_array(std::size_t(-1), tag_handler); + + // map (0x00..0x17 pairs of data items follow) + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + return get_cbor_object(static_cast(static_cast(current) & 0x1Fu), tag_handler); + + case 0xB8: // map (one-byte uint8_t for n follows) + { + std::uint8_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_object(static_cast(len), tag_handler); + } + + case 0xB9: // map (two-byte uint16_t for n follow) + { + std::uint16_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_object(static_cast(len), tag_handler); + } + + case 0xBA: // map (four-byte uint32_t for n follow) + { + std::uint32_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_object(static_cast(len), tag_handler); + } + + case 0xBB: // map (eight-byte uint64_t for n follow) + { + std::uint64_t len{}; + return get_number(input_format_t::cbor, len) && get_cbor_object(static_cast(len), tag_handler); + } + + case 0xBF: // map (indefinite length) + return get_cbor_object(std::size_t(-1), tag_handler); + + case 0xC6: // tagged item + case 0xC7: + case 0xC8: + case 0xC9: + case 0xCA: + case 0xCB: + case 0xCC: + case 0xCD: + case 0xCE: + case 0xCF: + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + case 0xD4: + case 0xD8: // tagged item (1 bytes follow) + case 0xD9: // tagged item (2 bytes follow) + case 0xDA: // tagged item (4 bytes follow) + case 0xDB: // tagged item (8 bytes follow) + { + switch (tag_handler) + { + case cbor_tag_handler_t::error: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::cbor, "invalid byte: 0x" + last_token, "value"))); + } + + case cbor_tag_handler_t::ignore: + { + switch (current) + { + case 0xD8: + { + std::uint8_t len{}; + get_number(input_format_t::cbor, len); + break; + } + case 0xD9: + { + std::uint16_t len{}; + get_number(input_format_t::cbor, len); + break; + } + case 0xDA: + { + std::uint32_t len{}; + get_number(input_format_t::cbor, len); + break; + } + case 0xDB: + { + std::uint64_t len{}; + get_number(input_format_t::cbor, len); + break; + } + default: + break; + } + return parse_cbor_internal(true, tag_handler); + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + } + + case 0xF4: // false + return sax->boolean(false); + + case 0xF5: // true + return sax->boolean(true); + + case 0xF6: // null + return sax->null(); + + case 0xF9: // Half-Precision Float (two-byte IEEE 754) + { + const auto byte1_raw = get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "number"))) + { + return false; + } + const auto byte2_raw = get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "number"))) + { + return false; + } + + const auto byte1 = static_cast(byte1_raw); + const auto byte2 = static_cast(byte2_raw); + + // code from RFC 7049, Appendix D, Figure 3: + // As half-precision floating-point numbers were only added + // to IEEE 754 in 2008, today's programming platforms often + // still only have limited support for them. It is very + // easy to include at least decoding support for them even + // without such support. An example of a small decoder for + // half-precision floating-point numbers in the C language + // is shown in Fig. 3. + const auto half = static_cast((byte1 << 8u) + byte2); + const double val = [&half] + { + const int exp = (half >> 10u) & 0x1Fu; + const unsigned int mant = half & 0x3FFu; + JSON_ASSERT(0 <= exp&& exp <= 32); + JSON_ASSERT(mant <= 1024); + switch (exp) + { + case 0: + return std::ldexp(mant, -24); + case 31: + return (mant == 0) + ? std::numeric_limits::infinity() + : std::numeric_limits::quiet_NaN(); + default: + return std::ldexp(mant + 1024, exp - 25); + } + }(); + return sax->number_float((half & 0x8000u) != 0 + ? static_cast(-val) + : static_cast(val), ""); + } + + case 0xFA: // Single-Precision Float (four-byte IEEE 754) + { + float number{}; + return get_number(input_format_t::cbor, number) && sax->number_float(static_cast(number), ""); + } + + case 0xFB: // Double-Precision Float (eight-byte IEEE 754) + { + double number{}; + return get_number(input_format_t::cbor, number) && sax->number_float(static_cast(number), ""); + } + + default: // anything else (0xFF is handled inside the other types) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::cbor, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @brief reads a CBOR string + + This function first reads starting bytes to determine the expected + string length and then copies this number of bytes into a string. + Additionally, CBOR's strings with indefinite lengths are supported. + + @param[out] result created string + + @return whether string creation completed + */ + bool get_cbor_string(string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "string"))) + { + return false; + } + + switch (current) + { + // UTF-8 string (0x00..0x17 bytes follow) + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + { + return get_string(input_format_t::cbor, static_cast(current) & 0x1Fu, result); + } + + case 0x78: // UTF-8 string (one-byte uint8_t for n follows) + { + std::uint8_t len{}; + return get_number(input_format_t::cbor, len) && get_string(input_format_t::cbor, len, result); + } + + case 0x79: // UTF-8 string (two-byte uint16_t for n follow) + { + std::uint16_t len{}; + return get_number(input_format_t::cbor, len) && get_string(input_format_t::cbor, len, result); + } + + case 0x7A: // UTF-8 string (four-byte uint32_t for n follow) + { + std::uint32_t len{}; + return get_number(input_format_t::cbor, len) && get_string(input_format_t::cbor, len, result); + } + + case 0x7B: // UTF-8 string (eight-byte uint64_t for n follow) + { + std::uint64_t len{}; + return get_number(input_format_t::cbor, len) && get_string(input_format_t::cbor, len, result); + } + + case 0x7F: // UTF-8 string (indefinite length) + { + while (get() != 0xFF) + { + string_t chunk; + if (!get_cbor_string(chunk)) + { + return false; + } + result.append(chunk); + } + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::cbor, "expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x" + last_token, "string"))); + } + } + } + + /*! + @brief reads a CBOR byte array + + This function first reads starting bytes to determine the expected + byte array length and then copies this number of bytes into the byte array. + Additionally, CBOR's byte arrays with indefinite lengths are supported. + + @param[out] result created byte array + + @return whether byte array creation completed + */ + bool get_cbor_binary(binary_t& result) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "binary"))) + { + return false; + } + + switch (current) + { + // Binary data (0x00..0x17 bytes follow) + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + { + return get_binary(input_format_t::cbor, static_cast(current) & 0x1Fu, result); + } + + case 0x58: // Binary data (one-byte uint8_t for n follows) + { + std::uint8_t len{}; + return get_number(input_format_t::cbor, len) && + get_binary(input_format_t::cbor, len, result); + } + + case 0x59: // Binary data (two-byte uint16_t for n follow) + { + std::uint16_t len{}; + return get_number(input_format_t::cbor, len) && + get_binary(input_format_t::cbor, len, result); + } + + case 0x5A: // Binary data (four-byte uint32_t for n follow) + { + std::uint32_t len{}; + return get_number(input_format_t::cbor, len) && + get_binary(input_format_t::cbor, len, result); + } + + case 0x5B: // Binary data (eight-byte uint64_t for n follow) + { + std::uint64_t len{}; + return get_number(input_format_t::cbor, len) && + get_binary(input_format_t::cbor, len, result); + } + + case 0x5F: // Binary data (indefinite length) + { + while (get() != 0xFF) + { + binary_t chunk; + if (!get_cbor_binary(chunk)) + { + return false; + } + result.insert(result.end(), chunk.begin(), chunk.end()); + } + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::cbor, "expected length specification (0x40-0x5B) or indefinite binary array type (0x5F); last byte: 0x" + last_token, "binary"))); + } + } + } + + /*! + @param[in] len the length of the array or std::size_t(-1) for an + array of indefinite size + @param[in] tag_handler how CBOR tags should be treated + @return whether array creation completed + */ + bool get_cbor_array(const std::size_t len, + const cbor_tag_handler_t tag_handler) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len))) + { + return false; + } + + if (len != std::size_t(-1)) + { + for (std::size_t i = 0; i < len; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler))) + { + return false; + } + } + } + else + { + while (get() != 0xFF) + { + if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(false, tag_handler))) + { + return false; + } + } + } + + return sax->end_array(); + } + + /*! + @param[in] len the length of the object or std::size_t(-1) for an + object of indefinite size + @param[in] tag_handler how CBOR tags should be treated + @return whether object creation completed + */ + bool get_cbor_object(const std::size_t len, + const cbor_tag_handler_t tag_handler) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(len))) + { + return false; + } + + string_t key; + if (len != std::size_t(-1)) + { + for (std::size_t i = 0; i < len; ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!get_cbor_string(key) || !sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler))) + { + return false; + } + key.clear(); + } + } + else + { + while (get() != 0xFF) + { + if (JSON_HEDLEY_UNLIKELY(!get_cbor_string(key) || !sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_cbor_internal(true, tag_handler))) + { + return false; + } + key.clear(); + } + } + + return sax->end_object(); + } + + ///////////// + // MsgPack // + ///////////// + + /*! + @return whether a valid MessagePack value was passed to the SAX parser + */ + bool parse_msgpack_internal() + { + switch (get()) + { + // EOF + case std::char_traits::eof(): + return unexpect_eof(input_format_t::msgpack, "value"); + + // positive fixint + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: + case 0x1F: + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2A: + case 0x2B: + case 0x2C: + case 0x2D: + case 0x2E: + case 0x2F: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x3A: + case 0x3B: + case 0x3C: + case 0x3D: + case 0x3E: + case 0x3F: + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + case 0x5A: + case 0x5B: + case 0x5C: + case 0x5D: + case 0x5E: + case 0x5F: + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x6A: + case 0x6B: + case 0x6C: + case 0x6D: + case 0x6E: + case 0x6F: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x7A: + case 0x7B: + case 0x7C: + case 0x7D: + case 0x7E: + case 0x7F: + return sax->number_unsigned(static_cast(current)); + + // fixmap + case 0x80: + case 0x81: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + case 0x8A: + case 0x8B: + case 0x8C: + case 0x8D: + case 0x8E: + case 0x8F: + return get_msgpack_object(static_cast(static_cast(current) & 0x0Fu)); + + // fixarray + case 0x90: + case 0x91: + case 0x92: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + case 0x98: + case 0x99: + case 0x9A: + case 0x9B: + case 0x9C: + case 0x9D: + case 0x9E: + case 0x9F: + return get_msgpack_array(static_cast(static_cast(current) & 0x0Fu)); + + // fixstr + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + case 0xB8: + case 0xB9: + case 0xBA: + case 0xBB: + case 0xBC: + case 0xBD: + case 0xBE: + case 0xBF: + case 0xD9: // str 8 + case 0xDA: // str 16 + case 0xDB: // str 32 + { + string_t s; + return get_msgpack_string(s) && sax->string(s); + } + + case 0xC0: // nil + return sax->null(); + + case 0xC2: // false + return sax->boolean(false); + + case 0xC3: // true + return sax->boolean(true); + + case 0xC4: // bin 8 + case 0xC5: // bin 16 + case 0xC6: // bin 32 + case 0xC7: // ext 8 + case 0xC8: // ext 16 + case 0xC9: // ext 32 + case 0xD4: // fixext 1 + case 0xD5: // fixext 2 + case 0xD6: // fixext 4 + case 0xD7: // fixext 8 + case 0xD8: // fixext 16 + { + binary_t b; + return get_msgpack_binary(b) && sax->binary(b); + } + + case 0xCA: // float 32 + { + float number{}; + return get_number(input_format_t::msgpack, number) && sax->number_float(static_cast(number), ""); + } + + case 0xCB: // float 64 + { + double number{}; + return get_number(input_format_t::msgpack, number) && sax->number_float(static_cast(number), ""); + } + + case 0xCC: // uint 8 + { + std::uint8_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_unsigned(number); + } + + case 0xCD: // uint 16 + { + std::uint16_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_unsigned(number); + } + + case 0xCE: // uint 32 + { + std::uint32_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_unsigned(number); + } + + case 0xCF: // uint 64 + { + std::uint64_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_unsigned(number); + } + + case 0xD0: // int 8 + { + std::int8_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_integer(number); + } + + case 0xD1: // int 16 + { + std::int16_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_integer(number); + } + + case 0xD2: // int 32 + { + std::int32_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_integer(number); + } + + case 0xD3: // int 64 + { + std::int64_t number{}; + return get_number(input_format_t::msgpack, number) && sax->number_integer(number); + } + + case 0xDC: // array 16 + { + std::uint16_t len{}; + return get_number(input_format_t::msgpack, len) && get_msgpack_array(static_cast(len)); + } + + case 0xDD: // array 32 + { + std::uint32_t len{}; + return get_number(input_format_t::msgpack, len) && get_msgpack_array(static_cast(len)); + } + + case 0xDE: // map 16 + { + std::uint16_t len{}; + return get_number(input_format_t::msgpack, len) && get_msgpack_object(static_cast(len)); + } + + case 0xDF: // map 32 + { + std::uint32_t len{}; + return get_number(input_format_t::msgpack, len) && get_msgpack_object(static_cast(len)); + } + + // negative fixint + case 0xE0: + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + case 0xE8: + case 0xE9: + case 0xEA: + case 0xEB: + case 0xEC: + case 0xED: + case 0xEE: + case 0xEF: + case 0xF0: + case 0xF1: + case 0xF2: + case 0xF3: + case 0xF4: + case 0xF5: + case 0xF6: + case 0xF7: + case 0xF8: + case 0xF9: + case 0xFA: + case 0xFB: + case 0xFC: + case 0xFD: + case 0xFE: + case 0xFF: + return sax->number_integer(static_cast(current)); + + default: // anything else + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::msgpack, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @brief reads a MessagePack string + + This function first reads starting bytes to determine the expected + string length and then copies this number of bytes into a string. + + @param[out] result created string + + @return whether string creation completed + */ + bool get_msgpack_string(string_t& result) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::msgpack, "string"))) + { + return false; + } + + switch (current) + { + // fixstr + case 0xA0: + case 0xA1: + case 0xA2: + case 0xA3: + case 0xA4: + case 0xA5: + case 0xA6: + case 0xA7: + case 0xA8: + case 0xA9: + case 0xAA: + case 0xAB: + case 0xAC: + case 0xAD: + case 0xAE: + case 0xAF: + case 0xB0: + case 0xB1: + case 0xB2: + case 0xB3: + case 0xB4: + case 0xB5: + case 0xB6: + case 0xB7: + case 0xB8: + case 0xB9: + case 0xBA: + case 0xBB: + case 0xBC: + case 0xBD: + case 0xBE: + case 0xBF: + { + return get_string(input_format_t::msgpack, static_cast(current) & 0x1Fu, result); + } + + case 0xD9: // str 8 + { + std::uint8_t len{}; + return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); + } + + case 0xDA: // str 16 + { + std::uint16_t len{}; + return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); + } + + case 0xDB: // str 32 + { + std::uint32_t len{}; + return get_number(input_format_t::msgpack, len) && get_string(input_format_t::msgpack, len, result); + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::msgpack, "expected length specification (0xA0-0xBF, 0xD9-0xDB); last byte: 0x" + last_token, "string"))); + } + } + } + + /*! + @brief reads a MessagePack byte array + + This function first reads starting bytes to determine the expected + byte array length and then copies this number of bytes into a byte array. + + @param[out] result created byte array + + @return whether byte array creation completed + */ + bool get_msgpack_binary(binary_t& result) + { + // helper function to set the subtype + auto assign_and_return_true = [&result](std::int8_t subtype) + { + result.set_subtype(static_cast(subtype)); + return true; + }; + + switch (current) + { + case 0xC4: // bin 8 + { + std::uint8_t len{}; + return get_number(input_format_t::msgpack, len) && + get_binary(input_format_t::msgpack, len, result); + } + + case 0xC5: // bin 16 + { + std::uint16_t len{}; + return get_number(input_format_t::msgpack, len) && + get_binary(input_format_t::msgpack, len, result); + } + + case 0xC6: // bin 32 + { + std::uint32_t len{}; + return get_number(input_format_t::msgpack, len) && + get_binary(input_format_t::msgpack, len, result); + } + + case 0xC7: // ext 8 + { + std::uint8_t len{}; + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, len) && + get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, len, result) && + assign_and_return_true(subtype); + } + + case 0xC8: // ext 16 + { + std::uint16_t len{}; + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, len) && + get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, len, result) && + assign_and_return_true(subtype); + } + + case 0xC9: // ext 32 + { + std::uint32_t len{}; + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, len) && + get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, len, result) && + assign_and_return_true(subtype); + } + + case 0xD4: // fixext 1 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 1, result) && + assign_and_return_true(subtype); + } + + case 0xD5: // fixext 2 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 2, result) && + assign_and_return_true(subtype); + } + + case 0xD6: // fixext 4 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 4, result) && + assign_and_return_true(subtype); + } + + case 0xD7: // fixext 8 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 8, result) && + assign_and_return_true(subtype); + } + + case 0xD8: // fixext 16 + { + std::int8_t subtype{}; + return get_number(input_format_t::msgpack, subtype) && + get_binary(input_format_t::msgpack, 16, result) && + assign_and_return_true(subtype); + } + + default: // LCOV_EXCL_LINE + return false; // LCOV_EXCL_LINE + } + } + + /*! + @param[in] len the length of the array + @return whether array creation completed + */ + bool get_msgpack_array(const std::size_t len) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(len))) + { + return false; + } + + for (std::size_t i = 0; i < len; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!parse_msgpack_internal())) + { + return false; + } + } + + return sax->end_array(); + } + + /*! + @param[in] len the length of the object + @return whether object creation completed + */ + bool get_msgpack_object(const std::size_t len) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(len))) + { + return false; + } + + string_t key; + for (std::size_t i = 0; i < len; ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!get_msgpack_string(key) || !sax->key(key))) + { + return false; + } + + if (JSON_HEDLEY_UNLIKELY(!parse_msgpack_internal())) + { + return false; + } + key.clear(); + } + + return sax->end_object(); + } + + //////////// + // UBJSON // + //////////// + + /*! + @param[in] get_char whether a new character should be retrieved from the + input (true, default) or whether the last read + character should be considered instead + + @return whether a valid UBJSON value was passed to the SAX parser + */ + bool parse_ubjson_internal(const bool get_char = true) + { + return get_ubjson_value(get_char ? get_ignore_noop() : current); + } + + /*! + @brief reads a UBJSON string + + This function is either called after reading the 'S' byte explicitly + indicating a string, or in case of an object key where the 'S' byte can be + left out. + + @param[out] result created string + @param[in] get_char whether a new character should be retrieved from the + input (true, default) or whether the last read + character should be considered instead + + @return whether string creation completed + */ + bool get_ubjson_string(string_t& result, const bool get_char = true) + { + if (get_char) + { + get(); // TODO(niels): may we ignore N here? + } + + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "value"))) + { + return false; + } + + switch (current) + { + case 'U': + { + std::uint8_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + case 'i': + { + std::int8_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + case 'I': + { + std::int16_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + case 'l': + { + std::int32_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + case 'L': + { + std::int64_t len{}; + return get_number(input_format_t::ubjson, len) && get_string(input_format_t::ubjson, len, result); + } + + default: + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "expected length type specification (U, i, I, l, L); last byte: 0x" + last_token, "string"))); + } + } + + /*! + @param[out] result determined size + @return whether size determination completed + */ + bool get_ubjson_size_value(std::size_t& result) + { + switch (get_ignore_noop()) + { + case 'U': + { + std::uint8_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + case 'i': + { + std::int8_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + case 'I': + { + std::int16_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + case 'l': + { + std::int32_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + case 'L': + { + std::int64_t number{}; + if (JSON_HEDLEY_UNLIKELY(!get_number(input_format_t::ubjson, number))) + { + return false; + } + result = static_cast(number); + return true; + } + + default: + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "expected length type specification (U, i, I, l, L) after '#'; last byte: 0x" + last_token, "size"))); + } + } + } + + /*! + @brief determine the type and size for a container + + In the optimized UBJSON format, a type and a size can be provided to allow + for a more compact representation. + + @param[out] result pair of the size and the type + + @return whether pair creation completed + */ + bool get_ubjson_size_type(std::pair& result) + { + result.first = string_t::npos; // size + result.second = 0; // type + + get_ignore_noop(); + + if (current == '$') + { + result.second = get(); // must not ignore 'N', because 'N' maybe the type + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "type"))) + { + return false; + } + + get_ignore_noop(); + if (JSON_HEDLEY_UNLIKELY(current != '#')) + { + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "value"))) + { + return false; + } + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::ubjson, "expected '#' after type information; last byte: 0x" + last_token, "size"))); + } + + return get_ubjson_size_value(result.first); + } + + if (current == '#') + { + return get_ubjson_size_value(result.first); + } + + return true; + } + + /*! + @param prefix the previously read or set type prefix + @return whether value creation completed + */ + bool get_ubjson_value(const char_int_type prefix) + { + switch (prefix) + { + case std::char_traits::eof(): // EOF + return unexpect_eof(input_format_t::ubjson, "value"); + + case 'T': // true + return sax->boolean(true); + case 'F': // false + return sax->boolean(false); + + case 'Z': // null + return sax->null(); + + case 'U': + { + std::uint8_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_unsigned(number); + } + + case 'i': + { + std::int8_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_integer(number); + } + + case 'I': + { + std::int16_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_integer(number); + } + + case 'l': + { + std::int32_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_integer(number); + } + + case 'L': + { + std::int64_t number{}; + return get_number(input_format_t::ubjson, number) && sax->number_integer(number); + } + + case 'd': + { + float number{}; + return get_number(input_format_t::ubjson, number) && sax->number_float(static_cast(number), ""); + } + + case 'D': + { + double number{}; + return get_number(input_format_t::ubjson, number) && sax->number_float(static_cast(number), ""); + } + + case 'H': + { + return get_ubjson_high_precision_number(); + } + + case 'C': // char + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "char"))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(current > 127)) + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, exception_message(input_format_t::ubjson, "byte after 'C' must be in range 0x00..0x7F; last byte: 0x" + last_token, "char"))); + } + string_t s(1, static_cast(current)); + return sax->string(s); + } + + case 'S': // string + { + string_t s; + return get_ubjson_string(s) && sax->string(s); + } + + case '[': // array + return get_ubjson_array(); + + case '{': // object + return get_ubjson_object(); + + default: // anything else + { + auto last_token = get_token_string(); + return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, exception_message(input_format_t::ubjson, "invalid byte: 0x" + last_token, "value"))); + } + } + } + + /*! + @return whether array creation completed + */ + bool get_ubjson_array() + { + std::pair size_and_type; + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_size_type(size_and_type))) + { + return false; + } + + if (size_and_type.first != string_t::npos) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(size_and_type.first))) + { + return false; + } + + if (size_and_type.second != 0) + { + if (size_and_type.second != 'N') + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_value(size_and_type.second))) + { + return false; + } + } + } + } + else + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal())) + { + return false; + } + } + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(std::size_t(-1)))) + { + return false; + } + + while (current != ']') + { + if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal(false))) + { + return false; + } + get_ignore_noop(); + } + } + + return sax->end_array(); + } + + /*! + @return whether object creation completed + */ + bool get_ubjson_object() + { + std::pair size_and_type; + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_size_type(size_and_type))) + { + return false; + } + + string_t key; + if (size_and_type.first != string_t::npos) + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(size_and_type.first))) + { + return false; + } + + if (size_and_type.second != 0) + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key) || !sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_value(size_and_type.second))) + { + return false; + } + key.clear(); + } + } + else + { + for (std::size_t i = 0; i < size_and_type.first; ++i) + { + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key) || !sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal())) + { + return false; + } + key.clear(); + } + } + } + else + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(std::size_t(-1)))) + { + return false; + } + + while (current != '}') + { + if (JSON_HEDLEY_UNLIKELY(!get_ubjson_string(key, false) || !sax->key(key))) + { + return false; + } + if (JSON_HEDLEY_UNLIKELY(!parse_ubjson_internal())) + { + return false; + } + get_ignore_noop(); + key.clear(); + } + } + + return sax->end_object(); + } + + // Note, no reader for UBJSON binary types is implemented because they do + // not exist + + bool get_ubjson_high_precision_number() + { + // get size of following number string + std::size_t size{}; + auto res = get_ubjson_size_value(size); + if (JSON_HEDLEY_UNLIKELY(!res)) + { + return res; + } + + // get number string + std::vector number_vector; + for (std::size_t i = 0; i < size; ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "number"))) + { + return false; + } + number_vector.push_back(static_cast(current)); + } + + // parse number string + auto number_ia = detail::input_adapter(std::forward(number_vector)); + auto number_lexer = detail::lexer(std::move(number_ia), false); + const auto result_number = number_lexer.scan(); + const auto number_string = number_lexer.get_token_string(); + const auto result_remainder = number_lexer.scan(); + + using token_type = typename detail::lexer_base::token_type; + + if (JSON_HEDLEY_UNLIKELY(result_remainder != token_type::end_of_input)) + { + return sax->parse_error(chars_read, number_string, parse_error::create(115, chars_read, exception_message(input_format_t::ubjson, "invalid number text: " + number_lexer.get_token_string(), "high-precision number"))); + } + + switch (result_number) + { + case token_type::value_integer: + return sax->number_integer(number_lexer.get_number_integer()); + case token_type::value_unsigned: + return sax->number_unsigned(number_lexer.get_number_unsigned()); + case token_type::value_float: + return sax->number_float(number_lexer.get_number_float(), std::move(number_string)); + default: + return sax->parse_error(chars_read, number_string, parse_error::create(115, chars_read, exception_message(input_format_t::ubjson, "invalid number text: " + number_lexer.get_token_string(), "high-precision number"))); + } + } + + /////////////////////// + // Utility functions // + /////////////////////// + + /*! + @brief get next character from the input + + This function provides the interface to the used input adapter. It does + not throw in case the input reached EOF, but returns a -'ve valued + `std::char_traits::eof()` in that case. + + @return character read from the input + */ + char_int_type get() + { + ++chars_read; + return current = ia.get_character(); + } + + /*! + @return character read from the input after ignoring all 'N' entries + */ + char_int_type get_ignore_noop() + { + do + { + get(); + } + while (current == 'N'); + + return current; + } + + /* + @brief read a number from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[out] result number of type @a NumberType + + @return whether conversion completed + + @note This function needs to respect the system's endianess, because + bytes in CBOR, MessagePack, and UBJSON are stored in network order + (big endian) and therefore need reordering on little endian systems. + */ + template + bool get_number(const input_format_t format, NumberType& result) + { + // step 1: read input into array with system's byte order + std::array vec; + for (std::size_t i = 0; i < sizeof(NumberType); ++i) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "number"))) + { + return false; + } + + // reverse byte order prior to conversion if necessary + if (is_little_endian != InputIsLittleEndian) + { + vec[sizeof(NumberType) - i - 1] = static_cast(current); + } + else + { + vec[i] = static_cast(current); // LCOV_EXCL_LINE + } + } + + // step 2: convert array into number of type T and return + std::memcpy(&result, vec.data(), sizeof(NumberType)); + return true; + } + + /*! + @brief create a string by reading characters from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[in] len number of characters to read + @param[out] result string created by reading @a len bytes + + @return whether string creation completed + + @note We can not reserve @a len bytes for the result, because @a len + may be too large. Usually, @ref unexpect_eof() detects the end of + the input before we run out of string memory. + */ + template + bool get_string(const input_format_t format, + const NumberType len, + string_t& result) + { + bool success = true; + for (NumberType i = 0; i < len; i++) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "string"))) + { + success = false; + break; + } + result.push_back(static_cast(current)); + }; + return success; + } + + /*! + @brief create a byte array by reading bytes from the input + + @tparam NumberType the type of the number + @param[in] format the current format (for diagnostics) + @param[in] len number of bytes to read + @param[out] result byte array created by reading @a len bytes + + @return whether byte array creation completed + + @note We can not reserve @a len bytes for the result, because @a len + may be too large. Usually, @ref unexpect_eof() detects the end of + the input before we run out of memory. + */ + template + bool get_binary(const input_format_t format, + const NumberType len, + binary_t& result) + { + bool success = true; + for (NumberType i = 0; i < len; i++) + { + get(); + if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) + { + success = false; + break; + } + result.push_back(static_cast(current)); + } + return success; + } + + /*! + @param[in] format the current format (for diagnostics) + @param[in] context further context information (for diagnostics) + @return whether the last read character is not EOF + */ + JSON_HEDLEY_NON_NULL(3) + bool unexpect_eof(const input_format_t format, const char* context) const + { + if (JSON_HEDLEY_UNLIKELY(current == std::char_traits::eof())) + { + return sax->parse_error(chars_read, "", + parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context))); + } + return true; + } + + /*! + @return a string representation of the last read byte + */ + std::string get_token_string() const + { + std::array cr{{}}; + (std::snprintf)(cr.data(), cr.size(), "%.2hhX", static_cast(current)); + return std::string{cr.data()}; + } + + /*! + @param[in] format the current format + @param[in] detail a detailed error message + @param[in] context further context information + @return a message string to use in the parse_error exceptions + */ + std::string exception_message(const input_format_t format, + const std::string& detail, + const std::string& context) const + { + std::string error_msg = "syntax error while parsing "; + + switch (format) + { + case input_format_t::cbor: + error_msg += "CBOR"; + break; + + case input_format_t::msgpack: + error_msg += "MessagePack"; + break; + + case input_format_t::ubjson: + error_msg += "UBJSON"; + break; + + case input_format_t::bson: + error_msg += "BSON"; + break; + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + + return error_msg + " " + context + ": " + detail; + } + + private: + /// input adapter + InputAdapterType ia; + + /// the current character + char_int_type current = std::char_traits::eof(); + + /// the number of characters read + std::size_t chars_read = 0; + + /// whether we can assume little endianess + const bool is_little_endian = little_endianess(); + + /// the SAX parser + json_sax_t* sax = nullptr; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + + +#include // isfinite +#include // uint8_t +#include // function +#include // string +#include // move +#include // vector + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +//////////// +// parser // +//////////// + +enum class parse_event_t : uint8_t +{ + /// the parser read `{` and started to process a JSON object + object_start, + /// the parser read `}` and finished processing a JSON object + object_end, + /// the parser read `[` and started to process a JSON array + array_start, + /// the parser read `]` and finished processing a JSON array + array_end, + /// the parser read a key of a value in an object + key, + /// the parser finished reading a JSON value + value +}; + +template +using parser_callback_t = + std::function; + +/*! +@brief syntax analysis + +This class implements a recursive descent parser. +*/ +template +class parser +{ + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using number_float_t = typename BasicJsonType::number_float_t; + using string_t = typename BasicJsonType::string_t; + using lexer_t = lexer; + using token_type = typename lexer_t::token_type; + + public: + /// a parser reading from an input adapter + explicit parser(InputAdapterType&& adapter, + const parser_callback_t cb = nullptr, + const bool allow_exceptions_ = true, + const bool skip_comments = false) + : callback(cb) + , m_lexer(std::move(adapter), skip_comments) + , allow_exceptions(allow_exceptions_) + { + // read first token + get_token(); + } + + /*! + @brief public parser interface + + @param[in] strict whether to expect the last token to be EOF + @param[in,out] result parsed JSON value + + @throw parse_error.101 in case of an unexpected token + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + */ + void parse(const bool strict, BasicJsonType& result) + { + if (callback) + { + json_sax_dom_callback_parser sdp(result, callback, allow_exceptions); + sax_parse_internal(&sdp); + result.assert_invariant(); + + // in strict mode, input must be completely read + if (strict && (get_token() != token_type::end_of_input)) + { + sdp.parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + // in case of an error, return discarded value + if (sdp.is_errored()) + { + result = value_t::discarded; + return; + } + + // set top-level value to null if it was discarded by the callback + // function + if (result.is_discarded()) + { + result = nullptr; + } + } + else + { + json_sax_dom_parser sdp(result, allow_exceptions); + sax_parse_internal(&sdp); + result.assert_invariant(); + + // in strict mode, input must be completely read + if (strict && (get_token() != token_type::end_of_input)) + { + sdp.parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + // in case of an error, return discarded value + if (sdp.is_errored()) + { + result = value_t::discarded; + return; + } + } + } + + /*! + @brief public accept interface + + @param[in] strict whether to expect the last token to be EOF + @return whether the input is a proper JSON text + */ + bool accept(const bool strict = true) + { + json_sax_acceptor sax_acceptor; + return sax_parse(&sax_acceptor, strict); + } + + template + JSON_HEDLEY_NON_NULL(2) + bool sax_parse(SAX* sax, const bool strict = true) + { + (void)detail::is_sax_static_asserts {}; + const bool result = sax_parse_internal(sax); + + // strict mode: next byte must be EOF + if (result && strict && (get_token() != token_type::end_of_input)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_of_input, "value"))); + } + + return result; + } + + private: + template + JSON_HEDLEY_NON_NULL(2) + bool sax_parse_internal(SAX* sax) + { + // stack to remember the hierarchy of structured values we are parsing + // true = array; false = object + std::vector states; + // value to avoid a goto (see comment where set to true) + bool skip_to_state_evaluation = false; + + while (true) + { + if (!skip_to_state_evaluation) + { + // invariant: get_token() was called before each iteration + switch (last_token) + { + case token_type::begin_object: + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_object(std::size_t(-1)))) + { + return false; + } + + // closing } -> we are done + if (get_token() == token_type::end_object) + { + if (JSON_HEDLEY_UNLIKELY(!sax->end_object())) + { + return false; + } + break; + } + + // parse key + if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::value_string, "object key"))); + } + if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string()))) + { + return false; + } + + // parse separator (:) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::name_separator, "object separator"))); + } + + // remember we are now inside an object + states.push_back(false); + + // parse values + get_token(); + continue; + } + + case token_type::begin_array: + { + if (JSON_HEDLEY_UNLIKELY(!sax->start_array(std::size_t(-1)))) + { + return false; + } + + // closing ] -> we are done + if (get_token() == token_type::end_array) + { + if (JSON_HEDLEY_UNLIKELY(!sax->end_array())) + { + return false; + } + break; + } + + // remember we are now inside an array + states.push_back(true); + + // parse values (no need to call get_token) + continue; + } + + case token_type::value_float: + { + const auto res = m_lexer.get_number_float(); + + if (JSON_HEDLEY_UNLIKELY(!std::isfinite(res))) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'")); + } + + if (JSON_HEDLEY_UNLIKELY(!sax->number_float(res, m_lexer.get_string()))) + { + return false; + } + + break; + } + + case token_type::literal_false: + { + if (JSON_HEDLEY_UNLIKELY(!sax->boolean(false))) + { + return false; + } + break; + } + + case token_type::literal_null: + { + if (JSON_HEDLEY_UNLIKELY(!sax->null())) + { + return false; + } + break; + } + + case token_type::literal_true: + { + if (JSON_HEDLEY_UNLIKELY(!sax->boolean(true))) + { + return false; + } + break; + } + + case token_type::value_integer: + { + if (JSON_HEDLEY_UNLIKELY(!sax->number_integer(m_lexer.get_number_integer()))) + { + return false; + } + break; + } + + case token_type::value_string: + { + if (JSON_HEDLEY_UNLIKELY(!sax->string(m_lexer.get_string()))) + { + return false; + } + break; + } + + case token_type::value_unsigned: + { + if (JSON_HEDLEY_UNLIKELY(!sax->number_unsigned(m_lexer.get_number_unsigned()))) + { + return false; + } + break; + } + + case token_type::parse_error: + { + // using "uninitialized" to avoid "expected" message + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::uninitialized, "value"))); + } + + default: // the last token was unexpected + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::literal_or_value, "value"))); + } + } + } + else + { + skip_to_state_evaluation = false; + } + + // we reached this line after we successfully parsed a value + if (states.empty()) + { + // empty stack: we reached the end of the hierarchy: done + return true; + } + + if (states.back()) // array + { + // comma -> next value + if (get_token() == token_type::value_separator) + { + // parse a new value + get_token(); + continue; + } + + // closing ] + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_array)) + { + if (JSON_HEDLEY_UNLIKELY(!sax->end_array())) + { + return false; + } + + // We are done with this array. Before we can parse a + // new value, we need to evaluate the new state first. + // By setting skip_to_state_evaluation to false, we + // are effectively jumping to the beginning of this if. + JSON_ASSERT(!states.empty()); + states.pop_back(); + skip_to_state_evaluation = true; + continue; + } + + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_array, "array"))); + } + else // object + { + // comma -> next value + if (get_token() == token_type::value_separator) + { + // parse key + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::value_string, "object key"))); + } + + if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string()))) + { + return false; + } + + // parse separator (:) + if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::name_separator, "object separator"))); + } + + // parse values + get_token(); + continue; + } + + // closing } + if (JSON_HEDLEY_LIKELY(last_token == token_type::end_object)) + { + if (JSON_HEDLEY_UNLIKELY(!sax->end_object())) + { + return false; + } + + // We are done with this object. Before we can parse a + // new value, we need to evaluate the new state first. + // By setting skip_to_state_evaluation to false, we + // are effectively jumping to the beginning of this if. + JSON_ASSERT(!states.empty()); + states.pop_back(); + skip_to_state_evaluation = true; + continue; + } + + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + exception_message(token_type::end_object, "object"))); + } + } + } + + /// get next token from lexer + token_type get_token() + { + return last_token = m_lexer.scan(); + } + + std::string exception_message(const token_type expected, const std::string& context) + { + std::string error_msg = "syntax error "; + + if (!context.empty()) + { + error_msg += "while parsing " + context + " "; + } + + error_msg += "- "; + + if (last_token == token_type::parse_error) + { + error_msg += std::string(m_lexer.get_error_message()) + "; last read: '" + + m_lexer.get_token_string() + "'"; + } + else + { + error_msg += "unexpected " + std::string(lexer_t::token_type_name(last_token)); + } + + if (expected != token_type::uninitialized) + { + error_msg += "; expected " + std::string(lexer_t::token_type_name(expected)); + } + + return error_msg; + } + + private: + /// callback function + const parser_callback_t callback = nullptr; + /// the type of the last read token + token_type last_token = token_type::uninitialized; + /// the lexer + lexer_t m_lexer; + /// whether to throw exceptions in case of errors + const bool allow_exceptions = true; +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +// #include + + +#include // ptrdiff_t +#include // numeric_limits + +namespace nlohmann +{ +namespace detail +{ +/* +@brief an iterator for primitive JSON types + +This class models an iterator for primitive JSON types (boolean, number, +string). It's only purpose is to allow the iterator/const_iterator classes +to "iterate" over primitive values. Internally, the iterator is modeled by +a `difference_type` variable. Value begin_value (`0`) models the begin, +end_value (`1`) models past the end. +*/ +class primitive_iterator_t +{ + private: + using difference_type = std::ptrdiff_t; + static constexpr difference_type begin_value = 0; + static constexpr difference_type end_value = begin_value + 1; + + /// iterator as signed integer type + difference_type m_it = (std::numeric_limits::min)(); + + public: + constexpr difference_type get_value() const noexcept + { + return m_it; + } + + /// set iterator to a defined beginning + void set_begin() noexcept + { + m_it = begin_value; + } + + /// set iterator to a defined past the end + void set_end() noexcept + { + m_it = end_value; + } + + /// return whether the iterator can be dereferenced + constexpr bool is_begin() const noexcept + { + return m_it == begin_value; + } + + /// return whether the iterator is at end + constexpr bool is_end() const noexcept + { + return m_it == end_value; + } + + friend constexpr bool operator==(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it == rhs.m_it; + } + + friend constexpr bool operator<(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it < rhs.m_it; + } + + primitive_iterator_t operator+(difference_type n) noexcept + { + auto result = *this; + result += n; + return result; + } + + friend constexpr difference_type operator-(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept + { + return lhs.m_it - rhs.m_it; + } + + primitive_iterator_t& operator++() noexcept + { + ++m_it; + return *this; + } + + primitive_iterator_t const operator++(int) noexcept + { + auto result = *this; + ++m_it; + return result; + } + + primitive_iterator_t& operator--() noexcept + { + --m_it; + return *this; + } + + primitive_iterator_t const operator--(int) noexcept + { + auto result = *this; + --m_it; + return result; + } + + primitive_iterator_t& operator+=(difference_type n) noexcept + { + m_it += n; + return *this; + } + + primitive_iterator_t& operator-=(difference_type n) noexcept + { + m_it -= n; + return *this; + } +}; +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +/*! +@brief an iterator value + +@note This structure could easily be a union, but MSVC currently does not allow +unions members with complex constructors, see https://github.com/nlohmann/json/pull/105. +*/ +template struct internal_iterator +{ + /// iterator for JSON objects + typename BasicJsonType::object_t::iterator object_iterator {}; + /// iterator for JSON arrays + typename BasicJsonType::array_t::iterator array_iterator {}; + /// generic iterator for all other types + primitive_iterator_t primitive_iterator {}; +}; +} // namespace detail +} // namespace nlohmann + +// #include + + +#include // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next +#include // conditional, is_const, remove_const + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +// forward declare, to be able to friend it later on +template class iteration_proxy; +template class iteration_proxy_value; + +/*! +@brief a template for a bidirectional iterator for the @ref basic_json class +This class implements a both iterators (iterator and const_iterator) for the +@ref basic_json class. +@note An iterator is called *initialized* when a pointer to a JSON value has + been set (e.g., by a constructor or a copy assignment). If the iterator is + default-constructed, it is *uninitialized* and most methods are undefined. + **The library uses assertions to detect calls on uninitialized iterators.** +@requirement The class satisfies the following concept requirements: +- +[BidirectionalIterator](https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator): + The iterator that can be moved can be moved in both directions (i.e. + incremented and decremented). +@since version 1.0.0, simplified in version 2.0.9, change to bidirectional + iterators in version 3.0.0 (see https://github.com/nlohmann/json/issues/593) +*/ +template +class iter_impl +{ + /// allow basic_json to access private members + friend iter_impl::value, typename std::remove_const::type, const BasicJsonType>::type>; + friend BasicJsonType; + friend iteration_proxy; + friend iteration_proxy_value; + + using object_t = typename BasicJsonType::object_t; + using array_t = typename BasicJsonType::array_t; + // make sure BasicJsonType is basic_json or const basic_json + static_assert(is_basic_json::type>::value, + "iter_impl only accepts (const) basic_json"); + + public: + + /// The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. + /// The C++ Standard has never required user-defined iterators to derive from std::iterator. + /// A user-defined iterator should provide publicly accessible typedefs named + /// iterator_category, value_type, difference_type, pointer, and reference. + /// Note that value_type is required to be non-const, even for constant iterators. + using iterator_category = std::bidirectional_iterator_tag; + + /// the type of the values when the iterator is dereferenced + using value_type = typename BasicJsonType::value_type; + /// a type to represent differences between iterators + using difference_type = typename BasicJsonType::difference_type; + /// defines a pointer to the type iterated over (value_type) + using pointer = typename std::conditional::value, + typename BasicJsonType::const_pointer, + typename BasicJsonType::pointer>::type; + /// defines a reference to the type iterated over (value_type) + using reference = + typename std::conditional::value, + typename BasicJsonType::const_reference, + typename BasicJsonType::reference>::type; + + /// default constructor + iter_impl() = default; + + /*! + @brief constructor for a given JSON instance + @param[in] object pointer to a JSON object for this iterator + @pre object != nullptr + @post The iterator is initialized; i.e. `m_object != nullptr`. + */ + explicit iter_impl(pointer object) noexcept : m_object(object) + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = typename object_t::iterator(); + break; + } + + case value_t::array: + { + m_it.array_iterator = typename array_t::iterator(); + break; + } + + default: + { + m_it.primitive_iterator = primitive_iterator_t(); + break; + } + } + } + + /*! + @note The conventional copy constructor and copy assignment are implicitly + defined. Combined with the following converting constructor and + assignment, they support: (1) copy from iterator to iterator, (2) + copy from const iterator to const iterator, and (3) conversion from + iterator to const iterator. However conversion from const iterator + to iterator is not defined. + */ + + /*! + @brief const copy constructor + @param[in] other const iterator to copy from + @note This copy constructor had to be defined explicitly to circumvent a bug + occurring on msvc v19.0 compiler (VS 2015) debug build. For more + information refer to: https://github.com/nlohmann/json/issues/1608 + */ + iter_impl(const iter_impl& other) noexcept + : m_object(other.m_object), m_it(other.m_it) + {} + + /*! + @brief converting assignment + @param[in] other const iterator to copy from + @return const/non-const iterator + @note It is not checked whether @a other is initialized. + */ + iter_impl& operator=(const iter_impl& other) noexcept + { + m_object = other.m_object; + m_it = other.m_it; + return *this; + } + + /*! + @brief converting constructor + @param[in] other non-const iterator to copy from + @note It is not checked whether @a other is initialized. + */ + iter_impl(const iter_impl::type>& other) noexcept + : m_object(other.m_object), m_it(other.m_it) + {} + + /*! + @brief converting assignment + @param[in] other non-const iterator to copy from + @return const/non-const iterator + @note It is not checked whether @a other is initialized. + */ + iter_impl& operator=(const iter_impl::type>& other) noexcept + { + m_object = other.m_object; + m_it = other.m_it; + return *this; + } + + private: + /*! + @brief set the iterator to the first value + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + void set_begin() noexcept + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = m_object->m_value.object->begin(); + break; + } + + case value_t::array: + { + m_it.array_iterator = m_object->m_value.array->begin(); + break; + } + + case value_t::null: + { + // set to end so begin()==end() is true: null is empty + m_it.primitive_iterator.set_end(); + break; + } + + default: + { + m_it.primitive_iterator.set_begin(); + break; + } + } + } + + /*! + @brief set the iterator past the last value + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + void set_end() noexcept + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + m_it.object_iterator = m_object->m_value.object->end(); + break; + } + + case value_t::array: + { + m_it.array_iterator = m_object->m_value.array->end(); + break; + } + + default: + { + m_it.primitive_iterator.set_end(); + break; + } + } + } + + public: + /*! + @brief return a reference to the value pointed to by the iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference operator*() const + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + JSON_ASSERT(m_it.object_iterator != m_object->m_value.object->end()); + return m_it.object_iterator->second; + } + + case value_t::array: + { + JSON_ASSERT(m_it.array_iterator != m_object->m_value.array->end()); + return *m_it.array_iterator; + } + + case value_t::null: + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + { + return *m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief dereference the iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + pointer operator->() const + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + JSON_ASSERT(m_it.object_iterator != m_object->m_value.object->end()); + return &(m_it.object_iterator->second); + } + + case value_t::array: + { + JSON_ASSERT(m_it.array_iterator != m_object->m_value.array->end()); + return &*m_it.array_iterator; + } + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin())) + { + return m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief post-increment (it++) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl const operator++(int) + { + auto result = *this; + ++(*this); + return result; + } + + /*! + @brief pre-increment (++it) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator++() + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + std::advance(m_it.object_iterator, 1); + break; + } + + case value_t::array: + { + std::advance(m_it.array_iterator, 1); + break; + } + + default: + { + ++m_it.primitive_iterator; + break; + } + } + + return *this; + } + + /*! + @brief post-decrement (it--) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl const operator--(int) + { + auto result = *this; + --(*this); + return result; + } + + /*! + @brief pre-decrement (--it) + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator--() + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + { + std::advance(m_it.object_iterator, -1); + break; + } + + case value_t::array: + { + std::advance(m_it.array_iterator, -1); + break; + } + + default: + { + --m_it.primitive_iterator; + break; + } + } + + return *this; + } + + /*! + @brief comparison: equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator==(const iter_impl& other) const + { + // if objects are not the same, the comparison is undefined + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + { + JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); + } + + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + return (m_it.object_iterator == other.m_it.object_iterator); + + case value_t::array: + return (m_it.array_iterator == other.m_it.array_iterator); + + default: + return (m_it.primitive_iterator == other.m_it.primitive_iterator); + } + } + + /*! + @brief comparison: not equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator!=(const iter_impl& other) const + { + return !operator==(other); + } + + /*! + @brief comparison: smaller + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator<(const iter_impl& other) const + { + // if objects are not the same, the comparison is undefined + if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object)) + { + JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers")); + } + + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(213, "cannot compare order of object iterators")); + + case value_t::array: + return (m_it.array_iterator < other.m_it.array_iterator); + + default: + return (m_it.primitive_iterator < other.m_it.primitive_iterator); + } + } + + /*! + @brief comparison: less than or equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator<=(const iter_impl& other) const + { + return !other.operator < (*this); + } + + /*! + @brief comparison: greater than + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator>(const iter_impl& other) const + { + return !operator<=(other); + } + + /*! + @brief comparison: greater than or equal + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + bool operator>=(const iter_impl& other) const + { + return !operator<(other); + } + + /*! + @brief add to iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator+=(difference_type i) + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(209, "cannot use offsets with object iterators")); + + case value_t::array: + { + std::advance(m_it.array_iterator, i); + break; + } + + default: + { + m_it.primitive_iterator += i; + break; + } + } + + return *this; + } + + /*! + @brief subtract from iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl& operator-=(difference_type i) + { + return operator+=(-i); + } + + /*! + @brief add to iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl operator+(difference_type i) const + { + auto result = *this; + result += i; + return result; + } + + /*! + @brief addition of distance and iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + friend iter_impl operator+(difference_type i, const iter_impl& it) + { + auto result = it; + result += i; + return result; + } + + /*! + @brief subtract from iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + iter_impl operator-(difference_type i) const + { + auto result = *this; + result -= i; + return result; + } + + /*! + @brief return difference + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + difference_type operator-(const iter_impl& other) const + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(209, "cannot use offsets with object iterators")); + + case value_t::array: + return m_it.array_iterator - other.m_it.array_iterator; + + default: + return m_it.primitive_iterator - other.m_it.primitive_iterator; + } + } + + /*! + @brief access to successor + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference operator[](difference_type n) const + { + JSON_ASSERT(m_object != nullptr); + + switch (m_object->m_type) + { + case value_t::object: + JSON_THROW(invalid_iterator::create(208, "cannot use operator[] for object iterators")); + + case value_t::array: + return *std::next(m_it.array_iterator, n); + + case value_t::null: + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + + default: + { + if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.get_value() == -n)) + { + return *m_object; + } + + JSON_THROW(invalid_iterator::create(214, "cannot get value")); + } + } + } + + /*! + @brief return the key of an object iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + const typename object_t::key_type& key() const + { + JSON_ASSERT(m_object != nullptr); + + if (JSON_HEDLEY_LIKELY(m_object->is_object())) + { + return m_it.object_iterator->first; + } + + JSON_THROW(invalid_iterator::create(207, "cannot use key() for non-object iterators")); + } + + /*! + @brief return the value of an iterator + @pre The iterator is initialized; i.e. `m_object != nullptr`. + */ + reference value() const + { + return operator*(); + } + + private: + /// associated JSON instance + pointer m_object = nullptr; + /// the actual iterator of the associated instance + internal_iterator::type> m_it {}; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // ptrdiff_t +#include // reverse_iterator +#include // declval + +namespace nlohmann +{ +namespace detail +{ +////////////////////// +// reverse_iterator // +////////////////////// + +/*! +@brief a template for a reverse iterator class + +@tparam Base the base iterator type to reverse. Valid types are @ref +iterator (to create @ref reverse_iterator) and @ref const_iterator (to +create @ref const_reverse_iterator). + +@requirement The class satisfies the following concept requirements: +- +[BidirectionalIterator](https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator): + The iterator that can be moved can be moved in both directions (i.e. + incremented and decremented). +- [OutputIterator](https://en.cppreference.com/w/cpp/named_req/OutputIterator): + It is possible to write to the pointed-to element (only if @a Base is + @ref iterator). + +@since version 1.0.0 +*/ +template +class json_reverse_iterator : public std::reverse_iterator +{ + public: + using difference_type = std::ptrdiff_t; + /// shortcut to the reverse iterator adapter + using base_iterator = std::reverse_iterator; + /// the reference type for the pointed-to element + using reference = typename Base::reference; + + /// create reverse iterator from iterator + explicit json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept + : base_iterator(it) {} + + /// create reverse iterator from base class + explicit json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} + + /// post-increment (it++) + json_reverse_iterator const operator++(int) + { + return static_cast(base_iterator::operator++(1)); + } + + /// pre-increment (++it) + json_reverse_iterator& operator++() + { + return static_cast(base_iterator::operator++()); + } + + /// post-decrement (it--) + json_reverse_iterator const operator--(int) + { + return static_cast(base_iterator::operator--(1)); + } + + /// pre-decrement (--it) + json_reverse_iterator& operator--() + { + return static_cast(base_iterator::operator--()); + } + + /// add to iterator + json_reverse_iterator& operator+=(difference_type i) + { + return static_cast(base_iterator::operator+=(i)); + } + + /// add to iterator + json_reverse_iterator operator+(difference_type i) const + { + return static_cast(base_iterator::operator+(i)); + } + + /// subtract from iterator + json_reverse_iterator operator-(difference_type i) const + { + return static_cast(base_iterator::operator-(i)); + } + + /// return difference + difference_type operator-(const json_reverse_iterator& other) const + { + return base_iterator(*this) - base_iterator(other); + } + + /// access to successor + reference operator[](difference_type n) const + { + return *(this->operator+(n)); + } + + /// return the key of an object iterator + auto key() const -> decltype(std::declval().key()) + { + auto it = --this->base(); + return it.key(); + } + + /// return the value of an iterator + reference value() const + { + auto it = --this->base(); + return it.operator * (); + } +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // all_of +#include // isdigit +#include // max +#include // accumulate +#include // string +#include // move +#include // vector + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +template +class json_pointer +{ + // allow basic_json to access private members + NLOHMANN_BASIC_JSON_TPL_DECLARATION + friend class basic_json; + + public: + /*! + @brief create JSON pointer + + Create a JSON pointer according to the syntax described in + [Section 3 of RFC6901](https://tools.ietf.org/html/rfc6901#section-3). + + @param[in] s string representing the JSON pointer; if omitted, the empty + string is assumed which references the whole JSON value + + @throw parse_error.107 if the given JSON pointer @a s is nonempty and does + not begin with a slash (`/`); see example below + + @throw parse_error.108 if a tilde (`~`) in the given JSON pointer @a s is + not followed by `0` (representing `~`) or `1` (representing `/`); see + example below + + @liveexample{The example shows the construction several valid JSON pointers + as well as the exceptional behavior.,json_pointer} + + @since version 2.0.0 + */ + explicit json_pointer(const std::string& s = "") + : reference_tokens(split(s)) + {} + + /*! + @brief return a string representation of the JSON pointer + + @invariant For each JSON pointer `ptr`, it holds: + @code {.cpp} + ptr == json_pointer(ptr.to_string()); + @endcode + + @return a string representation of the JSON pointer + + @liveexample{The example shows the result of `to_string`.,json_pointer__to_string} + + @since version 2.0.0 + */ + std::string to_string() const + { + return std::accumulate(reference_tokens.begin(), reference_tokens.end(), + std::string{}, + [](const std::string & a, const std::string & b) + { + return a + "/" + escape(b); + }); + } + + /// @copydoc to_string() + operator std::string() const + { + return to_string(); + } + + /*! + @brief append another JSON pointer at the end of this JSON pointer + + @param[in] ptr JSON pointer to append + @return JSON pointer with @a ptr appended + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::string) to append a reference token + @sa @ref operator/=(std::size_t) to append an array index + @sa @ref operator/(const json_pointer&, const json_pointer&) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(const json_pointer& ptr) + { + reference_tokens.insert(reference_tokens.end(), + ptr.reference_tokens.begin(), + ptr.reference_tokens.end()); + return *this; + } + + /*! + @brief append an unescaped reference token at the end of this JSON pointer + + @param[in] token reference token to append + @return JSON pointer with @a token appended without escaping @a token + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Amortized constant. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + @sa @ref operator/=(std::size_t) to append an array index + @sa @ref operator/(const json_pointer&, std::size_t) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(std::string token) + { + push_back(std::move(token)); + return *this; + } + + /*! + @brief append an array index at the end of this JSON pointer + + @param[in] array_idx array index to append + @return JSON pointer with @a array_idx appended + + @liveexample{The example shows the usage of `operator/=`.,json_pointer__operator_add} + + @complexity Amortized constant. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + @sa @ref operator/=(std::string) to append a reference token + @sa @ref operator/(const json_pointer&, std::string) for a binary operator + + @since version 3.6.0 + */ + json_pointer& operator/=(std::size_t array_idx) + { + return *this /= std::to_string(array_idx); + } + + /*! + @brief create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer + + @param[in] lhs JSON pointer + @param[in] rhs JSON pointer + @return a new JSON pointer with @a rhs appended to @a lhs + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a lhs and @a rhs. + + @sa @ref operator/=(const json_pointer&) to append a JSON pointer + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& lhs, + const json_pointer& rhs) + { + return json_pointer(lhs) /= rhs; + } + + /*! + @brief create a new JSON pointer by appending the unescaped token at the end of the JSON pointer + + @param[in] ptr JSON pointer + @param[in] token reference token + @return a new JSON pointer with unescaped @a token appended to @a ptr + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::string) to append a reference token + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& ptr, std::string token) + { + return json_pointer(ptr) /= std::move(token); + } + + /*! + @brief create a new JSON pointer by appending the array-index-token at the end of the JSON pointer + + @param[in] ptr JSON pointer + @param[in] array_idx array index + @return a new JSON pointer with @a array_idx appended to @a ptr + + @liveexample{The example shows the usage of `operator/`.,json_pointer__operator_add_binary} + + @complexity Linear in the length of @a ptr. + + @sa @ref operator/=(std::size_t) to append an array index + + @since version 3.6.0 + */ + friend json_pointer operator/(const json_pointer& ptr, std::size_t array_idx) + { + return json_pointer(ptr) /= array_idx; + } + + /*! + @brief returns the parent of this JSON pointer + + @return parent of this JSON pointer; in case this JSON pointer is the root, + the root itself is returned + + @complexity Linear in the length of the JSON pointer. + + @liveexample{The example shows the result of `parent_pointer` for different + JSON Pointers.,json_pointer__parent_pointer} + + @since version 3.6.0 + */ + json_pointer parent_pointer() const + { + if (empty()) + { + return *this; + } + + json_pointer res = *this; + res.pop_back(); + return res; + } + + /*! + @brief remove last reference token + + @pre not `empty()` + + @liveexample{The example shows the usage of `pop_back`.,json_pointer__pop_back} + + @complexity Constant. + + @throw out_of_range.405 if JSON pointer has no parent + + @since version 3.6.0 + */ + void pop_back() + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + reference_tokens.pop_back(); + } + + /*! + @brief return last reference token + + @pre not `empty()` + @return last reference token + + @liveexample{The example shows the usage of `back`.,json_pointer__back} + + @complexity Constant. + + @throw out_of_range.405 if JSON pointer has no parent + + @since version 3.6.0 + */ + const std::string& back() const + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + return reference_tokens.back(); + } + + /*! + @brief append an unescaped token at the end of the reference pointer + + @param[in] token token to add + + @complexity Amortized constant. + + @liveexample{The example shows the result of `push_back` for different + JSON Pointers.,json_pointer__push_back} + + @since version 3.6.0 + */ + void push_back(const std::string& token) + { + reference_tokens.push_back(token); + } + + /// @copydoc push_back(const std::string&) + void push_back(std::string&& token) + { + reference_tokens.push_back(std::move(token)); + } + + /*! + @brief return whether pointer points to the root document + + @return true iff the JSON pointer points to the root document + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example shows the result of `empty` for different JSON + Pointers.,json_pointer__empty} + + @since version 3.6.0 + */ + bool empty() const noexcept + { + return reference_tokens.empty(); + } + + private: + /*! + @param[in] s reference token to be converted into an array index + + @return integer representation of @a s + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index begins not with a digit + @throw out_of_range.404 if string @a s could not be converted to an integer + @throw out_of_range.410 if an array index exceeds size_type + */ + static typename BasicJsonType::size_type array_index(const std::string& s) + { + using size_type = typename BasicJsonType::size_type; + + // error condition (cf. RFC 6901, Sect. 4) + if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && s[0] == '0')) + { + JSON_THROW(detail::parse_error::create(106, 0, + "array index '" + s + + "' must not begin with '0'")); + } + + // error condition (cf. RFC 6901, Sect. 4) + if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && !(s[0] >= '1' && s[0] <= '9'))) + { + JSON_THROW(detail::parse_error::create(109, 0, "array index '" + s + "' is not a number")); + } + + std::size_t processed_chars = 0; + unsigned long long res = 0; + JSON_TRY + { + res = std::stoull(s, &processed_chars); + } + JSON_CATCH(std::out_of_range&) + { + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); + } + + // check if the string was completely read + if (JSON_HEDLEY_UNLIKELY(processed_chars != s.size())) + { + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'")); + } + + // only triggered on special platforms (like 32bit), see also + // https://github.com/nlohmann/json/pull/2203 + if (res >= static_cast((std::numeric_limits::max)())) + { + JSON_THROW(detail::out_of_range::create(410, "array index " + s + " exceeds size_type")); // LCOV_EXCL_LINE + } + + return static_cast(res); + } + + json_pointer top() const + { + if (JSON_HEDLEY_UNLIKELY(empty())) + { + JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent")); + } + + json_pointer result = *this; + result.reference_tokens = {reference_tokens[0]}; + return result; + } + + /*! + @brief create and return a reference to the pointed to value + + @complexity Linear in the number of reference tokens. + + @throw parse_error.109 if array index is not a number + @throw type_error.313 if value cannot be unflattened + */ + BasicJsonType& get_and_create(BasicJsonType& j) const + { + auto result = &j; + + // in case no reference tokens exist, return a reference to the JSON value + // j which will be overwritten by a primitive value + for (const auto& reference_token : reference_tokens) + { + switch (result->type()) + { + case detail::value_t::null: + { + if (reference_token == "0") + { + // start a new array if reference token is 0 + result = &result->operator[](0); + } + else + { + // start a new object otherwise + result = &result->operator[](reference_token); + } + break; + } + + case detail::value_t::object: + { + // create an entry in the object + result = &result->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + // create an entry in the array + result = &result->operator[](array_index(reference_token)); + break; + } + + /* + The following code is only reached if there exists a reference + token _and_ the current value is primitive. In this case, we have + an error situation, because primitive values may only occur as + single value; that is, with an empty list of reference tokens. + */ + default: + JSON_THROW(detail::type_error::create(313, "invalid value to unflatten")); + } + } + + return *result; + } + + /*! + @brief return a reference to the pointed to value + + @note This version does not throw if a value is not present, but tries to + create nested values instead. For instance, calling this function + with pointer `"/this/that"` on a null value is equivalent to calling + `operator[]("this").operator[]("that")` on that value, effectively + changing the null value to an object. + + @param[in] ptr a JSON value + + @return reference to the JSON value pointed to by the JSON pointer + + @complexity Linear in the length of the JSON pointer. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + BasicJsonType& get_unchecked(BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + // convert null values to arrays or objects before continuing + if (ptr->is_null()) + { + // check if reference token is a number + const bool nums = + std::all_of(reference_token.begin(), reference_token.end(), + [](const unsigned char x) + { + return std::isdigit(x); + }); + + // change value to array for numbers or "-" or to object otherwise + *ptr = (nums || reference_token == "-") + ? detail::value_t::array + : detail::value_t::object; + } + + switch (ptr->type()) + { + case detail::value_t::object: + { + // use unchecked object access + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (reference_token == "-") + { + // explicitly treat "-" as index beyond the end + ptr = &ptr->operator[](ptr->m_value.array->size()); + } + else + { + // convert array index to number; unchecked access + ptr = &ptr->operator[](array_index(reference_token)); + } + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + BasicJsonType& get_checked(BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // note: at performs range check + ptr = &ptr->at(reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // note: at performs range check + ptr = &ptr->at(array_index(reference_token)); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @brief return a const reference to the pointed to value + + @param[in] ptr a JSON value + + @return const reference to the JSON value pointed to by the JSON + pointer + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + const BasicJsonType& get_unchecked(const BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // use unchecked object access + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" cannot be used for const access + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // use unchecked array access + ptr = &ptr->operator[](array_index(reference_token)); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + */ + const BasicJsonType& get_checked(const BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + // note: at performs range check + ptr = &ptr->at(reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + JSON_THROW(detail::out_of_range::create(402, + "array index '-' (" + std::to_string(ptr->m_value.array->size()) + + ") is out of range")); + } + + // note: at performs range check + ptr = &ptr->at(array_index(reference_token)); + break; + } + + default: + JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + reference_token + "'")); + } + } + + return *ptr; + } + + /*! + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + */ + bool contains(const BasicJsonType* ptr) const + { + for (const auto& reference_token : reference_tokens) + { + switch (ptr->type()) + { + case detail::value_t::object: + { + if (!ptr->contains(reference_token)) + { + // we did not find the key in the object + return false; + } + + ptr = &ptr->operator[](reference_token); + break; + } + + case detail::value_t::array: + { + if (JSON_HEDLEY_UNLIKELY(reference_token == "-")) + { + // "-" always fails the range check + return false; + } + if (JSON_HEDLEY_UNLIKELY(reference_token.size() == 1 && !("0" <= reference_token && reference_token <= "9"))) + { + // invalid char + return false; + } + if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1)) + { + if (JSON_HEDLEY_UNLIKELY(!('1' <= reference_token[0] && reference_token[0] <= '9'))) + { + // first char should be between '1' and '9' + return false; + } + for (std::size_t i = 1; i < reference_token.size(); i++) + { + if (JSON_HEDLEY_UNLIKELY(!('0' <= reference_token[i] && reference_token[i] <= '9'))) + { + // other char should be between '0' and '9' + return false; + } + } + } + + const auto idx = array_index(reference_token); + if (idx >= ptr->size()) + { + // index out of range + return false; + } + + ptr = &ptr->operator[](idx); + break; + } + + default: + { + // we do not expect primitive values if there is still a + // reference token to process + return false; + } + } + } + + // no reference token left means we found a primitive value + return true; + } + + /*! + @brief split the string input to reference tokens + + @note This function is only called by the json_pointer constructor. + All exceptions below are documented there. + + @throw parse_error.107 if the pointer is not empty or begins with '/' + @throw parse_error.108 if character '~' is not followed by '0' or '1' + */ + static std::vector split(const std::string& reference_string) + { + std::vector result; + + // special case: empty reference string -> no reference tokens + if (reference_string.empty()) + { + return result; + } + + // check if nonempty reference string begins with slash + if (JSON_HEDLEY_UNLIKELY(reference_string[0] != '/')) + { + JSON_THROW(detail::parse_error::create(107, 1, + "JSON pointer must be empty or begin with '/' - was: '" + + reference_string + "'")); + } + + // extract the reference tokens: + // - slash: position of the last read slash (or end of string) + // - start: position after the previous slash + for ( + // search for the first slash after the first character + std::size_t slash = reference_string.find_first_of('/', 1), + // set the beginning of the first reference token + start = 1; + // we can stop if start == 0 (if slash == std::string::npos) + start != 0; + // set the beginning of the next reference token + // (will eventually be 0 if slash == std::string::npos) + start = (slash == std::string::npos) ? 0 : slash + 1, + // find next slash + slash = reference_string.find_first_of('/', start)) + { + // use the text between the beginning of the reference token + // (start) and the last slash (slash). + auto reference_token = reference_string.substr(start, slash - start); + + // check reference tokens are properly escaped + for (std::size_t pos = reference_token.find_first_of('~'); + pos != std::string::npos; + pos = reference_token.find_first_of('~', pos + 1)) + { + JSON_ASSERT(reference_token[pos] == '~'); + + // ~ must be followed by 0 or 1 + if (JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 || + (reference_token[pos + 1] != '0' && + reference_token[pos + 1] != '1'))) + { + JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'")); + } + } + + // finally, store the reference token + unescape(reference_token); + result.push_back(reference_token); + } + + return result; + } + + /*! + @brief replace all occurrences of a substring by another string + + @param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t + @param[in] f the substring to replace with @a t + @param[in] t the string to replace @a f + + @pre The search string @a f must not be empty. **This precondition is + enforced with an assertion.** + + @since version 2.0.0 + */ + static void replace_substring(std::string& s, const std::string& f, + const std::string& t) + { + JSON_ASSERT(!f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != std::string::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} + } + + /// escape "~" to "~0" and "/" to "~1" + static std::string escape(std::string s) + { + replace_substring(s, "~", "~0"); + replace_substring(s, "/", "~1"); + return s; + } + + /// unescape "~1" to tilde and "~0" to slash (order is important!) + static void unescape(std::string& s) + { + replace_substring(s, "~1", "/"); + replace_substring(s, "~0", "~"); + } + + /*! + @param[in] reference_string the reference string to the current value + @param[in] value the value to consider + @param[in,out] result the result object to insert values to + + @note Empty objects or arrays are flattened to `null`. + */ + static void flatten(const std::string& reference_string, + const BasicJsonType& value, + BasicJsonType& result) + { + switch (value.type()) + { + case detail::value_t::array: + { + if (value.m_value.array->empty()) + { + // flatten empty array as null + result[reference_string] = nullptr; + } + else + { + // iterate array and use index as reference string + for (std::size_t i = 0; i < value.m_value.array->size(); ++i) + { + flatten(reference_string + "/" + std::to_string(i), + value.m_value.array->operator[](i), result); + } + } + break; + } + + case detail::value_t::object: + { + if (value.m_value.object->empty()) + { + // flatten empty object as null + result[reference_string] = nullptr; + } + else + { + // iterate object and use keys as reference string + for (const auto& element : *value.m_value.object) + { + flatten(reference_string + "/" + escape(element.first), element.second, result); + } + } + break; + } + + default: + { + // add primitive value with its reference string + result[reference_string] = value; + break; + } + } + } + + /*! + @param[in] value flattened JSON + + @return unflattened JSON + + @throw parse_error.109 if array index is not a number + @throw type_error.314 if value is not an object + @throw type_error.315 if object values are not primitive + @throw type_error.313 if value cannot be unflattened + */ + static BasicJsonType + unflatten(const BasicJsonType& value) + { + if (JSON_HEDLEY_UNLIKELY(!value.is_object())) + { + JSON_THROW(detail::type_error::create(314, "only objects can be unflattened")); + } + + BasicJsonType result; + + // iterate the JSON object values + for (const auto& element : *value.m_value.object) + { + if (JSON_HEDLEY_UNLIKELY(!element.second.is_primitive())) + { + JSON_THROW(detail::type_error::create(315, "values in object must be primitive")); + } + + // assign value to reference pointed to by JSON pointer; Note that if + // the JSON pointer is "" (i.e., points to the whole value), function + // get_and_create returns a reference to result itself. An assignment + // will then create a primitive value. + json_pointer(element.first).get_and_create(result) = element.second; + } + + return result; + } + + /*! + @brief compares two JSON pointers for equality + + @param[in] lhs JSON pointer to compare + @param[in] rhs JSON pointer to compare + @return whether @a lhs is equal to @a rhs + + @complexity Linear in the length of the JSON pointer + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + */ + friend bool operator==(json_pointer const& lhs, + json_pointer const& rhs) noexcept + { + return lhs.reference_tokens == rhs.reference_tokens; + } + + /*! + @brief compares two JSON pointers for inequality + + @param[in] lhs JSON pointer to compare + @param[in] rhs JSON pointer to compare + @return whether @a lhs is not equal @a rhs + + @complexity Linear in the length of the JSON pointer + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + */ + friend bool operator!=(json_pointer const& lhs, + json_pointer const& rhs) noexcept + { + return !(lhs == rhs); + } + + /// the reference tokens + std::vector reference_tokens; +}; +} // namespace nlohmann + +// #include + + +#include +#include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +template +class json_ref +{ + public: + using value_type = BasicJsonType; + + json_ref(value_type&& value) + : owned_value(std::move(value)) + , value_ref(&owned_value) + , is_rvalue(true) + {} + + json_ref(const value_type& value) + : value_ref(const_cast(&value)) + , is_rvalue(false) + {} + + json_ref(std::initializer_list init) + : owned_value(init) + , value_ref(&owned_value) + , is_rvalue(true) + {} + + template < + class... Args, + enable_if_t::value, int> = 0 > + json_ref(Args && ... args) + : owned_value(std::forward(args)...) + , value_ref(&owned_value) + , is_rvalue(true) + {} + + // class should be movable only + json_ref(json_ref&&) = default; + json_ref(const json_ref&) = delete; + json_ref& operator=(const json_ref&) = delete; + json_ref& operator=(json_ref&&) = delete; + ~json_ref() = default; + + value_type moved_or_copied() const + { + if (is_rvalue) + { + return std::move(*value_ref); + } + return *value_ref; + } + + value_type const& operator*() const + { + return *static_cast(value_ref); + } + + value_type const* operator->() const + { + return static_cast(value_ref); + } + + private: + mutable value_type owned_value = nullptr; + value_type* value_ref = nullptr; + const bool is_rvalue = true; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + +// #include + + +#include // reverse +#include // array +#include // uint8_t, uint16_t, uint32_t, uint64_t +#include // memcpy +#include // numeric_limits +#include // string +#include // isnan, isinf + +// #include + +// #include + +// #include + + +#include // copy +#include // size_t +#include // streamsize +#include // back_inserter +#include // shared_ptr, make_shared +#include // basic_ostream +#include // basic_string +#include // vector +// #include + + +namespace nlohmann +{ +namespace detail +{ +/// abstract output adapter interface +template struct output_adapter_protocol +{ + virtual void write_character(CharType c) = 0; + virtual void write_characters(const CharType* s, std::size_t length) = 0; + virtual ~output_adapter_protocol() = default; +}; + +/// a type to simplify interfaces +template +using output_adapter_t = std::shared_ptr>; + +/// output adapter for byte vectors +template +class output_vector_adapter : public output_adapter_protocol +{ + public: + explicit output_vector_adapter(std::vector& vec) noexcept + : v(vec) + {} + + void write_character(CharType c) override + { + v.push_back(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + std::copy(s, s + length, std::back_inserter(v)); + } + + private: + std::vector& v; +}; + +/// output adapter for output streams +template +class output_stream_adapter : public output_adapter_protocol +{ + public: + explicit output_stream_adapter(std::basic_ostream& s) noexcept + : stream(s) + {} + + void write_character(CharType c) override + { + stream.put(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + stream.write(s, static_cast(length)); + } + + private: + std::basic_ostream& stream; +}; + +/// output adapter for basic_string +template> +class output_string_adapter : public output_adapter_protocol +{ + public: + explicit output_string_adapter(StringType& s) noexcept + : str(s) + {} + + void write_character(CharType c) override + { + str.push_back(c); + } + + JSON_HEDLEY_NON_NULL(2) + void write_characters(const CharType* s, std::size_t length) override + { + str.append(s, length); + } + + private: + StringType& str; +}; + +template> +class output_adapter +{ + public: + output_adapter(std::vector& vec) + : oa(std::make_shared>(vec)) {} + + output_adapter(std::basic_ostream& s) + : oa(std::make_shared>(s)) {} + + output_adapter(StringType& s) + : oa(std::make_shared>(s)) {} + + operator output_adapter_t() + { + return oa; + } + + private: + output_adapter_t oa = nullptr; +}; +} // namespace detail +} // namespace nlohmann + + +namespace nlohmann +{ +namespace detail +{ +/////////////////// +// binary writer // +/////////////////// + +/*! +@brief serialization to CBOR and MessagePack values +*/ +template +class binary_writer +{ + using string_t = typename BasicJsonType::string_t; + using binary_t = typename BasicJsonType::binary_t; + using number_float_t = typename BasicJsonType::number_float_t; + + public: + /*! + @brief create a binary writer + + @param[in] adapter output adapter to write to + */ + explicit binary_writer(output_adapter_t adapter) : oa(adapter) + { + JSON_ASSERT(oa); + } + + /*! + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + void write_bson(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::object: + { + write_bson_object(*j.m_value.object); + break; + } + + default: + { + JSON_THROW(type_error::create(317, "to serialize to BSON, top-level type must be object, but is " + std::string(j.type_name()))); + } + } + } + + /*! + @param[in] j JSON value to serialize + */ + void write_cbor(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::null: + { + oa->write_character(to_char_type(0xF6)); + break; + } + + case value_t::boolean: + { + oa->write_character(j.m_value.boolean + ? to_char_type(0xF5) + : to_char_type(0xF4)); + break; + } + + case value_t::number_integer: + { + if (j.m_value.number_integer >= 0) + { + // CBOR does not differentiate between positive signed + // integers and unsigned integers. Therefore, we used the + // code from the value_t::number_unsigned case here. + if (j.m_value.number_integer <= 0x17) + { + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x18)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x19)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x1A)); + write_number(static_cast(j.m_value.number_integer)); + } + else + { + oa->write_character(to_char_type(0x1B)); + write_number(static_cast(j.m_value.number_integer)); + } + } + else + { + // The conversions below encode the sign in the first + // byte, and the value is converted to a positive number. + const auto positive_number = -1 - j.m_value.number_integer; + if (j.m_value.number_integer >= -24) + { + write_number(static_cast(0x20 + positive_number)); + } + else if (positive_number <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x38)); + write_number(static_cast(positive_number)); + } + else if (positive_number <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x39)); + write_number(static_cast(positive_number)); + } + else if (positive_number <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x3A)); + write_number(static_cast(positive_number)); + } + else + { + oa->write_character(to_char_type(0x3B)); + write_number(static_cast(positive_number)); + } + } + break; + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned <= 0x17) + { + write_number(static_cast(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x18)); + write_number(static_cast(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x19)); + write_number(static_cast(j.m_value.number_unsigned)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x1A)); + write_number(static_cast(j.m_value.number_unsigned)); + } + else + { + oa->write_character(to_char_type(0x1B)); + write_number(static_cast(j.m_value.number_unsigned)); + } + break; + } + + case value_t::number_float: + { + if (std::isnan(j.m_value.number_float)) + { + // NaN is 0xf97e00 in CBOR + oa->write_character(to_char_type(0xF9)); + oa->write_character(to_char_type(0x7E)); + oa->write_character(to_char_type(0x00)); + } + else if (std::isinf(j.m_value.number_float)) + { + // Infinity is 0xf97c00, -Infinity is 0xf9fc00 + oa->write_character(to_char_type(0xf9)); + oa->write_character(j.m_value.number_float > 0 ? to_char_type(0x7C) : to_char_type(0xFC)); + oa->write_character(to_char_type(0x00)); + } + else + { + write_compact_float(j.m_value.number_float, detail::input_format_t::cbor); + } + break; + } + + case value_t::string: + { + // step 1: write control byte and the string length + const auto N = j.m_value.string->size(); + if (N <= 0x17) + { + write_number(static_cast(0x60 + N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x78)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x79)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x7A)); + write_number(static_cast(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x7B)); + write_number(static_cast(N)); + } + // LCOV_EXCL_STOP + + // step 2: write the string + oa->write_characters( + reinterpret_cast(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + // step 1: write control byte and the array size + const auto N = j.m_value.array->size(); + if (N <= 0x17) + { + write_number(static_cast(0x80 + N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x98)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x99)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x9A)); + write_number(static_cast(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x9B)); + write_number(static_cast(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + for (const auto& el : *j.m_value.array) + { + write_cbor(el); + } + break; + } + + case value_t::binary: + { + if (j.m_value.binary->has_subtype()) + { + write_number(static_cast(0xd8)); + write_number(j.m_value.binary->subtype()); + } + + // step 1: write control byte and the binary array size + const auto N = j.m_value.binary->size(); + if (N <= 0x17) + { + write_number(static_cast(0x40 + N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x58)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x59)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x5A)); + write_number(static_cast(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0x5B)); + write_number(static_cast(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + oa->write_characters( + reinterpret_cast(j.m_value.binary->data()), + N); + + break; + } + + case value_t::object: + { + // step 1: write control byte and the object size + const auto N = j.m_value.object->size(); + if (N <= 0x17) + { + write_number(static_cast(0xA0 + N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0xB8)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0xB9)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0xBA)); + write_number(static_cast(N)); + } + // LCOV_EXCL_START + else if (N <= (std::numeric_limits::max)()) + { + oa->write_character(to_char_type(0xBB)); + write_number(static_cast(N)); + } + // LCOV_EXCL_STOP + + // step 2: write each element + for (const auto& el : *j.m_value.object) + { + write_cbor(el.first); + write_cbor(el.second); + } + break; + } + + default: + break; + } + } + + /*! + @param[in] j JSON value to serialize + */ + void write_msgpack(const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::null: // nil + { + oa->write_character(to_char_type(0xC0)); + break; + } + + case value_t::boolean: // true and false + { + oa->write_character(j.m_value.boolean + ? to_char_type(0xC3) + : to_char_type(0xC2)); + break; + } + + case value_t::number_integer: + { + if (j.m_value.number_integer >= 0) + { + // MessagePack does not differentiate between positive + // signed integers and unsigned integers. Therefore, we used + // the code from the value_t::number_unsigned case here. + if (j.m_value.number_unsigned < 128) + { + // positive fixnum + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 8 + oa->write_character(to_char_type(0xCC)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 16 + oa->write_character(to_char_type(0xCD)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 32 + oa->write_character(to_char_type(0xCE)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 64 + oa->write_character(to_char_type(0xCF)); + write_number(static_cast(j.m_value.number_integer)); + } + } + else + { + if (j.m_value.number_integer >= -32) + { + // negative fixnum + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits::min)() && + j.m_value.number_integer <= (std::numeric_limits::max)()) + { + // int 8 + oa->write_character(to_char_type(0xD0)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits::min)() && + j.m_value.number_integer <= (std::numeric_limits::max)()) + { + // int 16 + oa->write_character(to_char_type(0xD1)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits::min)() && + j.m_value.number_integer <= (std::numeric_limits::max)()) + { + // int 32 + oa->write_character(to_char_type(0xD2)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_integer >= (std::numeric_limits::min)() && + j.m_value.number_integer <= (std::numeric_limits::max)()) + { + // int 64 + oa->write_character(to_char_type(0xD3)); + write_number(static_cast(j.m_value.number_integer)); + } + } + break; + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned < 128) + { + // positive fixnum + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 8 + oa->write_character(to_char_type(0xCC)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 16 + oa->write_character(to_char_type(0xCD)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 32 + oa->write_character(to_char_type(0xCE)); + write_number(static_cast(j.m_value.number_integer)); + } + else if (j.m_value.number_unsigned <= (std::numeric_limits::max)()) + { + // uint 64 + oa->write_character(to_char_type(0xCF)); + write_number(static_cast(j.m_value.number_integer)); + } + break; + } + + case value_t::number_float: + { + write_compact_float(j.m_value.number_float, detail::input_format_t::msgpack); + break; + } + + case value_t::string: + { + // step 1: write control byte and the string length + const auto N = j.m_value.string->size(); + if (N <= 31) + { + // fixstr + write_number(static_cast(0xA0 | N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // str 8 + oa->write_character(to_char_type(0xD9)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // str 16 + oa->write_character(to_char_type(0xDA)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // str 32 + oa->write_character(to_char_type(0xDB)); + write_number(static_cast(N)); + } + + // step 2: write the string + oa->write_characters( + reinterpret_cast(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + // step 1: write control byte and the array size + const auto N = j.m_value.array->size(); + if (N <= 15) + { + // fixarray + write_number(static_cast(0x90 | N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // array 16 + oa->write_character(to_char_type(0xDC)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // array 32 + oa->write_character(to_char_type(0xDD)); + write_number(static_cast(N)); + } + + // step 2: write each element + for (const auto& el : *j.m_value.array) + { + write_msgpack(el); + } + break; + } + + case value_t::binary: + { + // step 0: determine if the binary type has a set subtype to + // determine whether or not to use the ext or fixext types + const bool use_ext = j.m_value.binary->has_subtype(); + + // step 1: write control byte and the byte string length + const auto N = j.m_value.binary->size(); + if (N <= (std::numeric_limits::max)()) + { + std::uint8_t output_type{}; + bool fixed = true; + if (use_ext) + { + switch (N) + { + case 1: + output_type = 0xD4; // fixext 1 + break; + case 2: + output_type = 0xD5; // fixext 2 + break; + case 4: + output_type = 0xD6; // fixext 4 + break; + case 8: + output_type = 0xD7; // fixext 8 + break; + case 16: + output_type = 0xD8; // fixext 16 + break; + default: + output_type = 0xC7; // ext 8 + fixed = false; + break; + } + + } + else + { + output_type = 0xC4; // bin 8 + fixed = false; + } + + oa->write_character(to_char_type(output_type)); + if (!fixed) + { + write_number(static_cast(N)); + } + } + else if (N <= (std::numeric_limits::max)()) + { + std::uint8_t output_type = use_ext + ? 0xC8 // ext 16 + : 0xC5; // bin 16 + + oa->write_character(to_char_type(output_type)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + std::uint8_t output_type = use_ext + ? 0xC9 // ext 32 + : 0xC6; // bin 32 + + oa->write_character(to_char_type(output_type)); + write_number(static_cast(N)); + } + + // step 1.5: if this is an ext type, write the subtype + if (use_ext) + { + write_number(static_cast(j.m_value.binary->subtype())); + } + + // step 2: write the byte string + oa->write_characters( + reinterpret_cast(j.m_value.binary->data()), + N); + + break; + } + + case value_t::object: + { + // step 1: write control byte and the object size + const auto N = j.m_value.object->size(); + if (N <= 15) + { + // fixmap + write_number(static_cast(0x80 | (N & 0xF))); + } + else if (N <= (std::numeric_limits::max)()) + { + // map 16 + oa->write_character(to_char_type(0xDE)); + write_number(static_cast(N)); + } + else if (N <= (std::numeric_limits::max)()) + { + // map 32 + oa->write_character(to_char_type(0xDF)); + write_number(static_cast(N)); + } + + // step 2: write each element + for (const auto& el : *j.m_value.object) + { + write_msgpack(el.first); + write_msgpack(el.second); + } + break; + } + + default: + break; + } + } + + /*! + @param[in] j JSON value to serialize + @param[in] use_count whether to use '#' prefixes (optimized format) + @param[in] use_type whether to use '$' prefixes (optimized format) + @param[in] add_prefix whether prefixes need to be used for this value + */ + void write_ubjson(const BasicJsonType& j, const bool use_count, + const bool use_type, const bool add_prefix = true) + { + switch (j.type()) + { + case value_t::null: + { + if (add_prefix) + { + oa->write_character(to_char_type('Z')); + } + break; + } + + case value_t::boolean: + { + if (add_prefix) + { + oa->write_character(j.m_value.boolean + ? to_char_type('T') + : to_char_type('F')); + } + break; + } + + case value_t::number_integer: + { + write_number_with_ubjson_prefix(j.m_value.number_integer, add_prefix); + break; + } + + case value_t::number_unsigned: + { + write_number_with_ubjson_prefix(j.m_value.number_unsigned, add_prefix); + break; + } + + case value_t::number_float: + { + write_number_with_ubjson_prefix(j.m_value.number_float, add_prefix); + break; + } + + case value_t::string: + { + if (add_prefix) + { + oa->write_character(to_char_type('S')); + } + write_number_with_ubjson_prefix(j.m_value.string->size(), true); + oa->write_characters( + reinterpret_cast(j.m_value.string->c_str()), + j.m_value.string->size()); + break; + } + + case value_t::array: + { + if (add_prefix) + { + oa->write_character(to_char_type('[')); + } + + bool prefix_required = true; + if (use_type && !j.m_value.array->empty()) + { + JSON_ASSERT(use_count); + const CharType first_prefix = ubjson_prefix(j.front()); + const bool same_prefix = std::all_of(j.begin() + 1, j.end(), + [this, first_prefix](const BasicJsonType & v) + { + return ubjson_prefix(v) == first_prefix; + }); + + if (same_prefix) + { + prefix_required = false; + oa->write_character(to_char_type('$')); + oa->write_character(first_prefix); + } + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.array->size(), true); + } + + for (const auto& el : *j.m_value.array) + { + write_ubjson(el, use_count, use_type, prefix_required); + } + + if (!use_count) + { + oa->write_character(to_char_type(']')); + } + + break; + } + + case value_t::binary: + { + if (add_prefix) + { + oa->write_character(to_char_type('[')); + } + + if (use_type && !j.m_value.binary->empty()) + { + JSON_ASSERT(use_count); + oa->write_character(to_char_type('$')); + oa->write_character('U'); + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.binary->size(), true); + } + + if (use_type) + { + oa->write_characters( + reinterpret_cast(j.m_value.binary->data()), + j.m_value.binary->size()); + } + else + { + for (size_t i = 0; i < j.m_value.binary->size(); ++i) + { + oa->write_character(to_char_type('U')); + oa->write_character(j.m_value.binary->data()[i]); + } + } + + if (!use_count) + { + oa->write_character(to_char_type(']')); + } + + break; + } + + case value_t::object: + { + if (add_prefix) + { + oa->write_character(to_char_type('{')); + } + + bool prefix_required = true; + if (use_type && !j.m_value.object->empty()) + { + JSON_ASSERT(use_count); + const CharType first_prefix = ubjson_prefix(j.front()); + const bool same_prefix = std::all_of(j.begin(), j.end(), + [this, first_prefix](const BasicJsonType & v) + { + return ubjson_prefix(v) == first_prefix; + }); + + if (same_prefix) + { + prefix_required = false; + oa->write_character(to_char_type('$')); + oa->write_character(first_prefix); + } + } + + if (use_count) + { + oa->write_character(to_char_type('#')); + write_number_with_ubjson_prefix(j.m_value.object->size(), true); + } + + for (const auto& el : *j.m_value.object) + { + write_number_with_ubjson_prefix(el.first.size(), true); + oa->write_characters( + reinterpret_cast(el.first.c_str()), + el.first.size()); + write_ubjson(el.second, use_count, use_type, prefix_required); + } + + if (!use_count) + { + oa->write_character(to_char_type('}')); + } + + break; + } + + default: + break; + } + } + + private: + ////////// + // BSON // + ////////// + + /*! + @return The size of a BSON document entry header, including the id marker + and the entry name size (and its null-terminator). + */ + static std::size_t calc_bson_entry_header_size(const string_t& name) + { + const auto it = name.find(static_cast(0)); + if (JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos)) + { + JSON_THROW(out_of_range::create(409, + "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")")); + } + + return /*id*/ 1ul + name.size() + /*zero-terminator*/1u; + } + + /*! + @brief Writes the given @a element_type and @a name to the output adapter + */ + void write_bson_entry_header(const string_t& name, + const std::uint8_t element_type) + { + oa->write_character(to_char_type(element_type)); // boolean + oa->write_characters( + reinterpret_cast(name.c_str()), + name.size() + 1u); + } + + /*! + @brief Writes a BSON element with key @a name and boolean value @a value + */ + void write_bson_boolean(const string_t& name, + const bool value) + { + write_bson_entry_header(name, 0x08); + oa->write_character(value ? to_char_type(0x01) : to_char_type(0x00)); + } + + /*! + @brief Writes a BSON element with key @a name and double value @a value + */ + void write_bson_double(const string_t& name, + const double value) + { + write_bson_entry_header(name, 0x01); + write_number(value); + } + + /*! + @return The size of the BSON-encoded string in @a value + */ + static std::size_t calc_bson_string_size(const string_t& value) + { + return sizeof(std::int32_t) + value.size() + 1ul; + } + + /*! + @brief Writes a BSON element with key @a name and string value @a value + */ + void write_bson_string(const string_t& name, + const string_t& value) + { + write_bson_entry_header(name, 0x02); + + write_number(static_cast(value.size() + 1ul)); + oa->write_characters( + reinterpret_cast(value.c_str()), + value.size() + 1); + } + + /*! + @brief Writes a BSON element with key @a name and null value + */ + void write_bson_null(const string_t& name) + { + write_bson_entry_header(name, 0x0A); + } + + /*! + @return The size of the BSON-encoded integer @a value + */ + static std::size_t calc_bson_integer_size(const std::int64_t value) + { + return (std::numeric_limits::min)() <= value && value <= (std::numeric_limits::max)() + ? sizeof(std::int32_t) + : sizeof(std::int64_t); + } + + /*! + @brief Writes a BSON element with key @a name and integer @a value + */ + void write_bson_integer(const string_t& name, + const std::int64_t value) + { + if ((std::numeric_limits::min)() <= value && value <= (std::numeric_limits::max)()) + { + write_bson_entry_header(name, 0x10); // int32 + write_number(static_cast(value)); + } + else + { + write_bson_entry_header(name, 0x12); // int64 + write_number(static_cast(value)); + } + } + + /*! + @return The size of the BSON-encoded unsigned integer in @a j + */ + static constexpr std::size_t calc_bson_unsigned_size(const std::uint64_t value) noexcept + { + return (value <= static_cast((std::numeric_limits::max)())) + ? sizeof(std::int32_t) + : sizeof(std::int64_t); + } + + /*! + @brief Writes a BSON element with key @a name and unsigned @a value + */ + void write_bson_unsigned(const string_t& name, + const std::uint64_t value) + { + if (value <= static_cast((std::numeric_limits::max)())) + { + write_bson_entry_header(name, 0x10 /* int32 */); + write_number(static_cast(value)); + } + else if (value <= static_cast((std::numeric_limits::max)())) + { + write_bson_entry_header(name, 0x12 /* int64 */); + write_number(static_cast(value)); + } + else + { + JSON_THROW(out_of_range::create(407, "integer number " + std::to_string(value) + " cannot be represented by BSON as it does not fit int64")); + } + } + + /*! + @brief Writes a BSON element with key @a name and object @a value + */ + void write_bson_object_entry(const string_t& name, + const typename BasicJsonType::object_t& value) + { + write_bson_entry_header(name, 0x03); // object + write_bson_object(value); + } + + /*! + @return The size of the BSON-encoded array @a value + */ + static std::size_t calc_bson_array_size(const typename BasicJsonType::array_t& value) + { + std::size_t array_index = 0ul; + + const std::size_t embedded_document_size = std::accumulate(std::begin(value), std::end(value), std::size_t(0), [&array_index](std::size_t result, const typename BasicJsonType::array_t::value_type & el) + { + return result + calc_bson_element_size(std::to_string(array_index++), el); + }); + + return sizeof(std::int32_t) + embedded_document_size + 1ul; + } + + /*! + @return The size of the BSON-encoded binary array @a value + */ + static std::size_t calc_bson_binary_size(const typename BasicJsonType::binary_t& value) + { + return sizeof(std::int32_t) + value.size() + 1ul; + } + + /*! + @brief Writes a BSON element with key @a name and array @a value + */ + void write_bson_array(const string_t& name, + const typename BasicJsonType::array_t& value) + { + write_bson_entry_header(name, 0x04); // array + write_number(static_cast(calc_bson_array_size(value))); + + std::size_t array_index = 0ul; + + for (const auto& el : value) + { + write_bson_element(std::to_string(array_index++), el); + } + + oa->write_character(to_char_type(0x00)); + } + + /*! + @brief Writes a BSON element with key @a name and binary value @a value + */ + void write_bson_binary(const string_t& name, + const binary_t& value) + { + write_bson_entry_header(name, 0x05); + + write_number(static_cast(value.size())); + write_number(value.has_subtype() ? value.subtype() : std::uint8_t(0x00)); + + oa->write_characters(reinterpret_cast(value.data()), value.size()); + } + + /*! + @brief Calculates the size necessary to serialize the JSON value @a j with its @a name + @return The calculated size for the BSON document entry for @a j with the given @a name. + */ + static std::size_t calc_bson_element_size(const string_t& name, + const BasicJsonType& j) + { + const auto header_size = calc_bson_entry_header_size(name); + switch (j.type()) + { + case value_t::object: + return header_size + calc_bson_object_size(*j.m_value.object); + + case value_t::array: + return header_size + calc_bson_array_size(*j.m_value.array); + + case value_t::binary: + return header_size + calc_bson_binary_size(*j.m_value.binary); + + case value_t::boolean: + return header_size + 1ul; + + case value_t::number_float: + return header_size + 8ul; + + case value_t::number_integer: + return header_size + calc_bson_integer_size(j.m_value.number_integer); + + case value_t::number_unsigned: + return header_size + calc_bson_unsigned_size(j.m_value.number_unsigned); + + case value_t::string: + return header_size + calc_bson_string_size(*j.m_value.string); + + case value_t::null: + return header_size + 0ul; + + // LCOV_EXCL_START + default: + JSON_ASSERT(false); + return 0ul; + // LCOV_EXCL_STOP + } + } + + /*! + @brief Serializes the JSON value @a j to BSON and associates it with the + key @a name. + @param name The name to associate with the JSON entity @a j within the + current BSON document + @return The size of the BSON entry + */ + void write_bson_element(const string_t& name, + const BasicJsonType& j) + { + switch (j.type()) + { + case value_t::object: + return write_bson_object_entry(name, *j.m_value.object); + + case value_t::array: + return write_bson_array(name, *j.m_value.array); + + case value_t::binary: + return write_bson_binary(name, *j.m_value.binary); + + case value_t::boolean: + return write_bson_boolean(name, j.m_value.boolean); + + case value_t::number_float: + return write_bson_double(name, j.m_value.number_float); + + case value_t::number_integer: + return write_bson_integer(name, j.m_value.number_integer); + + case value_t::number_unsigned: + return write_bson_unsigned(name, j.m_value.number_unsigned); + + case value_t::string: + return write_bson_string(name, *j.m_value.string); + + case value_t::null: + return write_bson_null(name); + + // LCOV_EXCL_START + default: + JSON_ASSERT(false); + return; + // LCOV_EXCL_STOP + } + } + + /*! + @brief Calculates the size of the BSON serialization of the given + JSON-object @a j. + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + static std::size_t calc_bson_object_size(const typename BasicJsonType::object_t& value) + { + std::size_t document_size = std::accumulate(value.begin(), value.end(), std::size_t(0), + [](size_t result, const typename BasicJsonType::object_t::value_type & el) + { + return result += calc_bson_element_size(el.first, el.second); + }); + + return sizeof(std::int32_t) + document_size + 1ul; + } + + /*! + @param[in] j JSON value to serialize + @pre j.type() == value_t::object + */ + void write_bson_object(const typename BasicJsonType::object_t& value) + { + write_number(static_cast(calc_bson_object_size(value))); + + for (const auto& el : value) + { + write_bson_element(el.first, el.second); + } + + oa->write_character(to_char_type(0x00)); + } + + ////////// + // CBOR // + ////////// + + static constexpr CharType get_cbor_float_prefix(float /*unused*/) + { + return to_char_type(0xFA); // Single-Precision Float + } + + static constexpr CharType get_cbor_float_prefix(double /*unused*/) + { + return to_char_type(0xFB); // Double-Precision Float + } + + ///////////// + // MsgPack // + ///////////// + + static constexpr CharType get_msgpack_float_prefix(float /*unused*/) + { + return to_char_type(0xCA); // float 32 + } + + static constexpr CharType get_msgpack_float_prefix(double /*unused*/) + { + return to_char_type(0xCB); // float 64 + } + + //////////// + // UBJSON // + //////////// + + // UBJSON: write number (floating point) + template::value, int>::type = 0> + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if (add_prefix) + { + oa->write_character(get_ubjson_float_prefix(n)); + } + write_number(n); + } + + // UBJSON: write number (unsigned integer) + template::value, int>::type = 0> + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if (n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('i')); // int8 + } + write_number(static_cast(n)); + } + else if (n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('U')); // uint8 + } + write_number(static_cast(n)); + } + else if (n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('I')); // int16 + } + write_number(static_cast(n)); + } + else if (n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('l')); // int32 + } + write_number(static_cast(n)); + } + else if (n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('L')); // int64 + } + write_number(static_cast(n)); + } + else + { + if (add_prefix) + { + oa->write_character(to_char_type('H')); // high-precision number + } + + const auto number = BasicJsonType(n).dump(); + write_number_with_ubjson_prefix(number.size(), true); + for (std::size_t i = 0; i < number.size(); ++i) + { + oa->write_character(to_char_type(static_cast(number[i]))); + } + } + } + + // UBJSON: write number (signed integer) + template < typename NumberType, typename std::enable_if < + std::is_signed::value&& + !std::is_floating_point::value, int >::type = 0 > + void write_number_with_ubjson_prefix(const NumberType n, + const bool add_prefix) + { + if ((std::numeric_limits::min)() <= n && n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('i')); // int8 + } + write_number(static_cast(n)); + } + else if (static_cast((std::numeric_limits::min)()) <= n && n <= static_cast((std::numeric_limits::max)())) + { + if (add_prefix) + { + oa->write_character(to_char_type('U')); // uint8 + } + write_number(static_cast(n)); + } + else if ((std::numeric_limits::min)() <= n && n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('I')); // int16 + } + write_number(static_cast(n)); + } + else if ((std::numeric_limits::min)() <= n && n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('l')); // int32 + } + write_number(static_cast(n)); + } + else if ((std::numeric_limits::min)() <= n && n <= (std::numeric_limits::max)()) + { + if (add_prefix) + { + oa->write_character(to_char_type('L')); // int64 + } + write_number(static_cast(n)); + } + // LCOV_EXCL_START + else + { + if (add_prefix) + { + oa->write_character(to_char_type('H')); // high-precision number + } + + const auto number = BasicJsonType(n).dump(); + write_number_with_ubjson_prefix(number.size(), true); + for (std::size_t i = 0; i < number.size(); ++i) + { + oa->write_character(to_char_type(static_cast(number[i]))); + } + } + // LCOV_EXCL_STOP + } + + /*! + @brief determine the type prefix of container values + */ + CharType ubjson_prefix(const BasicJsonType& j) const noexcept + { + switch (j.type()) + { + case value_t::null: + return 'Z'; + + case value_t::boolean: + return j.m_value.boolean ? 'T' : 'F'; + + case value_t::number_integer: + { + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'i'; + } + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'U'; + } + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'I'; + } + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'l'; + } + if ((std::numeric_limits::min)() <= j.m_value.number_integer && j.m_value.number_integer <= (std::numeric_limits::max)()) + { + return 'L'; + } + // anything else is treated as high-precision number + return 'H'; // LCOV_EXCL_LINE + } + + case value_t::number_unsigned: + { + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'i'; + } + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'U'; + } + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'I'; + } + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'l'; + } + if (j.m_value.number_unsigned <= static_cast((std::numeric_limits::max)())) + { + return 'L'; + } + // anything else is treated as high-precision number + return 'H'; // LCOV_EXCL_LINE + } + + case value_t::number_float: + return get_ubjson_float_prefix(j.m_value.number_float); + + case value_t::string: + return 'S'; + + case value_t::array: // fallthrough + case value_t::binary: + return '['; + + case value_t::object: + return '{'; + + default: // discarded values + return 'N'; + } + } + + static constexpr CharType get_ubjson_float_prefix(float /*unused*/) + { + return 'd'; // float 32 + } + + static constexpr CharType get_ubjson_float_prefix(double /*unused*/) + { + return 'D'; // float 64 + } + + /////////////////////// + // Utility functions // + /////////////////////// + + /* + @brief write a number to output input + @param[in] n number of type @a NumberType + @tparam NumberType the type of the number + @tparam OutputIsLittleEndian Set to true if output data is + required to be little endian + + @note This function needs to respect the system's endianess, because bytes + in CBOR, MessagePack, and UBJSON are stored in network order (big + endian) and therefore need reordering on little endian systems. + */ + template + void write_number(const NumberType n) + { + // step 1: write number to array of length NumberType + std::array vec; + std::memcpy(vec.data(), &n, sizeof(NumberType)); + + // step 2: write array to output (with possible reordering) + if (is_little_endian != OutputIsLittleEndian) + { + // reverse byte order prior to conversion if necessary + std::reverse(vec.begin(), vec.end()); + } + + oa->write_characters(vec.data(), sizeof(NumberType)); + } + + void write_compact_float(const number_float_t n, detail::input_format_t format) + { + if (static_cast(n) >= static_cast(std::numeric_limits::lowest()) && + static_cast(n) <= static_cast((std::numeric_limits::max)()) && + static_cast(static_cast(n)) == static_cast(n)) + { + oa->write_character(format == detail::input_format_t::cbor + ? get_cbor_float_prefix(static_cast(n)) + : get_msgpack_float_prefix(static_cast(n))); + write_number(static_cast(n)); + } + else + { + oa->write_character(format == detail::input_format_t::cbor + ? get_cbor_float_prefix(n) + : get_msgpack_float_prefix(n)); + write_number(n); + } + } + + public: + // The following to_char_type functions are implement the conversion + // between uint8_t and CharType. In case CharType is not unsigned, + // such a conversion is required to allow values greater than 128. + // See for a discussion. + template < typename C = CharType, + enable_if_t < std::is_signed::value && std::is_signed::value > * = nullptr > + static constexpr CharType to_char_type(std::uint8_t x) noexcept + { + return *reinterpret_cast(&x); + } + + template < typename C = CharType, + enable_if_t < std::is_signed::value && std::is_unsigned::value > * = nullptr > + static CharType to_char_type(std::uint8_t x) noexcept + { + static_assert(sizeof(std::uint8_t) == sizeof(CharType), "size of CharType must be equal to std::uint8_t"); + static_assert(std::is_trivial::value, "CharType must be trivial"); + CharType result; + std::memcpy(&result, &x, sizeof(x)); + return result; + } + + template::value>* = nullptr> + static constexpr CharType to_char_type(std::uint8_t x) noexcept + { + return x; + } + + template < typename InputCharType, typename C = CharType, + enable_if_t < + std::is_signed::value && + std::is_signed::value && + std::is_same::type>::value + > * = nullptr > + static constexpr CharType to_char_type(InputCharType x) noexcept + { + return x; + } + + private: + /// whether we can assume little endianess + const bool is_little_endian = little_endianess(); + + /// the output + output_adapter_t oa = nullptr; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + + +#include // reverse, remove, fill, find, none_of +#include // array +#include // localeconv, lconv +#include // labs, isfinite, isnan, signbit +#include // size_t, ptrdiff_t +#include // uint8_t +#include // snprintf +#include // numeric_limits +#include // string, char_traits +#include // is_same +#include // move + +// #include + + +#include // array +#include // signbit, isfinite +#include // intN_t, uintN_t +#include // memcpy, memmove +#include // numeric_limits +#include // conditional + +// #include + + +namespace nlohmann +{ +namespace detail +{ + +/*! +@brief implements the Grisu2 algorithm for binary to decimal floating-point +conversion. + +This implementation is a slightly modified version of the reference +implementation which may be obtained from +http://florian.loitsch.com/publications (bench.tar.gz). + +The code is distributed under the MIT license, Copyright (c) 2009 Florian Loitsch. + +For a detailed description of the algorithm see: + +[1] Loitsch, "Printing Floating-Point Numbers Quickly and Accurately with + Integers", Proceedings of the ACM SIGPLAN 2010 Conference on Programming + Language Design and Implementation, PLDI 2010 +[2] Burger, Dybvig, "Printing Floating-Point Numbers Quickly and Accurately", + Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language + Design and Implementation, PLDI 1996 +*/ +namespace dtoa_impl +{ + +template +Target reinterpret_bits(const Source source) +{ + static_assert(sizeof(Target) == sizeof(Source), "size mismatch"); + + Target target; + std::memcpy(&target, &source, sizeof(Source)); + return target; +} + +struct diyfp // f * 2^e +{ + static constexpr int kPrecision = 64; // = q + + std::uint64_t f = 0; + int e = 0; + + constexpr diyfp(std::uint64_t f_, int e_) noexcept : f(f_), e(e_) {} + + /*! + @brief returns x - y + @pre x.e == y.e and x.f >= y.f + */ + static diyfp sub(const diyfp& x, const diyfp& y) noexcept + { + JSON_ASSERT(x.e == y.e); + JSON_ASSERT(x.f >= y.f); + + return {x.f - y.f, x.e}; + } + + /*! + @brief returns x * y + @note The result is rounded. (Only the upper q bits are returned.) + */ + static diyfp mul(const diyfp& x, const diyfp& y) noexcept + { + static_assert(kPrecision == 64, "internal error"); + + // Computes: + // f = round((x.f * y.f) / 2^q) + // e = x.e + y.e + q + + // Emulate the 64-bit * 64-bit multiplication: + // + // p = u * v + // = (u_lo + 2^32 u_hi) (v_lo + 2^32 v_hi) + // = (u_lo v_lo ) + 2^32 ((u_lo v_hi ) + (u_hi v_lo )) + 2^64 (u_hi v_hi ) + // = (p0 ) + 2^32 ((p1 ) + (p2 )) + 2^64 (p3 ) + // = (p0_lo + 2^32 p0_hi) + 2^32 ((p1_lo + 2^32 p1_hi) + (p2_lo + 2^32 p2_hi)) + 2^64 (p3 ) + // = (p0_lo ) + 2^32 (p0_hi + p1_lo + p2_lo ) + 2^64 (p1_hi + p2_hi + p3) + // = (p0_lo ) + 2^32 (Q ) + 2^64 (H ) + // = (p0_lo ) + 2^32 (Q_lo + 2^32 Q_hi ) + 2^64 (H ) + // + // (Since Q might be larger than 2^32 - 1) + // + // = (p0_lo + 2^32 Q_lo) + 2^64 (Q_hi + H) + // + // (Q_hi + H does not overflow a 64-bit int) + // + // = p_lo + 2^64 p_hi + + const std::uint64_t u_lo = x.f & 0xFFFFFFFFu; + const std::uint64_t u_hi = x.f >> 32u; + const std::uint64_t v_lo = y.f & 0xFFFFFFFFu; + const std::uint64_t v_hi = y.f >> 32u; + + const std::uint64_t p0 = u_lo * v_lo; + const std::uint64_t p1 = u_lo * v_hi; + const std::uint64_t p2 = u_hi * v_lo; + const std::uint64_t p3 = u_hi * v_hi; + + const std::uint64_t p0_hi = p0 >> 32u; + const std::uint64_t p1_lo = p1 & 0xFFFFFFFFu; + const std::uint64_t p1_hi = p1 >> 32u; + const std::uint64_t p2_lo = p2 & 0xFFFFFFFFu; + const std::uint64_t p2_hi = p2 >> 32u; + + std::uint64_t Q = p0_hi + p1_lo + p2_lo; + + // The full product might now be computed as + // + // p_hi = p3 + p2_hi + p1_hi + (Q >> 32) + // p_lo = p0_lo + (Q << 32) + // + // But in this particular case here, the full p_lo is not required. + // Effectively we only need to add the highest bit in p_lo to p_hi (and + // Q_hi + 1 does not overflow). + + Q += std::uint64_t{1} << (64u - 32u - 1u); // round, ties up + + const std::uint64_t h = p3 + p2_hi + p1_hi + (Q >> 32u); + + return {h, x.e + y.e + 64}; + } + + /*! + @brief normalize x such that the significand is >= 2^(q-1) + @pre x.f != 0 + */ + static diyfp normalize(diyfp x) noexcept + { + JSON_ASSERT(x.f != 0); + + while ((x.f >> 63u) == 0) + { + x.f <<= 1u; + x.e--; + } + + return x; + } + + /*! + @brief normalize x such that the result has the exponent E + @pre e >= x.e and the upper e - x.e bits of x.f must be zero. + */ + static diyfp normalize_to(const diyfp& x, const int target_exponent) noexcept + { + const int delta = x.e - target_exponent; + + JSON_ASSERT(delta >= 0); + JSON_ASSERT(((x.f << delta) >> delta) == x.f); + + return {x.f << delta, target_exponent}; + } +}; + +struct boundaries +{ + diyfp w; + diyfp minus; + diyfp plus; +}; + +/*! +Compute the (normalized) diyfp representing the input number 'value' and its +boundaries. + +@pre value must be finite and positive +*/ +template +boundaries compute_boundaries(FloatType value) +{ + JSON_ASSERT(std::isfinite(value)); + JSON_ASSERT(value > 0); + + // Convert the IEEE representation into a diyfp. + // + // If v is denormal: + // value = 0.F * 2^(1 - bias) = ( F) * 2^(1 - bias - (p-1)) + // If v is normalized: + // value = 1.F * 2^(E - bias) = (2^(p-1) + F) * 2^(E - bias - (p-1)) + + static_assert(std::numeric_limits::is_iec559, + "internal error: dtoa_short requires an IEEE-754 floating-point implementation"); + + constexpr int kPrecision = std::numeric_limits::digits; // = p (includes the hidden bit) + constexpr int kBias = std::numeric_limits::max_exponent - 1 + (kPrecision - 1); + constexpr int kMinExp = 1 - kBias; + constexpr std::uint64_t kHiddenBit = std::uint64_t{1} << (kPrecision - 1); // = 2^(p-1) + + using bits_type = typename std::conditional::type; + + const std::uint64_t bits = reinterpret_bits(value); + const std::uint64_t E = bits >> (kPrecision - 1); + const std::uint64_t F = bits & (kHiddenBit - 1); + + const bool is_denormal = E == 0; + const diyfp v = is_denormal + ? diyfp(F, kMinExp) + : diyfp(F + kHiddenBit, static_cast(E) - kBias); + + // Compute the boundaries m- and m+ of the floating-point value + // v = f * 2^e. + // + // Determine v- and v+, the floating-point predecessor and successor if v, + // respectively. + // + // v- = v - 2^e if f != 2^(p-1) or e == e_min (A) + // = v - 2^(e-1) if f == 2^(p-1) and e > e_min (B) + // + // v+ = v + 2^e + // + // Let m- = (v- + v) / 2 and m+ = (v + v+) / 2. All real numbers _strictly_ + // between m- and m+ round to v, regardless of how the input rounding + // algorithm breaks ties. + // + // ---+-------------+-------------+-------------+-------------+--- (A) + // v- m- v m+ v+ + // + // -----------------+------+------+-------------+-------------+--- (B) + // v- m- v m+ v+ + + const bool lower_boundary_is_closer = F == 0 && E > 1; + const diyfp m_plus = diyfp(2 * v.f + 1, v.e - 1); + const diyfp m_minus = lower_boundary_is_closer + ? diyfp(4 * v.f - 1, v.e - 2) // (B) + : diyfp(2 * v.f - 1, v.e - 1); // (A) + + // Determine the normalized w+ = m+. + const diyfp w_plus = diyfp::normalize(m_plus); + + // Determine w- = m- such that e_(w-) = e_(w+). + const diyfp w_minus = diyfp::normalize_to(m_minus, w_plus.e); + + return {diyfp::normalize(v), w_minus, w_plus}; +} + +// Given normalized diyfp w, Grisu needs to find a (normalized) cached +// power-of-ten c, such that the exponent of the product c * w = f * 2^e lies +// within a certain range [alpha, gamma] (Definition 3.2 from [1]) +// +// alpha <= e = e_c + e_w + q <= gamma +// +// or +// +// f_c * f_w * 2^alpha <= f_c 2^(e_c) * f_w 2^(e_w) * 2^q +// <= f_c * f_w * 2^gamma +// +// Since c and w are normalized, i.e. 2^(q-1) <= f < 2^q, this implies +// +// 2^(q-1) * 2^(q-1) * 2^alpha <= c * w * 2^q < 2^q * 2^q * 2^gamma +// +// or +// +// 2^(q - 2 + alpha) <= c * w < 2^(q + gamma) +// +// The choice of (alpha,gamma) determines the size of the table and the form of +// the digit generation procedure. Using (alpha,gamma)=(-60,-32) works out well +// in practice: +// +// The idea is to cut the number c * w = f * 2^e into two parts, which can be +// processed independently: An integral part p1, and a fractional part p2: +// +// f * 2^e = ( (f div 2^-e) * 2^-e + (f mod 2^-e) ) * 2^e +// = (f div 2^-e) + (f mod 2^-e) * 2^e +// = p1 + p2 * 2^e +// +// The conversion of p1 into decimal form requires a series of divisions and +// modulos by (a power of) 10. These operations are faster for 32-bit than for +// 64-bit integers, so p1 should ideally fit into a 32-bit integer. This can be +// achieved by choosing +// +// -e >= 32 or e <= -32 := gamma +// +// In order to convert the fractional part +// +// p2 * 2^e = p2 / 2^-e = d[-1] / 10^1 + d[-2] / 10^2 + ... +// +// into decimal form, the fraction is repeatedly multiplied by 10 and the digits +// d[-i] are extracted in order: +// +// (10 * p2) div 2^-e = d[-1] +// (10 * p2) mod 2^-e = d[-2] / 10^1 + ... +// +// The multiplication by 10 must not overflow. It is sufficient to choose +// +// 10 * p2 < 16 * p2 = 2^4 * p2 <= 2^64. +// +// Since p2 = f mod 2^-e < 2^-e, +// +// -e <= 60 or e >= -60 := alpha + +constexpr int kAlpha = -60; +constexpr int kGamma = -32; + +struct cached_power // c = f * 2^e ~= 10^k +{ + std::uint64_t f; + int e; + int k; +}; + +/*! +For a normalized diyfp w = f * 2^e, this function returns a (normalized) cached +power-of-ten c = f_c * 2^e_c, such that the exponent of the product w * c +satisfies (Definition 3.2 from [1]) + + alpha <= e_c + e + q <= gamma. +*/ +inline cached_power get_cached_power_for_binary_exponent(int e) +{ + // Now + // + // alpha <= e_c + e + q <= gamma (1) + // ==> f_c * 2^alpha <= c * 2^e * 2^q + // + // and since the c's are normalized, 2^(q-1) <= f_c, + // + // ==> 2^(q - 1 + alpha) <= c * 2^(e + q) + // ==> 2^(alpha - e - 1) <= c + // + // If c were an exact power of ten, i.e. c = 10^k, one may determine k as + // + // k = ceil( log_10( 2^(alpha - e - 1) ) ) + // = ceil( (alpha - e - 1) * log_10(2) ) + // + // From the paper: + // "In theory the result of the procedure could be wrong since c is rounded, + // and the computation itself is approximated [...]. In practice, however, + // this simple function is sufficient." + // + // For IEEE double precision floating-point numbers converted into + // normalized diyfp's w = f * 2^e, with q = 64, + // + // e >= -1022 (min IEEE exponent) + // -52 (p - 1) + // -52 (p - 1, possibly normalize denormal IEEE numbers) + // -11 (normalize the diyfp) + // = -1137 + // + // and + // + // e <= +1023 (max IEEE exponent) + // -52 (p - 1) + // -11 (normalize the diyfp) + // = 960 + // + // This binary exponent range [-1137,960] results in a decimal exponent + // range [-307,324]. One does not need to store a cached power for each + // k in this range. For each such k it suffices to find a cached power + // such that the exponent of the product lies in [alpha,gamma]. + // This implies that the difference of the decimal exponents of adjacent + // table entries must be less than or equal to + // + // floor( (gamma - alpha) * log_10(2) ) = 8. + // + // (A smaller distance gamma-alpha would require a larger table.) + + // NB: + // Actually this function returns c, such that -60 <= e_c + e + 64 <= -34. + + constexpr int kCachedPowersMinDecExp = -300; + constexpr int kCachedPowersDecStep = 8; + + static constexpr std::array kCachedPowers = + { + { + { 0xAB70FE17C79AC6CA, -1060, -300 }, + { 0xFF77B1FCBEBCDC4F, -1034, -292 }, + { 0xBE5691EF416BD60C, -1007, -284 }, + { 0x8DD01FAD907FFC3C, -980, -276 }, + { 0xD3515C2831559A83, -954, -268 }, + { 0x9D71AC8FADA6C9B5, -927, -260 }, + { 0xEA9C227723EE8BCB, -901, -252 }, + { 0xAECC49914078536D, -874, -244 }, + { 0x823C12795DB6CE57, -847, -236 }, + { 0xC21094364DFB5637, -821, -228 }, + { 0x9096EA6F3848984F, -794, -220 }, + { 0xD77485CB25823AC7, -768, -212 }, + { 0xA086CFCD97BF97F4, -741, -204 }, + { 0xEF340A98172AACE5, -715, -196 }, + { 0xB23867FB2A35B28E, -688, -188 }, + { 0x84C8D4DFD2C63F3B, -661, -180 }, + { 0xC5DD44271AD3CDBA, -635, -172 }, + { 0x936B9FCEBB25C996, -608, -164 }, + { 0xDBAC6C247D62A584, -582, -156 }, + { 0xA3AB66580D5FDAF6, -555, -148 }, + { 0xF3E2F893DEC3F126, -529, -140 }, + { 0xB5B5ADA8AAFF80B8, -502, -132 }, + { 0x87625F056C7C4A8B, -475, -124 }, + { 0xC9BCFF6034C13053, -449, -116 }, + { 0x964E858C91BA2655, -422, -108 }, + { 0xDFF9772470297EBD, -396, -100 }, + { 0xA6DFBD9FB8E5B88F, -369, -92 }, + { 0xF8A95FCF88747D94, -343, -84 }, + { 0xB94470938FA89BCF, -316, -76 }, + { 0x8A08F0F8BF0F156B, -289, -68 }, + { 0xCDB02555653131B6, -263, -60 }, + { 0x993FE2C6D07B7FAC, -236, -52 }, + { 0xE45C10C42A2B3B06, -210, -44 }, + { 0xAA242499697392D3, -183, -36 }, + { 0xFD87B5F28300CA0E, -157, -28 }, + { 0xBCE5086492111AEB, -130, -20 }, + { 0x8CBCCC096F5088CC, -103, -12 }, + { 0xD1B71758E219652C, -77, -4 }, + { 0x9C40000000000000, -50, 4 }, + { 0xE8D4A51000000000, -24, 12 }, + { 0xAD78EBC5AC620000, 3, 20 }, + { 0x813F3978F8940984, 30, 28 }, + { 0xC097CE7BC90715B3, 56, 36 }, + { 0x8F7E32CE7BEA5C70, 83, 44 }, + { 0xD5D238A4ABE98068, 109, 52 }, + { 0x9F4F2726179A2245, 136, 60 }, + { 0xED63A231D4C4FB27, 162, 68 }, + { 0xB0DE65388CC8ADA8, 189, 76 }, + { 0x83C7088E1AAB65DB, 216, 84 }, + { 0xC45D1DF942711D9A, 242, 92 }, + { 0x924D692CA61BE758, 269, 100 }, + { 0xDA01EE641A708DEA, 295, 108 }, + { 0xA26DA3999AEF774A, 322, 116 }, + { 0xF209787BB47D6B85, 348, 124 }, + { 0xB454E4A179DD1877, 375, 132 }, + { 0x865B86925B9BC5C2, 402, 140 }, + { 0xC83553C5C8965D3D, 428, 148 }, + { 0x952AB45CFA97A0B3, 455, 156 }, + { 0xDE469FBD99A05FE3, 481, 164 }, + { 0xA59BC234DB398C25, 508, 172 }, + { 0xF6C69A72A3989F5C, 534, 180 }, + { 0xB7DCBF5354E9BECE, 561, 188 }, + { 0x88FCF317F22241E2, 588, 196 }, + { 0xCC20CE9BD35C78A5, 614, 204 }, + { 0x98165AF37B2153DF, 641, 212 }, + { 0xE2A0B5DC971F303A, 667, 220 }, + { 0xA8D9D1535CE3B396, 694, 228 }, + { 0xFB9B7CD9A4A7443C, 720, 236 }, + { 0xBB764C4CA7A44410, 747, 244 }, + { 0x8BAB8EEFB6409C1A, 774, 252 }, + { 0xD01FEF10A657842C, 800, 260 }, + { 0x9B10A4E5E9913129, 827, 268 }, + { 0xE7109BFBA19C0C9D, 853, 276 }, + { 0xAC2820D9623BF429, 880, 284 }, + { 0x80444B5E7AA7CF85, 907, 292 }, + { 0xBF21E44003ACDD2D, 933, 300 }, + { 0x8E679C2F5E44FF8F, 960, 308 }, + { 0xD433179D9C8CB841, 986, 316 }, + { 0x9E19DB92B4E31BA9, 1013, 324 }, + } + }; + + // This computation gives exactly the same results for k as + // k = ceil((kAlpha - e - 1) * 0.30102999566398114) + // for |e| <= 1500, but doesn't require floating-point operations. + // NB: log_10(2) ~= 78913 / 2^18 + JSON_ASSERT(e >= -1500); + JSON_ASSERT(e <= 1500); + const int f = kAlpha - e - 1; + const int k = (f * 78913) / (1 << 18) + static_cast(f > 0); + + const int index = (-kCachedPowersMinDecExp + k + (kCachedPowersDecStep - 1)) / kCachedPowersDecStep; + JSON_ASSERT(index >= 0); + JSON_ASSERT(static_cast(index) < kCachedPowers.size()); + + const cached_power cached = kCachedPowers[static_cast(index)]; + JSON_ASSERT(kAlpha <= cached.e + e + 64); + JSON_ASSERT(kGamma >= cached.e + e + 64); + + return cached; +} + +/*! +For n != 0, returns k, such that pow10 := 10^(k-1) <= n < 10^k. +For n == 0, returns 1 and sets pow10 := 1. +*/ +inline int find_largest_pow10(const std::uint32_t n, std::uint32_t& pow10) +{ + // LCOV_EXCL_START + if (n >= 1000000000) + { + pow10 = 1000000000; + return 10; + } + // LCOV_EXCL_STOP + else if (n >= 100000000) + { + pow10 = 100000000; + return 9; + } + else if (n >= 10000000) + { + pow10 = 10000000; + return 8; + } + else if (n >= 1000000) + { + pow10 = 1000000; + return 7; + } + else if (n >= 100000) + { + pow10 = 100000; + return 6; + } + else if (n >= 10000) + { + pow10 = 10000; + return 5; + } + else if (n >= 1000) + { + pow10 = 1000; + return 4; + } + else if (n >= 100) + { + pow10 = 100; + return 3; + } + else if (n >= 10) + { + pow10 = 10; + return 2; + } + else + { + pow10 = 1; + return 1; + } +} + +inline void grisu2_round(char* buf, int len, std::uint64_t dist, std::uint64_t delta, + std::uint64_t rest, std::uint64_t ten_k) +{ + JSON_ASSERT(len >= 1); + JSON_ASSERT(dist <= delta); + JSON_ASSERT(rest <= delta); + JSON_ASSERT(ten_k > 0); + + // <--------------------------- delta ----> + // <---- dist ---------> + // --------------[------------------+-------------------]-------------- + // M- w M+ + // + // ten_k + // <------> + // <---- rest ----> + // --------------[------------------+----+--------------]-------------- + // w V + // = buf * 10^k + // + // ten_k represents a unit-in-the-last-place in the decimal representation + // stored in buf. + // Decrement buf by ten_k while this takes buf closer to w. + + // The tests are written in this order to avoid overflow in unsigned + // integer arithmetic. + + while (rest < dist + && delta - rest >= ten_k + && (rest + ten_k < dist || dist - rest > rest + ten_k - dist)) + { + JSON_ASSERT(buf[len - 1] != '0'); + buf[len - 1]--; + rest += ten_k; + } +} + +/*! +Generates V = buffer * 10^decimal_exponent, such that M- <= V <= M+. +M- and M+ must be normalized and share the same exponent -60 <= e <= -32. +*/ +inline void grisu2_digit_gen(char* buffer, int& length, int& decimal_exponent, + diyfp M_minus, diyfp w, diyfp M_plus) +{ + static_assert(kAlpha >= -60, "internal error"); + static_assert(kGamma <= -32, "internal error"); + + // Generates the digits (and the exponent) of a decimal floating-point + // number V = buffer * 10^decimal_exponent in the range [M-, M+]. The diyfp's + // w, M- and M+ share the same exponent e, which satisfies alpha <= e <= gamma. + // + // <--------------------------- delta ----> + // <---- dist ---------> + // --------------[------------------+-------------------]-------------- + // M- w M+ + // + // Grisu2 generates the digits of M+ from left to right and stops as soon as + // V is in [M-,M+]. + + JSON_ASSERT(M_plus.e >= kAlpha); + JSON_ASSERT(M_plus.e <= kGamma); + + std::uint64_t delta = diyfp::sub(M_plus, M_minus).f; // (significand of (M+ - M-), implicit exponent is e) + std::uint64_t dist = diyfp::sub(M_plus, w ).f; // (significand of (M+ - w ), implicit exponent is e) + + // Split M+ = f * 2^e into two parts p1 and p2 (note: e < 0): + // + // M+ = f * 2^e + // = ((f div 2^-e) * 2^-e + (f mod 2^-e)) * 2^e + // = ((p1 ) * 2^-e + (p2 )) * 2^e + // = p1 + p2 * 2^e + + const diyfp one(std::uint64_t{1} << -M_plus.e, M_plus.e); + + auto p1 = static_cast(M_plus.f >> -one.e); // p1 = f div 2^-e (Since -e >= 32, p1 fits into a 32-bit int.) + std::uint64_t p2 = M_plus.f & (one.f - 1); // p2 = f mod 2^-e + + // 1) + // + // Generate the digits of the integral part p1 = d[n-1]...d[1]d[0] + + JSON_ASSERT(p1 > 0); + + std::uint32_t pow10; + const int k = find_largest_pow10(p1, pow10); + + // 10^(k-1) <= p1 < 10^k, pow10 = 10^(k-1) + // + // p1 = (p1 div 10^(k-1)) * 10^(k-1) + (p1 mod 10^(k-1)) + // = (d[k-1] ) * 10^(k-1) + (p1 mod 10^(k-1)) + // + // M+ = p1 + p2 * 2^e + // = d[k-1] * 10^(k-1) + (p1 mod 10^(k-1)) + p2 * 2^e + // = d[k-1] * 10^(k-1) + ((p1 mod 10^(k-1)) * 2^-e + p2) * 2^e + // = d[k-1] * 10^(k-1) + ( rest) * 2^e + // + // Now generate the digits d[n] of p1 from left to right (n = k-1,...,0) + // + // p1 = d[k-1]...d[n] * 10^n + d[n-1]...d[0] + // + // but stop as soon as + // + // rest * 2^e = (d[n-1]...d[0] * 2^-e + p2) * 2^e <= delta * 2^e + + int n = k; + while (n > 0) + { + // Invariants: + // M+ = buffer * 10^n + (p1 + p2 * 2^e) (buffer = 0 for n = k) + // pow10 = 10^(n-1) <= p1 < 10^n + // + const std::uint32_t d = p1 / pow10; // d = p1 div 10^(n-1) + const std::uint32_t r = p1 % pow10; // r = p1 mod 10^(n-1) + // + // M+ = buffer * 10^n + (d * 10^(n-1) + r) + p2 * 2^e + // = (buffer * 10 + d) * 10^(n-1) + (r + p2 * 2^e) + // + JSON_ASSERT(d <= 9); + buffer[length++] = static_cast('0' + d); // buffer := buffer * 10 + d + // + // M+ = buffer * 10^(n-1) + (r + p2 * 2^e) + // + p1 = r; + n--; + // + // M+ = buffer * 10^n + (p1 + p2 * 2^e) + // pow10 = 10^n + // + + // Now check if enough digits have been generated. + // Compute + // + // p1 + p2 * 2^e = (p1 * 2^-e + p2) * 2^e = rest * 2^e + // + // Note: + // Since rest and delta share the same exponent e, it suffices to + // compare the significands. + const std::uint64_t rest = (std::uint64_t{p1} << -one.e) + p2; + if (rest <= delta) + { + // V = buffer * 10^n, with M- <= V <= M+. + + decimal_exponent += n; + + // We may now just stop. But instead look if the buffer could be + // decremented to bring V closer to w. + // + // pow10 = 10^n is now 1 ulp in the decimal representation V. + // The rounding procedure works with diyfp's with an implicit + // exponent of e. + // + // 10^n = (10^n * 2^-e) * 2^e = ulp * 2^e + // + const std::uint64_t ten_n = std::uint64_t{pow10} << -one.e; + grisu2_round(buffer, length, dist, delta, rest, ten_n); + + return; + } + + pow10 /= 10; + // + // pow10 = 10^(n-1) <= p1 < 10^n + // Invariants restored. + } + + // 2) + // + // The digits of the integral part have been generated: + // + // M+ = d[k-1]...d[1]d[0] + p2 * 2^e + // = buffer + p2 * 2^e + // + // Now generate the digits of the fractional part p2 * 2^e. + // + // Note: + // No decimal point is generated: the exponent is adjusted instead. + // + // p2 actually represents the fraction + // + // p2 * 2^e + // = p2 / 2^-e + // = d[-1] / 10^1 + d[-2] / 10^2 + ... + // + // Now generate the digits d[-m] of p1 from left to right (m = 1,2,...) + // + // p2 * 2^e = d[-1]d[-2]...d[-m] * 10^-m + // + 10^-m * (d[-m-1] / 10^1 + d[-m-2] / 10^2 + ...) + // + // using + // + // 10^m * p2 = ((10^m * p2) div 2^-e) * 2^-e + ((10^m * p2) mod 2^-e) + // = ( d) * 2^-e + ( r) + // + // or + // 10^m * p2 * 2^e = d + r * 2^e + // + // i.e. + // + // M+ = buffer + p2 * 2^e + // = buffer + 10^-m * (d + r * 2^e) + // = (buffer * 10^m + d) * 10^-m + 10^-m * r * 2^e + // + // and stop as soon as 10^-m * r * 2^e <= delta * 2^e + + JSON_ASSERT(p2 > delta); + + int m = 0; + for (;;) + { + // Invariant: + // M+ = buffer * 10^-m + 10^-m * (d[-m-1] / 10 + d[-m-2] / 10^2 + ...) * 2^e + // = buffer * 10^-m + 10^-m * (p2 ) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * (10 * p2) ) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * ((10*p2 div 2^-e) * 2^-e + (10*p2 mod 2^-e)) * 2^e + // + JSON_ASSERT(p2 <= (std::numeric_limits::max)() / 10); + p2 *= 10; + const std::uint64_t d = p2 >> -one.e; // d = (10 * p2) div 2^-e + const std::uint64_t r = p2 & (one.f - 1); // r = (10 * p2) mod 2^-e + // + // M+ = buffer * 10^-m + 10^-m * (1/10 * (d * 2^-e + r) * 2^e + // = buffer * 10^-m + 10^-m * (1/10 * (d + r * 2^e)) + // = (buffer * 10 + d) * 10^(-m-1) + 10^(-m-1) * r * 2^e + // + JSON_ASSERT(d <= 9); + buffer[length++] = static_cast('0' + d); // buffer := buffer * 10 + d + // + // M+ = buffer * 10^(-m-1) + 10^(-m-1) * r * 2^e + // + p2 = r; + m++; + // + // M+ = buffer * 10^-m + 10^-m * p2 * 2^e + // Invariant restored. + + // Check if enough digits have been generated. + // + // 10^-m * p2 * 2^e <= delta * 2^e + // p2 * 2^e <= 10^m * delta * 2^e + // p2 <= 10^m * delta + delta *= 10; + dist *= 10; + if (p2 <= delta) + { + break; + } + } + + // V = buffer * 10^-m, with M- <= V <= M+. + + decimal_exponent -= m; + + // 1 ulp in the decimal representation is now 10^-m. + // Since delta and dist are now scaled by 10^m, we need to do the + // same with ulp in order to keep the units in sync. + // + // 10^m * 10^-m = 1 = 2^-e * 2^e = ten_m * 2^e + // + const std::uint64_t ten_m = one.f; + grisu2_round(buffer, length, dist, delta, p2, ten_m); + + // By construction this algorithm generates the shortest possible decimal + // number (Loitsch, Theorem 6.2) which rounds back to w. + // For an input number of precision p, at least + // + // N = 1 + ceil(p * log_10(2)) + // + // decimal digits are sufficient to identify all binary floating-point + // numbers (Matula, "In-and-Out conversions"). + // This implies that the algorithm does not produce more than N decimal + // digits. + // + // N = 17 for p = 53 (IEEE double precision) + // N = 9 for p = 24 (IEEE single precision) +} + +/*! +v = buf * 10^decimal_exponent +len is the length of the buffer (number of decimal digits) +The buffer must be large enough, i.e. >= max_digits10. +*/ +JSON_HEDLEY_NON_NULL(1) +inline void grisu2(char* buf, int& len, int& decimal_exponent, + diyfp m_minus, diyfp v, diyfp m_plus) +{ + JSON_ASSERT(m_plus.e == m_minus.e); + JSON_ASSERT(m_plus.e == v.e); + + // --------(-----------------------+-----------------------)-------- (A) + // m- v m+ + // + // --------------------(-----------+-----------------------)-------- (B) + // m- v m+ + // + // First scale v (and m- and m+) such that the exponent is in the range + // [alpha, gamma]. + + const cached_power cached = get_cached_power_for_binary_exponent(m_plus.e); + + const diyfp c_minus_k(cached.f, cached.e); // = c ~= 10^-k + + // The exponent of the products is = v.e + c_minus_k.e + q and is in the range [alpha,gamma] + const diyfp w = diyfp::mul(v, c_minus_k); + const diyfp w_minus = diyfp::mul(m_minus, c_minus_k); + const diyfp w_plus = diyfp::mul(m_plus, c_minus_k); + + // ----(---+---)---------------(---+---)---------------(---+---)---- + // w- w w+ + // = c*m- = c*v = c*m+ + // + // diyfp::mul rounds its result and c_minus_k is approximated too. w, w- and + // w+ are now off by a small amount. + // In fact: + // + // w - v * 10^k < 1 ulp + // + // To account for this inaccuracy, add resp. subtract 1 ulp. + // + // --------+---[---------------(---+---)---------------]---+-------- + // w- M- w M+ w+ + // + // Now any number in [M-, M+] (bounds included) will round to w when input, + // regardless of how the input rounding algorithm breaks ties. + // + // And digit_gen generates the shortest possible such number in [M-, M+]. + // Note that this does not mean that Grisu2 always generates the shortest + // possible number in the interval (m-, m+). + const diyfp M_minus(w_minus.f + 1, w_minus.e); + const diyfp M_plus (w_plus.f - 1, w_plus.e ); + + decimal_exponent = -cached.k; // = -(-k) = k + + grisu2_digit_gen(buf, len, decimal_exponent, M_minus, w, M_plus); +} + +/*! +v = buf * 10^decimal_exponent +len is the length of the buffer (number of decimal digits) +The buffer must be large enough, i.e. >= max_digits10. +*/ +template +JSON_HEDLEY_NON_NULL(1) +void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value) +{ + static_assert(diyfp::kPrecision >= std::numeric_limits::digits + 3, + "internal error: not enough precision"); + + JSON_ASSERT(std::isfinite(value)); + JSON_ASSERT(value > 0); + + // If the neighbors (and boundaries) of 'value' are always computed for double-precision + // numbers, all float's can be recovered using strtod (and strtof). However, the resulting + // decimal representations are not exactly "short". + // + // The documentation for 'std::to_chars' (https://en.cppreference.com/w/cpp/utility/to_chars) + // says "value is converted to a string as if by std::sprintf in the default ("C") locale" + // and since sprintf promotes float's to double's, I think this is exactly what 'std::to_chars' + // does. + // On the other hand, the documentation for 'std::to_chars' requires that "parsing the + // representation using the corresponding std::from_chars function recovers value exactly". That + // indicates that single precision floating-point numbers should be recovered using + // 'std::strtof'. + // + // NB: If the neighbors are computed for single-precision numbers, there is a single float + // (7.0385307e-26f) which can't be recovered using strtod. The resulting double precision + // value is off by 1 ulp. +#if 0 + const boundaries w = compute_boundaries(static_cast(value)); +#else + const boundaries w = compute_boundaries(value); +#endif + + grisu2(buf, len, decimal_exponent, w.minus, w.w, w.plus); +} + +/*! +@brief appends a decimal representation of e to buf +@return a pointer to the element following the exponent. +@pre -1000 < e < 1000 +*/ +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL +inline char* append_exponent(char* buf, int e) +{ + JSON_ASSERT(e > -1000); + JSON_ASSERT(e < 1000); + + if (e < 0) + { + e = -e; + *buf++ = '-'; + } + else + { + *buf++ = '+'; + } + + auto k = static_cast(e); + if (k < 10) + { + // Always print at least two digits in the exponent. + // This is for compatibility with printf("%g"). + *buf++ = '0'; + *buf++ = static_cast('0' + k); + } + else if (k < 100) + { + *buf++ = static_cast('0' + k / 10); + k %= 10; + *buf++ = static_cast('0' + k); + } + else + { + *buf++ = static_cast('0' + k / 100); + k %= 100; + *buf++ = static_cast('0' + k / 10); + k %= 10; + *buf++ = static_cast('0' + k); + } + + return buf; +} + +/*! +@brief prettify v = buf * 10^decimal_exponent + +If v is in the range [10^min_exp, 10^max_exp) it will be printed in fixed-point +notation. Otherwise it will be printed in exponential notation. + +@pre min_exp < 0 +@pre max_exp > 0 +*/ +JSON_HEDLEY_NON_NULL(1) +JSON_HEDLEY_RETURNS_NON_NULL +inline char* format_buffer(char* buf, int len, int decimal_exponent, + int min_exp, int max_exp) +{ + JSON_ASSERT(min_exp < 0); + JSON_ASSERT(max_exp > 0); + + const int k = len; + const int n = len + decimal_exponent; + + // v = buf * 10^(n-k) + // k is the length of the buffer (number of decimal digits) + // n is the position of the decimal point relative to the start of the buffer. + + if (k <= n && n <= max_exp) + { + // digits[000] + // len <= max_exp + 2 + + std::memset(buf + k, '0', static_cast(n) - static_cast(k)); + // Make it look like a floating-point number (#362, #378) + buf[n + 0] = '.'; + buf[n + 1] = '0'; + return buf + (static_cast(n) + 2); + } + + if (0 < n && n <= max_exp) + { + // dig.its + // len <= max_digits10 + 1 + + JSON_ASSERT(k > n); + + std::memmove(buf + (static_cast(n) + 1), buf + n, static_cast(k) - static_cast(n)); + buf[n] = '.'; + return buf + (static_cast(k) + 1U); + } + + if (min_exp < n && n <= 0) + { + // 0.[000]digits + // len <= 2 + (-min_exp - 1) + max_digits10 + + std::memmove(buf + (2 + static_cast(-n)), buf, static_cast(k)); + buf[0] = '0'; + buf[1] = '.'; + std::memset(buf + 2, '0', static_cast(-n)); + return buf + (2U + static_cast(-n) + static_cast(k)); + } + + if (k == 1) + { + // dE+123 + // len <= 1 + 5 + + buf += 1; + } + else + { + // d.igitsE+123 + // len <= max_digits10 + 1 + 5 + + std::memmove(buf + 2, buf + 1, static_cast(k) - 1); + buf[1] = '.'; + buf += 1 + static_cast(k); + } + + *buf++ = 'e'; + return append_exponent(buf, n - 1); +} + +} // namespace dtoa_impl + +/*! +@brief generates a decimal representation of the floating-point number value in [first, last). + +The format of the resulting decimal representation is similar to printf's %g +format. Returns an iterator pointing past-the-end of the decimal representation. + +@note The input number must be finite, i.e. NaN's and Inf's are not supported. +@note The buffer must be large enough. +@note The result is NOT null-terminated. +*/ +template +JSON_HEDLEY_NON_NULL(1, 2) +JSON_HEDLEY_RETURNS_NON_NULL +char* to_chars(char* first, const char* last, FloatType value) +{ + static_cast(last); // maybe unused - fix warning + JSON_ASSERT(std::isfinite(value)); + + // Use signbit(value) instead of (value < 0) since signbit works for -0. + if (std::signbit(value)) + { + value = -value; + *first++ = '-'; + } + + if (value == 0) // +-0 + { + *first++ = '0'; + // Make it look like a floating-point number (#362, #378) + *first++ = '.'; + *first++ = '0'; + return first; + } + + JSON_ASSERT(last - first >= std::numeric_limits::max_digits10); + + // Compute v = buffer * 10^decimal_exponent. + // The decimal digits are stored in the buffer, which needs to be interpreted + // as an unsigned decimal integer. + // len is the length of the buffer, i.e. the number of decimal digits. + int len = 0; + int decimal_exponent = 0; + dtoa_impl::grisu2(first, len, decimal_exponent, value); + + JSON_ASSERT(len <= std::numeric_limits::max_digits10); + + // Format the buffer like printf("%.*g", prec, value) + constexpr int kMinExp = -4; + // Use digits10 here to increase compatibility with version 2. + constexpr int kMaxExp = std::numeric_limits::digits10; + + JSON_ASSERT(last - first >= kMaxExp + 2); + JSON_ASSERT(last - first >= 2 + (-kMinExp - 1) + std::numeric_limits::max_digits10); + JSON_ASSERT(last - first >= std::numeric_limits::max_digits10 + 6); + + return dtoa_impl::format_buffer(first, len, decimal_exponent, kMinExp, kMaxExp); +} + +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + +// #include + +// #include + +// #include + + +namespace nlohmann +{ +namespace detail +{ +/////////////////// +// serialization // +/////////////////// + +/// how to treat decoding errors +enum class error_handler_t +{ + strict, ///< throw a type_error exception in case of invalid UTF-8 + replace, ///< replace invalid UTF-8 sequences with U+FFFD + ignore ///< ignore invalid UTF-8 sequences +}; + +template +class serializer +{ + using string_t = typename BasicJsonType::string_t; + using number_float_t = typename BasicJsonType::number_float_t; + using number_integer_t = typename BasicJsonType::number_integer_t; + using number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using binary_char_t = typename BasicJsonType::binary_t::value_type; + static constexpr std::uint8_t UTF8_ACCEPT = 0; + static constexpr std::uint8_t UTF8_REJECT = 1; + + public: + /*! + @param[in] s output stream to serialize to + @param[in] ichar indentation character to use + @param[in] error_handler_ how to react on decoding errors + */ + serializer(output_adapter_t s, const char ichar, + error_handler_t error_handler_ = error_handler_t::strict) + : o(std::move(s)) + , loc(std::localeconv()) + , thousands_sep(loc->thousands_sep == nullptr ? '\0' : std::char_traits::to_char_type(* (loc->thousands_sep))) + , decimal_point(loc->decimal_point == nullptr ? '\0' : std::char_traits::to_char_type(* (loc->decimal_point))) + , indent_char(ichar) + , indent_string(512, indent_char) + , error_handler(error_handler_) + {} + + // delete because of pointer members + serializer(const serializer&) = delete; + serializer& operator=(const serializer&) = delete; + serializer(serializer&&) = delete; + serializer& operator=(serializer&&) = delete; + ~serializer() = default; + + /*! + @brief internal implementation of the serialization function + + This function is called by the public member function dump and organizes + the serialization internally. The indentation level is propagated as + additional parameter. In case of arrays and objects, the function is + called recursively. + + - strings and object keys are escaped using `escape_string()` + - integer numbers are converted implicitly via `operator<<` + - floating-point numbers are converted to a string using `"%g"` format + - binary values are serialized as objects containing the subtype and the + byte array + + @param[in] val value to serialize + @param[in] pretty_print whether the output shall be pretty-printed + @param[in] ensure_ascii If @a ensure_ascii is true, all non-ASCII characters + in the output are escaped with `\uXXXX` sequences, and the result consists + of ASCII characters only. + @param[in] indent_step the indent level + @param[in] current_indent the current indent level (only used internally) + */ + void dump(const BasicJsonType& val, + const bool pretty_print, + const bool ensure_ascii, + const unsigned int indent_step, + const unsigned int current_indent = 0) + { + switch (val.m_type) + { + case value_t::object: + { + if (val.m_value.object->empty()) + { + o->write_characters("{}", 2); + return; + } + + if (pretty_print) + { + o->write_characters("{\n", 2); + + // variable to hold indentation for recursive calls + const auto new_indent = current_indent + indent_step; + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + { + indent_string.resize(indent_string.size() * 2, ' '); + } + + // first n-1 elements + auto i = val.m_value.object->cbegin(); + for (std::size_t cnt = 0; cnt < val.m_value.object->size() - 1; ++cnt, ++i) + { + o->write_characters(indent_string.c_str(), new_indent); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\": ", 3); + dump(i->second, true, ensure_ascii, indent_step, new_indent); + o->write_characters(",\n", 2); + } + + // last element + JSON_ASSERT(i != val.m_value.object->cend()); + JSON_ASSERT(std::next(i) == val.m_value.object->cend()); + o->write_characters(indent_string.c_str(), new_indent); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\": ", 3); + dump(i->second, true, ensure_ascii, indent_step, new_indent); + + o->write_character('\n'); + o->write_characters(indent_string.c_str(), current_indent); + o->write_character('}'); + } + else + { + o->write_character('{'); + + // first n-1 elements + auto i = val.m_value.object->cbegin(); + for (std::size_t cnt = 0; cnt < val.m_value.object->size() - 1; ++cnt, ++i) + { + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\":", 2); + dump(i->second, false, ensure_ascii, indent_step, current_indent); + o->write_character(','); + } + + // last element + JSON_ASSERT(i != val.m_value.object->cend()); + JSON_ASSERT(std::next(i) == val.m_value.object->cend()); + o->write_character('\"'); + dump_escaped(i->first, ensure_ascii); + o->write_characters("\":", 2); + dump(i->second, false, ensure_ascii, indent_step, current_indent); + + o->write_character('}'); + } + + return; + } + + case value_t::array: + { + if (val.m_value.array->empty()) + { + o->write_characters("[]", 2); + return; + } + + if (pretty_print) + { + o->write_characters("[\n", 2); + + // variable to hold indentation for recursive calls + const auto new_indent = current_indent + indent_step; + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + { + indent_string.resize(indent_string.size() * 2, ' '); + } + + // first n-1 elements + for (auto i = val.m_value.array->cbegin(); + i != val.m_value.array->cend() - 1; ++i) + { + o->write_characters(indent_string.c_str(), new_indent); + dump(*i, true, ensure_ascii, indent_step, new_indent); + o->write_characters(",\n", 2); + } + + // last element + JSON_ASSERT(!val.m_value.array->empty()); + o->write_characters(indent_string.c_str(), new_indent); + dump(val.m_value.array->back(), true, ensure_ascii, indent_step, new_indent); + + o->write_character('\n'); + o->write_characters(indent_string.c_str(), current_indent); + o->write_character(']'); + } + else + { + o->write_character('['); + + // first n-1 elements + for (auto i = val.m_value.array->cbegin(); + i != val.m_value.array->cend() - 1; ++i) + { + dump(*i, false, ensure_ascii, indent_step, current_indent); + o->write_character(','); + } + + // last element + JSON_ASSERT(!val.m_value.array->empty()); + dump(val.m_value.array->back(), false, ensure_ascii, indent_step, current_indent); + + o->write_character(']'); + } + + return; + } + + case value_t::string: + { + o->write_character('\"'); + dump_escaped(*val.m_value.string, ensure_ascii); + o->write_character('\"'); + return; + } + + case value_t::binary: + { + if (pretty_print) + { + o->write_characters("{\n", 2); + + // variable to hold indentation for recursive calls + const auto new_indent = current_indent + indent_step; + if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent)) + { + indent_string.resize(indent_string.size() * 2, ' '); + } + + o->write_characters(indent_string.c_str(), new_indent); + + o->write_characters("\"bytes\": [", 10); + + if (!val.m_value.binary->empty()) + { + for (auto i = val.m_value.binary->cbegin(); + i != val.m_value.binary->cend() - 1; ++i) + { + dump_integer(*i); + o->write_characters(", ", 2); + } + dump_integer(val.m_value.binary->back()); + } + + o->write_characters("],\n", 3); + o->write_characters(indent_string.c_str(), new_indent); + + o->write_characters("\"subtype\": ", 11); + if (val.m_value.binary->has_subtype()) + { + dump_integer(val.m_value.binary->subtype()); + } + else + { + o->write_characters("null", 4); + } + o->write_character('\n'); + o->write_characters(indent_string.c_str(), current_indent); + o->write_character('}'); + } + else + { + o->write_characters("{\"bytes\":[", 10); + + if (!val.m_value.binary->empty()) + { + for (auto i = val.m_value.binary->cbegin(); + i != val.m_value.binary->cend() - 1; ++i) + { + dump_integer(*i); + o->write_character(','); + } + dump_integer(val.m_value.binary->back()); + } + + o->write_characters("],\"subtype\":", 12); + if (val.m_value.binary->has_subtype()) + { + dump_integer(val.m_value.binary->subtype()); + o->write_character('}'); + } + else + { + o->write_characters("null}", 5); + } + } + return; + } + + case value_t::boolean: + { + if (val.m_value.boolean) + { + o->write_characters("true", 4); + } + else + { + o->write_characters("false", 5); + } + return; + } + + case value_t::number_integer: + { + dump_integer(val.m_value.number_integer); + return; + } + + case value_t::number_unsigned: + { + dump_integer(val.m_value.number_unsigned); + return; + } + + case value_t::number_float: + { + dump_float(val.m_value.number_float); + return; + } + + case value_t::discarded: + { + o->write_characters("", 11); + return; + } + + case value_t::null: + { + o->write_characters("null", 4); + return; + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + } + + private: + /*! + @brief dump escaped string + + Escape a string by replacing certain special characters by a sequence of an + escape character (backslash) and another character and other control + characters by a sequence of "\u" followed by a four-digit hex + representation. The escaped string is written to output stream @a o. + + @param[in] s the string to escape + @param[in] ensure_ascii whether to escape non-ASCII characters with + \uXXXX sequences + + @complexity Linear in the length of string @a s. + */ + void dump_escaped(const string_t& s, const bool ensure_ascii) + { + std::uint32_t codepoint; + std::uint8_t state = UTF8_ACCEPT; + std::size_t bytes = 0; // number of bytes written to string_buffer + + // number of bytes written at the point of the last valid byte + std::size_t bytes_after_last_accept = 0; + std::size_t undumped_chars = 0; + + for (std::size_t i = 0; i < s.size(); ++i) + { + const auto byte = static_cast(s[i]); + + switch (decode(state, codepoint, byte)) + { + case UTF8_ACCEPT: // decode found a new code point + { + switch (codepoint) + { + case 0x08: // backspace + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'b'; + break; + } + + case 0x09: // horizontal tab + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 't'; + break; + } + + case 0x0A: // newline + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'n'; + break; + } + + case 0x0C: // formfeed + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'f'; + break; + } + + case 0x0D: // carriage return + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'r'; + break; + } + + case 0x22: // quotation mark + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = '\"'; + break; + } + + case 0x5C: // reverse solidus + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = '\\'; + break; + } + + default: + { + // escape control characters (0x00..0x1F) or, if + // ensure_ascii parameter is used, non-ASCII characters + if ((codepoint <= 0x1F) || (ensure_ascii && (codepoint >= 0x7F))) + { + if (codepoint <= 0xFFFF) + { + (std::snprintf)(string_buffer.data() + bytes, 7, "\\u%04x", + static_cast(codepoint)); + bytes += 6; + } + else + { + (std::snprintf)(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x", + static_cast(0xD7C0u + (codepoint >> 10u)), + static_cast(0xDC00u + (codepoint & 0x3FFu))); + bytes += 12; + } + } + else + { + // copy byte to buffer (all previous bytes + // been copied have in default case above) + string_buffer[bytes++] = s[i]; + } + break; + } + } + + // write buffer and reset index; there must be 13 bytes + // left, as this is the maximal number of bytes to be + // written ("\uxxxx\uxxxx\0") for one code point + if (string_buffer.size() - bytes < 13) + { + o->write_characters(string_buffer.data(), bytes); + bytes = 0; + } + + // remember the byte position of this accept + bytes_after_last_accept = bytes; + undumped_chars = 0; + break; + } + + case UTF8_REJECT: // decode found invalid UTF-8 byte + { + switch (error_handler) + { + case error_handler_t::strict: + { + std::string sn(3, '\0'); + (std::snprintf)(&sn[0], sn.size(), "%.2X", byte); + JSON_THROW(type_error::create(316, "invalid UTF-8 byte at index " + std::to_string(i) + ": 0x" + sn)); + } + + case error_handler_t::ignore: + case error_handler_t::replace: + { + // in case we saw this character the first time, we + // would like to read it again, because the byte + // may be OK for itself, but just not OK for the + // previous sequence + if (undumped_chars > 0) + { + --i; + } + + // reset length buffer to the last accepted index; + // thus removing/ignoring the invalid characters + bytes = bytes_after_last_accept; + + if (error_handler == error_handler_t::replace) + { + // add a replacement character + if (ensure_ascii) + { + string_buffer[bytes++] = '\\'; + string_buffer[bytes++] = 'u'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'f'; + string_buffer[bytes++] = 'd'; + } + else + { + string_buffer[bytes++] = detail::binary_writer::to_char_type('\xEF'); + string_buffer[bytes++] = detail::binary_writer::to_char_type('\xBF'); + string_buffer[bytes++] = detail::binary_writer::to_char_type('\xBD'); + } + + // write buffer and reset index; there must be 13 bytes + // left, as this is the maximal number of bytes to be + // written ("\uxxxx\uxxxx\0") for one code point + if (string_buffer.size() - bytes < 13) + { + o->write_characters(string_buffer.data(), bytes); + bytes = 0; + } + + bytes_after_last_accept = bytes; + } + + undumped_chars = 0; + + // continue processing the string + state = UTF8_ACCEPT; + break; + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + break; + } + + default: // decode found yet incomplete multi-byte code point + { + if (!ensure_ascii) + { + // code point will not be escaped - copy byte to buffer + string_buffer[bytes++] = s[i]; + } + ++undumped_chars; + break; + } + } + } + + // we finished processing the string + if (JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT)) + { + // write buffer + if (bytes > 0) + { + o->write_characters(string_buffer.data(), bytes); + } + } + else + { + // we finish reading, but do not accept: string was incomplete + switch (error_handler) + { + case error_handler_t::strict: + { + std::string sn(3, '\0'); + (std::snprintf)(&sn[0], sn.size(), "%.2X", static_cast(s.back())); + JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + sn)); + } + + case error_handler_t::ignore: + { + // write all accepted bytes + o->write_characters(string_buffer.data(), bytes_after_last_accept); + break; + } + + case error_handler_t::replace: + { + // write all accepted bytes + o->write_characters(string_buffer.data(), bytes_after_last_accept); + // add a replacement character + if (ensure_ascii) + { + o->write_characters("\\ufffd", 6); + } + else + { + o->write_characters("\xEF\xBF\xBD", 3); + } + break; + } + + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + } + } + + /*! + @brief count digits + + Count the number of decimal (base 10) digits for an input unsigned integer. + + @param[in] x unsigned integer number to count its digits + @return number of decimal digits + */ + inline unsigned int count_digits(number_unsigned_t x) noexcept + { + unsigned int n_digits = 1; + for (;;) + { + if (x < 10) + { + return n_digits; + } + if (x < 100) + { + return n_digits + 1; + } + if (x < 1000) + { + return n_digits + 2; + } + if (x < 10000) + { + return n_digits + 3; + } + x = x / 10000u; + n_digits += 4; + } + } + + /*! + @brief dump an integer + + Dump a given integer to output stream @a o. Works internally with + @a number_buffer. + + @param[in] x integer number (signed or unsigned) to dump + @tparam NumberType either @a number_integer_t or @a number_unsigned_t + */ + template < typename NumberType, detail::enable_if_t < + std::is_same::value || + std::is_same::value || + std::is_same::value, + int > = 0 > + void dump_integer(NumberType x) + { + static constexpr std::array, 100> digits_to_99 + { + { + {{'0', '0'}}, {{'0', '1'}}, {{'0', '2'}}, {{'0', '3'}}, {{'0', '4'}}, {{'0', '5'}}, {{'0', '6'}}, {{'0', '7'}}, {{'0', '8'}}, {{'0', '9'}}, + {{'1', '0'}}, {{'1', '1'}}, {{'1', '2'}}, {{'1', '3'}}, {{'1', '4'}}, {{'1', '5'}}, {{'1', '6'}}, {{'1', '7'}}, {{'1', '8'}}, {{'1', '9'}}, + {{'2', '0'}}, {{'2', '1'}}, {{'2', '2'}}, {{'2', '3'}}, {{'2', '4'}}, {{'2', '5'}}, {{'2', '6'}}, {{'2', '7'}}, {{'2', '8'}}, {{'2', '9'}}, + {{'3', '0'}}, {{'3', '1'}}, {{'3', '2'}}, {{'3', '3'}}, {{'3', '4'}}, {{'3', '5'}}, {{'3', '6'}}, {{'3', '7'}}, {{'3', '8'}}, {{'3', '9'}}, + {{'4', '0'}}, {{'4', '1'}}, {{'4', '2'}}, {{'4', '3'}}, {{'4', '4'}}, {{'4', '5'}}, {{'4', '6'}}, {{'4', '7'}}, {{'4', '8'}}, {{'4', '9'}}, + {{'5', '0'}}, {{'5', '1'}}, {{'5', '2'}}, {{'5', '3'}}, {{'5', '4'}}, {{'5', '5'}}, {{'5', '6'}}, {{'5', '7'}}, {{'5', '8'}}, {{'5', '9'}}, + {{'6', '0'}}, {{'6', '1'}}, {{'6', '2'}}, {{'6', '3'}}, {{'6', '4'}}, {{'6', '5'}}, {{'6', '6'}}, {{'6', '7'}}, {{'6', '8'}}, {{'6', '9'}}, + {{'7', '0'}}, {{'7', '1'}}, {{'7', '2'}}, {{'7', '3'}}, {{'7', '4'}}, {{'7', '5'}}, {{'7', '6'}}, {{'7', '7'}}, {{'7', '8'}}, {{'7', '9'}}, + {{'8', '0'}}, {{'8', '1'}}, {{'8', '2'}}, {{'8', '3'}}, {{'8', '4'}}, {{'8', '5'}}, {{'8', '6'}}, {{'8', '7'}}, {{'8', '8'}}, {{'8', '9'}}, + {{'9', '0'}}, {{'9', '1'}}, {{'9', '2'}}, {{'9', '3'}}, {{'9', '4'}}, {{'9', '5'}}, {{'9', '6'}}, {{'9', '7'}}, {{'9', '8'}}, {{'9', '9'}}, + } + }; + + // special case for "0" + if (x == 0) + { + o->write_character('0'); + return; + } + + // use a pointer to fill the buffer + auto buffer_ptr = number_buffer.begin(); + + const bool is_negative = std::is_same::value && !(x >= 0); // see issue #755 + number_unsigned_t abs_value; + + unsigned int n_chars; + + if (is_negative) + { + *buffer_ptr = '-'; + abs_value = remove_sign(static_cast(x)); + + // account one more byte for the minus sign + n_chars = 1 + count_digits(abs_value); + } + else + { + abs_value = static_cast(x); + n_chars = count_digits(abs_value); + } + + // spare 1 byte for '\0' + JSON_ASSERT(n_chars < number_buffer.size() - 1); + + // jump to the end to generate the string from backward + // so we later avoid reversing the result + buffer_ptr += n_chars; + + // Fast int2ascii implementation inspired by "Fastware" talk by Andrei Alexandrescu + // See: https://www.youtube.com/watch?v=o4-CwDo2zpg + while (abs_value >= 100) + { + const auto digits_index = static_cast((abs_value % 100)); + abs_value /= 100; + *(--buffer_ptr) = digits_to_99[digits_index][1]; + *(--buffer_ptr) = digits_to_99[digits_index][0]; + } + + if (abs_value >= 10) + { + const auto digits_index = static_cast(abs_value); + *(--buffer_ptr) = digits_to_99[digits_index][1]; + *(--buffer_ptr) = digits_to_99[digits_index][0]; + } + else + { + *(--buffer_ptr) = static_cast('0' + abs_value); + } + + o->write_characters(number_buffer.data(), n_chars); + } + + /*! + @brief dump a floating-point number + + Dump a given floating-point number to output stream @a o. Works internally + with @a number_buffer. + + @param[in] x floating-point number to dump + */ + void dump_float(number_float_t x) + { + // NaN / inf + if (!std::isfinite(x)) + { + o->write_characters("null", 4); + return; + } + + // If number_float_t is an IEEE-754 single or double precision number, + // use the Grisu2 algorithm to produce short numbers which are + // guaranteed to round-trip, using strtof and strtod, resp. + // + // NB: The test below works if == . + static constexpr bool is_ieee_single_or_double + = (std::numeric_limits::is_iec559 && std::numeric_limits::digits == 24 && std::numeric_limits::max_exponent == 128) || + (std::numeric_limits::is_iec559 && std::numeric_limits::digits == 53 && std::numeric_limits::max_exponent == 1024); + + dump_float(x, std::integral_constant()); + } + + void dump_float(number_float_t x, std::true_type /*is_ieee_single_or_double*/) + { + char* begin = number_buffer.data(); + char* end = ::nlohmann::detail::to_chars(begin, begin + number_buffer.size(), x); + + o->write_characters(begin, static_cast(end - begin)); + } + + void dump_float(number_float_t x, std::false_type /*is_ieee_single_or_double*/) + { + // get number of digits for a float -> text -> float round-trip + static constexpr auto d = std::numeric_limits::max_digits10; + + // the actual conversion + std::ptrdiff_t len = (std::snprintf)(number_buffer.data(), number_buffer.size(), "%.*g", d, x); + + // negative value indicates an error + JSON_ASSERT(len > 0); + // check if buffer was large enough + JSON_ASSERT(static_cast(len) < number_buffer.size()); + + // erase thousands separator + if (thousands_sep != '\0') + { + const auto end = std::remove(number_buffer.begin(), + number_buffer.begin() + len, thousands_sep); + std::fill(end, number_buffer.end(), '\0'); + JSON_ASSERT((end - number_buffer.begin()) <= len); + len = (end - number_buffer.begin()); + } + + // convert decimal point to '.' + if (decimal_point != '\0' && decimal_point != '.') + { + const auto dec_pos = std::find(number_buffer.begin(), number_buffer.end(), decimal_point); + if (dec_pos != number_buffer.end()) + { + *dec_pos = '.'; + } + } + + o->write_characters(number_buffer.data(), static_cast(len)); + + // determine if need to append ".0" + const bool value_is_int_like = + std::none_of(number_buffer.begin(), number_buffer.begin() + len + 1, + [](char c) + { + return c == '.' || c == 'e'; + }); + + if (value_is_int_like) + { + o->write_characters(".0", 2); + } + } + + /*! + @brief check whether a string is UTF-8 encoded + + The function checks each byte of a string whether it is UTF-8 encoded. The + result of the check is stored in the @a state parameter. The function must + be called initially with state 0 (accept). State 1 means the string must + be rejected, because the current byte is not allowed. If the string is + completely processed, but the state is non-zero, the string ended + prematurely; that is, the last byte indicated more bytes should have + followed. + + @param[in,out] state the state of the decoding + @param[in,out] codep codepoint (valid only if resulting state is UTF8_ACCEPT) + @param[in] byte next byte to decode + @return new state + + @note The function has been edited: a std::array is used. + + @copyright Copyright (c) 2008-2009 Bjoern Hoehrmann + @sa http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ + */ + static std::uint8_t decode(std::uint8_t& state, std::uint32_t& codep, const std::uint8_t byte) noexcept + { + static const std::array utf8d = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9F + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // A0..BF + 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0..DF + 0xA, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // E0..EF + 0xB, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // F0..FF + 0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2 + 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4 + 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6 + 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // s7..s8 + } + }; + + const std::uint8_t type = utf8d[byte]; + + codep = (state != UTF8_ACCEPT) + ? (byte & 0x3fu) | (codep << 6u) + : (0xFFu >> type) & (byte); + + std::size_t index = 256u + static_cast(state) * 16u + static_cast(type); + JSON_ASSERT(index < 400); + state = utf8d[index]; + return state; + } + + /* + * Overload to make the compiler happy while it is instantiating + * dump_integer for number_unsigned_t. + * Must never be called. + */ + number_unsigned_t remove_sign(number_unsigned_t x) + { + JSON_ASSERT(false); // LCOV_EXCL_LINE + return x; // LCOV_EXCL_LINE + } + + /* + * Helper function for dump_integer + * + * This function takes a negative signed integer and returns its absolute + * value as unsigned integer. The plus/minus shuffling is necessary as we can + * not directly remove the sign of an arbitrary signed integer as the + * absolute values of INT_MIN and INT_MAX are usually not the same. See + * #1708 for details. + */ + inline number_unsigned_t remove_sign(number_integer_t x) noexcept + { + JSON_ASSERT(x < 0 && x < (std::numeric_limits::max)()); + return static_cast(-(x + 1)) + 1; + } + + private: + /// the output of the serializer + output_adapter_t o = nullptr; + + /// a (hopefully) large enough character buffer + std::array number_buffer{{}}; + + /// the locale + const std::lconv* loc = nullptr; + /// the locale's thousand separator character + const char thousands_sep = '\0'; + /// the locale's decimal point character + const char decimal_point = '\0'; + + /// string buffer + std::array string_buffer{{}}; + + /// the indentation character + const char indent_char; + /// the indentation string + string_t indent_string; + + /// error_handler how to react on decoding errors + const error_handler_t error_handler; +}; +} // namespace detail +} // namespace nlohmann + +// #include + +// #include + +// #include + + +#include // less +#include // allocator +#include // pair +#include // vector + +namespace nlohmann +{ + +/// ordered_map: a minimal map-like container that preserves insertion order +/// for use within nlohmann::basic_json +template , + class Allocator = std::allocator>> + struct ordered_map : std::vector, Allocator> +{ + using key_type = Key; + using mapped_type = T; + using Container = std::vector, Allocator>; + using typename Container::iterator; + using typename Container::const_iterator; + using typename Container::size_type; + using typename Container::value_type; + + // Explicit constructors instead of `using Container::Container` + // otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4) + ordered_map(const Allocator& alloc = Allocator()) : Container{alloc} {} + template + ordered_map(It first, It last, const Allocator& alloc = Allocator()) + : Container{first, last, alloc} {} + ordered_map(std::initializer_list init, const Allocator& alloc = Allocator() ) + : Container{init, alloc} {} + + std::pair emplace(const key_type& key, T&& t) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return {it, false}; + } + } + Container::emplace_back(key, t); + return {--this->end(), true}; + } + + T& operator[](const Key& key) + { + return emplace(key, T{}).first->second; + } + + const T& operator[](const Key& key) const + { + return at(key); + } + + T& at(const Key& key) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return it->second; + } + } + + throw std::out_of_range("key not found"); + } + + const T& at(const Key& key) const + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return it->second; + } + } + + throw std::out_of_range("key not found"); + } + + size_type erase(const Key& key) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + // Since we cannot move const Keys, re-construct them in place + for (auto next = it; ++next != this->end(); ++it) + { + it->~value_type(); // Destroy but keep allocation + new (&*it) value_type{std::move(*next)}; + } + Container::pop_back(); + return 1; + } + } + return 0; + } + + iterator erase(iterator pos) + { + auto it = pos; + + // Since we cannot move const Keys, re-construct them in place + for (auto next = it; ++next != this->end(); ++it) + { + it->~value_type(); // Destroy but keep allocation + new (&*it) value_type{std::move(*next)}; + } + Container::pop_back(); + return pos; + } + + size_type count(const Key& key) const + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return 1; + } + } + return 0; + } + + iterator find(const Key& key) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return it; + } + } + return Container::end(); + } + + const_iterator find(const Key& key) const + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == key) + { + return it; + } + } + return Container::end(); + } + + std::pair insert( value_type&& value ) + { + return emplace(value.first, std::move(value.second)); + } + + std::pair insert( const value_type& value ) + { + for (auto it = this->begin(); it != this->end(); ++it) + { + if (it->first == value.first) + { + return {it, false}; + } + } + Container::push_back(value); + return {--this->end(), true}; + } +}; + +} // namespace nlohmann + + +/*! +@brief namespace for Niels Lohmann +@see https://github.com/nlohmann +@since version 1.0.0 +*/ +namespace nlohmann +{ + +/*! +@brief a class to store JSON values + +@tparam ObjectType type for JSON objects (`std::map` by default; will be used +in @ref object_t) +@tparam ArrayType type for JSON arrays (`std::vector` by default; will be used +in @ref array_t) +@tparam StringType type for JSON strings and object keys (`std::string` by +default; will be used in @ref string_t) +@tparam BooleanType type for JSON booleans (`bool` by default; will be used +in @ref boolean_t) +@tparam NumberIntegerType type for JSON integer numbers (`int64_t` by +default; will be used in @ref number_integer_t) +@tparam NumberUnsignedType type for JSON unsigned integer numbers (@c +`uint64_t` by default; will be used in @ref number_unsigned_t) +@tparam NumberFloatType type for JSON floating-point numbers (`double` by +default; will be used in @ref number_float_t) +@tparam BinaryType type for packed binary data for compatibility with binary +serialization formats (`std::vector` by default; will be used in +@ref binary_t) +@tparam AllocatorType type of the allocator to use (`std::allocator` by +default) +@tparam JSONSerializer the serializer to resolve internal calls to `to_json()` +and `from_json()` (@ref adl_serializer by default) + +@requirement The class satisfies the following concept requirements: +- Basic + - [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible): + JSON values can be default constructed. The result will be a JSON null + value. + - [MoveConstructible](https://en.cppreference.com/w/cpp/named_req/MoveConstructible): + A JSON value can be constructed from an rvalue argument. + - [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible): + A JSON value can be copy-constructed from an lvalue expression. + - [MoveAssignable](https://en.cppreference.com/w/cpp/named_req/MoveAssignable): + A JSON value van be assigned from an rvalue argument. + - [CopyAssignable](https://en.cppreference.com/w/cpp/named_req/CopyAssignable): + A JSON value can be copy-assigned from an lvalue expression. + - [Destructible](https://en.cppreference.com/w/cpp/named_req/Destructible): + JSON values can be destructed. +- Layout + - [StandardLayoutType](https://en.cppreference.com/w/cpp/named_req/StandardLayoutType): + JSON values have + [standard layout](https://en.cppreference.com/w/cpp/language/data_members#Standard_layout): + All non-static data members are private and standard layout types, the + class has no virtual functions or (virtual) base classes. +- Library-wide + - [EqualityComparable](https://en.cppreference.com/w/cpp/named_req/EqualityComparable): + JSON values can be compared with `==`, see @ref + operator==(const_reference,const_reference). + - [LessThanComparable](https://en.cppreference.com/w/cpp/named_req/LessThanComparable): + JSON values can be compared with `<`, see @ref + operator<(const_reference,const_reference). + - [Swappable](https://en.cppreference.com/w/cpp/named_req/Swappable): + Any JSON lvalue or rvalue of can be swapped with any lvalue or rvalue of + other compatible types, using unqualified function call @ref swap(). + - [NullablePointer](https://en.cppreference.com/w/cpp/named_req/NullablePointer): + JSON values can be compared against `std::nullptr_t` objects which are used + to model the `null` value. +- Container + - [Container](https://en.cppreference.com/w/cpp/named_req/Container): + JSON values can be used like STL containers and provide iterator access. + - [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer); + JSON values can be used like STL containers and provide reverse iterator + access. + +@invariant The member variables @a m_value and @a m_type have the following +relationship: +- If `m_type == value_t::object`, then `m_value.object != nullptr`. +- If `m_type == value_t::array`, then `m_value.array != nullptr`. +- If `m_type == value_t::string`, then `m_value.string != nullptr`. +The invariants are checked by member function assert_invariant(). + +@internal +@note ObjectType trick from https://stackoverflow.com/a/9860911 +@endinternal + +@see [RFC 7159: The JavaScript Object Notation (JSON) Data Interchange +Format](http://rfc7159.net/rfc7159) + +@since version 1.0.0 + +@nosubgrouping +*/ +NLOHMANN_BASIC_JSON_TPL_DECLARATION +class basic_json +{ + private: + template friend struct detail::external_constructor; + friend ::nlohmann::json_pointer; + + template + friend class ::nlohmann::detail::parser; + friend ::nlohmann::detail::serializer; + template + friend class ::nlohmann::detail::iter_impl; + template + friend class ::nlohmann::detail::binary_writer; + template + friend class ::nlohmann::detail::binary_reader; + template + friend class ::nlohmann::detail::json_sax_dom_parser; + template + friend class ::nlohmann::detail::json_sax_dom_callback_parser; + + /// workaround type for MSVC + using basic_json_t = NLOHMANN_BASIC_JSON_TPL; + + // convenience aliases for types residing in namespace detail; + using lexer = ::nlohmann::detail::lexer_base; + + template + static ::nlohmann::detail::parser parser( + InputAdapterType adapter, + detail::parser_callback_tcb = nullptr, + const bool allow_exceptions = true, + const bool ignore_comments = false + ) + { + return ::nlohmann::detail::parser(std::move(adapter), + std::move(cb), allow_exceptions, ignore_comments); + } + + using primitive_iterator_t = ::nlohmann::detail::primitive_iterator_t; + template + using internal_iterator = ::nlohmann::detail::internal_iterator; + template + using iter_impl = ::nlohmann::detail::iter_impl; + template + using iteration_proxy = ::nlohmann::detail::iteration_proxy; + template using json_reverse_iterator = ::nlohmann::detail::json_reverse_iterator; + + template + using output_adapter_t = ::nlohmann::detail::output_adapter_t; + + template + using binary_reader = ::nlohmann::detail::binary_reader; + template using binary_writer = ::nlohmann::detail::binary_writer; + + using serializer = ::nlohmann::detail::serializer; + + public: + using value_t = detail::value_t; + /// JSON Pointer, see @ref nlohmann::json_pointer + using json_pointer = ::nlohmann::json_pointer; + template + using json_serializer = JSONSerializer; + /// how to treat decoding errors + using error_handler_t = detail::error_handler_t; + /// how to treat CBOR tags + using cbor_tag_handler_t = detail::cbor_tag_handler_t; + /// helper type for initializer lists of basic_json values + using initializer_list_t = std::initializer_list>; + + using input_format_t = detail::input_format_t; + /// SAX interface type, see @ref nlohmann::json_sax + using json_sax_t = json_sax; + + //////////////// + // exceptions // + //////////////// + + /// @name exceptions + /// Classes to implement user-defined exceptions. + /// @{ + + /// @copydoc detail::exception + using exception = detail::exception; + /// @copydoc detail::parse_error + using parse_error = detail::parse_error; + /// @copydoc detail::invalid_iterator + using invalid_iterator = detail::invalid_iterator; + /// @copydoc detail::type_error + using type_error = detail::type_error; + /// @copydoc detail::out_of_range + using out_of_range = detail::out_of_range; + /// @copydoc detail::other_error + using other_error = detail::other_error; + + /// @} + + + ///////////////////// + // container types // + ///////////////////// + + /// @name container types + /// The canonic container types to use @ref basic_json like any other STL + /// container. + /// @{ + + /// the type of elements in a basic_json container + using value_type = basic_json; + + /// the type of an element reference + using reference = value_type&; + /// the type of an element const reference + using const_reference = const value_type&; + + /// a type to represent differences between iterators + using difference_type = std::ptrdiff_t; + /// a type to represent container sizes + using size_type = std::size_t; + + /// the allocator type + using allocator_type = AllocatorType; + + /// the type of an element pointer + using pointer = typename std::allocator_traits::pointer; + /// the type of an element const pointer + using const_pointer = typename std::allocator_traits::const_pointer; + + /// an iterator for a basic_json container + using iterator = iter_impl; + /// a const iterator for a basic_json container + using const_iterator = iter_impl; + /// a reverse iterator for a basic_json container + using reverse_iterator = json_reverse_iterator; + /// a const reverse iterator for a basic_json container + using const_reverse_iterator = json_reverse_iterator; + + /// @} + + + /*! + @brief returns the allocator associated with the container + */ + static allocator_type get_allocator() + { + return allocator_type(); + } + + /*! + @brief returns version information on the library + + This function returns a JSON object with information about the library, + including the version number and information on the platform and compiler. + + @return JSON object holding version information + key | description + ----------- | --------------- + `compiler` | Information on the used compiler. It is an object with the following keys: `c++` (the used C++ standard), `family` (the compiler family; possible values are `clang`, `icc`, `gcc`, `ilecpp`, `msvc`, `pgcpp`, `sunpro`, and `unknown`), and `version` (the compiler version). + `copyright` | The copyright line for the library as string. + `name` | The name of the library as string. + `platform` | The used platform as string. Possible values are `win32`, `linux`, `apple`, `unix`, and `unknown`. + `url` | The URL of the project as string. + `version` | The version of the library. It is an object with the following keys: `major`, `minor`, and `patch` as defined by [Semantic Versioning](http://semver.org), and `string` (the version string). + + @liveexample{The following code shows an example output of the `meta()` + function.,meta} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @complexity Constant. + + @since 2.1.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json meta() + { + basic_json result; + + result["copyright"] = "(C) 2013-2020 Niels Lohmann"; + result["name"] = "JSON for Modern C++"; + result["url"] = "https://github.com/nlohmann/json"; + result["version"]["string"] = + std::to_string(NLOHMANN_JSON_VERSION_MAJOR) + "." + + std::to_string(NLOHMANN_JSON_VERSION_MINOR) + "." + + std::to_string(NLOHMANN_JSON_VERSION_PATCH); + result["version"]["major"] = NLOHMANN_JSON_VERSION_MAJOR; + result["version"]["minor"] = NLOHMANN_JSON_VERSION_MINOR; + result["version"]["patch"] = NLOHMANN_JSON_VERSION_PATCH; + +#ifdef _WIN32 + result["platform"] = "win32"; +#elif defined __linux__ + result["platform"] = "linux"; +#elif defined __APPLE__ + result["platform"] = "apple"; +#elif defined __unix__ + result["platform"] = "unix"; +#else + result["platform"] = "unknown"; +#endif + +#if defined(__ICC) || defined(__INTEL_COMPILER) + result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}}; +#elif defined(__clang__) + result["compiler"] = {{"family", "clang"}, {"version", __clang_version__}}; +#elif defined(__GNUC__) || defined(__GNUG__) + result["compiler"] = {{"family", "gcc"}, {"version", std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)}}; +#elif defined(__HP_cc) || defined(__HP_aCC) + result["compiler"] = "hp" +#elif defined(__IBMCPP__) + result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}}; +#elif defined(_MSC_VER) + result["compiler"] = {{"family", "msvc"}, {"version", _MSC_VER}}; +#elif defined(__PGI) + result["compiler"] = {{"family", "pgcpp"}, {"version", __PGI}}; +#elif defined(__SUNPRO_CC) + result["compiler"] = {{"family", "sunpro"}, {"version", __SUNPRO_CC}}; +#else + result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}}; +#endif + +#ifdef __cplusplus + result["compiler"]["c++"] = std::to_string(__cplusplus); +#else + result["compiler"]["c++"] = "unknown"; +#endif + return result; + } + + + /////////////////////////// + // JSON value data types // + /////////////////////////// + + /// @name JSON value data types + /// The data types to store a JSON value. These types are derived from + /// the template arguments passed to class @ref basic_json. + /// @{ + +#if defined(JSON_HAS_CPP_14) + // Use transparent comparator if possible, combined with perfect forwarding + // on find() and count() calls prevents unnecessary string construction. + using object_comparator_t = std::less<>; +#else + using object_comparator_t = std::less; +#endif + + /*! + @brief a type for an object + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON objects as follows: + > An object is an unordered collection of zero or more name/value pairs, + > where a name is a string and a value is a string, number, boolean, null, + > object, or array. + + To store objects in C++, a type is defined by the template parameters + described below. + + @tparam ObjectType the container to store objects (e.g., `std::map` or + `std::unordered_map`) + @tparam StringType the type of the keys or names (e.g., `std::string`). + The comparison function `std::less` is used to order elements + inside the container. + @tparam AllocatorType the allocator to use for objects (e.g., + `std::allocator`) + + #### Default type + + With the default values for @a ObjectType (`std::map`), @a StringType + (`std::string`), and @a AllocatorType (`std::allocator`), the default + value for @a object_t is: + + @code {.cpp} + std::map< + std::string, // key_type + basic_json, // value_type + std::less, // key_compare + std::allocator> // allocator_type + > + @endcode + + #### Behavior + + The choice of @a object_t influences the behavior of the JSON class. With + the default type, objects have the following behavior: + + - When all names are unique, objects will be interoperable in the sense + that all software implementations receiving that object will agree on + the name-value mappings. + - When the names within an object are not unique, it is unspecified which + one of the values for a given key will be chosen. For instance, + `{"key": 2, "key": 1}` could be equal to either `{"key": 1}` or + `{"key": 2}`. + - Internally, name/value pairs are stored in lexicographical order of the + names. Objects will also be serialized (see @ref dump) in this order. + For instance, `{"b": 1, "a": 2}` and `{"a": 2, "b": 1}` will be stored + and serialized as `{"a": 2, "b": 1}`. + - When comparing objects, the order of the name/value pairs is irrelevant. + This makes objects interoperable in the sense that they will not be + affected by these differences. For instance, `{"b": 1, "a": 2}` and + `{"a": 2, "b": 1}` will be treated as equal. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the maximum depth of nesting. + + In this class, the object's limit of nesting is not explicitly constrained. + However, a maximum depth of nesting may be introduced by the compiler or + runtime environment. A theoretical limit can be queried by calling the + @ref max_size function of a JSON object. + + #### Storage + + Objects are stored as pointers in a @ref basic_json type. That is, for any + access to object values, a pointer of type `object_t*` must be + dereferenced. + + @sa @ref array_t -- type for an array value + + @since version 1.0.0 + + @note The order name/value pairs are added to the object is *not* + preserved by the library. Therefore, iterating an object may return + name/value pairs in a different order than they were originally stored. In + fact, keys will be traversed in alphabetical order as `std::map` with + `std::less` is used by default. Please note this behavior conforms to [RFC + 7159](http://rfc7159.net/rfc7159), because any order implements the + specified "unordered" nature of JSON objects. + */ + using object_t = ObjectType>>; + + /*! + @brief a type for an array + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON arrays as follows: + > An array is an ordered sequence of zero or more values. + + To store objects in C++, a type is defined by the template parameters + explained below. + + @tparam ArrayType container type to store arrays (e.g., `std::vector` or + `std::list`) + @tparam AllocatorType allocator to use for arrays (e.g., `std::allocator`) + + #### Default type + + With the default values for @a ArrayType (`std::vector`) and @a + AllocatorType (`std::allocator`), the default value for @a array_t is: + + @code {.cpp} + std::vector< + basic_json, // value_type + std::allocator // allocator_type + > + @endcode + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the maximum depth of nesting. + + In this class, the array's limit of nesting is not explicitly constrained. + However, a maximum depth of nesting may be introduced by the compiler or + runtime environment. A theoretical limit can be queried by calling the + @ref max_size function of a JSON array. + + #### Storage + + Arrays are stored as pointers in a @ref basic_json type. That is, for any + access to array values, a pointer of type `array_t*` must be dereferenced. + + @sa @ref object_t -- type for an object value + + @since version 1.0.0 + */ + using array_t = ArrayType>; + + /*! + @brief a type for a string + + [RFC 7159](http://rfc7159.net/rfc7159) describes JSON strings as follows: + > A string is a sequence of zero or more Unicode characters. + + To store objects in C++, a type is defined by the template parameter + described below. Unicode values are split by the JSON class into + byte-sized characters during deserialization. + + @tparam StringType the container to store strings (e.g., `std::string`). + Note this container is used for keys/names in objects, see @ref object_t. + + #### Default type + + With the default values for @a StringType (`std::string`), the default + value for @a string_t is: + + @code {.cpp} + std::string + @endcode + + #### Encoding + + Strings are stored in UTF-8 encoding. Therefore, functions like + `std::string::size()` or `std::string::length()` return the number of + bytes in the string rather than the number of characters or glyphs. + + #### String comparison + + [RFC 7159](http://rfc7159.net/rfc7159) states: + > Software implementations are typically required to test names of object + > members for equality. Implementations that transform the textual + > representation into sequences of Unicode code units and then perform the + > comparison numerically, code unit by code unit, are interoperable in the + > sense that implementations will agree in all cases on equality or + > inequality of two strings. For example, implementations that compare + > strings with escaped characters unconverted may incorrectly find that + > `"a\\b"` and `"a\u005Cb"` are not equal. + + This implementation is interoperable as it does compare strings code unit + by code unit. + + #### Storage + + String values are stored as pointers in a @ref basic_json type. That is, + for any access to string values, a pointer of type `string_t*` must be + dereferenced. + + @since version 1.0.0 + */ + using string_t = StringType; + + /*! + @brief a type for a boolean + + [RFC 7159](http://rfc7159.net/rfc7159) implicitly describes a boolean as a + type which differentiates the two literals `true` and `false`. + + To store objects in C++, a type is defined by the template parameter @a + BooleanType which chooses the type to use. + + #### Default type + + With the default values for @a BooleanType (`bool`), the default value for + @a boolean_t is: + + @code {.cpp} + bool + @endcode + + #### Storage + + Boolean values are stored directly inside a @ref basic_json type. + + @since version 1.0.0 + */ + using boolean_t = BooleanType; + + /*! + @brief a type for a number (integer) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store integer numbers in C++, a type is defined by the template + parameter @a NumberIntegerType which chooses the type to use. + + #### Default type + + With the default values for @a NumberIntegerType (`int64_t`), the default + value for @a number_integer_t is: + + @code {.cpp} + int64_t + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in integer literals lead to an interpretation as octal + number. Internally, the value will be stored as decimal number. For + instance, the C++ integer literal `010` will be serialized to `8`. + During deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the range and precision of numbers. + + When the default type is used, the maximal integer number that can be + stored is `9223372036854775807` (INT64_MAX) and the minimal integer number + that can be stored is `-9223372036854775808` (INT64_MIN). Integer numbers + that are out of range will yield over/underflow when used in a + constructor. During deserialization, too large or small integer numbers + will be automatically be stored as @ref number_unsigned_t or @ref + number_float_t. + + [RFC 7159](http://rfc7159.net/rfc7159) further states: + > Note that when such software is used, numbers that are integers and are + > in the range \f$[-2^{53}+1, 2^{53}-1]\f$ are interoperable in the sense + > that implementations will agree exactly on their numeric values. + + As this range is a subrange of the exactly supported range [INT64_MIN, + INT64_MAX], this class's integer type is interoperable. + + #### Storage + + Integer number values are stored directly inside a @ref basic_json type. + + @sa @ref number_float_t -- type for number values (floating-point) + + @sa @ref number_unsigned_t -- type for number values (unsigned integer) + + @since version 1.0.0 + */ + using number_integer_t = NumberIntegerType; + + /*! + @brief a type for a number (unsigned) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store unsigned integer numbers in C++, a type is defined by the + template parameter @a NumberUnsignedType which chooses the type to use. + + #### Default type + + With the default values for @a NumberUnsignedType (`uint64_t`), the + default value for @a number_unsigned_t is: + + @code {.cpp} + uint64_t + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in integer literals lead to an interpretation as octal + number. Internally, the value will be stored as decimal number. For + instance, the C++ integer literal `010` will be serialized to `8`. + During deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) specifies: + > An implementation may set limits on the range and precision of numbers. + + When the default type is used, the maximal integer number that can be + stored is `18446744073709551615` (UINT64_MAX) and the minimal integer + number that can be stored is `0`. Integer numbers that are out of range + will yield over/underflow when used in a constructor. During + deserialization, too large or small integer numbers will be automatically + be stored as @ref number_integer_t or @ref number_float_t. + + [RFC 7159](http://rfc7159.net/rfc7159) further states: + > Note that when such software is used, numbers that are integers and are + > in the range \f$[-2^{53}+1, 2^{53}-1]\f$ are interoperable in the sense + > that implementations will agree exactly on their numeric values. + + As this range is a subrange (when considered in conjunction with the + number_integer_t type) of the exactly supported range [0, UINT64_MAX], + this class's integer type is interoperable. + + #### Storage + + Integer number values are stored directly inside a @ref basic_json type. + + @sa @ref number_float_t -- type for number values (floating-point) + @sa @ref number_integer_t -- type for number values (integer) + + @since version 2.0.0 + */ + using number_unsigned_t = NumberUnsignedType; + + /*! + @brief a type for a number (floating-point) + + [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows: + > The representation of numbers is similar to that used in most + > programming languages. A number is represented in base 10 using decimal + > digits. It contains an integer component that may be prefixed with an + > optional minus sign, which may be followed by a fraction part and/or an + > exponent part. Leading zeros are not allowed. (...) Numeric values that + > cannot be represented in the grammar below (such as Infinity and NaN) + > are not permitted. + + This description includes both integer and floating-point numbers. + However, C++ allows more precise storage if it is known whether the number + is a signed integer, an unsigned integer or a floating-point number. + Therefore, three different types, @ref number_integer_t, @ref + number_unsigned_t and @ref number_float_t are used. + + To store floating-point numbers in C++, a type is defined by the template + parameter @a NumberFloatType which chooses the type to use. + + #### Default type + + With the default values for @a NumberFloatType (`double`), the default + value for @a number_float_t is: + + @code {.cpp} + double + @endcode + + #### Default behavior + + - The restrictions about leading zeros is not enforced in C++. Instead, + leading zeros in floating-point literals will be ignored. Internally, + the value will be stored as decimal number. For instance, the C++ + floating-point literal `01.2` will be serialized to `1.2`. During + deserialization, leading zeros yield an error. + - Not-a-number (NaN) values will be serialized to `null`. + + #### Limits + + [RFC 7159](http://rfc7159.net/rfc7159) states: + > This specification allows implementations to set limits on the range and + > precision of numbers accepted. Since software that implements IEEE + > 754-2008 binary64 (double precision) numbers is generally available and + > widely used, good interoperability can be achieved by implementations + > that expect no more precision or range than these provide, in the sense + > that implementations will approximate JSON numbers within the expected + > precision. + + This implementation does exactly follow this approach, as it uses double + precision floating-point numbers. Note values smaller than + `-1.79769313486232e+308` and values greater than `1.79769313486232e+308` + will be stored as NaN internally and be serialized to `null`. + + #### Storage + + Floating-point number values are stored directly inside a @ref basic_json + type. + + @sa @ref number_integer_t -- type for number values (integer) + + @sa @ref number_unsigned_t -- type for number values (unsigned integer) + + @since version 1.0.0 + */ + using number_float_t = NumberFloatType; + + /*! + @brief a type for a packed binary type + + This type is a type designed to carry binary data that appears in various + serialized formats, such as CBOR's Major Type 2, MessagePack's bin, and + BSON's generic binary subtype. This type is NOT a part of standard JSON and + exists solely for compatibility with these binary types. As such, it is + simply defined as an ordered sequence of zero or more byte values. + + Additionally, as an implementation detail, the subtype of the binary data is + carried around as a `std::uint8_t`, which is compatible with both of the + binary data formats that use binary subtyping, (though the specific + numbering is incompatible with each other, and it is up to the user to + translate between them). + + [CBOR's RFC 7049](https://tools.ietf.org/html/rfc7049) describes this type + as: + > Major type 2: a byte string. The string's length in bytes is represented + > following the rules for positive integers (major type 0). + + [MessagePack's documentation on the bin type + family](https://github.com/msgpack/msgpack/blob/master/spec.md#bin-format-family) + describes this type as: + > Bin format family stores an byte array in 2, 3, or 5 bytes of extra bytes + > in addition to the size of the byte array. + + [BSON's specifications](http://bsonspec.org/spec.html) describe several + binary types; however, this type is intended to represent the generic binary + type which has the description: + > Generic binary subtype - This is the most commonly used binary subtype and + > should be the 'default' for drivers and tools. + + None of these impose any limitations on the internal representation other + than the basic unit of storage be some type of array whose parts are + decomposable into bytes. + + The default representation of this binary format is a + `std::vector`, which is a very common way to represent a byte + array in modern C++. + + #### Default type + + The default values for @a BinaryType is `std::vector` + + #### Storage + + Binary Arrays are stored as pointers in a @ref basic_json type. That is, + for any access to array values, a pointer of the type `binary_t*` must be + dereferenced. + + #### Notes on subtypes + + - CBOR + - Binary values are represented as byte strings. No subtypes are + supported and will be ignored when CBOR is written. + - MessagePack + - If a subtype is given and the binary array contains exactly 1, 2, 4, 8, + or 16 elements, the fixext family (fixext1, fixext2, fixext4, fixext8) + is used. For other sizes, the ext family (ext8, ext16, ext32) is used. + The subtype is then added as singed 8-bit integer. + - If no subtype is given, the bin family (bin8, bin16, bin32) is used. + - BSON + - If a subtype is given, it is used and added as unsigned 8-bit integer. + - If no subtype is given, the generic binary subtype 0x00 is used. + + @sa @ref binary -- create a binary array + + @since version 3.8.0 + */ + using binary_t = nlohmann::byte_container_with_subtype; + /// @} + + private: + + /// helper for exception-safe object creation + template + JSON_HEDLEY_RETURNS_NON_NULL + static T* create(Args&& ... args) + { + AllocatorType alloc; + using AllocatorTraits = std::allocator_traits>; + + auto deleter = [&](T * object) + { + AllocatorTraits::deallocate(alloc, object, 1); + }; + std::unique_ptr object(AllocatorTraits::allocate(alloc, 1), deleter); + AllocatorTraits::construct(alloc, object.get(), std::forward(args)...); + JSON_ASSERT(object != nullptr); + return object.release(); + } + + //////////////////////// + // JSON value storage // + //////////////////////// + + /*! + @brief a JSON value + + The actual storage for a JSON value of the @ref basic_json class. This + union combines the different storage types for the JSON value types + defined in @ref value_t. + + JSON type | value_t type | used type + --------- | --------------- | ------------------------ + object | object | pointer to @ref object_t + array | array | pointer to @ref array_t + string | string | pointer to @ref string_t + boolean | boolean | @ref boolean_t + number | number_integer | @ref number_integer_t + number | number_unsigned | @ref number_unsigned_t + number | number_float | @ref number_float_t + binary | binary | pointer to @ref binary_t + null | null | *no value is stored* + + @note Variable-length types (objects, arrays, and strings) are stored as + pointers. The size of the union should not exceed 64 bits if the default + value types are used. + + @since version 1.0.0 + */ + union json_value + { + /// object (stored with pointer to save storage) + object_t* object; + /// array (stored with pointer to save storage) + array_t* array; + /// string (stored with pointer to save storage) + string_t* string; + /// binary (stored with pointer to save storage) + binary_t* binary; + /// boolean + boolean_t boolean; + /// number (integer) + number_integer_t number_integer; + /// number (unsigned integer) + number_unsigned_t number_unsigned; + /// number (floating-point) + number_float_t number_float; + + /// default constructor (for null values) + json_value() = default; + /// constructor for booleans + json_value(boolean_t v) noexcept : boolean(v) {} + /// constructor for numbers (integer) + json_value(number_integer_t v) noexcept : number_integer(v) {} + /// constructor for numbers (unsigned) + json_value(number_unsigned_t v) noexcept : number_unsigned(v) {} + /// constructor for numbers (floating-point) + json_value(number_float_t v) noexcept : number_float(v) {} + /// constructor for empty values of a given type + json_value(value_t t) + { + switch (t) + { + case value_t::object: + { + object = create(); + break; + } + + case value_t::array: + { + array = create(); + break; + } + + case value_t::string: + { + string = create(""); + break; + } + + case value_t::binary: + { + binary = create(); + break; + } + + case value_t::boolean: + { + boolean = boolean_t(false); + break; + } + + case value_t::number_integer: + { + number_integer = number_integer_t(0); + break; + } + + case value_t::number_unsigned: + { + number_unsigned = number_unsigned_t(0); + break; + } + + case value_t::number_float: + { + number_float = number_float_t(0.0); + break; + } + + case value_t::null: + { + object = nullptr; // silence warning, see #821 + break; + } + + default: + { + object = nullptr; // silence warning, see #821 + if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) + { + JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.9.1")); // LCOV_EXCL_LINE + } + break; + } + } + } + + /// constructor for strings + json_value(const string_t& value) + { + string = create(value); + } + + /// constructor for rvalue strings + json_value(string_t&& value) + { + string = create(std::move(value)); + } + + /// constructor for objects + json_value(const object_t& value) + { + object = create(value); + } + + /// constructor for rvalue objects + json_value(object_t&& value) + { + object = create(std::move(value)); + } + + /// constructor for arrays + json_value(const array_t& value) + { + array = create(value); + } + + /// constructor for rvalue arrays + json_value(array_t&& value) + { + array = create(std::move(value)); + } + + /// constructor for binary arrays + json_value(const typename binary_t::container_type& value) + { + binary = create(value); + } + + /// constructor for rvalue binary arrays + json_value(typename binary_t::container_type&& value) + { + binary = create(std::move(value)); + } + + /// constructor for binary arrays (internal type) + json_value(const binary_t& value) + { + binary = create(value); + } + + /// constructor for rvalue binary arrays (internal type) + json_value(binary_t&& value) + { + binary = create(std::move(value)); + } + + void destroy(value_t t) noexcept + { + // flatten the current json_value to a heap-allocated stack + std::vector stack; + + // move the top-level items to stack + if (t == value_t::array) + { + stack.reserve(array->size()); + std::move(array->begin(), array->end(), std::back_inserter(stack)); + } + else if (t == value_t::object) + { + stack.reserve(object->size()); + for (auto&& it : *object) + { + stack.push_back(std::move(it.second)); + } + } + + while (!stack.empty()) + { + // move the last item to local variable to be processed + basic_json current_item(std::move(stack.back())); + stack.pop_back(); + + // if current_item is array/object, move + // its children to the stack to be processed later + if (current_item.is_array()) + { + std::move(current_item.m_value.array->begin(), current_item.m_value.array->end(), + std::back_inserter(stack)); + + current_item.m_value.array->clear(); + } + else if (current_item.is_object()) + { + for (auto&& it : *current_item.m_value.object) + { + stack.push_back(std::move(it.second)); + } + + current_item.m_value.object->clear(); + } + + // it's now safe that current_item get destructed + // since it doesn't have any children + } + + switch (t) + { + case value_t::object: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, object); + std::allocator_traits::deallocate(alloc, object, 1); + break; + } + + case value_t::array: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, array); + std::allocator_traits::deallocate(alloc, array, 1); + break; + } + + case value_t::string: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, string); + std::allocator_traits::deallocate(alloc, string, 1); + break; + } + + case value_t::binary: + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, binary); + std::allocator_traits::deallocate(alloc, binary, 1); + break; + } + + default: + { + break; + } + } + } + }; + + /*! + @brief checks the class invariants + + This function asserts the class invariants. It needs to be called at the + end of every constructor to make sure that created objects respect the + invariant. Furthermore, it has to be called each time the type of a JSON + value is changed, because the invariant expresses a relationship between + @a m_type and @a m_value. + */ + void assert_invariant() const noexcept + { + JSON_ASSERT(m_type != value_t::object || m_value.object != nullptr); + JSON_ASSERT(m_type != value_t::array || m_value.array != nullptr); + JSON_ASSERT(m_type != value_t::string || m_value.string != nullptr); + JSON_ASSERT(m_type != value_t::binary || m_value.binary != nullptr); + } + + public: + ////////////////////////// + // JSON parser callback // + ////////////////////////// + + /*! + @brief parser event types + + The parser callback distinguishes the following events: + - `object_start`: the parser read `{` and started to process a JSON object + - `key`: the parser read a key of a value in an object + - `object_end`: the parser read `}` and finished processing a JSON object + - `array_start`: the parser read `[` and started to process a JSON array + - `array_end`: the parser read `]` and finished processing a JSON array + - `value`: the parser finished reading a JSON value + + @image html callback_events.png "Example when certain parse events are triggered" + + @sa @ref parser_callback_t for more information and examples + */ + using parse_event_t = detail::parse_event_t; + + /*! + @brief per-element parser callback type + + With a parser callback function, the result of parsing a JSON text can be + influenced. When passed to @ref parse, it is called on certain events + (passed as @ref parse_event_t via parameter @a event) with a set recursion + depth @a depth and context JSON value @a parsed. The return value of the + callback function is a boolean indicating whether the element that emitted + the callback shall be kept or not. + + We distinguish six scenarios (determined by the event type) in which the + callback function can be called. The following table describes the values + of the parameters @a depth, @a event, and @a parsed. + + parameter @a event | description | parameter @a depth | parameter @a parsed + ------------------ | ----------- | ------------------ | ------------------- + parse_event_t::object_start | the parser read `{` and started to process a JSON object | depth of the parent of the JSON object | a JSON value with type discarded + parse_event_t::key | the parser read a key of a value in an object | depth of the currently parsed JSON object | a JSON string containing the key + parse_event_t::object_end | the parser read `}` and finished processing a JSON object | depth of the parent of the JSON object | the parsed JSON object + parse_event_t::array_start | the parser read `[` and started to process a JSON array | depth of the parent of the JSON array | a JSON value with type discarded + parse_event_t::array_end | the parser read `]` and finished processing a JSON array | depth of the parent of the JSON array | the parsed JSON array + parse_event_t::value | the parser finished reading a JSON value | depth of the value | the parsed JSON value + + @image html callback_events.png "Example when certain parse events are triggered" + + Discarding a value (i.e., returning `false`) has different effects + depending on the context in which function was called: + + - Discarded values in structured types are skipped. That is, the parser + will behave as if the discarded value was never read. + - In case a value outside a structured type is skipped, it is replaced + with `null`. This case happens if the top-level element is skipped. + + @param[in] depth the depth of the recursion during parsing + + @param[in] event an event of type parse_event_t indicating the context in + the callback function has been called + + @param[in,out] parsed the current intermediate parse result; note that + writing to this value has no effect for parse_event_t::key events + + @return Whether the JSON value which called the function during parsing + should be kept (`true`) or not (`false`). In the latter case, it is either + skipped completely or replaced by an empty discarded object. + + @sa @ref parse for examples + + @since version 1.0.0 + */ + using parser_callback_t = detail::parser_callback_t; + + ////////////////// + // constructors // + ////////////////// + + /// @name constructors and destructors + /// Constructors of class @ref basic_json, copy/move constructor, copy + /// assignment, static functions creating objects, and the destructor. + /// @{ + + /*! + @brief create an empty value with a given type + + Create an empty JSON value with a given type. The value will be default + initialized with an empty value which depends on the type: + + Value type | initial value + ----------- | ------------- + null | `null` + boolean | `false` + string | `""` + number | `0` + object | `{}` + array | `[]` + binary | empty array + + @param[in] v the type of the value to create + + @complexity Constant. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows the constructor for different @ref + value_t values,basic_json__value_t} + + @sa @ref clear() -- restores the postcondition of this constructor + + @since version 1.0.0 + */ + basic_json(const value_t v) + : m_type(v), m_value(v) + { + assert_invariant(); + } + + /*! + @brief create a null object + + Create a `null` JSON value. It either takes a null pointer as parameter + (explicitly creating `null`) or no parameter (implicitly creating `null`). + The passed null pointer itself is not read -- it is only used to choose + the right constructor. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this constructor never throws + exceptions. + + @liveexample{The following code shows the constructor with and without a + null pointer parameter.,basic_json__nullptr_t} + + @since version 1.0.0 + */ + basic_json(std::nullptr_t = nullptr) noexcept + : basic_json(value_t::null) + { + assert_invariant(); + } + + /*! + @brief create a JSON value + + This is a "catch all" constructor for all compatible JSON types; that is, + types for which a `to_json()` method exists. The constructor forwards the + parameter @a val to that method (to `json_serializer::to_json` method + with `U = uncvref_t`, to be exact). + + Template type @a CompatibleType includes, but is not limited to, the + following types: + - **arrays**: @ref array_t and all kinds of compatible containers such as + `std::vector`, `std::deque`, `std::list`, `std::forward_list`, + `std::array`, `std::valarray`, `std::set`, `std::unordered_set`, + `std::multiset`, and `std::unordered_multiset` with a `value_type` from + which a @ref basic_json value can be constructed. + - **objects**: @ref object_t and all kinds of compatible associative + containers such as `std::map`, `std::unordered_map`, `std::multimap`, + and `std::unordered_multimap` with a `key_type` compatible to + @ref string_t and a `value_type` from which a @ref basic_json value can + be constructed. + - **strings**: @ref string_t, string literals, and all compatible string + containers can be used. + - **numbers**: @ref number_integer_t, @ref number_unsigned_t, + @ref number_float_t, and all convertible number types such as `int`, + `size_t`, `int64_t`, `float` or `double` can be used. + - **boolean**: @ref boolean_t / `bool` can be used. + - **binary**: @ref binary_t / `std::vector` may be used, + unfortunately because string literals cannot be distinguished from binary + character arrays by the C++ type system, all types compatible with `const + char*` will be directed to the string constructor instead. This is both + for backwards compatibility, and due to the fact that a binary type is not + a standard JSON type. + + See the examples below. + + @tparam CompatibleType a type such that: + - @a CompatibleType is not derived from `std::istream`, + - @a CompatibleType is not @ref basic_json (to avoid hijacking copy/move + constructors), + - @a CompatibleType is not a different @ref basic_json type (i.e. with different template arguments) + - @a CompatibleType is not a @ref basic_json nested type (e.g., + @ref json_pointer, @ref iterator, etc ...) + - @ref @ref json_serializer has a + `to_json(basic_json_t&, CompatibleType&&)` method + + @tparam U = `uncvref_t` + + @param[in] val the value to be forwarded to the respective constructor + + @complexity Usually linear in the size of the passed @a val, also + depending on the implementation of the called `to_json()` + method. + + @exceptionsafety Depends on the called constructor. For types directly + supported by the library (i.e., all types for which no `to_json()` function + was provided), strong guarantee holds: if an exception is thrown, there are + no changes to any JSON value. + + @liveexample{The following code shows the constructor with several + compatible types.,basic_json__CompatibleType} + + @since version 2.1.0 + */ + template < typename CompatibleType, + typename U = detail::uncvref_t, + detail::enable_if_t < + !detail::is_basic_json::value && detail::is_compatible_type::value, int > = 0 > + basic_json(CompatibleType && val) noexcept(noexcept( + JSONSerializer::to_json(std::declval(), + std::forward(val)))) + { + JSONSerializer::to_json(*this, std::forward(val)); + assert_invariant(); + } + + /*! + @brief create a JSON value from an existing one + + This is a constructor for existing @ref basic_json types. + It does not hijack copy/move constructors, since the parameter has different + template arguments than the current ones. + + The constructor tries to convert the internal @ref m_value of the parameter. + + @tparam BasicJsonType a type such that: + - @a BasicJsonType is a @ref basic_json type. + - @a BasicJsonType has different template arguments than @ref basic_json_t. + + @param[in] val the @ref basic_json value to be converted. + + @complexity Usually linear in the size of the passed @a val, also + depending on the implementation of the called `to_json()` + method. + + @exceptionsafety Depends on the called constructor. For types directly + supported by the library (i.e., all types for which no `to_json()` function + was provided), strong guarantee holds: if an exception is thrown, there are + no changes to any JSON value. + + @since version 3.2.0 + */ + template < typename BasicJsonType, + detail::enable_if_t < + detail::is_basic_json::value&& !std::is_same::value, int > = 0 > + basic_json(const BasicJsonType& val) + { + using other_boolean_t = typename BasicJsonType::boolean_t; + using other_number_float_t = typename BasicJsonType::number_float_t; + using other_number_integer_t = typename BasicJsonType::number_integer_t; + using other_number_unsigned_t = typename BasicJsonType::number_unsigned_t; + using other_string_t = typename BasicJsonType::string_t; + using other_object_t = typename BasicJsonType::object_t; + using other_array_t = typename BasicJsonType::array_t; + using other_binary_t = typename BasicJsonType::binary_t; + + switch (val.type()) + { + case value_t::boolean: + JSONSerializer::to_json(*this, val.template get()); + break; + case value_t::number_float: + JSONSerializer::to_json(*this, val.template get()); + break; + case value_t::number_integer: + JSONSerializer::to_json(*this, val.template get()); + break; + case value_t::number_unsigned: + JSONSerializer::to_json(*this, val.template get()); + break; + case value_t::string: + JSONSerializer::to_json(*this, val.template get_ref()); + break; + case value_t::object: + JSONSerializer::to_json(*this, val.template get_ref()); + break; + case value_t::array: + JSONSerializer::to_json(*this, val.template get_ref()); + break; + case value_t::binary: + JSONSerializer::to_json(*this, val.template get_ref()); + break; + case value_t::null: + *this = nullptr; + break; + case value_t::discarded: + m_type = value_t::discarded; + break; + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + assert_invariant(); + } + + /*! + @brief create a container (array or object) from an initializer list + + Creates a JSON value of type array or object from the passed initializer + list @a init. In case @a type_deduction is `true` (default), the type of + the JSON value to be created is deducted from the initializer list @a init + according to the following rules: + + 1. If the list is empty, an empty JSON object value `{}` is created. + 2. If the list consists of pairs whose first element is a string, a JSON + object value is created where the first elements of the pairs are + treated as keys and the second elements are as values. + 3. In all other cases, an array is created. + + The rules aim to create the best fit between a C++ initializer list and + JSON values. The rationale is as follows: + + 1. The empty initializer list is written as `{}` which is exactly an empty + JSON object. + 2. C++ has no way of describing mapped types other than to list a list of + pairs. As JSON requires that keys must be of type string, rule 2 is the + weakest constraint one can pose on initializer lists to interpret them + as an object. + 3. In all other cases, the initializer list could not be interpreted as + JSON object type, so interpreting it as JSON array type is safe. + + With the rules described above, the following JSON values cannot be + expressed by an initializer list: + + - the empty array (`[]`): use @ref array(initializer_list_t) + with an empty initializer list in this case + - arrays whose elements satisfy rule 2: use @ref + array(initializer_list_t) with the same initializer list + in this case + + @note When used without parentheses around an empty initializer list, @ref + basic_json() is called instead of this function, yielding the JSON null + value. + + @param[in] init initializer list with JSON values + + @param[in] type_deduction internal parameter; when set to `true`, the type + of the JSON value is deducted from the initializer list @a init; when set + to `false`, the type provided via @a manual_type is forced. This mode is + used by the functions @ref array(initializer_list_t) and + @ref object(initializer_list_t). + + @param[in] manual_type internal parameter; when @a type_deduction is set + to `false`, the created JSON value will use the provided type (only @ref + value_t::array and @ref value_t::object are valid); when @a type_deduction + is set to `true`, this parameter has no effect + + @throw type_error.301 if @a type_deduction is `false`, @a manual_type is + `value_t::object`, but @a init contains an element which is not a pair + whose first element is a string. In this case, the constructor could not + create an object. If @a type_deduction would have be `true`, an array + would have been created. See @ref object(initializer_list_t) + for an example. + + @complexity Linear in the size of the initializer list @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The example below shows how JSON values are created from + initializer lists.,basic_json__list_init_t} + + @sa @ref array(initializer_list_t) -- create a JSON array + value from an initializer list + @sa @ref object(initializer_list_t) -- create a JSON object + value from an initializer list + + @since version 1.0.0 + */ + basic_json(initializer_list_t init, + bool type_deduction = true, + value_t manual_type = value_t::array) + { + // check if each element is an array with two elements whose first + // element is a string + bool is_an_object = std::all_of(init.begin(), init.end(), + [](const detail::json_ref& element_ref) + { + return element_ref->is_array() && element_ref->size() == 2 && (*element_ref)[0].is_string(); + }); + + // adjust type if type deduction is not wanted + if (!type_deduction) + { + // if array is wanted, do not create an object though possible + if (manual_type == value_t::array) + { + is_an_object = false; + } + + // if object is wanted but impossible, throw an exception + if (JSON_HEDLEY_UNLIKELY(manual_type == value_t::object && !is_an_object)) + { + JSON_THROW(type_error::create(301, "cannot create object from initializer list")); + } + } + + if (is_an_object) + { + // the initializer list is a list of pairs -> create object + m_type = value_t::object; + m_value = value_t::object; + + std::for_each(init.begin(), init.end(), [this](const detail::json_ref& element_ref) + { + auto element = element_ref.moved_or_copied(); + m_value.object->emplace( + std::move(*((*element.m_value.array)[0].m_value.string)), + std::move((*element.m_value.array)[1])); + }); + } + else + { + // the initializer list describes an array -> create array + m_type = value_t::array; + m_value.array = create(init.begin(), init.end()); + } + + assert_invariant(); + } + + /*! + @brief explicitly create a binary array (without subtype) + + Creates a JSON binary array value from a given binary container. Binary + values are part of various binary formats, such as CBOR, MessagePack, and + BSON. This constructor is used to create a value for serialization to those + formats. + + @note Note, this function exists because of the difficulty in correctly + specifying the correct template overload in the standard value ctor, as both + JSON arrays and JSON binary arrays are backed with some form of a + `std::vector`. Because JSON binary arrays are a non-standard extension it + was decided that it would be best to prevent automatic initialization of a + binary array type, for backwards compatibility and so it does not happen on + accident. + + @param[in] init container containing bytes to use as binary type + + @return JSON binary array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @since version 3.8.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary(const typename binary_t::container_type& init) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = init; + return res; + } + + /*! + @brief explicitly create a binary array (with subtype) + + Creates a JSON binary array value from a given binary container. Binary + values are part of various binary formats, such as CBOR, MessagePack, and + BSON. This constructor is used to create a value for serialization to those + formats. + + @note Note, this function exists because of the difficulty in correctly + specifying the correct template overload in the standard value ctor, as both + JSON arrays and JSON binary arrays are backed with some form of a + `std::vector`. Because JSON binary arrays are a non-standard extension it + was decided that it would be best to prevent automatic initialization of a + binary array type, for backwards compatibility and so it does not happen on + accident. + + @param[in] init container containing bytes to use as binary type + @param[in] subtype subtype to use in MessagePack and BSON + + @return JSON binary array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @since version 3.8.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary(const typename binary_t::container_type& init, std::uint8_t subtype) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = binary_t(init, subtype); + return res; + } + + /// @copydoc binary(const typename binary_t::container_type&) + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary(typename binary_t::container_type&& init) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = std::move(init); + return res; + } + + /// @copydoc binary(const typename binary_t::container_type&, std::uint8_t) + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json binary(typename binary_t::container_type&& init, std::uint8_t subtype) + { + auto res = basic_json(); + res.m_type = value_t::binary; + res.m_value = binary_t(std::move(init), subtype); + return res; + } + + /*! + @brief explicitly create an array from an initializer list + + Creates a JSON array value from a given initializer list. That is, given a + list of values `a, b, c`, creates the JSON value `[a, b, c]`. If the + initializer list is empty, the empty array `[]` is created. + + @note This function is only needed to express two edge cases that cannot + be realized with the initializer list constructor (@ref + basic_json(initializer_list_t, bool, value_t)). These cases + are: + 1. creating an array whose elements are all pairs whose first element is a + string -- in this case, the initializer list constructor would create an + object, taking the first elements as keys + 2. creating an empty array -- passing the empty initializer list to the + initializer list constructor yields an empty object + + @param[in] init initializer list with JSON values to create an array from + (optional) + + @return JSON array value + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows an example for the `array` + function.,array} + + @sa @ref basic_json(initializer_list_t, bool, value_t) -- + create a JSON value from an initializer list + @sa @ref object(initializer_list_t) -- create a JSON object + value from an initializer list + + @since version 1.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json array(initializer_list_t init = {}) + { + return basic_json(init, false, value_t::array); + } + + /*! + @brief explicitly create an object from an initializer list + + Creates a JSON object value from a given initializer list. The initializer + lists elements must be pairs, and their first elements must be strings. If + the initializer list is empty, the empty object `{}` is created. + + @note This function is only added for symmetry reasons. In contrast to the + related function @ref array(initializer_list_t), there are + no cases which can only be expressed by this function. That is, any + initializer list @a init can also be passed to the initializer list + constructor @ref basic_json(initializer_list_t, bool, value_t). + + @param[in] init initializer list to create an object from (optional) + + @return JSON object value + + @throw type_error.301 if @a init is not a list of pairs whose first + elements are strings. In this case, no object can be created. When such a + value is passed to @ref basic_json(initializer_list_t, bool, value_t), + an array would have been created from the passed initializer list @a init. + See example below. + + @complexity Linear in the size of @a init. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows an example for the `object` + function.,object} + + @sa @ref basic_json(initializer_list_t, bool, value_t) -- + create a JSON value from an initializer list + @sa @ref array(initializer_list_t) -- create a JSON array + value from an initializer list + + @since version 1.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json object(initializer_list_t init = {}) + { + return basic_json(init, false, value_t::object); + } + + /*! + @brief construct an array with count copies of given value + + Constructs a JSON array value by creating @a cnt copies of a passed value. + In case @a cnt is `0`, an empty array is created. + + @param[in] cnt the number of JSON copies of @a val to create + @param[in] val the JSON value to copy + + @post `std::distance(begin(),end()) == cnt` holds. + + @complexity Linear in @a cnt. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The following code shows examples for the @ref + basic_json(size_type\, const basic_json&) + constructor.,basic_json__size_type_basic_json} + + @since version 1.0.0 + */ + basic_json(size_type cnt, const basic_json& val) + : m_type(value_t::array) + { + m_value.array = create(cnt, val); + assert_invariant(); + } + + /*! + @brief construct a JSON container given an iterator range + + Constructs the JSON value with the contents of the range `[first, last)`. + The semantics depends on the different types a JSON value can have: + - In case of a null type, invalid_iterator.206 is thrown. + - In case of other primitive types (number, boolean, or string), @a first + must be `begin()` and @a last must be `end()`. In this case, the value is + copied. Otherwise, invalid_iterator.204 is thrown. + - In case of structured types (array, object), the constructor behaves as + similar versions for `std::vector` or `std::map`; that is, a JSON array + or object is constructed from the values in the range. + + @tparam InputIT an input iterator type (@ref iterator or @ref + const_iterator) + + @param[in] first begin of the range to copy from (included) + @param[in] last end of the range to copy from (excluded) + + @pre Iterators @a first and @a last must be initialized. **This + precondition is enforced with an assertion (see warning).** If + assertions are switched off, a violation of this precondition yields + undefined behavior. + + @pre Range `[first, last)` is valid. Usually, this precondition cannot be + checked efficiently. Only certain edge cases are detected; see the + description of the exceptions below. A violation of this precondition + yields undefined behavior. + + @warning A precondition is enforced with a runtime assertion that will + result in calling `std::abort` if this precondition is not met. + Assertions can be disabled by defining `NDEBUG` at compile time. + See https://en.cppreference.com/w/cpp/error/assert for more + information. + + @throw invalid_iterator.201 if iterators @a first and @a last are not + compatible (i.e., do not belong to the same JSON value). In this case, + the range `[first, last)` is undefined. + @throw invalid_iterator.204 if iterators @a first and @a last belong to a + primitive type (number, boolean, or string), but @a first does not point + to the first element any more. In this case, the range `[first, last)` is + undefined. See example code below. + @throw invalid_iterator.206 if iterators @a first and @a last belong to a + null value. In this case, the range `[first, last)` is undefined. + + @complexity Linear in distance between @a first and @a last. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @liveexample{The example below shows several ways to create JSON values by + specifying a subrange with iterators.,basic_json__InputIt_InputIt} + + @since version 1.0.0 + */ + template < class InputIT, typename std::enable_if < + std::is_same::value || + std::is_same::value, int >::type = 0 > + basic_json(InputIT first, InputIT last) + { + JSON_ASSERT(first.m_object != nullptr); + JSON_ASSERT(last.m_object != nullptr); + + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(201, "iterators are not compatible")); + } + + // copy type from first iterator + m_type = first.m_object->m_type; + + // check if iterator range is complete for primitive values + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + { + if (JSON_HEDLEY_UNLIKELY(!first.m_it.primitive_iterator.is_begin() + || !last.m_it.primitive_iterator.is_end())) + { + JSON_THROW(invalid_iterator::create(204, "iterators out of range")); + } + break; + } + + default: + break; + } + + switch (m_type) + { + case value_t::number_integer: + { + m_value.number_integer = first.m_object->m_value.number_integer; + break; + } + + case value_t::number_unsigned: + { + m_value.number_unsigned = first.m_object->m_value.number_unsigned; + break; + } + + case value_t::number_float: + { + m_value.number_float = first.m_object->m_value.number_float; + break; + } + + case value_t::boolean: + { + m_value.boolean = first.m_object->m_value.boolean; + break; + } + + case value_t::string: + { + m_value = *first.m_object->m_value.string; + break; + } + + case value_t::object: + { + m_value.object = create(first.m_it.object_iterator, + last.m_it.object_iterator); + break; + } + + case value_t::array: + { + m_value.array = create(first.m_it.array_iterator, + last.m_it.array_iterator); + break; + } + + case value_t::binary: + { + m_value = *first.m_object->m_value.binary; + break; + } + + default: + JSON_THROW(invalid_iterator::create(206, "cannot construct with iterators from " + + std::string(first.m_object->type_name()))); + } + + assert_invariant(); + } + + + /////////////////////////////////////// + // other constructors and destructor // + /////////////////////////////////////// + + template, + std::is_same>::value, int> = 0 > + basic_json(const JsonRef& ref) : basic_json(ref.moved_or_copied()) {} + + /*! + @brief copy constructor + + Creates a copy of a given JSON value. + + @param[in] other the JSON value to copy + + @post `*this == other` + + @complexity Linear in the size of @a other. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes to any JSON value. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + - As postcondition, it holds: `other == basic_json(other)`. + + @liveexample{The following code shows an example for the copy + constructor.,basic_json__basic_json} + + @since version 1.0.0 + */ + basic_json(const basic_json& other) + : m_type(other.m_type) + { + // check of passed value is valid + other.assert_invariant(); + + switch (m_type) + { + case value_t::object: + { + m_value = *other.m_value.object; + break; + } + + case value_t::array: + { + m_value = *other.m_value.array; + break; + } + + case value_t::string: + { + m_value = *other.m_value.string; + break; + } + + case value_t::boolean: + { + m_value = other.m_value.boolean; + break; + } + + case value_t::number_integer: + { + m_value = other.m_value.number_integer; + break; + } + + case value_t::number_unsigned: + { + m_value = other.m_value.number_unsigned; + break; + } + + case value_t::number_float: + { + m_value = other.m_value.number_float; + break; + } + + case value_t::binary: + { + m_value = *other.m_value.binary; + break; + } + + default: + break; + } + + assert_invariant(); + } + + /*! + @brief move constructor + + Move constructor. Constructs a JSON value with the contents of the given + value @a other using move semantics. It "steals" the resources from @a + other and leaves it as JSON null value. + + @param[in,out] other value to move to this object + + @post `*this` has the same value as @a other before the call. + @post @a other is a JSON null value. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this constructor never throws + exceptions. + + @requirement This function helps `basic_json` satisfying the + [MoveConstructible](https://en.cppreference.com/w/cpp/named_req/MoveConstructible) + requirements. + + @liveexample{The code below shows the move constructor explicitly called + via std::move.,basic_json__moveconstructor} + + @since version 1.0.0 + */ + basic_json(basic_json&& other) noexcept + : m_type(std::move(other.m_type)), + m_value(std::move(other.m_value)) + { + // check that passed value is valid + other.assert_invariant(); + + // invalidate payload + other.m_type = value_t::null; + other.m_value = {}; + + assert_invariant(); + } + + /*! + @brief copy assignment + + Copy assignment operator. Copies a JSON value via the "copy and swap" + strategy: It is expressed in terms of the copy constructor, destructor, + and the `swap()` member function. + + @param[in] other value to copy from + + @complexity Linear. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + + @liveexample{The code below shows and example for the copy assignment. It + creates a copy of value `a` which is then swapped with `b`. Finally\, the + copy of `a` (which is the null value after the swap) is + destroyed.,basic_json__copyassignment} + + @since version 1.0.0 + */ + basic_json& operator=(basic_json other) noexcept ( + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value + ) + { + // check that passed value is valid + other.assert_invariant(); + + using std::swap; + swap(m_type, other.m_type); + swap(m_value, other.m_value); + + assert_invariant(); + return *this; + } + + /*! + @brief destructor + + Destroys the JSON value and frees all allocated memory. + + @complexity Linear. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is linear. + - All stored elements are destroyed and all memory is freed. + + @since version 1.0.0 + */ + ~basic_json() noexcept + { + assert_invariant(); + m_value.destroy(m_type); + } + + /// @} + + public: + /////////////////////// + // object inspection // + /////////////////////// + + /// @name object inspection + /// Functions to inspect the type of a JSON value. + /// @{ + + /*! + @brief serialization + + Serialization function for JSON values. The function tries to mimic + Python's `json.dumps()` function, and currently supports its @a indent + and @a ensure_ascii parameters. + + @param[in] indent If indent is nonnegative, then array elements and object + members will be pretty-printed with that indent level. An indent level of + `0` will only insert newlines. `-1` (the default) selects the most compact + representation. + @param[in] indent_char The character to use for indentation if @a indent is + greater than `0`. The default is ` ` (space). + @param[in] ensure_ascii If @a ensure_ascii is true, all non-ASCII characters + in the output are escaped with `\uXXXX` sequences, and the result consists + of ASCII characters only. + @param[in] error_handler how to react on decoding errors; there are three + possible values: `strict` (throws and exception in case a decoding error + occurs; default), `replace` (replace invalid UTF-8 sequences with U+FFFD), + and `ignore` (ignore invalid UTF-8 sequences during serialization; all + bytes are copied to the output unchanged). + + @return string containing the serialization of the JSON value + + @throw type_error.316 if a string stored inside the JSON value is not + UTF-8 encoded and @a error_handler is set to strict + + @note Binary values are serialized as object containing two keys: + - "bytes": an array of bytes as integers + - "subtype": the subtype as integer or "null" if the binary has no subtype + + @complexity Linear. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @liveexample{The following example shows the effect of different @a indent\, + @a indent_char\, and @a ensure_ascii parameters to the result of the + serialization.,dump} + + @see https://docs.python.org/2/library/json.html#json.dump + + @since version 1.0.0; indentation character @a indent_char, option + @a ensure_ascii and exceptions added in version 3.0.0; error + handlers added in version 3.4.0; serialization of binary values added + in version 3.8.0. + */ + string_t dump(const int indent = -1, + const char indent_char = ' ', + const bool ensure_ascii = false, + const error_handler_t error_handler = error_handler_t::strict) const + { + string_t result; + serializer s(detail::output_adapter(result), indent_char, error_handler); + + if (indent >= 0) + { + s.dump(*this, true, ensure_ascii, static_cast(indent)); + } + else + { + s.dump(*this, false, ensure_ascii, 0); + } + + return result; + } + + /*! + @brief return the type of the JSON value (explicit) + + Return the type of the JSON value as a value from the @ref value_t + enumeration. + + @return the type of the JSON value + Value type | return value + ------------------------- | ------------------------- + null | value_t::null + boolean | value_t::boolean + string | value_t::string + number (integer) | value_t::number_integer + number (unsigned integer) | value_t::number_unsigned + number (floating-point) | value_t::number_float + object | value_t::object + array | value_t::array + binary | value_t::binary + discarded | value_t::discarded + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `type()` for all JSON + types.,type} + + @sa @ref operator value_t() -- return the type of the JSON value (implicit) + @sa @ref type_name() -- return the type as string + + @since version 1.0.0 + */ + constexpr value_t type() const noexcept + { + return m_type; + } + + /*! + @brief return whether type is primitive + + This function returns true if and only if the JSON type is primitive + (string, number, boolean, or null). + + @return `true` if type is primitive (string, number, boolean, or null), + `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_primitive()` for all JSON + types.,is_primitive} + + @sa @ref is_structured() -- returns whether JSON value is structured + @sa @ref is_null() -- returns whether JSON value is `null` + @sa @ref is_string() -- returns whether JSON value is a string + @sa @ref is_boolean() -- returns whether JSON value is a boolean + @sa @ref is_number() -- returns whether JSON value is a number + @sa @ref is_binary() -- returns whether JSON value is a binary array + + @since version 1.0.0 + */ + constexpr bool is_primitive() const noexcept + { + return is_null() || is_string() || is_boolean() || is_number() || is_binary(); + } + + /*! + @brief return whether type is structured + + This function returns true if and only if the JSON type is structured + (array or object). + + @return `true` if type is structured (array or object), `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_structured()` for all JSON + types.,is_structured} + + @sa @ref is_primitive() -- returns whether value is primitive + @sa @ref is_array() -- returns whether value is an array + @sa @ref is_object() -- returns whether value is an object + + @since version 1.0.0 + */ + constexpr bool is_structured() const noexcept + { + return is_array() || is_object(); + } + + /*! + @brief return whether value is null + + This function returns true if and only if the JSON value is null. + + @return `true` if type is null, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_null()` for all JSON + types.,is_null} + + @since version 1.0.0 + */ + constexpr bool is_null() const noexcept + { + return m_type == value_t::null; + } + + /*! + @brief return whether value is a boolean + + This function returns true if and only if the JSON value is a boolean. + + @return `true` if type is boolean, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_boolean()` for all JSON + types.,is_boolean} + + @since version 1.0.0 + */ + constexpr bool is_boolean() const noexcept + { + return m_type == value_t::boolean; + } + + /*! + @brief return whether value is a number + + This function returns true if and only if the JSON value is a number. This + includes both integer (signed and unsigned) and floating-point values. + + @return `true` if type is number (regardless whether integer, unsigned + integer or floating-type), `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number()` for all JSON + types.,is_number} + + @sa @ref is_number_integer() -- check if value is an integer or unsigned + integer number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 1.0.0 + */ + constexpr bool is_number() const noexcept + { + return is_number_integer() || is_number_float(); + } + + /*! + @brief return whether value is an integer number + + This function returns true if and only if the JSON value is a signed or + unsigned integer number. This excludes floating-point values. + + @return `true` if type is an integer or unsigned integer number, `false` + otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_integer()` for all + JSON types.,is_number_integer} + + @sa @ref is_number() -- check if value is a number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 1.0.0 + */ + constexpr bool is_number_integer() const noexcept + { + return m_type == value_t::number_integer || m_type == value_t::number_unsigned; + } + + /*! + @brief return whether value is an unsigned integer number + + This function returns true if and only if the JSON value is an unsigned + integer number. This excludes floating-point and signed integer values. + + @return `true` if type is an unsigned integer number, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_unsigned()` for all + JSON types.,is_number_unsigned} + + @sa @ref is_number() -- check if value is a number + @sa @ref is_number_integer() -- check if value is an integer or unsigned + integer number + @sa @ref is_number_float() -- check if value is a floating-point number + + @since version 2.0.0 + */ + constexpr bool is_number_unsigned() const noexcept + { + return m_type == value_t::number_unsigned; + } + + /*! + @brief return whether value is a floating-point number + + This function returns true if and only if the JSON value is a + floating-point number. This excludes signed and unsigned integer values. + + @return `true` if type is a floating-point number, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_number_float()` for all + JSON types.,is_number_float} + + @sa @ref is_number() -- check if value is number + @sa @ref is_number_integer() -- check if value is an integer number + @sa @ref is_number_unsigned() -- check if value is an unsigned integer + number + + @since version 1.0.0 + */ + constexpr bool is_number_float() const noexcept + { + return m_type == value_t::number_float; + } + + /*! + @brief return whether value is an object + + This function returns true if and only if the JSON value is an object. + + @return `true` if type is object, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_object()` for all JSON + types.,is_object} + + @since version 1.0.0 + */ + constexpr bool is_object() const noexcept + { + return m_type == value_t::object; + } + + /*! + @brief return whether value is an array + + This function returns true if and only if the JSON value is an array. + + @return `true` if type is array, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_array()` for all JSON + types.,is_array} + + @since version 1.0.0 + */ + constexpr bool is_array() const noexcept + { + return m_type == value_t::array; + } + + /*! + @brief return whether value is a string + + This function returns true if and only if the JSON value is a string. + + @return `true` if type is string, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_string()` for all JSON + types.,is_string} + + @since version 1.0.0 + */ + constexpr bool is_string() const noexcept + { + return m_type == value_t::string; + } + + /*! + @brief return whether value is a binary array + + This function returns true if and only if the JSON value is a binary array. + + @return `true` if type is binary array, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_binary()` for all JSON + types.,is_binary} + + @since version 3.8.0 + */ + constexpr bool is_binary() const noexcept + { + return m_type == value_t::binary; + } + + /*! + @brief return whether value is discarded + + This function returns true if and only if the JSON value was discarded + during parsing with a callback function (see @ref parser_callback_t). + + @note This function will always be `false` for JSON values after parsing. + That is, discarded values can only occur during parsing, but will be + removed when inside a structured value or replaced by null in other cases. + + @return `true` if type is discarded, `false` otherwise. + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies `is_discarded()` for all JSON + types.,is_discarded} + + @since version 1.0.0 + */ + constexpr bool is_discarded() const noexcept + { + return m_type == value_t::discarded; + } + + /*! + @brief return the type of the JSON value (implicit) + + Implicitly return the type of the JSON value as a value from the @ref + value_t enumeration. + + @return the type of the JSON value + + @complexity Constant. + + @exceptionsafety No-throw guarantee: this member function never throws + exceptions. + + @liveexample{The following code exemplifies the @ref value_t operator for + all JSON types.,operator__value_t} + + @sa @ref type() -- return the type of the JSON value (explicit) + @sa @ref type_name() -- return the type as string + + @since version 1.0.0 + */ + constexpr operator value_t() const noexcept + { + return m_type; + } + + /// @} + + private: + ////////////////// + // value access // + ////////////////// + + /// get a boolean (explicit) + boolean_t get_impl(boolean_t* /*unused*/) const + { + if (JSON_HEDLEY_LIKELY(is_boolean())) + { + return m_value.boolean; + } + + JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(type_name()))); + } + + /// get a pointer to the value (object) + object_t* get_impl_ptr(object_t* /*unused*/) noexcept + { + return is_object() ? m_value.object : nullptr; + } + + /// get a pointer to the value (object) + constexpr const object_t* get_impl_ptr(const object_t* /*unused*/) const noexcept + { + return is_object() ? m_value.object : nullptr; + } + + /// get a pointer to the value (array) + array_t* get_impl_ptr(array_t* /*unused*/) noexcept + { + return is_array() ? m_value.array : nullptr; + } + + /// get a pointer to the value (array) + constexpr const array_t* get_impl_ptr(const array_t* /*unused*/) const noexcept + { + return is_array() ? m_value.array : nullptr; + } + + /// get a pointer to the value (string) + string_t* get_impl_ptr(string_t* /*unused*/) noexcept + { + return is_string() ? m_value.string : nullptr; + } + + /// get a pointer to the value (string) + constexpr const string_t* get_impl_ptr(const string_t* /*unused*/) const noexcept + { + return is_string() ? m_value.string : nullptr; + } + + /// get a pointer to the value (boolean) + boolean_t* get_impl_ptr(boolean_t* /*unused*/) noexcept + { + return is_boolean() ? &m_value.boolean : nullptr; + } + + /// get a pointer to the value (boolean) + constexpr const boolean_t* get_impl_ptr(const boolean_t* /*unused*/) const noexcept + { + return is_boolean() ? &m_value.boolean : nullptr; + } + + /// get a pointer to the value (integer number) + number_integer_t* get_impl_ptr(number_integer_t* /*unused*/) noexcept + { + return is_number_integer() ? &m_value.number_integer : nullptr; + } + + /// get a pointer to the value (integer number) + constexpr const number_integer_t* get_impl_ptr(const number_integer_t* /*unused*/) const noexcept + { + return is_number_integer() ? &m_value.number_integer : nullptr; + } + + /// get a pointer to the value (unsigned number) + number_unsigned_t* get_impl_ptr(number_unsigned_t* /*unused*/) noexcept + { + return is_number_unsigned() ? &m_value.number_unsigned : nullptr; + } + + /// get a pointer to the value (unsigned number) + constexpr const number_unsigned_t* get_impl_ptr(const number_unsigned_t* /*unused*/) const noexcept + { + return is_number_unsigned() ? &m_value.number_unsigned : nullptr; + } + + /// get a pointer to the value (floating-point number) + number_float_t* get_impl_ptr(number_float_t* /*unused*/) noexcept + { + return is_number_float() ? &m_value.number_float : nullptr; + } + + /// get a pointer to the value (floating-point number) + constexpr const number_float_t* get_impl_ptr(const number_float_t* /*unused*/) const noexcept + { + return is_number_float() ? &m_value.number_float : nullptr; + } + + /// get a pointer to the value (binary) + binary_t* get_impl_ptr(binary_t* /*unused*/) noexcept + { + return is_binary() ? m_value.binary : nullptr; + } + + /// get a pointer to the value (binary) + constexpr const binary_t* get_impl_ptr(const binary_t* /*unused*/) const noexcept + { + return is_binary() ? m_value.binary : nullptr; + } + + /*! + @brief helper function to implement get_ref() + + This function helps to implement get_ref() without code duplication for + const and non-const overloads + + @tparam ThisType will be deduced as `basic_json` or `const basic_json` + + @throw type_error.303 if ReferenceType does not match underlying value + type of the current JSON + */ + template + static ReferenceType get_ref_impl(ThisType& obj) + { + // delegate the call to get_ptr<>() + auto ptr = obj.template get_ptr::type>(); + + if (JSON_HEDLEY_LIKELY(ptr != nullptr)) + { + return *ptr; + } + + JSON_THROW(type_error::create(303, "incompatible ReferenceType for get_ref, actual type is " + std::string(obj.type_name()))); + } + + public: + /// @name value access + /// Direct access to the stored value of a JSON value. + /// @{ + + /*! + @brief get special-case overload + + This overloads avoids a lot of template boilerplate, it can be seen as the + identity method + + @tparam BasicJsonType == @ref basic_json + + @return a copy of *this + + @complexity Constant. + + @since version 2.1.0 + */ + template::type, basic_json_t>::value, + int> = 0> + basic_json get() const + { + return *this; + } + + /*! + @brief get special-case overload + + This overloads converts the current @ref basic_json in a different + @ref basic_json type + + @tparam BasicJsonType == @ref basic_json + + @return a copy of *this, converted into @tparam BasicJsonType + + @complexity Depending on the implementation of the called `from_json()` + method. + + @since version 3.2.0 + */ + template < typename BasicJsonType, detail::enable_if_t < + !std::is_same::value&& + detail::is_basic_json::value, int > = 0 > + BasicJsonType get() const + { + return *this; + } + + /*! + @brief get a value (explicit) + + Explicit type conversion between the JSON value and a compatible value + which is [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible) + and [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible). + The value is converted by calling the @ref json_serializer + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + ValueType ret; + JSONSerializer::from_json(*this, ret); + return ret; + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json, + - @ref json_serializer has a `from_json()` method of the form + `void from_json(const basic_json&, ValueType&)`, and + - @ref json_serializer does not have a `from_json()` method of + the form `ValueType from_json(const basic_json&)` + + @tparam ValueTypeCV the provided value type + @tparam ValueType the returned value type + + @return copy of the JSON value, converted to @a ValueType + + @throw what @ref json_serializer `from_json()` method throws + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map`.,get__ValueType_const} + + @since version 2.1.0 + */ + template < typename ValueTypeCV, typename ValueType = detail::uncvref_t, + detail::enable_if_t < + !detail::is_basic_json::value && + detail::has_from_json::value && + !detail::has_non_default_from_json::value, + int > = 0 > + ValueType get() const noexcept(noexcept( + JSONSerializer::from_json(std::declval(), std::declval()))) + { + // we cannot static_assert on ValueTypeCV being non-const, because + // there is support for get(), which is why we + // still need the uncvref + static_assert(!std::is_reference::value, + "get() cannot be used with reference types, you might want to use get_ref()"); + static_assert(std::is_default_constructible::value, + "types must be DefaultConstructible when used with get()"); + + ValueType ret; + JSONSerializer::from_json(*this, ret); + return ret; + } + + /*! + @brief get a value (explicit); special case + + Explicit type conversion between the JSON value and a compatible value + which is **not** [CopyConstructible](https://en.cppreference.com/w/cpp/named_req/CopyConstructible) + and **not** [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible). + The value is converted by calling the @ref json_serializer + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + return JSONSerializer::from_json(*this); + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json and + - @ref json_serializer has a `from_json()` method of the form + `ValueType from_json(const basic_json&)` + + @note If @ref json_serializer has both overloads of + `from_json()`, this one is chosen. + + @tparam ValueTypeCV the provided value type + @tparam ValueType the returned value type + + @return copy of the JSON value, converted to @a ValueType + + @throw what @ref json_serializer `from_json()` method throws + + @since version 2.1.0 + */ + template < typename ValueTypeCV, typename ValueType = detail::uncvref_t, + detail::enable_if_t < !std::is_same::value && + detail::has_non_default_from_json::value, + int > = 0 > + ValueType get() const noexcept(noexcept( + JSONSerializer::from_json(std::declval()))) + { + static_assert(!std::is_reference::value, + "get() cannot be used with reference types, you might want to use get_ref()"); + return JSONSerializer::from_json(*this); + } + + /*! + @brief get a value (explicit) + + Explicit type conversion between the JSON value and a compatible value. + The value is filled into the input parameter by calling the @ref json_serializer + `from_json()` method. + + The function is equivalent to executing + @code {.cpp} + ValueType v; + JSONSerializer::from_json(*this, v); + @endcode + + This overloads is chosen if: + - @a ValueType is not @ref basic_json, + - @ref json_serializer has a `from_json()` method of the form + `void from_json(const basic_json&, ValueType&)`, and + + @tparam ValueType the input parameter type. + + @return the input parameter, allowing chaining calls. + + @throw what @ref json_serializer `from_json()` method throws + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map`.,get_to} + + @since version 3.3.0 + */ + template < typename ValueType, + detail::enable_if_t < + !detail::is_basic_json::value&& + detail::has_from_json::value, + int > = 0 > + ValueType & get_to(ValueType& v) const noexcept(noexcept( + JSONSerializer::from_json(std::declval(), v))) + { + JSONSerializer::from_json(*this, v); + return v; + } + + // specialization to allow to call get_to with a basic_json value + // see https://github.com/nlohmann/json/issues/2175 + template::value, + int> = 0> + ValueType & get_to(ValueType& v) const + { + v = *this; + return v; + } + + template < + typename T, std::size_t N, + typename Array = T (&)[N], + detail::enable_if_t < + detail::has_from_json::value, int > = 0 > + Array get_to(T (&v)[N]) const + noexcept(noexcept(JSONSerializer::from_json( + std::declval(), v))) + { + JSONSerializer::from_json(*this, v); + return v; + } + + + /*! + @brief get a pointer value (implicit) + + Implicit pointer access to the internally stored JSON value. No copies are + made. + + @warning Writing data to the pointee of the result yields an undefined + state. + + @tparam PointerType pointer type; must be a pointer to @ref array_t, @ref + object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, + @ref number_unsigned_t, or @ref number_float_t. Enforced by a static + assertion. + + @return pointer to the internally stored JSON value if the requested + pointer type @a PointerType fits to the JSON value; `nullptr` otherwise + + @complexity Constant. + + @liveexample{The example below shows how pointers to internal values of a + JSON value can be requested. Note that no type conversions are made and a + `nullptr` is returned if the value and the requested pointer type does not + match.,get_ptr} + + @since version 1.0.0 + */ + template::value, int>::type = 0> + auto get_ptr() noexcept -> decltype(std::declval().get_impl_ptr(std::declval())) + { + // delegate the call to get_impl_ptr<>() + return get_impl_ptr(static_cast(nullptr)); + } + + /*! + @brief get a pointer value (implicit) + @copydoc get_ptr() + */ + template < typename PointerType, typename std::enable_if < + std::is_pointer::value&& + std::is_const::type>::value, int >::type = 0 > + constexpr auto get_ptr() const noexcept -> decltype(std::declval().get_impl_ptr(std::declval())) + { + // delegate the call to get_impl_ptr<>() const + return get_impl_ptr(static_cast(nullptr)); + } + + /*! + @brief get a pointer value (explicit) + + Explicit pointer access to the internally stored JSON value. No copies are + made. + + @warning The pointer becomes invalid if the underlying JSON object + changes. + + @tparam PointerType pointer type; must be a pointer to @ref array_t, @ref + object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, + @ref number_unsigned_t, or @ref number_float_t. + + @return pointer to the internally stored JSON value if the requested + pointer type @a PointerType fits to the JSON value; `nullptr` otherwise + + @complexity Constant. + + @liveexample{The example below shows how pointers to internal values of a + JSON value can be requested. Note that no type conversions are made and a + `nullptr` is returned if the value and the requested pointer type does not + match.,get__PointerType} + + @sa @ref get_ptr() for explicit pointer-member access + + @since version 1.0.0 + */ + template::value, int>::type = 0> + auto get() noexcept -> decltype(std::declval().template get_ptr()) + { + // delegate the call to get_ptr + return get_ptr(); + } + + /*! + @brief get a pointer value (explicit) + @copydoc get() + */ + template::value, int>::type = 0> + constexpr auto get() const noexcept -> decltype(std::declval().template get_ptr()) + { + // delegate the call to get_ptr + return get_ptr(); + } + + /*! + @brief get a reference value (implicit) + + Implicit reference access to the internally stored JSON value. No copies + are made. + + @warning Writing data to the referee of the result yields an undefined + state. + + @tparam ReferenceType reference type; must be a reference to @ref array_t, + @ref object_t, @ref string_t, @ref boolean_t, @ref number_integer_t, or + @ref number_float_t. Enforced by static assertion. + + @return reference to the internally stored JSON value if the requested + reference type @a ReferenceType fits to the JSON value; throws + type_error.303 otherwise + + @throw type_error.303 in case passed type @a ReferenceType is incompatible + with the stored JSON value; see example below + + @complexity Constant. + + @liveexample{The example shows several calls to `get_ref()`.,get_ref} + + @since version 1.1.0 + */ + template::value, int>::type = 0> + ReferenceType get_ref() + { + // delegate call to get_ref_impl + return get_ref_impl(*this); + } + + /*! + @brief get a reference value (implicit) + @copydoc get_ref() + */ + template < typename ReferenceType, typename std::enable_if < + std::is_reference::value&& + std::is_const::type>::value, int >::type = 0 > + ReferenceType get_ref() const + { + // delegate call to get_ref_impl + return get_ref_impl(*this); + } + + /*! + @brief get a value (implicit) + + Implicit type conversion between the JSON value and a compatible value. + The call is realized by calling @ref get() const. + + @tparam ValueType non-pointer type compatible to the JSON value, for + instance `int` for JSON integer numbers, `bool` for JSON booleans, or + `std::vector` types for JSON arrays. The character type of @ref string_t + as well as an initializer list of this type is excluded to avoid + ambiguities as these types implicitly convert to `std::string`. + + @return copy of the JSON value, converted to type @a ValueType + + @throw type_error.302 in case passed type @a ValueType is incompatible + to the JSON value type (e.g., the JSON value is of type boolean, but a + string is requested); see example below + + @complexity Linear in the size of the JSON value. + + @liveexample{The example below shows several conversions from JSON values + to other types. There a few things to note: (1) Floating-point numbers can + be converted to integers\, (2) A JSON array can be converted to a standard + `std::vector`\, (3) A JSON object can be converted to C++ + associative containers such as `std::unordered_map`.,operator__ValueType} + + @since version 1.0.0 + */ + template < typename ValueType, typename std::enable_if < + !std::is_pointer::value&& + !std::is_same>::value&& + !std::is_same::value&& + !detail::is_basic_json::value + && !std::is_same>::value +#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER <= 1914)) + && !std::is_same::value +#endif + && detail::is_detected::value + , int >::type = 0 > + JSON_EXPLICIT operator ValueType() const + { + // delegate the call to get<>() const + return get(); + } + + /*! + @return reference to the binary value + + @throw type_error.302 if the value is not binary + + @sa @ref is_binary() to check if the value is binary + + @since version 3.8.0 + */ + binary_t& get_binary() + { + if (!is_binary()) + { + JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(type_name()))); + } + + return *get_ptr(); + } + + /// @copydoc get_binary() + const binary_t& get_binary() const + { + if (!is_binary()) + { + JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(type_name()))); + } + + return *get_ptr(); + } + + /// @} + + + //////////////////// + // element access // + //////////////////// + + /// @name element access + /// Access to the JSON value. + /// @{ + + /*! + @brief access specified array element with bounds checking + + Returns a reference to the element at specified location @a idx, with + bounds checking. + + @param[in] idx index of the element to access + + @return reference to the element at index @a idx + + @throw type_error.304 if the JSON value is not an array; in this case, + calling `at` with an index makes no sense. See example below. + @throw out_of_range.401 if the index @a idx is out of range of the array; + that is, `idx >= size()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 1.0.0 + + @liveexample{The example below shows how array elements can be read and + written using `at()`. It also demonstrates the different exceptions that + can be thrown.,at__size_type} + */ + reference at(size_type idx) + { + // at only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + JSON_TRY + { + return m_value.array->at(idx); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified array element with bounds checking + + Returns a const reference to the element at specified location @a idx, + with bounds checking. + + @param[in] idx index of the element to access + + @return const reference to the element at index @a idx + + @throw type_error.304 if the JSON value is not an array; in this case, + calling `at` with an index makes no sense. See example below. + @throw out_of_range.401 if the index @a idx is out of range of the array; + that is, `idx >= size()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 1.0.0 + + @liveexample{The example below shows how array elements can be read using + `at()`. It also demonstrates the different exceptions that can be thrown., + at__size_type_const} + */ + const_reference at(size_type idx) const + { + // at only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + JSON_TRY + { + return m_value.array->at(idx); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified object element with bounds checking + + Returns a reference to the element at with specified key @a key, with + bounds checking. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.304 if the JSON value is not an object; in this case, + calling `at` with a key makes no sense. See example below. + @throw out_of_range.403 if the key @a key is is not stored in the object; + that is, `find(key) == end()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Logarithmic in the size of the container. + + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + + @liveexample{The example below shows how object elements can be read and + written using `at()`. It also demonstrates the different exceptions that + can be thrown.,at__object_t_key_type} + */ + reference at(const typename object_t::key_type& key) + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_TRY + { + return m_value.object->at(key); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(403, "key '" + key + "' not found")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified object element with bounds checking + + Returns a const reference to the element at with specified key @a key, + with bounds checking. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @throw type_error.304 if the JSON value is not an object; in this case, + calling `at` with a key makes no sense. See example below. + @throw out_of_range.403 if the key @a key is is not stored in the object; + that is, `find(key) == end()`. See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Logarithmic in the size of the container. + + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + + @liveexample{The example below shows how object elements can be read using + `at()`. It also demonstrates the different exceptions that can be thrown., + at__object_t_key_type_const} + */ + const_reference at(const typename object_t::key_type& key) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_TRY + { + return m_value.object->at(key); + } + JSON_CATCH (std::out_of_range&) + { + // create better exception explanation + JSON_THROW(out_of_range::create(403, "key '" + key + "' not found")); + } + } + else + { + JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()))); + } + } + + /*! + @brief access specified array element + + Returns a reference to the element at specified location @a idx. + + @note If @a idx is beyond the range of the array (i.e., `idx >= size()`), + then the array is silently filled up with `null` values to make `idx` a + valid reference to the last stored element. + + @param[in] idx index of the element to access + + @return reference to the element at index @a idx + + @throw type_error.305 if the JSON value is not an array or null; in that + cases, using the [] operator with an index makes no sense. + + @complexity Constant if @a idx is in the range of the array. Otherwise + linear in `idx - size()`. + + @liveexample{The example below shows how array elements can be read and + written using `[]` operator. Note the addition of `null` + values.,operatorarray__size_type} + + @since version 1.0.0 + */ + reference operator[](size_type idx) + { + // implicitly convert null value to an empty array + if (is_null()) + { + m_type = value_t::array; + m_value.array = create(); + assert_invariant(); + } + + // operator[] only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // fill up array with null values if given idx is outside range + if (idx >= m_value.array->size()) + { + m_value.array->insert(m_value.array->end(), + idx - m_value.array->size() + 1, + basic_json()); + } + + return m_value.array->operator[](idx); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a numeric argument with " + std::string(type_name()))); + } + + /*! + @brief access specified array element + + Returns a const reference to the element at specified location @a idx. + + @param[in] idx index of the element to access + + @return const reference to the element at index @a idx + + @throw type_error.305 if the JSON value is not an array; in that case, + using the [] operator with an index makes no sense. + + @complexity Constant. + + @liveexample{The example below shows how array elements can be read using + the `[]` operator.,operatorarray__size_type_const} + + @since version 1.0.0 + */ + const_reference operator[](size_type idx) const + { + // const operator[] only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + return m_value.array->operator[](idx); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a numeric argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element + + Returns a reference to the element at with specified key @a key. + + @note If @a key is not found in the object, then it is silently added to + the object and filled with a `null` value to make `key` a valid reference. + In case the value was `null` before, it is converted to an object. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.305 if the JSON value is not an object or null; in that + cases, using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read and + written using the `[]` operator.,operatorarray__key_type} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + */ + reference operator[](const typename object_t::key_type& key) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create(); + assert_invariant(); + } + + // operator[] only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->operator[](key); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief read-only access specified object element + + Returns a const reference to the element at with specified key @a key. No + bounds checking is performed. + + @warning If the element with key @a key does not exist, the behavior is + undefined. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @pre The element with key @a key must exist. **This precondition is + enforced with an assertion.** + + @throw type_error.305 if the JSON value is not an object; in that case, + using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read using + the `[]` operator.,operatorarray__key_type_const} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.0.0 + */ + const_reference operator[](const typename object_t::key_type& key) const + { + // const operator[] only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_ASSERT(m_value.object->find(key) != m_value.object->end()); + return m_value.object->find(key)->second; + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element + + Returns a reference to the element at with specified key @a key. + + @note If @a key is not found in the object, then it is silently added to + the object and filled with a `null` value to make `key` a valid reference. + In case the value was `null` before, it is converted to an object. + + @param[in] key key of the element to access + + @return reference to the element at key @a key + + @throw type_error.305 if the JSON value is not an object or null; in that + cases, using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read and + written using the `[]` operator.,operatorarray__key_type} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.1.0 + */ + template + JSON_HEDLEY_NON_NULL(2) + reference operator[](T* key) + { + // implicitly convert null to object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->operator[](key); + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief read-only access specified object element + + Returns a const reference to the element at with specified key @a key. No + bounds checking is performed. + + @warning If the element with key @a key does not exist, the behavior is + undefined. + + @param[in] key key of the element to access + + @return const reference to the element at key @a key + + @pre The element with key @a key must exist. **This precondition is + enforced with an assertion.** + + @throw type_error.305 if the JSON value is not an object; in that case, + using the [] operator with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be read using + the `[]` operator.,operatorarray__key_type_const} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref value() for access by value with a default value + + @since version 1.1.0 + */ + template + JSON_HEDLEY_NON_NULL(2) + const_reference operator[](T* key) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + JSON_ASSERT(m_value.object->find(key) != m_value.object->end()); + return m_value.object->find(key)->second; + } + + JSON_THROW(type_error::create(305, "cannot use operator[] with a string argument with " + std::string(type_name()))); + } + + /*! + @brief access specified object element with default value + + Returns either a copy of an object's element at the specified key @a key + or a given default value if no element with key @a key exists. + + The function is basically equivalent to executing + @code {.cpp} + try { + return at(key); + } catch(out_of_range) { + return default_value; + } + @endcode + + @note Unlike @ref at(const typename object_t::key_type&), this function + does not throw if the given key @a key was not found. + + @note Unlike @ref operator[](const typename object_t::key_type& key), this + function does not implicitly add an element to the position defined by @a + key. This function is furthermore also applicable to const objects. + + @param[in] key key of the element to access + @param[in] default_value the value to return if @a key is not found + + @tparam ValueType type compatible to JSON values, for instance `int` for + JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for + JSON arrays. Note the type of the expected value at @a key and the default + value @a default_value must be compatible. + + @return copy of the element at key @a key or @a default_value if @a key + is not found + + @throw type_error.302 if @a default_value does not match the type of the + value at @a key + @throw type_error.306 if the JSON value is not an object; in that case, + using `value()` with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be queried + with a default value.,basic_json__value} + + @sa @ref at(const typename object_t::key_type&) for access by reference + with range checking + @sa @ref operator[](const typename object_t::key_type&) for unchecked + access by reference + + @since version 1.0.0 + */ + // using std::is_convertible in a std::enable_if will fail when using explicit conversions + template < class ValueType, typename std::enable_if < + detail::is_getable::value + && !std::is_same::value, int >::type = 0 > + ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + // if key is found, return value and given default value otherwise + const auto it = find(key); + if (it != end()) + { + return it->template get(); + } + + return default_value; + } + + JSON_THROW(type_error::create(306, "cannot use value() with " + std::string(type_name()))); + } + + /*! + @brief overload for a default value of type const char* + @copydoc basic_json::value(const typename object_t::key_type&, const ValueType&) const + */ + string_t value(const typename object_t::key_type& key, const char* default_value) const + { + return value(key, string_t(default_value)); + } + + /*! + @brief access specified object element via JSON Pointer with default value + + Returns either a copy of an object's element at the specified key @a key + or a given default value if no element with key @a key exists. + + The function is basically equivalent to executing + @code {.cpp} + try { + return at(ptr); + } catch(out_of_range) { + return default_value; + } + @endcode + + @note Unlike @ref at(const json_pointer&), this function does not throw + if the given key @a key was not found. + + @param[in] ptr a JSON pointer to the element to access + @param[in] default_value the value to return if @a ptr found no value + + @tparam ValueType type compatible to JSON values, for instance `int` for + JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for + JSON arrays. Note the type of the expected value at @a key and the default + value @a default_value must be compatible. + + @return copy of the element at key @a key or @a default_value if @a key + is not found + + @throw type_error.302 if @a default_value does not match the type of the + value at @a ptr + @throw type_error.306 if the JSON value is not an object; in that case, + using `value()` with a key makes no sense. + + @complexity Logarithmic in the size of the container. + + @liveexample{The example below shows how object elements can be queried + with a default value.,basic_json__value_ptr} + + @sa @ref operator[](const json_pointer&) for unchecked access by reference + + @since version 2.0.2 + */ + template::value, int>::type = 0> + ValueType value(const json_pointer& ptr, const ValueType& default_value) const + { + // at only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + // if pointer resolves a value, return it or use default value + JSON_TRY + { + return ptr.get_checked(this).template get(); + } + JSON_INTERNAL_CATCH (out_of_range&) + { + return default_value; + } + } + + JSON_THROW(type_error::create(306, "cannot use value() with " + std::string(type_name()))); + } + + /*! + @brief overload for a default value of type const char* + @copydoc basic_json::value(const json_pointer&, ValueType) const + */ + JSON_HEDLEY_NON_NULL(3) + string_t value(const json_pointer& ptr, const char* default_value) const + { + return value(ptr, string_t(default_value)); + } + + /*! + @brief access the first element + + Returns a reference to the first element in the container. For a JSON + container `c`, the expression `c.front()` is equivalent to `*c.begin()`. + + @return In case of a structured type (array or object), a reference to the + first element is returned. In case of number, string, boolean, or binary + values, a reference to the value is returned. + + @complexity Constant. + + @pre The JSON value must not be `null` (would throw `std::out_of_range`) + or an empty array or object (undefined behavior, **guarded by + assertions**). + @post The JSON value remains unchanged. + + @throw invalid_iterator.214 when called on `null` value + + @liveexample{The following code shows an example for `front()`.,front} + + @sa @ref back() -- access the last element + + @since version 1.0.0 + */ + reference front() + { + return *begin(); + } + + /*! + @copydoc basic_json::front() + */ + const_reference front() const + { + return *cbegin(); + } + + /*! + @brief access the last element + + Returns a reference to the last element in the container. For a JSON + container `c`, the expression `c.back()` is equivalent to + @code {.cpp} + auto tmp = c.end(); + --tmp; + return *tmp; + @endcode + + @return In case of a structured type (array or object), a reference to the + last element is returned. In case of number, string, boolean, or binary + values, a reference to the value is returned. + + @complexity Constant. + + @pre The JSON value must not be `null` (would throw `std::out_of_range`) + or an empty array or object (undefined behavior, **guarded by + assertions**). + @post The JSON value remains unchanged. + + @throw invalid_iterator.214 when called on a `null` value. See example + below. + + @liveexample{The following code shows an example for `back()`.,back} + + @sa @ref front() -- access the first element + + @since version 1.0.0 + */ + reference back() + { + auto tmp = end(); + --tmp; + return *tmp; + } + + /*! + @copydoc basic_json::back() + */ + const_reference back() const + { + auto tmp = cend(); + --tmp; + return *tmp; + } + + /*! + @brief remove element given an iterator + + Removes the element specified by iterator @a pos. The iterator @a pos must + be valid and dereferenceable. Thus the `end()` iterator (which is valid, + but is not dereferenceable) cannot be used as a value for @a pos. + + If called on a primitive type other than `null`, the resulting JSON value + will be `null`. + + @param[in] pos iterator to the element to remove + @return Iterator following the last removed element. If the iterator @a + pos refers to the last element, the `end()` iterator is returned. + + @tparam IteratorType an @ref iterator or @ref const_iterator + + @post Invalidates iterators and references at or after the point of the + erase, including the `end()` iterator. + + @throw type_error.307 if called on a `null` value; example: `"cannot use + erase() with null"` + @throw invalid_iterator.202 if called on an iterator which does not belong + to the current JSON value; example: `"iterator does not fit current + value"` + @throw invalid_iterator.205 if called on a primitive type with invalid + iterator (i.e., any iterator which is not `begin()`); example: `"iterator + out of range"` + + @complexity The complexity depends on the type: + - objects: amortized constant + - arrays: linear in distance between @a pos and the end of the container + - strings and binary: linear in the length of the member + - other types: constant + + @liveexample{The example shows the result of `erase()` for different JSON + types.,erase__IteratorType} + + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + template < class IteratorType, typename std::enable_if < + std::is_same::value || + std::is_same::value, int >::type + = 0 > + IteratorType erase(IteratorType pos) + { + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(this != pos.m_object)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + IteratorType result = end(); + + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + case value_t::binary: + { + if (JSON_HEDLEY_UNLIKELY(!pos.m_it.primitive_iterator.is_begin())) + { + JSON_THROW(invalid_iterator::create(205, "iterator out of range")); + } + + if (is_string()) + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, m_value.string); + std::allocator_traits::deallocate(alloc, m_value.string, 1); + m_value.string = nullptr; + } + else if (is_binary()) + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, m_value.binary); + std::allocator_traits::deallocate(alloc, m_value.binary, 1); + m_value.binary = nullptr; + } + + m_type = value_t::null; + assert_invariant(); + break; + } + + case value_t::object: + { + result.m_it.object_iterator = m_value.object->erase(pos.m_it.object_iterator); + break; + } + + case value_t::array: + { + result.m_it.array_iterator = m_value.array->erase(pos.m_it.array_iterator); + break; + } + + default: + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + return result; + } + + /*! + @brief remove elements given an iterator range + + Removes the element specified by the range `[first; last)`. The iterator + @a first does not need to be dereferenceable if `first == last`: erasing + an empty range is a no-op. + + If called on a primitive type other than `null`, the resulting JSON value + will be `null`. + + @param[in] first iterator to the beginning of the range to remove + @param[in] last iterator past the end of the range to remove + @return Iterator following the last removed element. If the iterator @a + second refers to the last element, the `end()` iterator is returned. + + @tparam IteratorType an @ref iterator or @ref const_iterator + + @post Invalidates iterators and references at or after the point of the + erase, including the `end()` iterator. + + @throw type_error.307 if called on a `null` value; example: `"cannot use + erase() with null"` + @throw invalid_iterator.203 if called on iterators which does not belong + to the current JSON value; example: `"iterators do not fit current value"` + @throw invalid_iterator.204 if called on a primitive type with invalid + iterators (i.e., if `first != begin()` and `last != end()`); example: + `"iterators out of range"` + + @complexity The complexity depends on the type: + - objects: `log(size()) + std::distance(first, last)` + - arrays: linear in the distance between @a first and @a last, plus linear + in the distance between @a last and end of the container + - strings and binary: linear in the length of the member + - other types: constant + + @liveexample{The example shows the result of `erase()` for different JSON + types.,erase__IteratorType_IteratorType} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + template < class IteratorType, typename std::enable_if < + std::is_same::value || + std::is_same::value, int >::type + = 0 > + IteratorType erase(IteratorType first, IteratorType last) + { + // make sure iterator fits the current value + if (JSON_HEDLEY_UNLIKELY(this != first.m_object || this != last.m_object)) + { + JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value")); + } + + IteratorType result = end(); + + switch (m_type) + { + case value_t::boolean: + case value_t::number_float: + case value_t::number_integer: + case value_t::number_unsigned: + case value_t::string: + case value_t::binary: + { + if (JSON_HEDLEY_LIKELY(!first.m_it.primitive_iterator.is_begin() + || !last.m_it.primitive_iterator.is_end())) + { + JSON_THROW(invalid_iterator::create(204, "iterators out of range")); + } + + if (is_string()) + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, m_value.string); + std::allocator_traits::deallocate(alloc, m_value.string, 1); + m_value.string = nullptr; + } + else if (is_binary()) + { + AllocatorType alloc; + std::allocator_traits::destroy(alloc, m_value.binary); + std::allocator_traits::deallocate(alloc, m_value.binary, 1); + m_value.binary = nullptr; + } + + m_type = value_t::null; + assert_invariant(); + break; + } + + case value_t::object: + { + result.m_it.object_iterator = m_value.object->erase(first.m_it.object_iterator, + last.m_it.object_iterator); + break; + } + + case value_t::array: + { + result.m_it.array_iterator = m_value.array->erase(first.m_it.array_iterator, + last.m_it.array_iterator); + break; + } + + default: + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + return result; + } + + /*! + @brief remove element from a JSON object given a key + + Removes elements from a JSON object with the key value @a key. + + @param[in] key value of the elements to remove + + @return Number of elements removed. If @a ObjectType is the default + `std::map` type, the return value will always be `0` (@a key was not + found) or `1` (@a key was found). + + @post References and iterators to the erased elements are invalidated. + Other references and iterators are not affected. + + @throw type_error.307 when called on a type other than JSON object; + example: `"cannot use erase() with null"` + + @complexity `log(size()) + count(key)` + + @liveexample{The example shows the effect of `erase()`.,erase__key_type} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const size_type) -- removes the element from an array at + the given index + + @since version 1.0.0 + */ + size_type erase(const typename object_t::key_type& key) + { + // this erase only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + return m_value.object->erase(key); + } + + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + + /*! + @brief remove element from a JSON array given an index + + Removes element from a JSON array at the index @a idx. + + @param[in] idx index of the element to remove + + @throw type_error.307 when called on a type other than JSON object; + example: `"cannot use erase() with null"` + @throw out_of_range.401 when `idx >= size()`; example: `"array index 17 + is out of range"` + + @complexity Linear in distance between @a idx and the end of the container. + + @liveexample{The example shows the effect of `erase()`.,erase__size_type} + + @sa @ref erase(IteratorType) -- removes the element at a given position + @sa @ref erase(IteratorType, IteratorType) -- removes the elements in + the given range + @sa @ref erase(const typename object_t::key_type&) -- removes the element + from an object at the given key + + @since version 1.0.0 + */ + void erase(const size_type idx) + { + // this erase only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + if (JSON_HEDLEY_UNLIKELY(idx >= size())) + { + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + + m_value.array->erase(m_value.array->begin() + static_cast(idx)); + } + else + { + JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()))); + } + } + + /// @} + + + //////////// + // lookup // + //////////// + + /// @name lookup + /// @{ + + /*! + @brief find an element in a JSON object + + Finds an element in a JSON object with key equivalent to @a key. If the + element is not found or the JSON value is not an object, end() is + returned. + + @note This method always returns @ref end() when executed on a JSON type + that is not an object. + + @param[in] key key value of the element to search for. + + @return Iterator to an element with key equivalent to @a key. If no such + element is found or the JSON value is not an object, past-the-end (see + @ref end()) iterator is returned. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The example shows how `find()` is used.,find__key_type} + + @sa @ref contains(KeyT&&) const -- checks whether a key exists + + @since version 1.0.0 + */ + template + iterator find(KeyT&& key) + { + auto result = end(); + + if (is_object()) + { + result.m_it.object_iterator = m_value.object->find(std::forward(key)); + } + + return result; + } + + /*! + @brief find an element in a JSON object + @copydoc find(KeyT&&) + */ + template + const_iterator find(KeyT&& key) const + { + auto result = cend(); + + if (is_object()) + { + result.m_it.object_iterator = m_value.object->find(std::forward(key)); + } + + return result; + } + + /*! + @brief returns the number of occurrences of a key in a JSON object + + Returns the number of elements with key @a key. If ObjectType is the + default `std::map` type, the return value will always be `0` (@a key was + not found) or `1` (@a key was found). + + @note This method always returns `0` when executed on a JSON type that is + not an object. + + @param[in] key key value of the element to count + + @return Number of elements with key @a key. If the JSON value is not an + object, the return value will be `0`. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The example shows how `count()` is used.,count} + + @since version 1.0.0 + */ + template + size_type count(KeyT&& key) const + { + // return 0 for all nonobject types + return is_object() ? m_value.object->count(std::forward(key)) : 0; + } + + /*! + @brief check the existence of an element in a JSON object + + Check whether an element exists in a JSON object with key equivalent to + @a key. If the element is not found or the JSON value is not an object, + false is returned. + + @note This method always returns false when executed on a JSON type + that is not an object. + + @param[in] key key value to check its existence. + + @return true if an element with specified @a key exists. If no such + element with such key is found or the JSON value is not an object, + false is returned. + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The following code shows an example for `contains()`.,contains} + + @sa @ref find(KeyT&&) -- returns an iterator to an object element + @sa @ref contains(const json_pointer&) const -- checks the existence for a JSON pointer + + @since version 3.6.0 + */ + template < typename KeyT, typename std::enable_if < + !std::is_same::type, json_pointer>::value, int >::type = 0 > + bool contains(KeyT && key) const + { + return is_object() && m_value.object->find(std::forward(key)) != m_value.object->end(); + } + + /*! + @brief check the existence of an element in a JSON object given a JSON pointer + + Check whether the given JSON pointer @a ptr can be resolved in the current + JSON value. + + @note This method can be executed on any JSON value type. + + @param[in] ptr JSON pointer to check its existence. + + @return true if the JSON pointer can be resolved to a stored value, false + otherwise. + + @post If `j.contains(ptr)` returns true, it is safe to call `j[ptr]`. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + + @complexity Logarithmic in the size of the JSON object. + + @liveexample{The following code shows an example for `contains()`.,contains_json_pointer} + + @sa @ref contains(KeyT &&) const -- checks the existence of a key + + @since version 3.7.0 + */ + bool contains(const json_pointer& ptr) const + { + return ptr.contains(this); + } + + /// @} + + + /////////////// + // iterators // + /////////////// + + /// @name iterators + /// @{ + + /*! + @brief returns an iterator to the first element + + Returns an iterator to the first element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return iterator to the first element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + + @liveexample{The following code shows an example for `begin()`.,begin} + + @sa @ref cbegin() -- returns a const iterator to the beginning + @sa @ref end() -- returns an iterator to the end + @sa @ref cend() -- returns a const iterator to the end + + @since version 1.0.0 + */ + iterator begin() noexcept + { + iterator result(this); + result.set_begin(); + return result; + } + + /*! + @copydoc basic_json::cbegin() + */ + const_iterator begin() const noexcept + { + return cbegin(); + } + + /*! + @brief returns a const iterator to the first element + + Returns a const iterator to the first element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return const iterator to the first element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast(*this).begin()`. + + @liveexample{The following code shows an example for `cbegin()`.,cbegin} + + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref end() -- returns an iterator to the end + @sa @ref cend() -- returns a const iterator to the end + + @since version 1.0.0 + */ + const_iterator cbegin() const noexcept + { + const_iterator result(this); + result.set_begin(); + return result; + } + + /*! + @brief returns an iterator to one past the last element + + Returns an iterator to one past the last element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return iterator one past the last element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + + @liveexample{The following code shows an example for `end()`.,end} + + @sa @ref cend() -- returns a const iterator to the end + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref cbegin() -- returns a const iterator to the beginning + + @since version 1.0.0 + */ + iterator end() noexcept + { + iterator result(this); + result.set_end(); + return result; + } + + /*! + @copydoc basic_json::cend() + */ + const_iterator end() const noexcept + { + return cend(); + } + + /*! + @brief returns a const iterator to one past the last element + + Returns a const iterator to one past the last element. + + @image html range-begin-end.svg "Illustration from cppreference.com" + + @return const iterator one past the last element + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast(*this).end()`. + + @liveexample{The following code shows an example for `cend()`.,cend} + + @sa @ref end() -- returns an iterator to the end + @sa @ref begin() -- returns an iterator to the beginning + @sa @ref cbegin() -- returns a const iterator to the beginning + + @since version 1.0.0 + */ + const_iterator cend() const noexcept + { + const_iterator result(this); + result.set_end(); + return result; + } + + /*! + @brief returns an iterator to the reverse-beginning + + Returns an iterator to the reverse-beginning; that is, the last element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `reverse_iterator(end())`. + + @liveexample{The following code shows an example for `rbegin()`.,rbegin} + + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref crend() -- returns a const reverse iterator to the end + + @since version 1.0.0 + */ + reverse_iterator rbegin() noexcept + { + return reverse_iterator(end()); + } + + /*! + @copydoc basic_json::crbegin() + */ + const_reverse_iterator rbegin() const noexcept + { + return crbegin(); + } + + /*! + @brief returns an iterator to the reverse-end + + Returns an iterator to the reverse-end; that is, one before the first + element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `reverse_iterator(begin())`. + + @liveexample{The following code shows an example for `rend()`.,rend} + + @sa @ref crend() -- returns a const reverse iterator to the end + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + + @since version 1.0.0 + */ + reverse_iterator rend() noexcept + { + return reverse_iterator(begin()); + } + + /*! + @copydoc basic_json::crend() + */ + const_reverse_iterator rend() const noexcept + { + return crend(); + } + + /*! + @brief returns a const reverse iterator to the last element + + Returns a const iterator to the reverse-beginning; that is, the last + element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast(*this).rbegin()`. + + @liveexample{The following code shows an example for `crbegin()`.,crbegin} + + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref crend() -- returns a const reverse iterator to the end + + @since version 1.0.0 + */ + const_reverse_iterator crbegin() const noexcept + { + return const_reverse_iterator(cend()); + } + + /*! + @brief returns a const reverse iterator to one before the first + + Returns a const reverse iterator to the reverse-end; that is, one before + the first element. + + @image html range-rbegin-rend.svg "Illustration from cppreference.com" + + @complexity Constant. + + @requirement This function helps `basic_json` satisfying the + [ReversibleContainer](https://en.cppreference.com/w/cpp/named_req/ReversibleContainer) + requirements: + - The complexity is constant. + - Has the semantics of `const_cast(*this).rend()`. + + @liveexample{The following code shows an example for `crend()`.,crend} + + @sa @ref rend() -- returns a reverse iterator to the end + @sa @ref rbegin() -- returns a reverse iterator to the beginning + @sa @ref crbegin() -- returns a const reverse iterator to the beginning + + @since version 1.0.0 + */ + const_reverse_iterator crend() const noexcept + { + return const_reverse_iterator(cbegin()); + } + + public: + /*! + @brief wrapper to access iterator member functions in range-based for + + This function allows to access @ref iterator::key() and @ref + iterator::value() during range-based for loops. In these loops, a + reference to the JSON values is returned, so there is no access to the + underlying iterator. + + For loop without iterator_wrapper: + + @code{cpp} + for (auto it = j_object.begin(); it != j_object.end(); ++it) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + Range-based for loop without iterator proxy: + + @code{cpp} + for (auto it : j_object) + { + // "it" is of type json::reference and has no key() member + std::cout << "value: " << it << '\n'; + } + @endcode + + Range-based for loop with iterator proxy: + + @code{cpp} + for (auto it : json::iterator_wrapper(j_object)) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + @note When iterating over an array, `key()` will return the index of the + element as string (see example). + + @param[in] ref reference to a JSON value + @return iteration proxy object wrapping @a ref with an interface to use in + range-based for loops + + @liveexample{The following code shows how the wrapper is used,iterator_wrapper} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @note The name of this function is not yet final and may change in the + future. + + @deprecated This stream operator is deprecated and will be removed in + future 4.0.0 of the library. Please use @ref items() instead; + that is, replace `json::iterator_wrapper(j)` with `j.items()`. + */ + JSON_HEDLEY_DEPRECATED_FOR(3.1.0, items()) + static iteration_proxy iterator_wrapper(reference ref) noexcept + { + return ref.items(); + } + + /*! + @copydoc iterator_wrapper(reference) + */ + JSON_HEDLEY_DEPRECATED_FOR(3.1.0, items()) + static iteration_proxy iterator_wrapper(const_reference ref) noexcept + { + return ref.items(); + } + + /*! + @brief helper to access iterator member functions in range-based for + + This function allows to access @ref iterator::key() and @ref + iterator::value() during range-based for loops. In these loops, a + reference to the JSON values is returned, so there is no access to the + underlying iterator. + + For loop without `items()` function: + + @code{cpp} + for (auto it = j_object.begin(); it != j_object.end(); ++it) + { + std::cout << "key: " << it.key() << ", value:" << it.value() << '\n'; + } + @endcode + + Range-based for loop without `items()` function: + + @code{cpp} + for (auto it : j_object) + { + // "it" is of type json::reference and has no key() member + std::cout << "value: " << it << '\n'; + } + @endcode + + Range-based for loop with `items()` function: + + @code{cpp} + for (auto& el : j_object.items()) + { + std::cout << "key: " << el.key() << ", value:" << el.value() << '\n'; + } + @endcode + + The `items()` function also allows to use + [structured bindings](https://en.cppreference.com/w/cpp/language/structured_binding) + (C++17): + + @code{cpp} + for (auto& [key, val] : j_object.items()) + { + std::cout << "key: " << key << ", value:" << val << '\n'; + } + @endcode + + @note When iterating over an array, `key()` will return the index of the + element as string (see example). For primitive types (e.g., numbers), + `key()` returns an empty string. + + @warning Using `items()` on temporary objects is dangerous. Make sure the + object's lifetime exeeds the iteration. See + for more + information. + + @return iteration proxy object wrapping @a ref with an interface to use in + range-based for loops + + @liveexample{The following code shows how the function is used.,items} + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 3.1.0, structured bindings support since 3.5.0. + */ + iteration_proxy items() noexcept + { + return iteration_proxy(*this); + } + + /*! + @copydoc items() + */ + iteration_proxy items() const noexcept + { + return iteration_proxy(*this); + } + + /// @} + + + ////////////// + // capacity // + ////////////// + + /// @name capacity + /// @{ + + /*! + @brief checks whether the container is empty. + + Checks if a JSON value has no elements (i.e. whether its @ref size is `0`). + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `true` + boolean | `false` + string | `false` + number | `false` + binary | `false` + object | result of function `object_t::empty()` + array | result of function `array_t::empty()` + + @liveexample{The following code uses `empty()` to check if a JSON + object contains any elements.,empty} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their `empty()` functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @note This function does not return whether a string stored as JSON value + is empty - it returns whether the JSON container itself is empty which is + false in the case of a string. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `begin() == end()`. + + @sa @ref size() -- returns the number of elements + + @since version 1.0.0 + */ + bool empty() const noexcept + { + switch (m_type) + { + case value_t::null: + { + // null values are empty + return true; + } + + case value_t::array: + { + // delegate call to array_t::empty() + return m_value.array->empty(); + } + + case value_t::object: + { + // delegate call to object_t::empty() + return m_value.object->empty(); + } + + default: + { + // all other types are nonempty + return false; + } + } + } + + /*! + @brief returns the number of elements + + Returns the number of elements in a JSON value. + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `0` + boolean | `1` + string | `1` + number | `1` + binary | `1` + object | result of function object_t::size() + array | result of function array_t::size() + + @liveexample{The following code calls `size()` on the different value + types.,size} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their size() functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @note This function does not return the length of a string stored as JSON + value - it returns the number of elements in the JSON value which is 1 in + the case of a string. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of `std::distance(begin(), end())`. + + @sa @ref empty() -- checks whether the container is empty + @sa @ref max_size() -- returns the maximal number of elements + + @since version 1.0.0 + */ + size_type size() const noexcept + { + switch (m_type) + { + case value_t::null: + { + // null values are empty + return 0; + } + + case value_t::array: + { + // delegate call to array_t::size() + return m_value.array->size(); + } + + case value_t::object: + { + // delegate call to object_t::size() + return m_value.object->size(); + } + + default: + { + // all other types have size 1 + return 1; + } + } + } + + /*! + @brief returns the maximum possible number of elements + + Returns the maximum number of elements a JSON value is able to hold due to + system or library implementation limitations, i.e. `std::distance(begin(), + end())` for the JSON value. + + @return The return value depends on the different types and is + defined as follows: + Value type | return value + ----------- | ------------- + null | `0` (same as `size()`) + boolean | `1` (same as `size()`) + string | `1` (same as `size()`) + number | `1` (same as `size()`) + binary | `1` (same as `size()`) + object | result of function `object_t::max_size()` + array | result of function `array_t::max_size()` + + @liveexample{The following code calls `max_size()` on the different value + types. Note the output is implementation specific.,max_size} + + @complexity Constant, as long as @ref array_t and @ref object_t satisfy + the Container concept; that is, their `max_size()` functions have constant + complexity. + + @iterators No changes. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @requirement This function helps `basic_json` satisfying the + [Container](https://en.cppreference.com/w/cpp/named_req/Container) + requirements: + - The complexity is constant. + - Has the semantics of returning `b.size()` where `b` is the largest + possible JSON value. + + @sa @ref size() -- returns the number of elements + + @since version 1.0.0 + */ + size_type max_size() const noexcept + { + switch (m_type) + { + case value_t::array: + { + // delegate call to array_t::max_size() + return m_value.array->max_size(); + } + + case value_t::object: + { + // delegate call to object_t::max_size() + return m_value.object->max_size(); + } + + default: + { + // all other types have max_size() == size() + return size(); + } + } + } + + /// @} + + + /////////////// + // modifiers // + /////////////// + + /// @name modifiers + /// @{ + + /*! + @brief clears the contents + + Clears the content of a JSON value and resets it to the default value as + if @ref basic_json(value_t) would have been called with the current value + type from @ref type(): + + Value type | initial value + ----------- | ------------- + null | `null` + boolean | `false` + string | `""` + number | `0` + binary | An empty byte vector + object | `{}` + array | `[]` + + @post Has the same effect as calling + @code {.cpp} + *this = basic_json(type()); + @endcode + + @liveexample{The example below shows the effect of `clear()` to different + JSON types.,clear} + + @complexity Linear in the size of the JSON value. + + @iterators All iterators, pointers and references related to this container + are invalidated. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @sa @ref basic_json(value_t) -- constructor that creates an object with the + same value than calling `clear()` + + @since version 1.0.0 + */ + void clear() noexcept + { + switch (m_type) + { + case value_t::number_integer: + { + m_value.number_integer = 0; + break; + } + + case value_t::number_unsigned: + { + m_value.number_unsigned = 0; + break; + } + + case value_t::number_float: + { + m_value.number_float = 0.0; + break; + } + + case value_t::boolean: + { + m_value.boolean = false; + break; + } + + case value_t::string: + { + m_value.string->clear(); + break; + } + + case value_t::binary: + { + m_value.binary->clear(); + break; + } + + case value_t::array: + { + m_value.array->clear(); + break; + } + + case value_t::object: + { + m_value.object->clear(); + break; + } + + default: + break; + } + } + + /*! + @brief add an object to an array + + Appends the given element @a val to the end of the JSON value. If the + function is called on a JSON null value, an empty array is created before + appending @a val. + + @param[in] val the value to add to the JSON array + + @throw type_error.308 when called on a type other than JSON array or + null; example: `"cannot use push_back() with number"` + + @complexity Amortized constant. + + @liveexample{The example shows how `push_back()` and `+=` can be used to + add elements to a JSON array. Note how the `null` value was silently + converted to a JSON array.,push_back} + + @since version 1.0.0 + */ + void push_back(basic_json&& val) + { + // push_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_array()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array (move semantics) + m_value.array->push_back(std::move(val)); + // if val is moved from, basic_json move constructor marks it null so we do not call the destructor + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + reference operator+=(basic_json&& val) + { + push_back(std::move(val)); + return *this; + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + void push_back(const basic_json& val) + { + // push_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_array()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array + m_value.array->push_back(val); + } + + /*! + @brief add an object to an array + @copydoc push_back(basic_json&&) + */ + reference operator+=(const basic_json& val) + { + push_back(val); + return *this; + } + + /*! + @brief add an object to an object + + Inserts the given element @a val to the JSON object. If the function is + called on a JSON null value, an empty object is created before inserting + @a val. + + @param[in] val the value to add to the JSON object + + @throw type_error.308 when called on a type other than JSON object or + null; example: `"cannot use push_back() with number"` + + @complexity Logarithmic in the size of the container, O(log(`size()`)). + + @liveexample{The example shows how `push_back()` and `+=` can be used to + add elements to a JSON object. Note how the `null` value was silently + converted to a JSON object.,push_back__object_t__value} + + @since version 1.0.0 + */ + void push_back(const typename object_t::value_type& val) + { + // push_back only works for null objects or objects + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_object()))) + { + JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name()))); + } + + // transform null object into an object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // add element to array + m_value.object->insert(val); + } + + /*! + @brief add an object to an object + @copydoc push_back(const typename object_t::value_type&) + */ + reference operator+=(const typename object_t::value_type& val) + { + push_back(val); + return *this; + } + + /*! + @brief add an object to an object + + This function allows to use `push_back` with an initializer list. In case + + 1. the current value is an object, + 2. the initializer list @a init contains only two elements, and + 3. the first element of @a init is a string, + + @a init is converted into an object element and added using + @ref push_back(const typename object_t::value_type&). Otherwise, @a init + is converted to a JSON value and added using @ref push_back(basic_json&&). + + @param[in] init an initializer list + + @complexity Linear in the size of the initializer list @a init. + + @note This function is required to resolve an ambiguous overload error, + because pairs like `{"key", "value"}` can be both interpreted as + `object_t::value_type` or `std::initializer_list`, see + https://github.com/nlohmann/json/issues/235 for more information. + + @liveexample{The example shows how initializer lists are treated as + objects when possible.,push_back__initializer_list} + */ + void push_back(initializer_list_t init) + { + if (is_object() && init.size() == 2 && (*init.begin())->is_string()) + { + basic_json&& key = init.begin()->moved_or_copied(); + push_back(typename object_t::value_type( + std::move(key.get_ref()), (init.begin() + 1)->moved_or_copied())); + } + else + { + push_back(basic_json(init)); + } + } + + /*! + @brief add an object to an object + @copydoc push_back(initializer_list_t) + */ + reference operator+=(initializer_list_t init) + { + push_back(init); + return *this; + } + + /*! + @brief add an object to an array + + Creates a JSON value from the passed parameters @a args to the end of the + JSON value. If the function is called on a JSON null value, an empty array + is created before appending the value created from @a args. + + @param[in] args arguments to forward to a constructor of @ref basic_json + @tparam Args compatible types to create a @ref basic_json object + + @return reference to the inserted element + + @throw type_error.311 when called on a type other than JSON array or + null; example: `"cannot use emplace_back() with number"` + + @complexity Amortized constant. + + @liveexample{The example shows how `push_back()` can be used to add + elements to a JSON array. Note how the `null` value was silently converted + to a JSON array.,emplace_back} + + @since version 2.0.8, returns reference since 3.7.0 + */ + template + reference emplace_back(Args&& ... args) + { + // emplace_back only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_array()))) + { + JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + std::string(type_name()))); + } + + // transform null object into an array + if (is_null()) + { + m_type = value_t::array; + m_value = value_t::array; + assert_invariant(); + } + + // add element to array (perfect forwarding) +#ifdef JSON_HAS_CPP_17 + return m_value.array->emplace_back(std::forward(args)...); +#else + m_value.array->emplace_back(std::forward(args)...); + return m_value.array->back(); +#endif + } + + /*! + @brief add an object to an object if key does not exist + + Inserts a new element into a JSON object constructed in-place with the + given @a args if there is no element with the key in the container. If the + function is called on a JSON null value, an empty object is created before + appending the value created from @a args. + + @param[in] args arguments to forward to a constructor of @ref basic_json + @tparam Args compatible types to create a @ref basic_json object + + @return a pair consisting of an iterator to the inserted element, or the + already-existing element if no insertion happened, and a bool + denoting whether the insertion took place. + + @throw type_error.311 when called on a type other than JSON object or + null; example: `"cannot use emplace() with number"` + + @complexity Logarithmic in the size of the container, O(log(`size()`)). + + @liveexample{The example shows how `emplace()` can be used to add elements + to a JSON object. Note how the `null` value was silently converted to a + JSON object. Further note how no value is added if there was already one + value stored with the same key.,emplace} + + @since version 2.0.8 + */ + template + std::pair emplace(Args&& ... args) + { + // emplace only works for null objects or arrays + if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_object()))) + { + JSON_THROW(type_error::create(311, "cannot use emplace() with " + std::string(type_name()))); + } + + // transform null object into an object + if (is_null()) + { + m_type = value_t::object; + m_value = value_t::object; + assert_invariant(); + } + + // add element to array (perfect forwarding) + auto res = m_value.object->emplace(std::forward(args)...); + // create result iterator and set iterator to the result of emplace + auto it = begin(); + it.m_it.object_iterator = res.first; + + // return pair of iterator and boolean + return {it, res.second}; + } + + /// Helper for insertion of an iterator + /// @note: This uses std::distance to support GCC 4.8, + /// see https://github.com/nlohmann/json/pull/1257 + template + iterator insert_iterator(const_iterator pos, Args&& ... args) + { + iterator result(this); + JSON_ASSERT(m_value.array != nullptr); + + auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator); + m_value.array->insert(pos.m_it.array_iterator, std::forward(args)...); + result.m_it.array_iterator = m_value.array->begin() + insert_pos; + + // This could have been written as: + // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val); + // but the return value of insert is missing in GCC 4.8, so it is written this way instead. + + return result; + } + + /*! + @brief inserts element + + Inserts element @a val before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] val element to insert + @return iterator pointing to the inserted @a val. + + @throw type_error.309 if called on JSON values other than arrays; + example: `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @complexity Constant plus linear in the distance between @a pos and end of + the container. + + @liveexample{The example shows how `insert()` is used.,insert} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, const basic_json& val) + { + // insert only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, val); + } + + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + /*! + @brief inserts element + @copydoc insert(const_iterator, const basic_json&) + */ + iterator insert(const_iterator pos, basic_json&& val) + { + return insert(pos, val); + } + + /*! + @brief inserts elements + + Inserts @a cnt copies of @a val before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] cnt number of copies of @a val to insert + @param[in] val element to insert + @return iterator pointing to the first element inserted, or @a pos if + `cnt==0` + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @complexity Linear in @a cnt plus linear in the distance between @a pos + and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__count} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, size_type cnt, const basic_json& val) + { + // insert only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, cnt, val); + } + + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + /*! + @brief inserts elements + + Inserts elements from range `[first, last)` before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + @throw invalid_iterator.211 if @a first or @a last are iterators into + container for which insert is called; example: `"passed iterators may not + belong to container"` + + @return iterator pointing to the first element inserted, or @a pos if + `first==last` + + @complexity Linear in `std::distance(first, last)` plus linear in the + distance between @a pos and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__range} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, const_iterator first, const_iterator last) + { + // insert only works for arrays + if (JSON_HEDLEY_UNLIKELY(!is_array())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + if (JSON_HEDLEY_UNLIKELY(first.m_object == this)) + { + JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container")); + } + + // insert to array and return iterator + return insert_iterator(pos, first.m_it.array_iterator, last.m_it.array_iterator); + } + + /*! + @brief inserts elements + + Inserts elements from initializer list @a ilist before iterator @a pos. + + @param[in] pos iterator before which the content will be inserted; may be + the end() iterator + @param[in] ilist initializer list to insert the values from + + @throw type_error.309 if called on JSON values other than arrays; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if @a pos is not an iterator of *this; + example: `"iterator does not fit current value"` + + @return iterator pointing to the first element inserted, or @a pos if + `ilist` is empty + + @complexity Linear in `ilist.size()` plus linear in the distance between + @a pos and end of the container. + + @liveexample{The example shows how `insert()` is used.,insert__ilist} + + @since version 1.0.0 + */ + iterator insert(const_iterator pos, initializer_list_t ilist) + { + // insert only works for arrays + if (JSON_HEDLEY_UNLIKELY(!is_array())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if iterator pos fits to this JSON value + if (JSON_HEDLEY_UNLIKELY(pos.m_object != this)) + { + JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value")); + } + + // insert to array and return iterator + return insert_iterator(pos, ilist.begin(), ilist.end()); + } + + /*! + @brief inserts elements + + Inserts elements from range `[first, last)`. + + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.309 if called on JSON values other than objects; example: + `"cannot use insert() with string"` + @throw invalid_iterator.202 if iterator @a first or @a last does does not + point to an object; example: `"iterators first and last must point to + objects"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + + @complexity Logarithmic: `O(N*log(size() + N))`, where `N` is the number + of elements to insert. + + @liveexample{The example shows how `insert()` is used.,insert__range_object} + + @since version 3.0.0 + */ + void insert(const_iterator first, const_iterator last) + { + // insert only works for objects + if (JSON_HEDLEY_UNLIKELY(!is_object())) + { + JSON_THROW(type_error::create(309, "cannot use insert() with " + std::string(type_name()))); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + // passed iterators must belong to objects + if (JSON_HEDLEY_UNLIKELY(!first.m_object->is_object())) + { + JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); + } + + m_value.object->insert(first.m_it.object_iterator, last.m_it.object_iterator); + } + + /*! + @brief updates a JSON object from another object, overwriting existing keys + + Inserts all values from JSON object @a j and overwrites existing keys. + + @param[in] j JSON object to read values from + + @throw type_error.312 if called on JSON values other than objects; example: + `"cannot use update() with string"` + + @complexity O(N*log(size() + N)), where N is the number of elements to + insert. + + @liveexample{The example shows how `update()` is used.,update} + + @sa https://docs.python.org/3.6/library/stdtypes.html#dict.update + + @since version 3.0.0 + */ + void update(const_reference j) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create(); + assert_invariant(); + } + + if (JSON_HEDLEY_UNLIKELY(!is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); + } + if (JSON_HEDLEY_UNLIKELY(!j.is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(j.type_name()))); + } + + for (auto it = j.cbegin(); it != j.cend(); ++it) + { + m_value.object->operator[](it.key()) = it.value(); + } + } + + /*! + @brief updates a JSON object from another object, overwriting existing keys + + Inserts all values from from range `[first, last)` and overwrites existing + keys. + + @param[in] first begin of the range of elements to insert + @param[in] last end of the range of elements to insert + + @throw type_error.312 if called on JSON values other than objects; example: + `"cannot use update() with string"` + @throw invalid_iterator.202 if iterator @a first or @a last does does not + point to an object; example: `"iterators first and last must point to + objects"` + @throw invalid_iterator.210 if @a first and @a last do not belong to the + same JSON value; example: `"iterators do not fit"` + + @complexity O(N*log(size() + N)), where N is the number of elements to + insert. + + @liveexample{The example shows how `update()` is used__range.,update} + + @sa https://docs.python.org/3.6/library/stdtypes.html#dict.update + + @since version 3.0.0 + */ + void update(const_iterator first, const_iterator last) + { + // implicitly convert null value to an empty object + if (is_null()) + { + m_type = value_t::object; + m_value.object = create(); + assert_invariant(); + } + + if (JSON_HEDLEY_UNLIKELY(!is_object())) + { + JSON_THROW(type_error::create(312, "cannot use update() with " + std::string(type_name()))); + } + + // check if range iterators belong to the same JSON object + if (JSON_HEDLEY_UNLIKELY(first.m_object != last.m_object)) + { + JSON_THROW(invalid_iterator::create(210, "iterators do not fit")); + } + + // passed iterators must belong to objects + if (JSON_HEDLEY_UNLIKELY(!first.m_object->is_object() + || !last.m_object->is_object())) + { + JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects")); + } + + for (auto it = first; it != last; ++it) + { + m_value.object->operator[](it.key()) = it.value(); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of the JSON value with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other JSON value to exchange the contents with + + @complexity Constant. + + @liveexample{The example below shows how JSON values can be swapped with + `swap()`.,swap__reference} + + @since version 1.0.0 + */ + void swap(reference other) noexcept ( + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value + ) + { + std::swap(m_type, other.m_type); + std::swap(m_value, other.m_value); + assert_invariant(); + } + + /*! + @brief exchanges the values + + Exchanges the contents of the JSON value from @a left with those of @a right. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. implemented as a friend function callable via ADL. + + @param[in,out] left JSON value to exchange the contents with + @param[in,out] right JSON value to exchange the contents with + + @complexity Constant. + + @liveexample{The example below shows how JSON values can be swapped with + `swap()`.,swap__reference} + + @since version 1.0.0 + */ + friend void swap(reference left, reference right) noexcept ( + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_assignable::value + ) + { + left.swap(right); + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON array with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other array to exchange the contents with + + @throw type_error.310 when JSON value is not an array; example: `"cannot + use swap() with string"` + + @complexity Constant. + + @liveexample{The example below shows how arrays can be swapped with + `swap()`.,swap__array_t} + + @since version 1.0.0 + */ + void swap(array_t& other) + { + // swap only works for arrays + if (JSON_HEDLEY_LIKELY(is_array())) + { + std::swap(*(m_value.array), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON object with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other object to exchange the contents with + + @throw type_error.310 when JSON value is not an object; example: + `"cannot use swap() with string"` + + @complexity Constant. + + @liveexample{The example below shows how objects can be swapped with + `swap()`.,swap__object_t} + + @since version 1.0.0 + */ + void swap(object_t& other) + { + // swap only works for objects + if (JSON_HEDLEY_LIKELY(is_object())) + { + std::swap(*(m_value.object), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON string with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other string to exchange the contents with + + @throw type_error.310 when JSON value is not a string; example: `"cannot + use swap() with boolean"` + + @complexity Constant. + + @liveexample{The example below shows how strings can be swapped with + `swap()`.,swap__string_t} + + @since version 1.0.0 + */ + void swap(string_t& other) + { + // swap only works for strings + if (JSON_HEDLEY_LIKELY(is_string())) + { + std::swap(*(m_value.string), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /*! + @brief exchanges the values + + Exchanges the contents of a JSON string with those of @a other. Does not + invoke any move, copy, or swap operations on individual elements. All + iterators and references remain valid. The past-the-end iterator is + invalidated. + + @param[in,out] other binary to exchange the contents with + + @throw type_error.310 when JSON value is not a string; example: `"cannot + use swap() with boolean"` + + @complexity Constant. + + @liveexample{The example below shows how strings can be swapped with + `swap()`.,swap__binary_t} + + @since version 3.8.0 + */ + void swap(binary_t& other) + { + // swap only works for strings + if (JSON_HEDLEY_LIKELY(is_binary())) + { + std::swap(*(m_value.binary), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /// @copydoc swap(binary_t) + void swap(typename binary_t::container_type& other) + { + // swap only works for strings + if (JSON_HEDLEY_LIKELY(is_binary())) + { + std::swap(*(m_value.binary), other); + } + else + { + JSON_THROW(type_error::create(310, "cannot use swap() with " + std::string(type_name()))); + } + } + + /// @} + + public: + ////////////////////////////////////////// + // lexicographical comparison operators // + ////////////////////////////////////////// + + /// @name lexicographical comparison operators + /// @{ + + /*! + @brief comparison: equal + + Compares two JSON values for equality according to the following rules: + - Two JSON values are equal if (1) they are from the same type and (2) + their stored values are the same according to their respective + `operator==`. + - Integer and floating-point numbers are automatically converted before + comparison. Note that two NaN values are always treated as unequal. + - Two JSON null values are equal. + + @note Floating-point inside JSON values numbers are compared with + `json::number_float_t::operator==` which is `double::operator==` by + default. To compare floating-point while respecting an epsilon, an alternative + [comparison function](https://github.com/mariokonrad/marnav/blob/master/include/marnav/math/floatingpoint.hpp#L34-#L39) + could be used, for instance + @code {.cpp} + template::value, T>::type> + inline bool is_same(T a, T b, T epsilon = std::numeric_limits::epsilon()) noexcept + { + return std::abs(a - b) <= epsilon; + } + @endcode + Or you can self-defined operator equal function like this: + @code {.cpp} + bool my_equal(const_reference lhs, const_reference rhs) { + const auto lhs_type lhs.type(); + const auto rhs_type rhs.type(); + if (lhs_type == rhs_type) { + switch(lhs_type) + // self_defined case + case value_t::number_float: + return std::abs(lhs - rhs) <= std::numeric_limits::epsilon(); + // other cases remain the same with the original + ... + } + ... + } + @endcode + + @note NaN values never compare equal to themselves or to other NaN values. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether the values @a lhs and @a rhs are equal + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @complexity Linear. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__equal} + + @since version 1.0.0 + */ + friend bool operator==(const_reference lhs, const_reference rhs) noexcept + { + const auto lhs_type = lhs.type(); + const auto rhs_type = rhs.type(); + + if (lhs_type == rhs_type) + { + switch (lhs_type) + { + case value_t::array: + return *lhs.m_value.array == *rhs.m_value.array; + + case value_t::object: + return *lhs.m_value.object == *rhs.m_value.object; + + case value_t::null: + return true; + + case value_t::string: + return *lhs.m_value.string == *rhs.m_value.string; + + case value_t::boolean: + return lhs.m_value.boolean == rhs.m_value.boolean; + + case value_t::number_integer: + return lhs.m_value.number_integer == rhs.m_value.number_integer; + + case value_t::number_unsigned: + return lhs.m_value.number_unsigned == rhs.m_value.number_unsigned; + + case value_t::number_float: + return lhs.m_value.number_float == rhs.m_value.number_float; + + case value_t::binary: + return *lhs.m_value.binary == *rhs.m_value.binary; + + default: + return false; + } + } + else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_float) + { + return static_cast(lhs.m_value.number_integer) == rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float && rhs_type == value_t::number_integer) + { + return lhs.m_value.number_float == static_cast(rhs.m_value.number_integer); + } + else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_float) + { + return static_cast(lhs.m_value.number_unsigned) == rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float && rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_float == static_cast(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_integer) + { + return static_cast(lhs.m_value.number_unsigned) == rhs.m_value.number_integer; + } + else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_integer == static_cast(rhs.m_value.number_unsigned); + } + + return false; + } + + /*! + @brief comparison: equal + @copydoc operator==(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator==(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs == basic_json(rhs); + } + + /*! + @brief comparison: equal + @copydoc operator==(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator==(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) == rhs; + } + + /*! + @brief comparison: not equal + + Compares two JSON values for inequality by calculating `not (lhs == rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether the values @a lhs and @a rhs are not equal + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__notequal} + + @since version 1.0.0 + */ + friend bool operator!=(const_reference lhs, const_reference rhs) noexcept + { + return !(lhs == rhs); + } + + /*! + @brief comparison: not equal + @copydoc operator!=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator!=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs != basic_json(rhs); + } + + /*! + @brief comparison: not equal + @copydoc operator!=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator!=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) != rhs; + } + + /*! + @brief comparison: less than + + Compares whether one JSON value @a lhs is less than another JSON value @a + rhs according to the following rules: + - If @a lhs and @a rhs have the same type, the values are compared using + the default `<` operator. + - Integer and floating-point numbers are automatically converted before + comparison + - In case @a lhs and @a rhs have different types, the values are ignored + and the order of the types is considered, see + @ref operator<(const value_t, const value_t). + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is less than @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__less} + + @since version 1.0.0 + */ + friend bool operator<(const_reference lhs, const_reference rhs) noexcept + { + const auto lhs_type = lhs.type(); + const auto rhs_type = rhs.type(); + + if (lhs_type == rhs_type) + { + switch (lhs_type) + { + case value_t::array: + // note parentheses are necessary, see + // https://github.com/nlohmann/json/issues/1530 + return (*lhs.m_value.array) < (*rhs.m_value.array); + + case value_t::object: + return (*lhs.m_value.object) < (*rhs.m_value.object); + + case value_t::null: + return false; + + case value_t::string: + return (*lhs.m_value.string) < (*rhs.m_value.string); + + case value_t::boolean: + return (lhs.m_value.boolean) < (rhs.m_value.boolean); + + case value_t::number_integer: + return (lhs.m_value.number_integer) < (rhs.m_value.number_integer); + + case value_t::number_unsigned: + return (lhs.m_value.number_unsigned) < (rhs.m_value.number_unsigned); + + case value_t::number_float: + return (lhs.m_value.number_float) < (rhs.m_value.number_float); + + case value_t::binary: + return (*lhs.m_value.binary) < (*rhs.m_value.binary); + + default: + return false; + } + } + else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_float) + { + return static_cast(lhs.m_value.number_integer) < rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float && rhs_type == value_t::number_integer) + { + return lhs.m_value.number_float < static_cast(rhs.m_value.number_integer); + } + else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_float) + { + return static_cast(lhs.m_value.number_unsigned) < rhs.m_value.number_float; + } + else if (lhs_type == value_t::number_float && rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_float < static_cast(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_unsigned) + { + return lhs.m_value.number_integer < static_cast(rhs.m_value.number_unsigned); + } + else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_integer) + { + return static_cast(lhs.m_value.number_unsigned) < rhs.m_value.number_integer; + } + + // We only reach this line if we cannot compare values. In that case, + // we compare types. Note we have to call the operator explicitly, + // because MSVC has problems otherwise. + return operator<(lhs_type, rhs_type); + } + + /*! + @brief comparison: less than + @copydoc operator<(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator<(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs < basic_json(rhs); + } + + /*! + @brief comparison: less than + @copydoc operator<(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator<(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) < rhs; + } + + /*! + @brief comparison: less than or equal + + Compares whether one JSON value @a lhs is less than or equal to another + JSON value by calculating `not (rhs < lhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is less than or equal to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__greater} + + @since version 1.0.0 + */ + friend bool operator<=(const_reference lhs, const_reference rhs) noexcept + { + return !(rhs < lhs); + } + + /*! + @brief comparison: less than or equal + @copydoc operator<=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator<=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs <= basic_json(rhs); + } + + /*! + @brief comparison: less than or equal + @copydoc operator<=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator<=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) <= rhs; + } + + /*! + @brief comparison: greater than + + Compares whether one JSON value @a lhs is greater than another + JSON value by calculating `not (lhs <= rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is greater than to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__lessequal} + + @since version 1.0.0 + */ + friend bool operator>(const_reference lhs, const_reference rhs) noexcept + { + return !(lhs <= rhs); + } + + /*! + @brief comparison: greater than + @copydoc operator>(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator>(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs > basic_json(rhs); + } + + /*! + @brief comparison: greater than + @copydoc operator>(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator>(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) > rhs; + } + + /*! + @brief comparison: greater than or equal + + Compares whether one JSON value @a lhs is greater than or equal to another + JSON value by calculating `not (lhs < rhs)`. + + @param[in] lhs first JSON value to consider + @param[in] rhs second JSON value to consider + @return whether @a lhs is greater than or equal to @a rhs + + @complexity Linear. + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @liveexample{The example demonstrates comparing several JSON + types.,operator__greaterequal} + + @since version 1.0.0 + */ + friend bool operator>=(const_reference lhs, const_reference rhs) noexcept + { + return !(lhs < rhs); + } + + /*! + @brief comparison: greater than or equal + @copydoc operator>=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator>=(const_reference lhs, const ScalarType rhs) noexcept + { + return lhs >= basic_json(rhs); + } + + /*! + @brief comparison: greater than or equal + @copydoc operator>=(const_reference, const_reference) + */ + template::value, int>::type = 0> + friend bool operator>=(const ScalarType lhs, const_reference rhs) noexcept + { + return basic_json(lhs) >= rhs; + } + + /// @} + + /////////////////// + // serialization // + /////////////////// + + /// @name serialization + /// @{ + + /*! + @brief serialize to stream + + Serialize the given JSON value @a j to the output stream @a o. The JSON + value will be serialized using the @ref dump member function. + + - The indentation of the output can be controlled with the member variable + `width` of the output stream @a o. For instance, using the manipulator + `std::setw(4)` on @a o sets the indentation level to `4` and the + serialization result is the same as calling `dump(4)`. + + - The indentation character can be controlled with the member variable + `fill` of the output stream @a o. For instance, the manipulator + `std::setfill('\\t')` sets indentation to use a tab character rather than + the default space character. + + @param[in,out] o stream to serialize to + @param[in] j JSON value to serialize + + @return the stream @a o + + @throw type_error.316 if a string stored inside the JSON value is not + UTF-8 encoded + + @complexity Linear. + + @liveexample{The example below shows the serialization with different + parameters to `width` to adjust the indentation level.,operator_serialize} + + @since version 1.0.0; indentation character added in version 3.0.0 + */ + friend std::ostream& operator<<(std::ostream& o, const basic_json& j) + { + // read width member and use it as indentation parameter if nonzero + const bool pretty_print = o.width() > 0; + const auto indentation = pretty_print ? o.width() : 0; + + // reset width to 0 for subsequent calls to this stream + o.width(0); + + // do the actual serialization + serializer s(detail::output_adapter(o), o.fill()); + s.dump(j, pretty_print, false, static_cast(indentation)); + return o; + } + + /*! + @brief serialize to stream + @deprecated This stream operator is deprecated and will be removed in + future 4.0.0 of the library. Please use + @ref operator<<(std::ostream&, const basic_json&) + instead; that is, replace calls like `j >> o;` with `o << j;`. + @since version 1.0.0; deprecated since version 3.0.0 + */ + JSON_HEDLEY_DEPRECATED_FOR(3.0.0, operator<<(std::ostream&, const basic_json&)) + friend std::ostream& operator>>(const basic_json& j, std::ostream& o) + { + return o << j; + } + + /// @} + + + ///////////////////// + // deserialization // + ///////////////////// + + /// @name deserialization + /// @{ + + /*! + @brief deserialize from a compatible input + + @tparam InputType A compatible input, for instance + - an std::istream object + - a FILE pointer + - a C-style array of characters + - a pointer to a null-terminated string of single byte characters + - an object obj for which begin(obj) and end(obj) produces a valid pair of + iterators. + + @param[in] i input to read from + @param[in] cb a parser callback function of type @ref parser_callback_t + which is used to control the deserialization by filtering unwanted values + (optional) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + @param[in] ignore_comments whether comments should be ignored and treated + like whitespace (true) or yield a parse error (true); (optional, false by + default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.101 if a parse error occurs; example: `""unexpected end + of input; expected string literal""` + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. The complexity can be higher if the parser callback function + @a cb or reading from the input @a i has a super-linear complexity. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `parse()` function reading + from an array.,parse__array__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function with + and without callback function.,parse__string__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function with + and without callback function.,parse__istream__parser_callback_t} + + @liveexample{The example below demonstrates the `parse()` function reading + from a contiguous container.,parse__contiguouscontainer__parser_callback_t} + + @since version 2.0.3 (contiguous containers); version 3.9.0 allowed to + ignore comments. + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json parse(InputType&& i, + const parser_callback_t cb = nullptr, + const bool allow_exceptions = true, + const bool ignore_comments = false) + { + basic_json result; + parser(detail::input_adapter(std::forward(i)), cb, allow_exceptions, ignore_comments).parse(true, result); + return result; + } + + /*! + @brief deserialize from a pair of character iterators + + The value_type of the iterator must be a integral type with size of 1, 2 or + 4 bytes, which will be interpreted respectively as UTF-8, UTF-16 and UTF-32. + + @param[in] first iterator to start of character range + @param[in] last iterator to end of character range + @param[in] cb a parser callback function of type @ref parser_callback_t + which is used to control the deserialization by filtering unwanted values + (optional) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + @param[in] ignore_comments whether comments should be ignored and treated + like whitespace (true) or yield a parse error (true); (optional, false by + default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.101 if a parse error occurs; example: `""unexpected end + of input; expected string literal""` + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json parse(IteratorType first, + IteratorType last, + const parser_callback_t cb = nullptr, + const bool allow_exceptions = true, + const bool ignore_comments = false) + { + basic_json result; + parser(detail::input_adapter(std::move(first), std::move(last)), cb, allow_exceptions, ignore_comments).parse(true, result); + return result; + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, parse(ptr, ptr + len)) + static basic_json parse(detail::span_input_adapter&& i, + const parser_callback_t cb = nullptr, + const bool allow_exceptions = true, + const bool ignore_comments = false) + { + basic_json result; + parser(i.get(), cb, allow_exceptions, ignore_comments).parse(true, result); + return result; + } + + /*! + @brief check if the input is valid JSON + + Unlike the @ref parse(InputType&&, const parser_callback_t,const bool) + function, this function neither throws an exception in case of invalid JSON + input (i.e., a parse error) nor creates diagnostic information. + + @tparam InputType A compatible input, for instance + - an std::istream object + - a FILE pointer + - a C-style array of characters + - a pointer to a null-terminated string of single byte characters + - an object obj for which begin(obj) and end(obj) produces a valid pair of + iterators. + + @param[in] i input to read from + @param[in] ignore_comments whether comments should be ignored and treated + like whitespace (true) or yield a parse error (true); (optional, false by + default) + + @return Whether the input read from @a i is valid JSON. + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `accept()` function reading + from a string.,accept__string} + */ + template + static bool accept(InputType&& i, + const bool ignore_comments = false) + { + return parser(detail::input_adapter(std::forward(i)), nullptr, false, ignore_comments).accept(true); + } + + template + static bool accept(IteratorType first, IteratorType last, + const bool ignore_comments = false) + { + return parser(detail::input_adapter(std::move(first), std::move(last)), nullptr, false, ignore_comments).accept(true); + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, accept(ptr, ptr + len)) + static bool accept(detail::span_input_adapter&& i, + const bool ignore_comments = false) + { + return parser(i.get(), nullptr, false, ignore_comments).accept(true); + } + + /*! + @brief generate SAX events + + The SAX event lister must follow the interface of @ref json_sax. + + This function reads from a compatible input. Examples are: + - an std::istream object + - a FILE pointer + - a C-style array of characters + - a pointer to a null-terminated string of single byte characters + - an object obj for which begin(obj) and end(obj) produces a valid pair of + iterators. + + @param[in] i input to read from + @param[in,out] sax SAX event listener + @param[in] format the format to parse (JSON, CBOR, MessagePack, or UBJSON) + @param[in] strict whether the input has to be consumed completely + @param[in] ignore_comments whether comments should be ignored and treated + like whitespace (true) or yield a parse error (true); (optional, false by + default); only applies to the JSON file format. + + @return return value of the last processed SAX event + + @throw parse_error.101 if a parse error occurs; example: `""unexpected end + of input; expected string literal""` + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. The complexity can be higher if the SAX consumer @a sax has + a super-linear complexity. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below demonstrates the `sax_parse()` function + reading from string and processing the events with a user-defined SAX + event consumer.,sax_parse} + + @since version 3.2.0 + */ + template + JSON_HEDLEY_NON_NULL(2) + static bool sax_parse(InputType&& i, SAX* sax, + input_format_t format = input_format_t::json, + const bool strict = true, + const bool ignore_comments = false) + { + auto ia = detail::input_adapter(std::forward(i)); + return format == input_format_t::json + ? parser(std::move(ia), nullptr, true, ignore_comments).sax_parse(sax, strict) + : detail::binary_reader(std::move(ia)).sax_parse(format, sax, strict); + } + + template + JSON_HEDLEY_NON_NULL(3) + static bool sax_parse(IteratorType first, IteratorType last, SAX* sax, + input_format_t format = input_format_t::json, + const bool strict = true, + const bool ignore_comments = false) + { + auto ia = detail::input_adapter(std::move(first), std::move(last)); + return format == input_format_t::json + ? parser(std::move(ia), nullptr, true, ignore_comments).sax_parse(sax, strict) + : detail::binary_reader(std::move(ia)).sax_parse(format, sax, strict); + } + + template + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, sax_parse(ptr, ptr + len, ...)) + JSON_HEDLEY_NON_NULL(2) + static bool sax_parse(detail::span_input_adapter&& i, SAX* sax, + input_format_t format = input_format_t::json, + const bool strict = true, + const bool ignore_comments = false) + { + auto ia = i.get(); + return format == input_format_t::json + ? parser(std::move(ia), nullptr, true, ignore_comments).sax_parse(sax, strict) + : detail::binary_reader(std::move(ia)).sax_parse(format, sax, strict); + } + + /*! + @brief deserialize from stream + @deprecated This stream operator is deprecated and will be removed in + version 4.0.0 of the library. Please use + @ref operator>>(std::istream&, basic_json&) + instead; that is, replace calls like `j << i;` with `i >> j;`. + @since version 1.0.0; deprecated since version 3.0.0 + */ + JSON_HEDLEY_DEPRECATED_FOR(3.0.0, operator>>(std::istream&, basic_json&)) + friend std::istream& operator<<(basic_json& j, std::istream& i) + { + return operator>>(i, j); + } + + /*! + @brief deserialize from stream + + Deserializes an input stream to a JSON value. + + @param[in,out] i input stream to read a serialized JSON value from + @param[in,out] j JSON value to write the deserialized input to + + @throw parse_error.101 in case of an unexpected token + @throw parse_error.102 if to_unicode fails or surrogate error + @throw parse_error.103 if to_unicode fails + + @complexity Linear in the length of the input. The parser is a predictive + LL(1) parser. + + @note A UTF-8 byte order mark is silently ignored. + + @liveexample{The example below shows how a JSON value is constructed by + reading a serialization from a stream.,operator_deserialize} + + @sa parse(std::istream&, const parser_callback_t) for a variant with a + parser callback function to filter values while parsing + + @since version 1.0.0 + */ + friend std::istream& operator>>(std::istream& i, basic_json& j) + { + parser(detail::input_adapter(i)).parse(false, j); + return i; + } + + /// @} + + /////////////////////////// + // convenience functions // + /////////////////////////// + + /*! + @brief return the type as string + + Returns the type name as string to be used in error messages - usually to + indicate that a function was called on a wrong JSON type. + + @return a string representation of a the @a m_type member: + Value type | return value + ----------- | ------------- + null | `"null"` + boolean | `"boolean"` + string | `"string"` + number | `"number"` (for all number types) + object | `"object"` + array | `"array"` + binary | `"binary"` + discarded | `"discarded"` + + @exceptionsafety No-throw guarantee: this function never throws exceptions. + + @complexity Constant. + + @liveexample{The following code exemplifies `type_name()` for all JSON + types.,type_name} + + @sa @ref type() -- return the type of the JSON value + @sa @ref operator value_t() -- return the type of the JSON value (implicit) + + @since version 1.0.0, public since 2.1.0, `const char*` and `noexcept` + since 3.0.0 + */ + JSON_HEDLEY_RETURNS_NON_NULL + const char* type_name() const noexcept + { + { + switch (m_type) + { + case value_t::null: + return "null"; + case value_t::object: + return "object"; + case value_t::array: + return "array"; + case value_t::string: + return "string"; + case value_t::boolean: + return "boolean"; + case value_t::binary: + return "binary"; + case value_t::discarded: + return "discarded"; + default: + return "number"; + } + } + } + + + private: + ////////////////////// + // member variables // + ////////////////////// + + /// the type of the current element + value_t m_type = value_t::null; + + /// the value of the current element + json_value m_value = {}; + + ////////////////////////////////////////// + // binary serialization/deserialization // + ////////////////////////////////////////// + + /// @name binary serialization/deserialization support + /// @{ + + public: + /*! + @brief create a CBOR serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the CBOR (Concise + Binary Object Representation) serialization format. CBOR is a binary + serialization format which aims to be more compact than JSON itself, yet + more efficient to parse. + + The library uses the following mapping from JSON values types to + CBOR types according to the CBOR specification (RFC 7049): + + JSON value type | value/range | CBOR type | first byte + --------------- | ------------------------------------------ | ---------------------------------- | --------------- + null | `null` | Null | 0xF6 + boolean | `true` | True | 0xF5 + boolean | `false` | False | 0xF4 + number_integer | -9223372036854775808..-2147483649 | Negative integer (8 bytes follow) | 0x3B + number_integer | -2147483648..-32769 | Negative integer (4 bytes follow) | 0x3A + number_integer | -32768..-129 | Negative integer (2 bytes follow) | 0x39 + number_integer | -128..-25 | Negative integer (1 byte follow) | 0x38 + number_integer | -24..-1 | Negative integer | 0x20..0x37 + number_integer | 0..23 | Integer | 0x00..0x17 + number_integer | 24..255 | Unsigned integer (1 byte follow) | 0x18 + number_integer | 256..65535 | Unsigned integer (2 bytes follow) | 0x19 + number_integer | 65536..4294967295 | Unsigned integer (4 bytes follow) | 0x1A + number_integer | 4294967296..18446744073709551615 | Unsigned integer (8 bytes follow) | 0x1B + number_unsigned | 0..23 | Integer | 0x00..0x17 + number_unsigned | 24..255 | Unsigned integer (1 byte follow) | 0x18 + number_unsigned | 256..65535 | Unsigned integer (2 bytes follow) | 0x19 + number_unsigned | 65536..4294967295 | Unsigned integer (4 bytes follow) | 0x1A + number_unsigned | 4294967296..18446744073709551615 | Unsigned integer (8 bytes follow) | 0x1B + number_float | *any value representable by a float* | Single-Precision Float | 0xFA + number_float | *any value NOT representable by a float* | Double-Precision Float | 0xFB + string | *length*: 0..23 | UTF-8 string | 0x60..0x77 + string | *length*: 23..255 | UTF-8 string (1 byte follow) | 0x78 + string | *length*: 256..65535 | UTF-8 string (2 bytes follow) | 0x79 + string | *length*: 65536..4294967295 | UTF-8 string (4 bytes follow) | 0x7A + string | *length*: 4294967296..18446744073709551615 | UTF-8 string (8 bytes follow) | 0x7B + array | *size*: 0..23 | array | 0x80..0x97 + array | *size*: 23..255 | array (1 byte follow) | 0x98 + array | *size*: 256..65535 | array (2 bytes follow) | 0x99 + array | *size*: 65536..4294967295 | array (4 bytes follow) | 0x9A + array | *size*: 4294967296..18446744073709551615 | array (8 bytes follow) | 0x9B + object | *size*: 0..23 | map | 0xA0..0xB7 + object | *size*: 23..255 | map (1 byte follow) | 0xB8 + object | *size*: 256..65535 | map (2 bytes follow) | 0xB9 + object | *size*: 65536..4294967295 | map (4 bytes follow) | 0xBA + object | *size*: 4294967296..18446744073709551615 | map (8 bytes follow) | 0xBB + binary | *size*: 0..23 | byte string | 0x40..0x57 + binary | *size*: 23..255 | byte string (1 byte follow) | 0x58 + binary | *size*: 256..65535 | byte string (2 bytes follow) | 0x59 + binary | *size*: 65536..4294967295 | byte string (4 bytes follow) | 0x5A + binary | *size*: 4294967296..18446744073709551615 | byte string (8 bytes follow) | 0x5B + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a CBOR value. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @note The following CBOR types are not used in the conversion: + - UTF-8 strings terminated by "break" (0x7F) + - arrays terminated by "break" (0x9F) + - maps terminated by "break" (0xBF) + - byte strings terminated by "break" (0x5F) + - date/time (0xC0..0xC1) + - bignum (0xC2..0xC3) + - decimal fraction (0xC4) + - bigfloat (0xC5) + - expected conversions (0xD5..0xD7) + - simple values (0xE0..0xF3, 0xF8) + - undefined (0xF7) + - half-precision floats (0xF9) + - break (0xFF) + + @param[in] j JSON value to serialize + @return CBOR serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in CBOR format.,to_cbor} + + @sa http://cbor.io + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) for the + analogous deserialization + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9; compact representation of floating-point numbers + since version 3.8.0 + */ + static std::vector to_cbor(const basic_json& j) + { + std::vector result; + to_cbor(j, result); + return result; + } + + static void to_cbor(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_cbor(j); + } + + static void to_cbor(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_cbor(j); + } + + /*! + @brief create a MessagePack serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the MessagePack + serialization format. MessagePack is a binary serialization format which + aims to be more compact than JSON itself, yet more efficient to parse. + + The library uses the following mapping from JSON values types to + MessagePack types according to the MessagePack specification: + + JSON value type | value/range | MessagePack type | first byte + --------------- | --------------------------------- | ---------------- | ---------- + null | `null` | nil | 0xC0 + boolean | `true` | true | 0xC3 + boolean | `false` | false | 0xC2 + number_integer | -9223372036854775808..-2147483649 | int64 | 0xD3 + number_integer | -2147483648..-32769 | int32 | 0xD2 + number_integer | -32768..-129 | int16 | 0xD1 + number_integer | -128..-33 | int8 | 0xD0 + number_integer | -32..-1 | negative fixint | 0xE0..0xFF + number_integer | 0..127 | positive fixint | 0x00..0x7F + number_integer | 128..255 | uint 8 | 0xCC + number_integer | 256..65535 | uint 16 | 0xCD + number_integer | 65536..4294967295 | uint 32 | 0xCE + number_integer | 4294967296..18446744073709551615 | uint 64 | 0xCF + number_unsigned | 0..127 | positive fixint | 0x00..0x7F + number_unsigned | 128..255 | uint 8 | 0xCC + number_unsigned | 256..65535 | uint 16 | 0xCD + number_unsigned | 65536..4294967295 | uint 32 | 0xCE + number_unsigned | 4294967296..18446744073709551615 | uint 64 | 0xCF + number_float | *any value representable by a float* | float 32 | 0xCA + number_float | *any value NOT representable by a float* | float 64 | 0xCB + string | *length*: 0..31 | fixstr | 0xA0..0xBF + string | *length*: 32..255 | str 8 | 0xD9 + string | *length*: 256..65535 | str 16 | 0xDA + string | *length*: 65536..4294967295 | str 32 | 0xDB + array | *size*: 0..15 | fixarray | 0x90..0x9F + array | *size*: 16..65535 | array 16 | 0xDC + array | *size*: 65536..4294967295 | array 32 | 0xDD + object | *size*: 0..15 | fix map | 0x80..0x8F + object | *size*: 16..65535 | map 16 | 0xDE + object | *size*: 65536..4294967295 | map 32 | 0xDF + binary | *size*: 0..255 | bin 8 | 0xC4 + binary | *size*: 256..65535 | bin 16 | 0xC5 + binary | *size*: 65536..4294967295 | bin 32 | 0xC6 + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a MessagePack value. + + @note The following values can **not** be converted to a MessagePack value: + - strings with more than 4294967295 bytes + - byte strings with more than 4294967295 bytes + - arrays with more than 4294967295 elements + - objects with more than 4294967295 elements + + @note Any MessagePack output created @ref to_msgpack can be successfully + parsed by @ref from_msgpack. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @param[in] j JSON value to serialize + @return MessagePack serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in MessagePack format.,to_msgpack} + + @sa http://msgpack.org + @sa @ref from_msgpack for the analogous deserialization + @sa @ref to_cbor(const basic_json& for the related CBOR format + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9 + */ + static std::vector to_msgpack(const basic_json& j) + { + std::vector result; + to_msgpack(j, result); + return result; + } + + static void to_msgpack(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_msgpack(j); + } + + static void to_msgpack(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_msgpack(j); + } + + /*! + @brief create a UBJSON serialization of a given JSON value + + Serializes a given JSON value @a j to a byte vector using the UBJSON + (Universal Binary JSON) serialization format. UBJSON aims to be more compact + than JSON itself, yet more efficient to parse. + + The library uses the following mapping from JSON values types to + UBJSON types according to the UBJSON specification: + + JSON value type | value/range | UBJSON type | marker + --------------- | --------------------------------- | ----------- | ------ + null | `null` | null | `Z` + boolean | `true` | true | `T` + boolean | `false` | false | `F` + number_integer | -9223372036854775808..-2147483649 | int64 | `L` + number_integer | -2147483648..-32769 | int32 | `l` + number_integer | -32768..-129 | int16 | `I` + number_integer | -128..127 | int8 | `i` + number_integer | 128..255 | uint8 | `U` + number_integer | 256..32767 | int16 | `I` + number_integer | 32768..2147483647 | int32 | `l` + number_integer | 2147483648..9223372036854775807 | int64 | `L` + number_unsigned | 0..127 | int8 | `i` + number_unsigned | 128..255 | uint8 | `U` + number_unsigned | 256..32767 | int16 | `I` + number_unsigned | 32768..2147483647 | int32 | `l` + number_unsigned | 2147483648..9223372036854775807 | int64 | `L` + number_unsigned | 2147483649..18446744073709551615 | high-precision | `H` + number_float | *any value* | float64 | `D` + string | *with shortest length indicator* | string | `S` + array | *see notes on optimized format* | array | `[` + object | *see notes on optimized format* | map | `{` + + @note The mapping is **complete** in the sense that any JSON value type + can be converted to a UBJSON value. + + @note The following values can **not** be converted to a UBJSON value: + - strings with more than 9223372036854775807 bytes (theoretical) + + @note The following markers are not used in the conversion: + - `Z`: no-op values are not created. + - `C`: single-byte strings are serialized with `S` markers. + + @note Any UBJSON output created @ref to_ubjson can be successfully parsed + by @ref from_ubjson. + + @note If NaN or Infinity are stored inside a JSON number, they are + serialized properly. This behavior differs from the @ref dump() + function which serializes NaN or Infinity to `null`. + + @note The optimized formats for containers are supported: Parameter + @a use_size adds size information to the beginning of a container and + removes the closing marker. Parameter @a use_type further checks + whether all elements of a container have the same type and adds the + type marker to the beginning of the container. The @a use_type + parameter must only be used together with @a use_size = true. Note + that @a use_size = true alone may result in larger representations - + the benefit of this parameter is that the receiving side is + immediately informed on the number of elements of the container. + + @note If the JSON data contains the binary type, the value stored is a list + of integers, as suggested by the UBJSON documentation. In particular, + this means that serialization and the deserialization of a JSON + containing binary values into UBJSON and back will result in a + different JSON object. + + @param[in] j JSON value to serialize + @param[in] use_size whether to add size annotations to container types + @param[in] use_type whether to add type annotations to container types + (must be combined with @a use_size = true) + @return UBJSON serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in UBJSON format.,to_ubjson} + + @sa http://ubjson.org + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + analogous deserialization + @sa @ref to_cbor(const basic_json& for the related CBOR format + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + + @since version 3.1.0 + */ + static std::vector to_ubjson(const basic_json& j, + const bool use_size = false, + const bool use_type = false) + { + std::vector result; + to_ubjson(j, result, use_size, use_type); + return result; + } + + static void to_ubjson(const basic_json& j, detail::output_adapter o, + const bool use_size = false, const bool use_type = false) + { + binary_writer(o).write_ubjson(j, use_size, use_type); + } + + static void to_ubjson(const basic_json& j, detail::output_adapter o, + const bool use_size = false, const bool use_type = false) + { + binary_writer(o).write_ubjson(j, use_size, use_type); + } + + + /*! + @brief Serializes the given JSON object `j` to BSON and returns a vector + containing the corresponding BSON-representation. + + BSON (Binary JSON) is a binary format in which zero or more ordered key/value pairs are + stored as a single entity (a so-called document). + + The library uses the following mapping from JSON values types to BSON types: + + JSON value type | value/range | BSON type | marker + --------------- | --------------------------------- | ----------- | ------ + null | `null` | null | 0x0A + boolean | `true`, `false` | boolean | 0x08 + number_integer | -9223372036854775808..-2147483649 | int64 | 0x12 + number_integer | -2147483648..2147483647 | int32 | 0x10 + number_integer | 2147483648..9223372036854775807 | int64 | 0x12 + number_unsigned | 0..2147483647 | int32 | 0x10 + number_unsigned | 2147483648..9223372036854775807 | int64 | 0x12 + number_unsigned | 9223372036854775808..18446744073709551615| -- | -- + number_float | *any value* | double | 0x01 + string | *any value* | string | 0x02 + array | *any value* | document | 0x04 + object | *any value* | document | 0x03 + binary | *any value* | binary | 0x05 + + @warning The mapping is **incomplete**, since only JSON-objects (and things + contained therein) can be serialized to BSON. + Also, integers larger than 9223372036854775807 cannot be serialized to BSON, + and the keys may not contain U+0000, since they are serialized a + zero-terminated c-strings. + + @throw out_of_range.407 if `j.is_number_unsigned() && j.get() > 9223372036854775807` + @throw out_of_range.409 if a key in `j` contains a NULL (U+0000) + @throw type_error.317 if `!j.is_object()` + + @pre The input `j` is required to be an object: `j.is_object() == true`. + + @note Any BSON output created via @ref to_bson can be successfully parsed + by @ref from_bson. + + @param[in] j JSON value to serialize + @return BSON serialization as byte vector + + @complexity Linear in the size of the JSON value @a j. + + @liveexample{The example shows the serialization of a JSON value to a byte + vector in BSON format.,to_bson} + + @sa http://bsonspec.org/spec.html + @sa @ref from_bson(detail::input_adapter&&, const bool strict) for the + analogous deserialization + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + related UBJSON format + @sa @ref to_cbor(const basic_json&) for the related CBOR format + @sa @ref to_msgpack(const basic_json&) for the related MessagePack format + */ + static std::vector to_bson(const basic_json& j) + { + std::vector result; + to_bson(j, result); + return result; + } + + /*! + @brief Serializes the given JSON object `j` to BSON and forwards the + corresponding BSON-representation to the given output_adapter `o`. + @param j The JSON object to convert to BSON. + @param o The output adapter that receives the binary BSON representation. + @pre The input `j` shall be an object: `j.is_object() == true` + @sa @ref to_bson(const basic_json&) + */ + static void to_bson(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_bson(j); + } + + /*! + @copydoc to_bson(const basic_json&, detail::output_adapter) + */ + static void to_bson(const basic_json& j, detail::output_adapter o) + { + binary_writer(o).write_bson(j); + } + + + /*! + @brief create a JSON value from an input in CBOR format + + Deserializes a given input @a i to a JSON value using the CBOR (Concise + Binary Object Representation) serialization format. + + The library maps CBOR types to JSON value types as follows: + + CBOR type | JSON value type | first byte + ---------------------- | --------------- | ---------- + Integer | number_unsigned | 0x00..0x17 + Unsigned integer | number_unsigned | 0x18 + Unsigned integer | number_unsigned | 0x19 + Unsigned integer | number_unsigned | 0x1A + Unsigned integer | number_unsigned | 0x1B + Negative integer | number_integer | 0x20..0x37 + Negative integer | number_integer | 0x38 + Negative integer | number_integer | 0x39 + Negative integer | number_integer | 0x3A + Negative integer | number_integer | 0x3B + Byte string | binary | 0x40..0x57 + Byte string | binary | 0x58 + Byte string | binary | 0x59 + Byte string | binary | 0x5A + Byte string | binary | 0x5B + UTF-8 string | string | 0x60..0x77 + UTF-8 string | string | 0x78 + UTF-8 string | string | 0x79 + UTF-8 string | string | 0x7A + UTF-8 string | string | 0x7B + UTF-8 string | string | 0x7F + array | array | 0x80..0x97 + array | array | 0x98 + array | array | 0x99 + array | array | 0x9A + array | array | 0x9B + array | array | 0x9F + map | object | 0xA0..0xB7 + map | object | 0xB8 + map | object | 0xB9 + map | object | 0xBA + map | object | 0xBB + map | object | 0xBF + False | `false` | 0xF4 + True | `true` | 0xF5 + Null | `null` | 0xF6 + Half-Precision Float | number_float | 0xF9 + Single-Precision Float | number_float | 0xFA + Double-Precision Float | number_float | 0xFB + + @warning The mapping is **incomplete** in the sense that not all CBOR + types can be converted to a JSON value. The following CBOR types + are not supported and will yield parse errors (parse_error.112): + - date/time (0xC0..0xC1) + - bignum (0xC2..0xC3) + - decimal fraction (0xC4) + - bigfloat (0xC5) + - expected conversions (0xD5..0xD7) + - simple values (0xE0..0xF3, 0xF8) + - undefined (0xF7) + + @warning CBOR allows map keys of any type, whereas JSON only allows + strings as keys in object values. Therefore, CBOR maps with keys + other than UTF-8 strings are rejected (parse_error.113). + + @note Any CBOR output created @ref to_cbor can be successfully parsed by + @ref from_cbor. + + @param[in] i an input in CBOR format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + @param[in] tag_handler how to treat CBOR tags (optional, error by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if unsupported features from CBOR were + used in the given input @a v or if the input is not valid CBOR + @throw parse_error.113 if a string was expected as map key, but not found + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in CBOR + format to a JSON value.,from_cbor} + + @sa http://cbor.io + @sa @ref to_cbor(const basic_json&) for the analogous serialization + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for the + related MessagePack format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + related UBJSON format + + @since version 2.0.9; parameter @a start_index since 2.1.1; changed to + consume input adapters, removed start_index parameter, and added + @a strict parameter since 3.0.0; added @a allow_exceptions parameter + since 3.2.0; added @a tag_handler parameter since 3.9.0. + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_cbor(InputType&& i, + const bool strict = true, + const bool allow_exceptions = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::forward(i)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_cbor(IteratorType first, IteratorType last, + const bool strict = true, + const bool allow_exceptions = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::move(first), std::move(last)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler); + return res ? result : basic_json(value_t::discarded); + } + + template + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) + static basic_json from_cbor(const T* ptr, std::size_t len, + const bool strict = true, + const bool allow_exceptions = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + return from_cbor(ptr, ptr + len, strict, allow_exceptions, tag_handler); + } + + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) + static basic_json from_cbor(detail::span_input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true, + const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = i.get(); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @brief create a JSON value from an input in MessagePack format + + Deserializes a given input @a i to a JSON value using the MessagePack + serialization format. + + The library maps MessagePack types to JSON value types as follows: + + MessagePack type | JSON value type | first byte + ---------------- | --------------- | ---------- + positive fixint | number_unsigned | 0x00..0x7F + fixmap | object | 0x80..0x8F + fixarray | array | 0x90..0x9F + fixstr | string | 0xA0..0xBF + nil | `null` | 0xC0 + false | `false` | 0xC2 + true | `true` | 0xC3 + float 32 | number_float | 0xCA + float 64 | number_float | 0xCB + uint 8 | number_unsigned | 0xCC + uint 16 | number_unsigned | 0xCD + uint 32 | number_unsigned | 0xCE + uint 64 | number_unsigned | 0xCF + int 8 | number_integer | 0xD0 + int 16 | number_integer | 0xD1 + int 32 | number_integer | 0xD2 + int 64 | number_integer | 0xD3 + str 8 | string | 0xD9 + str 16 | string | 0xDA + str 32 | string | 0xDB + array 16 | array | 0xDC + array 32 | array | 0xDD + map 16 | object | 0xDE + map 32 | object | 0xDF + bin 8 | binary | 0xC4 + bin 16 | binary | 0xC5 + bin 32 | binary | 0xC6 + ext 8 | binary | 0xC7 + ext 16 | binary | 0xC8 + ext 32 | binary | 0xC9 + fixext 1 | binary | 0xD4 + fixext 2 | binary | 0xD5 + fixext 4 | binary | 0xD6 + fixext 8 | binary | 0xD7 + fixext 16 | binary | 0xD8 + negative fixint | number_integer | 0xE0-0xFF + + @note Any MessagePack output created @ref to_msgpack can be successfully + parsed by @ref from_msgpack. + + @param[in] i an input in MessagePack format convertible to an input + adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if unsupported features from MessagePack were + used in the given input @a i or if the input is not valid MessagePack + @throw parse_error.113 if a string was expected as map key, but not found + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + MessagePack format to a JSON value.,from_msgpack} + + @sa http://msgpack.org + @sa @ref to_msgpack(const basic_json&) for the analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) for the + related CBOR format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for + the related UBJSON format + @sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for + the related BSON format + + @since version 2.0.9; parameter @a start_index since 2.1.1; changed to + consume input adapters, removed start_index parameter, and added + @a strict parameter since 3.0.0; added @a allow_exceptions parameter + since 3.2.0 + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_msgpack(InputType&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::forward(i)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::msgpack, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_msgpack(detail::input_adapter&&, const bool, const bool) + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_msgpack(IteratorType first, IteratorType last, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::move(first), std::move(last)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::msgpack, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + + template + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_msgpack(ptr, ptr + len)) + static basic_json from_msgpack(const T* ptr, std::size_t len, + const bool strict = true, + const bool allow_exceptions = true) + { + return from_msgpack(ptr, ptr + len, strict, allow_exceptions); + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_msgpack(ptr, ptr + len)) + static basic_json from_msgpack(detail::span_input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = i.get(); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::msgpack, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + + /*! + @brief create a JSON value from an input in UBJSON format + + Deserializes a given input @a i to a JSON value using the UBJSON (Universal + Binary JSON) serialization format. + + The library maps UBJSON types to JSON value types as follows: + + UBJSON type | JSON value type | marker + ----------- | --------------------------------------- | ------ + no-op | *no value, next value is read* | `N` + null | `null` | `Z` + false | `false` | `F` + true | `true` | `T` + float32 | number_float | `d` + float64 | number_float | `D` + uint8 | number_unsigned | `U` + int8 | number_integer | `i` + int16 | number_integer | `I` + int32 | number_integer | `l` + int64 | number_integer | `L` + high-precision number | number_integer, number_unsigned, or number_float - depends on number string | 'H' + string | string | `S` + char | string | `C` + array | array (optimized values are supported) | `[` + object | object (optimized values are supported) | `{` + + @note The mapping is **complete** in the sense that any UBJSON value can + be converted to a JSON value. + + @param[in] i an input in UBJSON format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.110 if the given input ends prematurely or the end of + file was not reached when @a strict was set to true + @throw parse_error.112 if a parse error occurs + @throw parse_error.113 if a string could not be parsed successfully + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + UBJSON format to a JSON value.,from_ubjson} + + @sa http://ubjson.org + @sa @ref to_ubjson(const basic_json&, const bool, const bool) for the + analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) for the + related CBOR format + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for + the related MessagePack format + @sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for + the related BSON format + + @since version 3.1.0; added @a allow_exceptions parameter since 3.2.0 + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_ubjson(InputType&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::forward(i)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::ubjson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_ubjson(detail::input_adapter&&, const bool, const bool) + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_ubjson(IteratorType first, IteratorType last, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::move(first), std::move(last)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::ubjson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + template + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_ubjson(ptr, ptr + len)) + static basic_json from_ubjson(const T* ptr, std::size_t len, + const bool strict = true, + const bool allow_exceptions = true) + { + return from_ubjson(ptr, ptr + len, strict, allow_exceptions); + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_ubjson(ptr, ptr + len)) + static basic_json from_ubjson(detail::span_input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = i.get(); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::ubjson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + + /*! + @brief Create a JSON value from an input in BSON format + + Deserializes a given input @a i to a JSON value using the BSON (Binary JSON) + serialization format. + + The library maps BSON record types to JSON value types as follows: + + BSON type | BSON marker byte | JSON value type + --------------- | ---------------- | --------------------------- + double | 0x01 | number_float + string | 0x02 | string + document | 0x03 | object + array | 0x04 | array + binary | 0x05 | still unsupported + undefined | 0x06 | still unsupported + ObjectId | 0x07 | still unsupported + boolean | 0x08 | boolean + UTC Date-Time | 0x09 | still unsupported + null | 0x0A | null + Regular Expr. | 0x0B | still unsupported + DB Pointer | 0x0C | still unsupported + JavaScript Code | 0x0D | still unsupported + Symbol | 0x0E | still unsupported + JavaScript Code | 0x0F | still unsupported + int32 | 0x10 | number_integer + Timestamp | 0x11 | still unsupported + 128-bit decimal float | 0x13 | still unsupported + Max Key | 0x7F | still unsupported + Min Key | 0xFF | still unsupported + + @warning The mapping is **incomplete**. The unsupported mappings + are indicated in the table above. + + @param[in] i an input in BSON format convertible to an input adapter + @param[in] strict whether to expect the input to be consumed until EOF + (true by default) + @param[in] allow_exceptions whether to throw exceptions in case of a + parse error (optional, true by default) + + @return deserialized JSON value; in case of a parse error and + @a allow_exceptions set to `false`, the return value will be + value_t::discarded. + + @throw parse_error.114 if an unsupported BSON record type is encountered + + @complexity Linear in the size of the input @a i. + + @liveexample{The example shows the deserialization of a byte vector in + BSON format to a JSON value.,from_bson} + + @sa http://bsonspec.org/spec.html + @sa @ref to_bson(const basic_json&) for the analogous serialization + @sa @ref from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t) for the + related CBOR format + @sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for + the related MessagePack format + @sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the + related UBJSON format + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_bson(InputType&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::forward(i)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::bson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + /*! + @copydoc from_bson(detail::input_adapter&&, const bool, const bool) + */ + template + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json from_bson(IteratorType first, IteratorType last, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = detail::input_adapter(std::move(first), std::move(last)); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::bson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + + template + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len)) + static basic_json from_bson(const T* ptr, std::size_t len, + const bool strict = true, + const bool allow_exceptions = true) + { + return from_bson(ptr, ptr + len, strict, allow_exceptions); + } + + JSON_HEDLEY_WARN_UNUSED_RESULT + JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len)) + static basic_json from_bson(detail::span_input_adapter&& i, + const bool strict = true, + const bool allow_exceptions = true) + { + basic_json result; + detail::json_sax_dom_parser sdp(result, allow_exceptions); + auto ia = i.get(); + const bool res = binary_reader(std::move(ia)).sax_parse(input_format_t::bson, &sdp, strict); + return res ? result : basic_json(value_t::discarded); + } + /// @} + + ////////////////////////// + // JSON Pointer support // + ////////////////////////// + + /// @name JSON Pointer functions + /// @{ + + /*! + @brief access specified element via JSON Pointer + + Uses a JSON pointer to retrieve a reference to the respective JSON value. + No bound checking is performed. Similar to @ref operator[](const typename + object_t::key_type&), `null` values are created in arrays and objects if + necessary. + + In particular: + - If the JSON pointer points to an object key that does not exist, it + is created an filled with a `null` value before a reference to it + is returned. + - If the JSON pointer points to an array index that does not exist, it + is created an filled with a `null` value before a reference to it + is returned. All indices between the current maximum and the given + index are also filled with `null`. + - The special value `-` is treated as a synonym for the index past the + end. + + @param[in] ptr a JSON pointer + + @return reference to the element pointed to by @a ptr + + @complexity Constant. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.404 if the JSON pointer can not be resolved + + @liveexample{The behavior is shown in the example.,operatorjson_pointer} + + @since version 2.0.0 + */ + reference operator[](const json_pointer& ptr) + { + return ptr.get_unchecked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Uses a JSON pointer to retrieve a reference to the respective JSON value. + No bound checking is performed. The function does not change the JSON + value; no `null` values are created. In particular, the special value + `-` yields an exception. + + @param[in] ptr JSON pointer to the desired element + + @return const reference to the element pointed to by @a ptr + + @complexity Constant. + + @throw parse_error.106 if an array index begins with '0' + @throw parse_error.109 if an array index was not a number + @throw out_of_range.402 if the array index '-' is used + @throw out_of_range.404 if the JSON pointer can not be resolved + + @liveexample{The behavior is shown in the example.,operatorjson_pointer_const} + + @since version 2.0.0 + */ + const_reference operator[](const json_pointer& ptr) const + { + return ptr.get_unchecked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Returns a reference to the element at with specified JSON pointer @a ptr, + with bounds checking. + + @param[in] ptr JSON pointer to the desired element + + @return reference to the element pointed to by @a ptr + + @throw parse_error.106 if an array index in the passed JSON pointer @a ptr + begins with '0'. See example below. + + @throw parse_error.109 if an array index in the passed JSON pointer @a ptr + is not a number. See example below. + + @throw out_of_range.401 if an array index in the passed JSON pointer @a ptr + is out of range. See example below. + + @throw out_of_range.402 if the array index '-' is used in the passed JSON + pointer @a ptr. As `at` provides checked access (and no elements are + implicitly inserted), the index '-' is always invalid. See example below. + + @throw out_of_range.403 if the JSON pointer describes a key of an object + which cannot be found. See example below. + + @throw out_of_range.404 if the JSON pointer @a ptr can not be resolved. + See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 2.0.0 + + @liveexample{The behavior is shown in the example.,at_json_pointer} + */ + reference at(const json_pointer& ptr) + { + return ptr.get_checked(this); + } + + /*! + @brief access specified element via JSON Pointer + + Returns a const reference to the element at with specified JSON pointer @a + ptr, with bounds checking. + + @param[in] ptr JSON pointer to the desired element + + @return reference to the element pointed to by @a ptr + + @throw parse_error.106 if an array index in the passed JSON pointer @a ptr + begins with '0'. See example below. + + @throw parse_error.109 if an array index in the passed JSON pointer @a ptr + is not a number. See example below. + + @throw out_of_range.401 if an array index in the passed JSON pointer @a ptr + is out of range. See example below. + + @throw out_of_range.402 if the array index '-' is used in the passed JSON + pointer @a ptr. As `at` provides checked access (and no elements are + implicitly inserted), the index '-' is always invalid. See example below. + + @throw out_of_range.403 if the JSON pointer describes a key of an object + which cannot be found. See example below. + + @throw out_of_range.404 if the JSON pointer @a ptr can not be resolved. + See example below. + + @exceptionsafety Strong guarantee: if an exception is thrown, there are no + changes in the JSON value. + + @complexity Constant. + + @since version 2.0.0 + + @liveexample{The behavior is shown in the example.,at_json_pointer_const} + */ + const_reference at(const json_pointer& ptr) const + { + return ptr.get_checked(this); + } + + /*! + @brief return flattened JSON value + + The function creates a JSON object whose keys are JSON pointers (see [RFC + 6901](https://tools.ietf.org/html/rfc6901)) and whose values are all + primitive. The original JSON value can be restored using the @ref + unflatten() function. + + @return an object that maps JSON pointers to primitive values + + @note Empty objects and arrays are flattened to `null` and will not be + reconstructed correctly by the @ref unflatten() function. + + @complexity Linear in the size the JSON value. + + @liveexample{The following code shows how a JSON object is flattened to an + object whose keys consist of JSON pointers.,flatten} + + @sa @ref unflatten() for the reverse function + + @since version 2.0.0 + */ + basic_json flatten() const + { + basic_json result(value_t::object); + json_pointer::flatten("", *this, result); + return result; + } + + /*! + @brief unflatten a previously flattened JSON value + + The function restores the arbitrary nesting of a JSON value that has been + flattened before using the @ref flatten() function. The JSON value must + meet certain constraints: + 1. The value must be an object. + 2. The keys must be JSON pointers (see + [RFC 6901](https://tools.ietf.org/html/rfc6901)) + 3. The mapped values must be primitive JSON types. + + @return the original JSON from a flattened version + + @note Empty objects and arrays are flattened by @ref flatten() to `null` + values and can not unflattened to their original type. Apart from + this example, for a JSON value `j`, the following is always true: + `j == j.flatten().unflatten()`. + + @complexity Linear in the size the JSON value. + + @throw type_error.314 if value is not an object + @throw type_error.315 if object values are not primitive + + @liveexample{The following code shows how a flattened JSON object is + unflattened into the original nested JSON object.,unflatten} + + @sa @ref flatten() for the reverse function + + @since version 2.0.0 + */ + basic_json unflatten() const + { + return json_pointer::unflatten(*this); + } + + /// @} + + ////////////////////////// + // JSON Patch functions // + ////////////////////////// + + /// @name JSON Patch functions + /// @{ + + /*! + @brief applies a JSON patch + + [JSON Patch](http://jsonpatch.com) defines a JSON document structure for + expressing a sequence of operations to apply to a JSON) document. With + this function, a JSON Patch is applied to the current JSON value by + executing all operations from the patch. + + @param[in] json_patch JSON patch document + @return patched document + + @note The application of a patch is atomic: Either all operations succeed + and the patched document is returned or an exception is thrown. In + any case, the original value is not changed: the patch is applied + to a copy of the value. + + @throw parse_error.104 if the JSON patch does not consist of an array of + objects + + @throw parse_error.105 if the JSON patch is malformed (e.g., mandatory + attributes are missing); example: `"operation add must have member path"` + + @throw out_of_range.401 if an array index is out of range. + + @throw out_of_range.403 if a JSON pointer inside the patch could not be + resolved successfully in the current JSON value; example: `"key baz not + found"` + + @throw out_of_range.405 if JSON pointer has no parent ("add", "remove", + "move") + + @throw other_error.501 if "test" operation was unsuccessful + + @complexity Linear in the size of the JSON value and the length of the + JSON patch. As usually only a fraction of the JSON value is affected by + the patch, the complexity can usually be neglected. + + @liveexample{The following code shows how a JSON patch is applied to a + value.,patch} + + @sa @ref diff -- create a JSON patch by comparing two JSON values + + @sa [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902) + @sa [RFC 6901 (JSON Pointer)](https://tools.ietf.org/html/rfc6901) + + @since version 2.0.0 + */ + basic_json patch(const basic_json& json_patch) const + { + // make a working copy to apply the patch to + basic_json result = *this; + + // the valid JSON Patch operations + enum class patch_operations {add, remove, replace, move, copy, test, invalid}; + + const auto get_op = [](const std::string & op) + { + if (op == "add") + { + return patch_operations::add; + } + if (op == "remove") + { + return patch_operations::remove; + } + if (op == "replace") + { + return patch_operations::replace; + } + if (op == "move") + { + return patch_operations::move; + } + if (op == "copy") + { + return patch_operations::copy; + } + if (op == "test") + { + return patch_operations::test; + } + + return patch_operations::invalid; + }; + + // wrapper for "add" operation; add value at ptr + const auto operation_add = [&result](json_pointer & ptr, basic_json val) + { + // adding to the root of the target document means replacing it + if (ptr.empty()) + { + result = val; + return; + } + + // make sure the top element of the pointer exists + json_pointer top_pointer = ptr.top(); + if (top_pointer != ptr) + { + result.at(top_pointer); + } + + // get reference to parent of JSON pointer ptr + const auto last_path = ptr.back(); + ptr.pop_back(); + basic_json& parent = result[ptr]; + + switch (parent.m_type) + { + case value_t::null: + case value_t::object: + { + // use operator[] to add value + parent[last_path] = val; + break; + } + + case value_t::array: + { + if (last_path == "-") + { + // special case: append to back + parent.push_back(val); + } + else + { + const auto idx = json_pointer::array_index(last_path); + if (JSON_HEDLEY_UNLIKELY(idx > parent.size())) + { + // avoid undefined behavior + JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range")); + } + + // default case: insert add offset + parent.insert(parent.begin() + static_cast(idx), val); + } + break; + } + + // if there exists a parent it cannot be primitive + default: // LCOV_EXCL_LINE + JSON_ASSERT(false); // LCOV_EXCL_LINE + } + }; + + // wrapper for "remove" operation; remove value at ptr + const auto operation_remove = [&result](json_pointer & ptr) + { + // get reference to parent of JSON pointer ptr + const auto last_path = ptr.back(); + ptr.pop_back(); + basic_json& parent = result.at(ptr); + + // remove child + if (parent.is_object()) + { + // perform range check + auto it = parent.find(last_path); + if (JSON_HEDLEY_LIKELY(it != parent.end())) + { + parent.erase(it); + } + else + { + JSON_THROW(out_of_range::create(403, "key '" + last_path + "' not found")); + } + } + else if (parent.is_array()) + { + // note erase performs range check + parent.erase(json_pointer::array_index(last_path)); + } + }; + + // type check: top level value must be an array + if (JSON_HEDLEY_UNLIKELY(!json_patch.is_array())) + { + JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); + } + + // iterate and apply the operations + for (const auto& val : json_patch) + { + // wrapper to get a value for an operation + const auto get_value = [&val](const std::string & op, + const std::string & member, + bool string_type) -> basic_json & + { + // find value + auto it = val.m_value.object->find(member); + + // context-sensitive error message + const auto error_msg = (op == "op") ? "operation" : "operation '" + op + "'"; + + // check if desired value is present + if (JSON_HEDLEY_UNLIKELY(it == val.m_value.object->end())) + { + JSON_THROW(parse_error::create(105, 0, error_msg + " must have member '" + member + "'")); + } + + // check if result is of type string + if (JSON_HEDLEY_UNLIKELY(string_type && !it->second.is_string())) + { + JSON_THROW(parse_error::create(105, 0, error_msg + " must have string member '" + member + "'")); + } + + // no error: return value + return it->second; + }; + + // type check: every element of the array must be an object + if (JSON_HEDLEY_UNLIKELY(!val.is_object())) + { + JSON_THROW(parse_error::create(104, 0, "JSON patch must be an array of objects")); + } + + // collect mandatory members + const auto op = get_value("op", "op", true).template get(); + const auto path = get_value(op, "path", true).template get(); + json_pointer ptr(path); + + switch (get_op(op)) + { + case patch_operations::add: + { + operation_add(ptr, get_value("add", "value", false)); + break; + } + + case patch_operations::remove: + { + operation_remove(ptr); + break; + } + + case patch_operations::replace: + { + // the "path" location must exist - use at() + result.at(ptr) = get_value("replace", "value", false); + break; + } + + case patch_operations::move: + { + const auto from_path = get_value("move", "from", true).template get(); + json_pointer from_ptr(from_path); + + // the "from" location must exist - use at() + basic_json v = result.at(from_ptr); + + // The move operation is functionally identical to a + // "remove" operation on the "from" location, followed + // immediately by an "add" operation at the target + // location with the value that was just removed. + operation_remove(from_ptr); + operation_add(ptr, v); + break; + } + + case patch_operations::copy: + { + const auto from_path = get_value("copy", "from", true).template get(); + const json_pointer from_ptr(from_path); + + // the "from" location must exist - use at() + basic_json v = result.at(from_ptr); + + // The copy is functionally identical to an "add" + // operation at the target location using the value + // specified in the "from" member. + operation_add(ptr, v); + break; + } + + case patch_operations::test: + { + bool success = false; + JSON_TRY + { + // check if "value" matches the one at "path" + // the "path" location must exist - use at() + success = (result.at(ptr) == get_value("test", "value", false)); + } + JSON_INTERNAL_CATCH (out_of_range&) + { + // ignore out of range errors: success remains false + } + + // throw an exception if test fails + if (JSON_HEDLEY_UNLIKELY(!success)) + { + JSON_THROW(other_error::create(501, "unsuccessful: " + val.dump())); + } + + break; + } + + default: + { + // op must be "add", "remove", "replace", "move", "copy", or + // "test" + JSON_THROW(parse_error::create(105, 0, "operation value '" + op + "' is invalid")); + } + } + } + + return result; + } + + /*! + @brief creates a diff as a JSON patch + + Creates a [JSON Patch](http://jsonpatch.com) so that value @a source can + be changed into the value @a target by calling @ref patch function. + + @invariant For two JSON values @a source and @a target, the following code + yields always `true`: + @code {.cpp} + source.patch(diff(source, target)) == target; + @endcode + + @note Currently, only `remove`, `add`, and `replace` operations are + generated. + + @param[in] source JSON value to compare from + @param[in] target JSON value to compare against + @param[in] path helper value to create JSON pointers + + @return a JSON patch to convert the @a source to @a target + + @complexity Linear in the lengths of @a source and @a target. + + @liveexample{The following code shows how a JSON patch is created as a + diff for two JSON values.,diff} + + @sa @ref patch -- apply a JSON patch + @sa @ref merge_patch -- apply a JSON Merge Patch + + @sa [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902) + + @since version 2.0.0 + */ + JSON_HEDLEY_WARN_UNUSED_RESULT + static basic_json diff(const basic_json& source, const basic_json& target, + const std::string& path = "") + { + // the patch + basic_json result(value_t::array); + + // if the values are the same, return empty patch + if (source == target) + { + return result; + } + + if (source.type() != target.type()) + { + // different types: replace value + result.push_back( + { + {"op", "replace"}, {"path", path}, {"value", target} + }); + return result; + } + + switch (source.type()) + { + case value_t::array: + { + // first pass: traverse common elements + std::size_t i = 0; + while (i < source.size() && i < target.size()) + { + // recursive call to compare array values at index i + auto temp_diff = diff(source[i], target[i], path + "/" + std::to_string(i)); + result.insert(result.end(), temp_diff.begin(), temp_diff.end()); + ++i; + } + + // i now reached the end of at least one array + // in a second pass, traverse the remaining elements + + // remove my remaining elements + const auto end_index = static_cast(result.size()); + while (i < source.size()) + { + // add operations in reverse order to avoid invalid + // indices + result.insert(result.begin() + end_index, object( + { + {"op", "remove"}, + {"path", path + "/" + std::to_string(i)} + })); + ++i; + } + + // add other remaining elements + while (i < target.size()) + { + result.push_back( + { + {"op", "add"}, + {"path", path + "/-"}, + {"value", target[i]} + }); + ++i; + } + + break; + } + + case value_t::object: + { + // first pass: traverse this object's elements + for (auto it = source.cbegin(); it != source.cend(); ++it) + { + // escape the key name to be used in a JSON patch + const auto key = json_pointer::escape(it.key()); + + if (target.find(it.key()) != target.end()) + { + // recursive call to compare object values at key it + auto temp_diff = diff(it.value(), target[it.key()], path + "/" + key); + result.insert(result.end(), temp_diff.begin(), temp_diff.end()); + } + else + { + // found a key that is not in o -> remove it + result.push_back(object( + { + {"op", "remove"}, {"path", path + "/" + key} + })); + } + } + + // second pass: traverse other object's elements + for (auto it = target.cbegin(); it != target.cend(); ++it) + { + if (source.find(it.key()) == source.end()) + { + // found a key that is not in this -> add it + const auto key = json_pointer::escape(it.key()); + result.push_back( + { + {"op", "add"}, {"path", path + "/" + key}, + {"value", it.value()} + }); + } + } + + break; + } + + default: + { + // both primitive type: replace value + result.push_back( + { + {"op", "replace"}, {"path", path}, {"value", target} + }); + break; + } + } + + return result; + } + + /// @} + + //////////////////////////////// + // JSON Merge Patch functions // + //////////////////////////////// + + /// @name JSON Merge Patch functions + /// @{ + + /*! + @brief applies a JSON Merge Patch + + The merge patch format is primarily intended for use with the HTTP PATCH + method as a means of describing a set of modifications to a target + resource's content. This function applies a merge patch to the current + JSON value. + + The function implements the following algorithm from Section 2 of + [RFC 7396 (JSON Merge Patch)](https://tools.ietf.org/html/rfc7396): + + ``` + define MergePatch(Target, Patch): + if Patch is an Object: + if Target is not an Object: + Target = {} // Ignore the contents and set it to an empty Object + for each Name/Value pair in Patch: + if Value is null: + if Name exists in Target: + remove the Name/Value pair from Target + else: + Target[Name] = MergePatch(Target[Name], Value) + return Target + else: + return Patch + ``` + + Thereby, `Target` is the current object; that is, the patch is applied to + the current value. + + @param[in] apply_patch the patch to apply + + @complexity Linear in the lengths of @a patch. + + @liveexample{The following code shows how a JSON Merge Patch is applied to + a JSON document.,merge_patch} + + @sa @ref patch -- apply a JSON patch + @sa [RFC 7396 (JSON Merge Patch)](https://tools.ietf.org/html/rfc7396) + + @since version 3.0.0 + */ + void merge_patch(const basic_json& apply_patch) + { + if (apply_patch.is_object()) + { + if (!is_object()) + { + *this = object(); + } + for (auto it = apply_patch.begin(); it != apply_patch.end(); ++it) + { + if (it.value().is_null()) + { + erase(it.key()); + } + else + { + operator[](it.key()).merge_patch(it.value()); + } + } + } + else + { + *this = apply_patch; + } + } + + /// @} +}; + +/*! +@brief user-defined to_string function for JSON values + +This function implements a user-defined to_string for JSON objects. + +@param[in] j a JSON object +@return a std::string object +*/ + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +std::string to_string(const NLOHMANN_BASIC_JSON_TPL& j) +{ + return j.dump(); +} +} // namespace nlohmann + +/////////////////////// +// nonmember support // +/////////////////////// + +// specialization of std::swap, and std::hash +namespace std +{ + +/// hash value for JSON objects +template<> +struct hash +{ + /*! + @brief return a hash value for a JSON object + + @since version 1.0.0 + */ + std::size_t operator()(const nlohmann::json& j) const + { + return nlohmann::detail::hash(j); + } +}; + +/// specialization for std::less +/// @note: do not remove the space after '<', +/// see https://github.com/nlohmann/json/pull/679 +template<> +struct less<::nlohmann::detail::value_t> +{ + /*! + @brief compare two value_t enum values + @since version 3.0.0 + */ + bool operator()(nlohmann::detail::value_t lhs, + nlohmann::detail::value_t rhs) const noexcept + { + return nlohmann::detail::operator<(lhs, rhs); + } +}; + +// C++20 prohibit function specialization in the std namespace. +#ifndef JSON_HAS_CPP_20 + +/*! +@brief exchanges the values of two JSON objects + +@since version 1.0.0 +*/ +template<> +inline void swap(nlohmann::json& j1, nlohmann::json& j2) noexcept( + is_nothrow_move_constructible::value&& + is_nothrow_move_assignable::value + ) +{ + j1.swap(j2); +} + +#endif + +} // namespace std + +/*! +@brief user-defined string literal for JSON values + +This operator implements a user-defined string literal for JSON objects. It +can be used by adding `"_json"` to a string literal and returns a JSON object +if no parse error occurred. + +@param[in] s a string representation of a JSON object +@param[in] n the length of string @a s +@return a JSON object + +@since version 1.0.0 +*/ +JSON_HEDLEY_NON_NULL(1) +inline nlohmann::json operator "" _json(const char* s, std::size_t n) +{ + return nlohmann::json::parse(s, s + n); +} + +/*! +@brief user-defined string literal for JSON pointer + +This operator implements a user-defined string literal for JSON Pointers. It +can be used by adding `"_json_pointer"` to a string literal and returns a JSON pointer +object if no parse error occurred. + +@param[in] s a string representation of a JSON Pointer +@param[in] n the length of string @a s +@return a JSON pointer object + +@since version 2.0.0 +*/ +JSON_HEDLEY_NON_NULL(1) +inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n) +{ + return nlohmann::json::json_pointer(std::string(s, n)); +} + +// #include + + +// restore GCC/clang diagnostic settings +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) + #pragma GCC diagnostic pop +#endif +#if defined(__clang__) + #pragma GCC diagnostic pop +#endif + +// clean up +#undef JSON_ASSERT +#undef JSON_INTERNAL_CATCH +#undef JSON_CATCH +#undef JSON_THROW +#undef JSON_TRY +#undef JSON_HAS_CPP_14 +#undef JSON_HAS_CPP_17 +#undef NLOHMANN_BASIC_JSON_TPL_DECLARATION +#undef NLOHMANN_BASIC_JSON_TPL +#undef JSON_EXPLICIT + +// #include +#undef JSON_HEDLEY_ALWAYS_INLINE +#undef JSON_HEDLEY_ARM_VERSION +#undef JSON_HEDLEY_ARM_VERSION_CHECK +#undef JSON_HEDLEY_ARRAY_PARAM +#undef JSON_HEDLEY_ASSUME +#undef JSON_HEDLEY_BEGIN_C_DECLS +#undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#undef JSON_HEDLEY_CLANG_HAS_FEATURE +#undef JSON_HEDLEY_CLANG_HAS_WARNING +#undef JSON_HEDLEY_COMPCERT_VERSION +#undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#undef JSON_HEDLEY_CONCAT +#undef JSON_HEDLEY_CONCAT3 +#undef JSON_HEDLEY_CONCAT3_EX +#undef JSON_HEDLEY_CONCAT_EX +#undef JSON_HEDLEY_CONST +#undef JSON_HEDLEY_CONSTEXPR +#undef JSON_HEDLEY_CONST_CAST +#undef JSON_HEDLEY_CPP_CAST +#undef JSON_HEDLEY_CRAY_VERSION +#undef JSON_HEDLEY_CRAY_VERSION_CHECK +#undef JSON_HEDLEY_C_DECL +#undef JSON_HEDLEY_DEPRECATED +#undef JSON_HEDLEY_DEPRECATED_FOR +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#undef JSON_HEDLEY_DIAGNOSTIC_POP +#undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#undef JSON_HEDLEY_DMC_VERSION +#undef JSON_HEDLEY_DMC_VERSION_CHECK +#undef JSON_HEDLEY_EMPTY_BASES +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#undef JSON_HEDLEY_END_C_DECLS +#undef JSON_HEDLEY_FLAGS +#undef JSON_HEDLEY_FLAGS_CAST +#undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_BUILTIN +#undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GCC_HAS_EXTENSION +#undef JSON_HEDLEY_GCC_HAS_FEATURE +#undef JSON_HEDLEY_GCC_HAS_WARNING +#undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#undef JSON_HEDLEY_GCC_VERSION +#undef JSON_HEDLEY_GCC_VERSION_CHECK +#undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#undef JSON_HEDLEY_GNUC_HAS_FEATURE +#undef JSON_HEDLEY_GNUC_HAS_WARNING +#undef JSON_HEDLEY_GNUC_VERSION +#undef JSON_HEDLEY_GNUC_VERSION_CHECK +#undef JSON_HEDLEY_HAS_ATTRIBUTE +#undef JSON_HEDLEY_HAS_BUILTIN +#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#undef JSON_HEDLEY_HAS_EXTENSION +#undef JSON_HEDLEY_HAS_FEATURE +#undef JSON_HEDLEY_HAS_WARNING +#undef JSON_HEDLEY_IAR_VERSION +#undef JSON_HEDLEY_IAR_VERSION_CHECK +#undef JSON_HEDLEY_IBM_VERSION +#undef JSON_HEDLEY_IBM_VERSION_CHECK +#undef JSON_HEDLEY_IMPORT +#undef JSON_HEDLEY_INLINE +#undef JSON_HEDLEY_INTEL_VERSION +#undef JSON_HEDLEY_INTEL_VERSION_CHECK +#undef JSON_HEDLEY_IS_CONSTANT +#undef JSON_HEDLEY_IS_CONSTEXPR_ +#undef JSON_HEDLEY_LIKELY +#undef JSON_HEDLEY_MALLOC +#undef JSON_HEDLEY_MESSAGE +#undef JSON_HEDLEY_MSVC_VERSION +#undef JSON_HEDLEY_MSVC_VERSION_CHECK +#undef JSON_HEDLEY_NEVER_INLINE +#undef JSON_HEDLEY_NON_NULL +#undef JSON_HEDLEY_NO_ESCAPE +#undef JSON_HEDLEY_NO_RETURN +#undef JSON_HEDLEY_NO_THROW +#undef JSON_HEDLEY_NULL +#undef JSON_HEDLEY_PELLES_VERSION +#undef JSON_HEDLEY_PELLES_VERSION_CHECK +#undef JSON_HEDLEY_PGI_VERSION +#undef JSON_HEDLEY_PGI_VERSION_CHECK +#undef JSON_HEDLEY_PREDICT +#undef JSON_HEDLEY_PRINTF_FORMAT +#undef JSON_HEDLEY_PRIVATE +#undef JSON_HEDLEY_PUBLIC +#undef JSON_HEDLEY_PURE +#undef JSON_HEDLEY_REINTERPRET_CAST +#undef JSON_HEDLEY_REQUIRE +#undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#undef JSON_HEDLEY_REQUIRE_MSG +#undef JSON_HEDLEY_RESTRICT +#undef JSON_HEDLEY_RETURNS_NON_NULL +#undef JSON_HEDLEY_SENTINEL +#undef JSON_HEDLEY_STATIC_ASSERT +#undef JSON_HEDLEY_STATIC_CAST +#undef JSON_HEDLEY_STRINGIFY +#undef JSON_HEDLEY_STRINGIFY_EX +#undef JSON_HEDLEY_SUNPRO_VERSION +#undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#undef JSON_HEDLEY_TINYC_VERSION +#undef JSON_HEDLEY_TINYC_VERSION_CHECK +#undef JSON_HEDLEY_TI_ARMCL_VERSION +#undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL2000_VERSION +#undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL430_VERSION +#undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL6X_VERSION +#undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#undef JSON_HEDLEY_TI_CL7X_VERSION +#undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#undef JSON_HEDLEY_TI_CLPRU_VERSION +#undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#undef JSON_HEDLEY_TI_VERSION +#undef JSON_HEDLEY_TI_VERSION_CHECK +#undef JSON_HEDLEY_UNAVAILABLE +#undef JSON_HEDLEY_UNLIKELY +#undef JSON_HEDLEY_UNPREDICTABLE +#undef JSON_HEDLEY_UNREACHABLE +#undef JSON_HEDLEY_UNREACHABLE_RETURN +#undef JSON_HEDLEY_VERSION +#undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#undef JSON_HEDLEY_VERSION_DECODE_MINOR +#undef JSON_HEDLEY_VERSION_DECODE_REVISION +#undef JSON_HEDLEY_VERSION_ENCODE +#undef JSON_HEDLEY_WARNING +#undef JSON_HEDLEY_WARN_UNUSED_RESULT +#undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#undef JSON_HEDLEY_FALL_THROUGH + + + +#endif // INCLUDE_NLOHMANN_JSON_HPP_ diff --git a/demboyz/base/jsonfile.cpp b/demboyz/base/jsonfile.cpp deleted file mode 100644 index 0ce640f..0000000 --- a/demboyz/base/jsonfile.cpp +++ /dev/null @@ -1,470 +0,0 @@ - -#include "jsonfile.h" -#include -#include - -#define CBASE64_IMPLEMENTATION -#include "cbase64/cbase64.h" - -#define RIGHT_TO_LEFT_BITS - -namespace base -{ - JsonWriterFile::JsonWriterFile(FILE* fp, char* buffer, std::size_t length): - m_fileStream(fp, buffer, length), - m_writer(m_fileStream), - m_fp(fp) - { - } - - JsonWriterFile::~JsonWriterFile() - { - Flush(); - } - - FILE* JsonWriterFile::GetFp() const - { - return m_fp; - } - - void JsonWriterFile::Flush() - { - m_fileStream.Flush(); - fflush(m_fp); - } - - void JsonWriterFile::Reset() - { - m_writer.Reset(m_fileStream); - } - - bool JsonWriterFile::IsComplete() const - { - return m_writer.IsComplete(); - } - - void JsonWriterFile::StartObject(const char* name /*= nullptr*/) - { - auto& writer = m_writer; - if (name) - { - writer.String(name); - } - writer.StartObject(); - } - - void JsonWriterFile::EndObject() - { - m_writer.EndObject(); - } - - void JsonWriterFile::StartArray(const char* name /*= nullptr*/) - { - auto& writer = m_writer; - if (name) - { - writer.String(name); - } - writer.StartArray(); - } - - void JsonWriterFile::EndArray() - { - m_writer.EndArray(); - } - - void JsonWriterFile::WriteNull(const char* name) - { - auto& writer = m_writer; - writer.String(name); - writer.Null(); - } - - void JsonWriterFile::WriteBool(const char* name, bool value) - { - auto& writer = m_writer; - writer.String(name); - writer.Bool(value); - } - - void JsonWriterFile::WriteChar(const char* name, char value) - { - auto& writer = m_writer; - writer.String(name); - - char temp[2] = { value, '\0' }; - writer.String(temp); - } - - void JsonWriterFile::WriteInt32(const char* name, std::int32_t value) - { - auto& writer = m_writer; - writer.String(name); - writer.Int(value); - } - - void JsonWriterFile::WriteInt32(const char* name, std::int32_t value, bool writeCondition) - { - auto& writer = m_writer; - writer.String(name); - if (writeCondition) - { - writer.Int(value); - } - else - { - writer.Null(); - } - } - - void JsonWriterFile::WriteInt64(const char* name, std::int64_t value) - { - auto& writer = m_writer; - writer.String(name); - writer.Int64(value); - } - - void JsonWriterFile::WriteUInt32(const char* name, std::uint32_t value) - { - auto& writer = m_writer; - writer.String(name); - writer.Uint(value); - } - - void JsonWriterFile::WriteUInt32(const char* name, std::uint32_t value, bool writeCondition) - { - auto& writer = m_writer; - writer.String(name); - if (writeCondition) - { - writer.Uint(value); - } - else - { - writer.Null(); - } - } - - void JsonWriterFile::WriteUint64(const char* name, std::uint64_t value) - { - auto& writer = m_writer; - writer.String(name); - writer.Uint64(value); - } - - void JsonWriterFile::WriteString(const char* name, const char* value) - { - auto& writer = m_writer; - writer.String(name); - writer.String(value); - } - - void JsonWriterFile::WriteString(const char* name, const char* value, std::uint32_t length) - { - auto& writer = m_writer; - writer.String(name); - writer.String(value, length); - } - - void JsonWriterFile::WriteString(const char* name, const std::string& value) - { - auto& writer = m_writer; - writer.String(name); - writer.String(value.c_str(), value.length()); - } - - void JsonWriterFile::WriteFloat(const char* name, const double value) - { - auto& writer = m_writer; - writer.String(name); - writer.Double(value); - } - - void JsonWriterFile::WriteBits(const char* name, const unsigned char* data, std::size_t numBits) - { - auto& writer = m_writer; - writer.String(name); - - cbase64_encodestate state; - cbase64_init_encodestate(&state); - - const std::size_t numBytes = ((numBits + 7) >> 3); - - char* const encoded = (char*)malloc(cbase64_calc_encoded_length(numBytes)); - char* encodedCurOut = encoded; - - const std::size_t numBytesWithoutBits = (numBits >> 3); - const std::size_t numTrailingBits = (numBits & 7); - - encodedCurOut += cbase64_encode_block(data, numBytesWithoutBits, encodedCurOut, &state); - if (numTrailingBits > 0) - { -#ifdef LEFT_TO_RIGHT_BITS - const unsigned char lastByteClean = data[numBytesWithoutBits] & (0xFF >> numTrailingBits); -#else // RIGHT_TO_LEFT_BITS - const unsigned char lastByteClean = data[numBytesWithoutBits] & ~(0xFF << numTrailingBits); -#endif - encodedCurOut += cbase64_encode_block(&lastByteClean, 1, encodedCurOut, &state); - } - encodedCurOut += cbase64_encode_blockend(encodedCurOut, &state); - - writer.String(encoded, encodedCurOut - encoded); - free(encoded); - return; - } - - void JsonWriterFile::WriteBytes(const char* name, const unsigned char* data, std::size_t numBytes) - { - JsonWriterFile::WriteBits(name, data, numBytes * 8); - } - - JsonReaderObject::JsonReaderIterator::JsonReaderIterator(JsonValue* value, bool& hasReadError): - m_value(value), - m_hasReadError(hasReadError) - { - } - - JsonReaderObject JsonReaderIterator::operator*() const - { - return JsonReaderObject(*m_value, m_hasReadError); - } - - JsonReaderIterator& JsonReaderIterator::operator++() - { - ++m_value; - return *this; - } - - bool JsonReaderIterator::operator==(const JsonReaderIterator& other) const - { - return m_value == other.m_value; - } - - bool JsonReaderIterator::operator!=(const JsonReaderIterator& other) const - { - return m_value != other.m_value; - } - - JsonReaderObject::JsonReaderArray::JsonReaderArray(JsonValue& value, bool& parseError): - m_value(value), - m_hasReadError(parseError) - { - } - - bool JsonReaderArray::HasReadError() const - { - return m_hasReadError; - } - - std::size_t JsonReaderArray::size() const - { - return m_value.Size(); - } - - JsonReaderIterator JsonReaderArray::begin() - { - return JsonReaderIterator(m_value.Begin(), m_hasReadError); - } - - JsonReaderIterator JsonReaderArray::end() - { - return JsonReaderIterator(m_value.End(), m_hasReadError); - } - - JsonReaderObject::JsonReaderObject(JsonValue& value, bool& parseError): - m_value(value), - m_hasReadError(parseError) - { - } - - bool JsonReaderObject::HasReadError() const - { - return m_hasReadError; - } - - JsonReaderObject JsonReaderObject::ReadObject(const char* name) const - { - JsonValue& value = m_value[name]; - m_hasReadError |= !value.IsObject(); - return JsonReaderObject(value, m_hasReadError); - } - - JsonReaderArray JsonReaderObject::ReadArray(const char* name) const - { - JsonValue& value = m_value[name]; - m_hasReadError |= !value.IsArray(); - return JsonReaderArray(value, m_hasReadError); - } - - bool JsonReaderObject::ReadBool(const char* name) - { - const auto& val = m_value[name]; - if (!val.IsBool()) - { - m_hasReadError = true; - return false; - } - return val.GetBool(); - } - - char JsonReaderObject::ReadChar(const char* name) - { - const auto& val = m_value[name]; - if (!val.IsString() || val.GetStringLength() != 1) - { - m_hasReadError = true; - return false; - } - return *val.GetString(); - } - - std::int32_t JsonReaderObject::ReadInt32(const char* name) - { - const auto& val = m_value[name]; - if (!val.IsInt()) - { - m_hasReadError = true; - return 0; - } - return val.GetInt(); - } - - std::int64_t JsonReaderObject::ReadInt64(const char* name) - { - const auto& val = m_value[name]; - if (!val.IsInt64()) - { - m_hasReadError = true; - return 0; - } - return val.GetInt64(); - } - - std::uint32_t JsonReaderObject::ReadUInt32(const char* name) - { - const auto& val = m_value[name]; - if (!val.IsUint()) - { - m_hasReadError = true; - return 0; - } - return val.GetUint(); - } - - std::uint64_t JsonReaderObject::ReadUint64(const char* name) - { - const auto& val = m_value[name]; - if (!val.IsUint64()) - { - m_hasReadError = true; - return 0; - } - return val.GetUint64(); - } - - std::uint32_t JsonReaderObject::ReadString(const char* name, char* dest, std::uint32_t maxLength) - { - const auto& val = m_value[name]; - if (!val.IsString()) - { - m_hasReadError = true; - return 0; - } - strncpy(dest, val.GetString(), maxLength - 1); - dest[maxLength - 1] = '\0'; - return std::min(maxLength - 1, val.GetStringLength()); - } - - float JsonReaderObject::ReadFloat(const char* name) - { - const auto& val = m_value[name]; - if (!val.IsDouble()) - { - m_hasReadError = true; - return 0.0f; - } - return val.GetDouble(); - } - - std::size_t JsonReaderObject::ReadBits(const char* name, unsigned char* dest, std::size_t numBits) - { - const auto& val = m_value[name]; - if (!val.IsString()) - { - m_hasReadError = true; - return 0; - } - - const char* const encodedBits = val.GetString(); - const std::size_t numEncodedBytes = val.GetStringLength(); - const std::size_t numDecodedBytes = cbase64_calc_decoded_length(encodedBits, numEncodedBytes); - if (!dest || (numDecodedBytes == 0)) - { - return numDecodedBytes * 8; - } - - const std::size_t numBytes = ((numBits + 7) >> 3); - if ((numDecodedBytes == 0) || (numBytes < numDecodedBytes)) - { - return 0; - } - - unsigned char* lastByte = &dest[numDecodedBytes - 1]; - unsigned char restoreBits = *lastByte; - - cbase64_decodestate state; - cbase64_init_decodestate(&state); - const size_t numWritten = cbase64_decode_block(encodedBits, numEncodedBytes, dest, &state); - assert(numWritten == numDecodedBytes); - - const std::size_t numTrailingBits = (numBits & 7); - if (numTrailingBits > 0) - { - // clean up end of decoded, clean up start of restoreBits - // then combine -#ifdef LEFT_TO_RIGHT_BITS - *lastByte = (*lastByte & ~(0xFF >> numTrailingBits)) | - (restoreBits & (0xFF >> numTrailingBits)); -#else // RIGHT_TO_LEFT_BITS - *lastByte = (*lastByte & ~(0xFF << numTrailingBits)) | - (restoreBits & (0xFF << numTrailingBits)); -#endif - } - return numBits; - } - - std::size_t JsonReaderObject::ReadBytes(const char* name, unsigned char* dest, std::size_t numBytes) - { - const std::size_t numBitsRead = ReadBits(name, dest, numBytes * 8); - assert((numBitsRead & 7) == 0); - return (numBitsRead / 8); - } - - JsonReaderFile::JsonReaderFile(FILE* fp, char* buffer, std::size_t length): - m_fileStream(fp, buffer, length), - m_document() - { - } - - JsonReaderObject JsonReaderFile::ParseObject() - { - const int flags = rapidjson::kParseValidateEncodingFlag | - rapidjson::kParseStopWhenDoneFlag; - - auto& document = m_document; - document.ParseStream(m_fileStream); - m_hasParseError = document.HasParseError(); - m_hasReadError = false; - return JsonReaderObject(document, m_hasReadError); - } - - bool JsonReaderFile::HasParseError() const - { - return m_hasParseError; - } - - bool JsonReaderFile::HasReadError() const - { - return m_hasReadError; - } -} diff --git a/demboyz/base/jsonfile.h b/demboyz/base/jsonfile.h deleted file mode 100644 index 0991c7a..0000000 --- a/demboyz/base/jsonfile.h +++ /dev/null @@ -1,147 +0,0 @@ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace base -{ - class JsonWriterFile - { - public: - JsonWriterFile(FILE* fp, char* buffer, std::size_t length); - ~JsonWriterFile(); - - FILE* GetFp() const; - void Flush(); - void Reset(); - bool IsComplete() const; - - void StartObject(const char* name = nullptr); - void EndObject(); - - void StartArray(const char* name = nullptr); - void EndArray(); - - void WriteNull(const char* name); - void WriteBool(const char* name, bool value); - void WriteChar(const char* name, char value); - void WriteInt32(const char* name, std::int32_t value); - void WriteInt32(const char* name, std::int32_t value, bool writeCondition); - void WriteInt64(const char* name, std::int64_t value); - void WriteUInt32(const char* name, std::uint32_t value); - void WriteUInt32(const char* name, std::uint32_t value, bool writeCondition); - void WriteUint64(const char* name, std::uint64_t value); - void WriteString(const char* name, const char* value); - void WriteString(const char* name, const char* value, std::uint32_t length); - void WriteString(const char* name, const std::string& value); - void WriteFloat(const char* name, const double value); - - void WriteBits(const char* name, const unsigned char* data, std::size_t numBits); - void WriteBytes(const char* name, const unsigned char* data, std::size_t numBytes); - - private: - rapidjson::FileWriteStream m_fileStream; - rapidjson::PrettyWriter> m_writer; - FILE* m_fp; - }; - - class JsonReaderObject - { - public: - using JsonValue = rapidjson::GenericValue>; - - class JsonReaderIterator - { - public: - explicit JsonReaderIterator(JsonValue* value, bool& hasReadError); - - JsonReaderObject operator*() const; - JsonReaderIterator& operator++(); - bool operator==(const JsonReaderIterator& other) const; - bool operator!=(const JsonReaderIterator& other) const; - - private: - JsonValue* m_value; - bool& m_hasReadError; - }; - - class JsonReaderArray - { - public: - explicit JsonReaderArray(JsonValue& value, bool& parseError); - - bool HasReadError() const; - - std::size_t size() const; - JsonReaderIterator begin(); - JsonReaderIterator end(); - - template - void TransformTo(Container& c, Fn fn) - { - c.resize(m_value.Size()); - std::size_t index = 0; - for (base::JsonReaderObject obj : *this) - { - fn(obj, c[index++]); - } - } - - private: - JsonValue& m_value; - bool& m_hasReadError; - }; - - public: - explicit JsonReaderObject(JsonValue& value, bool& parseError); - - bool HasReadError() const; - - JsonReaderObject ReadObject(const char* name) const; - JsonReaderArray ReadArray(const char* name) const; - - bool ReadBool(const char* name); - char ReadChar(const char* name); - std::int32_t ReadInt32(const char* name); - std::int64_t ReadInt64(const char* name); - std::uint32_t ReadUInt32(const char* name); - std::uint64_t ReadUint64(const char* name); - std::uint32_t ReadString(const char* name, char* dest, std::uint32_t maxLength); - //std::string ReadString(const char* name, std::uint32_t maxLength); - float ReadFloat(const char* name); - - std::size_t ReadBits(const char* name, unsigned char* dest, std::size_t numBits); - std::size_t ReadBytes(const char* name, unsigned char* dest, std::size_t numBytes); - - private: - JsonValue& m_value; - bool& m_hasReadError; - }; - - using JsonReaderIterator = JsonReaderObject::JsonReaderIterator; - using JsonReaderArray = JsonReaderObject::JsonReaderArray; - - class JsonReaderFile - { - public: - JsonReaderFile(FILE* fp, char* buffer, std::size_t length); - - JsonReaderObject ParseObject(); - - bool HasParseError() const; - bool HasReadError() const; - - private: - rapidjson::FileReadStream m_fileStream; - rapidjson::GenericDocument> m_document; - bool m_hasParseError; - bool m_hasReadError; - }; -} diff --git a/demboyz/base/steamid.h b/demboyz/base/steamid.h new file mode 100644 index 0000000..4e35961 --- /dev/null +++ b/demboyz/base/steamid.h @@ -0,0 +1,457 @@ +/*! + * SteamID Parser + * + * Copyright 2014 Mukunda Johnson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#pragma once +#ifndef _STEAMID_ +#define _STEAMID_ + +#include +#include + +/** --------------------------------------------------------------------------- + * SteamID + * + * Contains a User Steam ID. + * + * @author Mukunda Johnson + */ +class SteamID { + +public: + enum class Formats { + AUTO = 0, // Auto-detect format --- this also supports + // other unlisted formats such as + // full profile URLs. + STEAMID32 = 1, // Classic STEAM_x:y:zzzzzz | x = 0/1 + STEAMID64 = 2, // SteamID64: 7656119xxxxxxxxxx + STEAMID3 = 3, // SteamID3 format: [U:1:xxxxxx] + S32 = 4, // Raw 32-bit SIGNED format. + // this is a raw steamid index that overflows + // into negative bitspace. + // This is the format that SourceMod returns + // with GetSteamAccountID, and will always + // fit into a 32-bit signed variable. (e.g. + // a 32-bit PHP integer). + RAW = 5, // Raw index. like 64-bit minus the base value. + + }; + + // 64-bit type. + using bigint = long long; + using uint = unsigned int; + + // base constant of 64-bit Steam IDs + static const bigint STEAMID64_BASE = 76561197960265728L; + + // max allowed value. (sanity check) + // 2^36; update this in approx 2,400,000 years + static const bigint MAX_VALUE = 68719476736L; + + /** ----------------------------------------------------------------------- + * Parse a Steam ID. + * + * @param input Input to parse. + * + * @param format Input formatting, see Format constants. + * Defaults to Format::AUTO which detects the format. + * + * @param detect_raw Detect and parse RAW values. (only used with + * Format::AUTO. e.g "123" will resolve to the + * SteamID with the raw value 123. + * Default option set with ParseRawDefault. + * + * @returns SteamID instance or an empty SteamID if the parsing fails. + */ + static SteamID Parse( const std::string &input, + Formats format = Formats::AUTO, + int detect_raw = ParseRawDefault(-1) ) { + + if( input.empty() ) return SteamID(); // no input... + + try { + switch( format ) { + + //----------------------------------------------------------------- + case Formats::STEAMID32: { + + // regex is slow as fuck for some reason. + if( input.size() < 11 || input[0] != 'S' || input[1] != 'T' + || input[2] != 'E' || input[3] != 'A' || input[4] != 'M' + || input[5] != '_' || !Is01(input,6) || input[7] != ':' + || !Is01(input,8) || input[9] != ':' ) return SteamID(); + + // STEAM_X:Y:Z' +// static const std::regex r( +// R"--(^STEAM_[0-1]:[0-1]:[0-9]+$)--", +// rc::icase | rc::optimize ); +// +// if( !std::regex_match( input, r ) ) return SteamID(); + + bigint z = std::stoll( input.substr( 10 ) ); + z = (z << 1) + (input[8] - '0'); + + SteamID result(z); + //result.Cache( Format::STEAMID32, input ); + return result; + + //----------------------------------------------------------------- + } case Formats::STEAMID64: { + + // allow digits only + if( !IsDigits( input ) ) return SteamID(); + + // convert to raw (subtract base) + SteamID result( std::stoll( input ) - STEAMID64_BASE ); + //result.Cache( Format::STEAMID64, input ); + return result; + + //----------------------------------------------------------------- + } case Formats::STEAMID3: { + + // [U:1:xxxxxx] + if( input.size() < 7 || input[0] != '[' || input[1] != 'U' + || input[2] != ':' || input[3] != '1' || input[4] != ':' + || input[input.size()-1] != ']' + || !IsDigits( input, 5, input.size() - 1 - 5 ) ) { + + return SteamID(); + } + + // slow. +// static const std::regex r( R"--(^\[U:1:[0-9]+\]$)--", +// rc::optimize ); +// if( !std::regex_match( input, r ) ) return SteamID(); + + SteamID result( std::stoll( + input.substr( 5, input.size() - 1 - 5 ))); + + //result.Cache( Format::STEAMID3, input ); + return result; + + //----------------------------------------------------------------- + } case Formats::S32: { + + // signed digits + if( !IsDigits( input, input[0] == '-' ? 1:0 ) ) { + return SteamID(); + } + + bigint a = std::stoll( input ); + if( a < 0 ) a += 4294967296L; + + SteamID result( a ); + //result.Cache( Format::S32, input ); + return result; + + //----------------------------------------------------------------- + } case Formats::RAW: { + + // validate digits only + if( !IsDigits( input ) ) return SteamID(); + + return SteamID( std::stoll( input )); + } + + case Formats::AUTO: { + break; + }} + } catch( std::out_of_range& ) { + + // integer conversion out of range... + return SteamID(); + } + // Auto detect format: + + std::string cleaned = TrimString(input); + SteamID result; + result = Parse( cleaned, Formats::STEAMID32 ); + if( *result ) return result; + result = Parse( cleaned, Formats::STEAMID64 ); + if( *result ) return result; + result = Parse( cleaned, Formats::STEAMID3 ); + if( *result ) return result; + + result = TryConvertProfileURL( cleaned ); + if( *result ) return result; + + // static const std::regex r_url( + // R"--(^(?:https?:\/\/)?(?:www.)?steamcommunity.com\/profiles\/([0-9]+)$)--", + // rc::icase | rc::optimize ); + + // std::smatch matches; + // if( std::regex_match( cleaned, matches, r_url ) ) { + // result = Parse( matches[1], Formats::STEAMID64 ); + // if( *result ) return result; + // } + + if( detect_raw ) { + result = Parse( input, Formats::S32 ); + if( *result ) return result; + result = Parse( input, Formats::RAW ); + if( *result ) return result; + } + + // unknown stem + return SteamID(); + } + + /** ----------------------------------------------------------------------- + * Format this SteamID to a string. + * + * @param format Output format. See Format constants. + * @returns Formatted Steam ID, or an empty string if an invalid + * format is given or the desired format cannot + * contain the SteamID. + */ + std::string Format( Formats format ) const { + + switch( format ) { + case Formats::STEAMID32: { + bigint z = m_value >> 1; + int y = m_value & 1; + return std::string("STEAM_1:") + std::to_string(y) + + ":" + std::to_string(z); + + } case Formats::STEAMID64: { + return std::to_string( m_value + STEAMID64_BASE ); + + } case Formats::STEAMID3: { + return std::string( "[U:1:" ) + + std::to_string(m_value) + ']'; + + } case Formats::S32: { + if( m_value >= 4294967296L ) { + return ""; // too large for s32. + } + + if( m_value >= 2147483648L ) { + return std::to_string( m_value - 4294967296L ); + } + + // --> + } case Formats::RAW: { + return std::to_string( m_value ); + } + + case Formats::AUTO: { + break; + }} + + return ""; + } + + /** ----------------------------------------------------------------------- + * Set the default setting for detect_raw for Parse() + * + * @param detect_raw Default detect_raw value, see Parse function. + * @returns Current or updated setting. + */ + static bool ParseRawDefault( int detect_raw = -1 ) { + static int option = false; + if( detect_raw == -1 ) return !!option; + option = !!detect_raw; + return !!option; + } + + /** ----------------------------------------------------------------------- + * Overload for Format. + */ + std::string operator[]( Formats format ) const { + return Format( format ); + } + + /** ----------------------------------------------------------------------- + * Get raw value. 0 = empty + */ + bigint Value() const { + return m_value; + } + + /** ----------------------------------------------------------------------- + * Get raw value. 0 = empty + */ + bigint operator*() const { + return m_value; + } + + /** ----------------------------------------------------------------------- + * Returns true if this SteamID is empty/invalid. + */ + bool operator!() { + return m_value == 0; + } + + /** ----------------------------------------------------------------------- + * Returns true if this SteamID is empty/invalid. + */ + bool Empty() const { + return m_value == 0; + } + + /** ----------------------------------------------------------------------- + * Get 64-bit Steam ID. + */ + bigint To64() { + return m_value + STEAMID64_BASE; + } + + /** ----------------------------------------------------------------------- + * Get raw value, same as operator*. + */ + bigint ToRaw() { + return m_value; + } + + /** ----------------------------------------------------------------------- + * Get 32-bit value cast to signed. + */ + int ToS32() { + if( m_value > 0xFFFFFFFF ) { + return 0; + } + return (int)m_value; + } + + /** ----------------------------------------------------------------------- + * Parsing shortcut. + */ + SteamID( const std::string &input, Formats format = Formats::AUTO, + int detect_raw = ParseRawDefault() ) + : SteamID( Parse( input, format, detect_raw )) { + } + + /** ----------------------------------------------------------------------- + * Construct a Steam ID. + * + * @param raw RAW value of Steam ID. + */ + SteamID( bigint raw ) + : m_value( (raw > 0 && raw <= MAX_VALUE) ? raw : 0 ) { + } + + /** ----------------------------------------------------------------------- + * An empty steam id. + */ + SteamID() : m_value(0) { + } + + SteamID( const SteamID& o ) = default; + SteamID( SteamID&& o ) { + m_value = o.m_value; + } + SteamID& operator=( const SteamID& o ) = default; + SteamID& operator=( SteamID&& o ) { + m_value = o.m_value; + return *this; + } + +private: + + bigint m_value; // RAW Steam ID value. + + //------------------------------------------------------------------------- + static bool IsDigits( const std::string &str, size_t start = 0, + size_t length = 9000 ) { + + for( size_t i = start; i != (start+length) && str[i]; i++ ) { + if( str[i] < '0' || str[i] > '9' ) return false; + } + return true; + } + + //------------------------------------------------------------------------- + static bool Is01( const std::string &str, size_t index ) { + return str[index] == '0' || str[index] == '1'; + } + + //------------------------------------------------------------------------- + static std::string TrimString( const std::string &input ) { + + int start = 0, end = (int)input.size()-1; + if( end < 0 ) return ""; + + while( std::isspace( input[start] )) { + start++; + if( start == (int)input.size() ) return ""; + } + + while( std::isspace( input[end] )) { + end--; + } + + return input.substr( start, 1+end-start ); + } + + //------------------------------------------------------------------------- + static SteamID TryConvertProfileURL( std::string &str ) { + if( str[0] != 'h' && str[0] != 'w' && str[0] != 's' ) return SteamID(); + + int lastslash = str.find_last_of( '/' ); + if( lastslash == (int)std::string::npos ) return SteamID(); + if( lastslash == (int)str.size()-1 ) { + str.pop_back(); + lastslash = str.find_last_of( '/' ); + if( lastslash == (int)std::string::npos ) return SteamID(); + } + + if( CheckProfilePrefix( str, lastslash ) ) { + return Parse( str.substr( lastslash+1 ) ); + } + return SteamID(); + } + + static bool CheckProfilePrefix( std::string &str, int end ) { + // possible prefixes: + // 0123456789012345678901234567890123456789 + // https://www.steamcommunity.com/profiles/ + // http://www.steamcommunity.com/profiles/ + // https://steamcommunity.com/profiles/ + // http://steamcommunity.com/profiles/ + // www.steamcommunity.com/profiles/ + // steamcommunity.com/profiles/ + + if( end == 39 ) { + return str.compare( 0, 1+end, + "https://www.steamcommunity.com/profiles/" ) == 0; + } else if( end == 38 ) { + return str.compare( 0, 1+end, + "http://www.steamcommunity.com/profiles/" ) == 0; + } else if( end == 35 ) { + return str.compare( 0, 1+end, + "https://steamcommunity.com/profiles/" ) == 0; + } else if( end == 34 ) { + return str.compare( 0, 1+end, + "http://steamcommunity.com/profiles/" ) == 0; + } else if( end == 31 ) { + return str.compare( 0, 1+end, + "www.steamcommunity.com/profiles/" ) == 0; + } else if( end == 27 ) { + return str.compare( 0, 1+end, + "steamcommunity.com/profiles/" ) == 0; + } + return false; + } +}; + +#endif diff --git a/demboyz/demboyz.cpp b/demboyz/demboyz.cpp index 13f0897..3957c44 100644 --- a/demboyz/demboyz.cpp +++ b/demboyz/demboyz.cpp @@ -1,76 +1,20 @@ -#include "io/idemowriter.h" #include "io/demoreader.h" -#include "json_checker/JSON_checker.h" +#include "game/sourcecontext.h" #include #include #include - -std::string GetExtension(const std::string& filename) -{ - size_t index = filename.find_last_of("."); - if (index != std::string::npos) - { - return filename.substr(index + 1); - } - return std::string(); -} - -enum class FileType -{ - None, - Dem, - Json, - ConLog -}; - -FileType GetFileType(const std::string& filename) -{ - std::string ext = GetExtension(filename); - if (ext == "dem") - { - return FileType::Dem; - } - if (ext == "json") - { - return FileType::Json; - } - if (ext == "con") - { - return FileType::ConLog; - } - return FileType::None; -} +#include int main(const int argc, const char* argv[]) { - if (argc != 3) + if (argc != 2) { - fprintf(stderr, "Usage: %s .dem/json .dem/json/con\n", argv[0]); - return -1; - } - - std::string inputFile(argv[1]); - std::string outputFile(argv[2]); - if (inputFile == outputFile) - { - fprintf(stderr, "Error: Input and output file cannot be the same!\n"); - return -1; - } - - FileType inputType = GetFileType(inputFile); - FileType outputType = GetFileType(outputFile); - if (inputType == FileType::None) - { - fprintf(stderr, "Error: Bad type for input file\n"); - return -1; - } - if (outputType == FileType::None) - { - fprintf(stderr, "Error: Bad type for output file\n"); + fprintf(stderr, "Usage: %s .dem\n", argv[0]); return -1; } + std::filesystem::path inputFile(argv[1]); FILE* inputFp = fopen(inputFile.c_str(), "rb"); if (!inputFp) { @@ -78,66 +22,18 @@ int main(const int argc, const char* argv[]) return -1; } - FILE* outputFp = fopen(outputFile.c_str(), "wb"); - if (!outputFp) - { - fprintf(stderr, "Error: Could not open input file\n"); - fclose(inputFp); + std::filesystem::path outputDir = inputFile.filename().replace_extension(); + std::filesystem::path outputDirVoice = outputDir.string() + "/voice"; + std::filesystem::create_directory(outputDir); + std::filesystem::create_directory(outputDirVoice); + + SourceGameContext context = SourceGameContext(outputDir, outputDirVoice); + if (!context.init()) return -1; - } - IDemoWriter* writer = nullptr; - if (outputType == FileType::Dem) - { - writer = IDemoWriter::CreateDemoWriter(outputFp); - } - else if (outputType == FileType::Json) - { - writer = IDemoWriter::CreateJsonWriter(outputFp); - } - else if (outputType == FileType::ConLog) - { - writer = IDemoWriter::CreateConLogWriter(outputFp); - } - else - { - assert(false); - } - - if (inputType == FileType::Dem) - { - DemoReader::ProcessDem(inputFp, writer); - } - else if (inputType == FileType::Json) - { - DemoReader::ProcessJson(inputFp, writer); - } - else - { - assert(false); - } - IDemoWriter::FreeDemoWriter(writer); + bool error = DemoReader::ProcessDem(inputFp, &context); fclose(inputFp); - fclose(outputFp); - /*if (outputType == FileType::Json) - { - FILE* outputFp = fopen(outputFile.c_str(), "rb"); - JSON_checker jc = new_JSON_checker(20); - int next_char = 0; - while ((next_char = fgetc(outputFp)) > 0) - { - if (!JSON_checker_char(jc, next_char)) - { - fprintf(stderr, "JSON_checker_char: syntax error\n"); - } - } - if (!JSON_checker_done(jc)) - { - fprintf(stderr, "JSON_checker_end: syntax error\n"); - } - fclose(outputFp); - }*/ - return 0; + return error; } diff --git a/demboyz/demmessages/dem_consolecmd.cpp b/demboyz/demmessages/dem_consolecmd.cpp index 96fdee8..c0962e8 100644 --- a/demboyz/demmessages/dem_consolecmd.cpp +++ b/demboyz/demmessages/dem_consolecmd.cpp @@ -1,7 +1,6 @@ #include "dem_consolecmd.h" #include "demofile/demofile.h" -#include "base/jsonfile.h" namespace DemHandlers { @@ -12,31 +11,4 @@ namespace DemHandlers data->command.assign(command); return demofile.IsOk(); } - - bool Dem_ConsoleCmd_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_ConsoleCmd* data) - { - const uint8_t* command = reinterpret_cast(data->command.data()); - demofile.WriteRawData(command, data->command.length() + 1); - return demofile.IsOk(); - } - - bool Dem_ConsoleCmd_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_ConsoleCmd* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - - char command[DemMsg::Dem_ConsoleCmd::COMMAND_MAX_LENGTH]; - reader.ReadString("command", command, sizeof(command)); - data->command.assign(command); - return !reader.HasReadError(); - } - - bool Dem_ConsoleCmd_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_ConsoleCmd* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteString("command", data->command); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } } diff --git a/demboyz/demmessages/dem_datatables.cpp b/demboyz/demmessages/dem_datatables.cpp index de57b13..dd1ee53 100644 --- a/demboyz/demmessages/dem_datatables.cpp +++ b/demboyz/demmessages/dem_datatables.cpp @@ -1,38 +1,74 @@ #include "dem_datatables.h" #include "demofile/demofile.h" -#include "demofile/demojson.h" +#include "sourcesdk/bitbuf.h" +#include namespace DemHandlers { bool Dem_DataTables_FileRead_Internal(FileRead& demofile, DemMsg::Dem_DataTables* data) { - data->data = demofile.ReadRawData(DemMsg::Dem_DataTables::DATA_MAX_LENGTH); + Array buffer = demofile.ReadRawData(DemMsg::Dem_DataTables::DATA_MAX_LENGTH); + bf_read bitbuf(buffer.begin(), buffer.length()); + + char strBuf[1024]; + while (bitbuf.ReadOneBit() != 0) + { + DemMsg::Dem_DataTables::SendTable sendTable; + + sendTable.needsDecoder = bitbuf.ReadOneBit() != 0; + bitbuf.ReadString(strBuf, sizeof(strBuf)); + sendTable.name.assign(strBuf); + + sendTable.numProps = bitbuf.ReadUBitLong(PROPINFOBITS_NUMPROPS); + + for (int i = 0; i < sendTable.numProps; i++) + { + DemMsg::Dem_DataTables::SendProp prop; + + prop.type = bitbuf.ReadUBitLong(PROPINFOBITS_TYPE); + + bitbuf.ReadString(strBuf, sizeof(strBuf)); + prop.name.assign(strBuf); + + prop.flags = bitbuf.ReadUBitLong(PROPINFOBITS_FLAGS); // demoprotocol 2: 11 + + if (prop.type == DPT_DataTable || prop.flags & SPROP_EXCLUDE) + { + bitbuf.ReadString(strBuf, sizeof(strBuf)); + prop.exclude.assign(strBuf); + } + else if (prop.type == DPT_Array) + { + prop.elements = bitbuf.ReadUBitLong(PROPINFOBITS_NUMELEMENTS); + } + else + { + prop.lowValue = bitbuf.ReadBitFloat(); + prop.highValue = bitbuf.ReadBitFloat(); + prop.bits = bitbuf.ReadUBitLong(PROPINFOBITS_NUMBITS); + } + + sendTable.props.push_back(prop); + } + + data->sendtables.push_back(sendTable); + } + + int numClasses = bitbuf.ReadShort(); + data->classes.reset(numClasses); + for (int i = 0; i < numClasses; i++) + { + int classID = bitbuf.ReadShort(); + DemMsg::Dem_DataTables::DataClass &dataClass = data->classes[classID]; + + bitbuf.ReadString(strBuf, sizeof(strBuf)); + dataClass.className.assign(strBuf); + + bitbuf.ReadString(strBuf, sizeof(strBuf)); + dataClass.datatableName.assign(strBuf); + } + return demofile.IsOk(); } - - bool Dem_DataTables_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_DataTables* data) - { - demofile.WriteRawData(data->data.begin(), data->data.length()); - return demofile.IsOk(); - } - - bool Dem_DataTables_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_DataTables* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - - data->data.reset(reader.ReadBytes("data", nullptr, 0)); - reader.ReadBytes("data", data->data.begin(), DemMsg::Dem_DataTables::DATA_MAX_LENGTH); - return !reader.HasReadError(); - } - - bool Dem_DataTables_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_DataTables* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteBytes("data", data->data.begin(), data->data.length()); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } } diff --git a/demboyz/demmessages/dem_datatables.h b/demboyz/demmessages/dem_datatables.h index e394496..c7636a6 100644 --- a/demboyz/demmessages/dem_datatables.h +++ b/demboyz/demmessages/dem_datatables.h @@ -3,13 +3,114 @@ #include "demhandlers.h" #include "base/array.h" +#include +#include + +#define PROPINFOBITS_NUMPROPS 10 +#define PROPINFOBITS_NUMPROPS 10 +#define PROPINFOBITS_TYPE 5 +#define PROPINFOBITS_FLAGS SPROP_NUMFLAGBITS_NETWORKED +#define PROPINFOBITS_STRINGBUFFERLEN 10 +#define PROPINFOBITS_NUMBITS 7 +#define PROPINFOBITS_RIGHTSHIFT 6 +#define PROPINFOBITS_NUMELEMENTS 10 // For arrays. + + +// SendProp::m_Flags. +#define SPROP_UNSIGNED (1<<0) // Unsigned integer data. + +#define SPROP_COORD (1<<1) // If this is set, the float/vector is treated like a world coordinate. + // Note that the bit count is ignored in this case. + +#define SPROP_NOSCALE (1<<2) // For floating point, don't scale into range, just take value as is. + +#define SPROP_ROUNDDOWN (1<<3) // For floating point, limit high value to range minus one bit unit + +#define SPROP_ROUNDUP (1<<4) // For floating point, limit low value to range minus one bit unit + +#define SPROP_NORMAL (1<<5) // If this is set, the vector is treated like a normal (only valid for vectors) + +#define SPROP_EXCLUDE (1<<6) // This is an exclude prop (not excludED, but it points at another prop to be excluded). + +#define SPROP_XYZE (1<<7) // Use XYZ/Exponent encoding for vectors. + +#define SPROP_INSIDEARRAY (1<<8) // This tells us that the property is inside an array, so it shouldn't be put into the + // flattened property list. Its array will point at it when it needs to. + +#define SPROP_PROXY_ALWAYS_YES (1<<9) // Set for datatable props using one of the default datatable proxies like + // SendProxy_DataTableToDataTable that always send the data to all clients. + +#define SPROP_CHANGES_OFTEN (1<<10) // this is an often changed field, moved to head of sendtable so it gets a small index + +#define SPROP_IS_A_VECTOR_ELEM (1<<11) // Set automatically if SPROP_VECTORELEM is used. + +#define SPROP_COLLAPSIBLE (1<<12) // Set automatically if it's a datatable with an offset of 0 that doesn't change the pointer + // (ie: for all automatically-chained base classes). + // In this case, it can get rid of this SendPropDataTable altogether and spare the + // trouble of walking the hierarchy more than necessary. + +#define SPROP_COORD_MP (1<<13) // Like SPROP_COORD, but special handling for multiplayer games +#define SPROP_COORD_MP_LOWPRECISION (1<<14) // Like SPROP_COORD, but special handling for multiplayer games where the fractional component only gets a 3 bits instead of 5 +#define SPROP_COORD_MP_INTEGRAL (1<<15) // SPROP_COORD_MP, but coordinates are rounded to integral boundaries + +#define SPROP_VARINT SPROP_NORMAL // reuse existing flag so we don't break demo. note you want to include SPROP_UNSIGNED if needed, its more efficient + +#define SPROP_NUMFLAGBITS_NETWORKED 16 + +// This is server side only, it's used to mark properties whose SendProxy_* functions encode against gpGlobals->tickcount (the only ones that currently do this are +// m_flAnimTime and m_flSimulationTime. MODs shouldn't need to mess with this probably +#define SPROP_ENCODED_AGAINST_TICKCOUNT (1<<16) + +// See SPROP_NUMFLAGBITS_NETWORKED for the ones which are networked +#define SPROP_NUMFLAGBITS 17 + + +enum +{ + DPT_Int=0, + DPT_Float, + DPT_Vector, + DPT_VectorXY, + DPT_String, + DPT_Array, + DPT_DataTable, + DPT_Int64, + DPT_NUMSendPropTypes +}; namespace DemMsg { struct Dem_DataTables { static const int DATA_MAX_LENGTH = 256 * 1024; - Array data; + + struct SendProp + { + std::string name; + std::string exclude; + int type; + int flags; + int elements; + int lowValue; + int highValue; + int bits; + }; + + struct SendTable + { + bool needsDecoder; + std::string name; + int numProps; + std::vector props; + }; + std::vector sendtables; + + struct DataClass + { + std::string className; + std::string datatableName; + }; + Array classes; }; } diff --git a/demboyz/demmessages/dem_packet.cpp b/demboyz/demmessages/dem_packet.cpp index e6b74d7..c8d876e 100644 --- a/demboyz/demmessages/dem_packet.cpp +++ b/demboyz/demmessages/dem_packet.cpp @@ -1,7 +1,6 @@ #include "dem_packet.h" #include "demofile/demofile.h" -#include "demofile/demojson.h" #include "netmessages/nethandlers.h" namespace DemHandlers @@ -12,31 +11,4 @@ namespace DemHandlers demofile.ReadSequenceInfo(data->sequenceNum1, data->sequenceNum2); return demofile.IsOk(); } - - bool Dem_Packet_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_Packet* data) - { - demofile.WriteCmdInfo(data->cmdInfo); - demofile.WriteSequenceInfo(data->sequenceNum1, data->sequenceNum2); - return demofile.IsOk(); - } - - bool Dem_Packet_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_Packet* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - - bool readError = DemoJsonReader::ReadCmdInfo(reader, data->cmdInfo); - readError |= DemoJsonReader::ReadSequenceInfo(reader, data->sequenceNum1, data->sequenceNum2); - return !readError && !reader.HasReadError(); - } - - bool Dem_Packet_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_Packet* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - DemoJsonWriter::WriteCmdInfo(jsonbuf, data->cmdInfo); - DemoJsonWriter::WriteSequenceInfo(jsonbuf, data->sequenceNum1, data->sequenceNum2); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } } diff --git a/demboyz/demmessages/dem_stop.cpp b/demboyz/demmessages/dem_stop.cpp index 2fa47b9..6032041 100644 --- a/demboyz/demmessages/dem_stop.cpp +++ b/demboyz/demmessages/dem_stop.cpp @@ -7,19 +7,4 @@ namespace DemHandlers { return true; } - - bool Dem_Stop_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_Stop* data) - { - return true; - } - - bool Dem_Stop_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_Stop* data) - { - return true; - } - - bool Dem_Stop_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_Stop* data) - { - return true; - } } diff --git a/demboyz/demmessages/dem_stringtables.cpp b/demboyz/demmessages/dem_stringtables.cpp index 602fccb..d412724 100644 --- a/demboyz/demmessages/dem_stringtables.cpp +++ b/demboyz/demmessages/dem_stringtables.cpp @@ -3,17 +3,13 @@ #include "demofile/demofile.h" #include "netmessages/netcontants.h" #include "sourcesdk/bitbuf.h" -#include "base/jsonfile.h" -#include static void StringTableEntry_BitRead(bf_read& bitbuf, DemMsg::Dem_StringTables::StringTableEntry* data) { using StringTableEntry = DemMsg::Dem_StringTables::StringTableEntry; - { - char entryName[StringTableEntry::ENTRYNAME_MAX_LENGTH]; - bitbuf.ReadString(entryName, sizeof(entryName)); - data->entryName.assign(entryName); - } + + char entryName[StringTableEntry::ENTRYNAME_MAX_LENGTH]; + bitbuf.ReadString(entryName, sizeof(entryName)); if (bitbuf.ReadOneBit() != 0) { @@ -27,46 +23,14 @@ static void StringTableEntry_BitRead(bf_read& bitbuf, DemMsg::Dem_StringTables:: } } -static void StringTableEntry_BitWrite(bf_write& bitbuf, DemMsg::Dem_StringTables::StringTableEntry* data) -{ - bitbuf.WriteString(data->entryName.c_str()); - const int32_t numDataBytes = data->data.length(); - - bitbuf.WriteOneBit(numDataBytes > 0); - if (numDataBytes > 0) - { - bitbuf.WriteWord(numDataBytes); - bitbuf.WriteBytes(data->data.begin(), numDataBytes); - } -} - -static void StringTableEntry_JsonRead(base::JsonReaderObject& jsonbuf, DemMsg::Dem_StringTables::StringTableEntry* data) -{ - using StringTableEntry = DemMsg::Dem_StringTables::StringTableEntry; - { - char entryName[StringTableEntry::ENTRYNAME_MAX_LENGTH]; - jsonbuf.ReadString("name", entryName, sizeof(entryName)); - data->entryName.assign(entryName); - } - data->data.reset(jsonbuf.ReadBytes("data", nullptr, 0)); - jsonbuf.ReadBytes("data", data->data.begin(), data->data.length()); -} - -static void StringTableEntry_JsonWrite(DemHandlers::JsonWrite& jsonbuf, const DemMsg::Dem_StringTables::StringTableEntry* data) -{ - jsonbuf.WriteString("name", data->entryName); - jsonbuf.WriteBytes("data", data->data.begin(), data->data.length()); -} - static void StringTable_BitRead(bf_read& bitbuf, DemMsg::Dem_StringTables::StringTable* data) { using StringTable = DemMsg::Dem_StringTables::StringTable; using StringTableEntry = DemMsg::Dem_StringTables::StringTableEntry; - { - char tableName[StringTable::TABLENAME_MAX_LENGTH]; - bitbuf.ReadString(tableName, sizeof(tableName)); - data->tableName.assign(tableName); - } + + char tableName[StringTable::TABLENAME_MAX_LENGTH]; + bitbuf.ReadString(tableName, sizeof(tableName)); + data->tableName.assign(tableName); data->entries.reset(bitbuf.ReadWord()); for (StringTableEntry& entry : data->entries) @@ -87,78 +51,6 @@ static void StringTable_BitRead(bf_read& bitbuf, DemMsg::Dem_StringTables::Strin } } -static void StringTable_BitWrite(bf_write& bitbuf, DemMsg::Dem_StringTables::StringTable* data) -{ - using StringTableEntry = DemMsg::Dem_StringTables::StringTableEntry; - bitbuf.WriteString(data->tableName.c_str()); - - bitbuf.WriteWord(data->entries.length()); - for (StringTableEntry& entry : data->entries) - { - StringTableEntry_BitWrite(bitbuf, &entry); - } - - const int32_t numEntriesClientSide = data->entriesClientSide.length(); - bitbuf.WriteOneBit(numEntriesClientSide > 0); - if (numEntriesClientSide > 0) - { - bitbuf.WriteWord(numEntriesClientSide); - for (StringTableEntry& entry : data->entriesClientSide) - { - StringTableEntry_BitWrite(bitbuf, &entry); - } - } -} - -static void StringTable_JsonRead(base::JsonReaderObject& jsonbuf, DemMsg::Dem_StringTables::StringTable* data) -{ - using StringTable = DemMsg::Dem_StringTables::StringTable; - using StringTableEntry = DemMsg::Dem_StringTables::StringTableEntry; - { - char tableName[StringTable::TABLENAME_MAX_LENGTH]; - jsonbuf.ReadString("tableName", tableName, sizeof(tableName)); - data->tableName.assign(tableName); - } - - { - base::JsonReaderArray entries = jsonbuf.ReadArray("entries"); - entries.TransformTo(data->entries, [](base::JsonReaderObject& obj, StringTableEntry& entry) - { - StringTableEntry_JsonRead(obj, &entry); - }); - } - { - base::JsonReaderArray entriesClientSide = jsonbuf.ReadArray("entriesClientSide"); - entriesClientSide.TransformTo(data->entriesClientSide, [](base::JsonReaderObject& obj, StringTableEntry& entry) - { - StringTableEntry_JsonRead(obj, &entry); - }); - } -} - -static void StringTable_JsonWrite(DemHandlers::JsonWrite& jsonbuf, const DemMsg::Dem_StringTables::StringTable* data) -{ - using StringTableEntry = DemMsg::Dem_StringTables::StringTableEntry; - jsonbuf.WriteString("tableName", data->tableName); - jsonbuf.StartArray("entries"); - for (const StringTableEntry& entry : data->entries) - { - jsonbuf.StartObject(); - StringTableEntry_JsonWrite(jsonbuf, &entry); - jsonbuf.EndObject(); - } - jsonbuf.EndArray(); - - jsonbuf.StartArray("entriesClientSide"); - for (const StringTableEntry& entry : data->entriesClientSide) - { - jsonbuf.StartObject(); - StringTableEntry_JsonWrite(jsonbuf, &entry); - jsonbuf.EndObject(); - } - jsonbuf.EndArray(); -} - namespace DemHandlers { bool Dem_StringTables_FileRead_Internal(FileRead& demofile, DemMsg::Dem_StringTables* data) @@ -184,66 +76,4 @@ namespace DemHandlers } return !bitbuf.IsOverflowed(); } - - bool Dem_StringTables_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_StringTables* data) - { - using StringTable = DemMsg::Dem_StringTables::StringTable; - - std::unique_ptr buffer(new uint8_t[MAX_STRINGTABLE_DATA]); - bf_write bitbuf(buffer.get(), MAX_STRINGTABLE_DATA); - - bitbuf.WriteByte(data->stringtables.length()); - for (StringTable& table : data->stringtables) - { - StringTable_BitWrite(bitbuf, &table); - } - if (data->numTrailingBits > 0) - { - bitbuf.WriteUBitLong(data->trailingBitsValue, data->numTrailingBits); - } - demofile.WriteRawData(bitbuf.GetBasePointer(), bitbuf.GetNumBytesWritten()); - return !bitbuf.IsOverflowed(); - } - - bool Dem_StringTables_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_StringTables* data) - { - using StringTable = DemMsg::Dem_StringTables::StringTable; - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - - data->stringtables.reset(reader.ReadInt32("numStringTables")); - data->numTrailingBits = reader.ReadUInt32("numTrailingBits"); - data->trailingBitsValue = reader.ReadUInt32("trailingBitsValue"); - } - { - for (StringTable& table : data->stringtables) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - StringTable_JsonRead(reader, &table); - } - } - return true; - } - - bool Dem_StringTables_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_StringTables* data) - { - using StringTable = DemMsg::Dem_StringTables::StringTable; - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteInt32("numStringTables", data->stringtables.length()); - jsonbuf.WriteUInt32("numTrailingBits", data->numTrailingBits); - jsonbuf.WriteUInt32("trailingBitsValue", data->trailingBitsValue, (data->numTrailingBits > 0)); - jsonbuf.EndObject(); - - for (const StringTable& table : data->stringtables) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - StringTable_JsonWrite(jsonbuf, &table); - jsonbuf.EndObject(); - } - return jsonbuf.IsComplete(); - } } diff --git a/demboyz/demmessages/dem_synctick.cpp b/demboyz/demmessages/dem_synctick.cpp index 326130f..29877e0 100644 --- a/demboyz/demmessages/dem_synctick.cpp +++ b/demboyz/demmessages/dem_synctick.cpp @@ -7,19 +7,4 @@ namespace DemHandlers { return true; } - - bool Dem_SyncTick_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_SyncTick* data) - { - return true; - } - - bool Dem_SyncTick_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_SyncTick* data) - { - return true; - } - - bool Dem_SyncTick_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_SyncTick* data) - { - return true; - } } diff --git a/demboyz/demmessages/dem_unknown.cpp b/demboyz/demmessages/dem_unknown.cpp index 325b896..3e869fe 100644 --- a/demboyz/demmessages/dem_unknown.cpp +++ b/demboyz/demmessages/dem_unknown.cpp @@ -7,19 +7,4 @@ namespace DemHandlers { return true; } - - bool Dem_Unknown_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_Unknown* data) - { - return true; - } - - bool Dem_Unknown_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_Unknown* data) - { - return true; - } - - bool Dem_Unknown_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_Unknown* data) - { - return true; - } } diff --git a/demboyz/demmessages/dem_usercmd.cpp b/demboyz/demmessages/dem_usercmd.cpp index 28083e1..099c03a 100644 --- a/demboyz/demmessages/dem_usercmd.cpp +++ b/demboyz/demmessages/dem_usercmd.cpp @@ -1,7 +1,6 @@ #include "dem_usercmd.h" #include "demofile/demofile.h" -#include "demofile/demojson.h" namespace DemHandlers { @@ -10,30 +9,4 @@ namespace DemHandlers data->commandData = demofile.ReadUserCmd(data->commandNum, DemMsg::Dem_UserCmd::COMMANDDATA_MAX_LENGTH); return demofile.IsOk(); } - - bool Dem_UserCmd_FileWrite_Internal(FileWrite& demofile, DemMsg::Dem_UserCmd* data) - { - demofile.WriteUserCmd(data->commandNum, data->commandData.begin(), data->commandData.length()); - return demofile.IsOk(); - } - - bool Dem_UserCmd_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::Dem_UserCmd* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - - DemoJsonReader::ReadUserCmd(reader, data->commandNum, - data->commandData, DemMsg::Dem_UserCmd::COMMANDDATA_MAX_LENGTH); - return !reader.HasReadError(); - } - - bool Dem_UserCmd_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::Dem_UserCmd* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - DemoJsonWriter::WriteUserCmd(jsonbuf, data->commandNum, - data->commandData.begin(), data->commandData.length()); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } } diff --git a/demboyz/demmessages/demhandlers.cpp b/demboyz/demmessages/demhandlers.cpp index 79d622e..561a46c 100644 --- a/demboyz/demmessages/demhandlers.cpp +++ b/demboyz/demmessages/demhandlers.cpp @@ -51,9 +51,6 @@ void DemHandlers::DestroyDemMsgStructs(DemDataStructArray& demDataStructs) } typedef bool (*DemMsgFileReadFn)(DemHandlers::FileRead& demofile, void* data); -typedef bool (*DemMsgFileWriteFn)(DemHandlers::FileWrite& demofile, void* data); -typedef bool (*DemMsgJsonReadFn)(DemHandlers::JsonRead& jsonbuf, void* data); -typedef bool (*DemMsgJsonWriteFn)(DemHandlers::JsonWrite& jsonbuf, void* data); bool DemHandlers::DemMsg_FileRead(uint32_t type, FileRead& demofile, void* data) { @@ -64,33 +61,3 @@ bool DemHandlers::DemMsg_FileRead(uint32_t type, FileRead& demofile, void* data) } return demHandlers[type](demofile, data); } - -bool DemHandlers::DemMsg_FileWrite(uint32_t type, FileWrite& demofile, void* data) -{ - static const DemMsgFileWriteFn demHandlers[] = DECLARE_DEM_HANDLER_ARRAY(FileWrite); - if (type >= (sizeof(demHandlers) / sizeof(DemMsgFileWriteFn))) - { - return false; - } - return demHandlers[type](demofile, data); -} - -bool DemHandlers::DemMsg_JsonRead(uint32_t type, JsonRead& jsonbuf, void* data) -{ - static const DemMsgJsonReadFn demHandlers[] = DECLARE_DEM_HANDLER_ARRAY(JsonRead); - if (type >= (sizeof(demHandlers) / sizeof(DemMsgJsonReadFn))) - { - return false; - } - return demHandlers[type](jsonbuf, data); -} - -bool DemHandlers::DemMsg_JsonWrite(uint32_t type, JsonWrite& jsonbuf, void* data) -{ - static const DemMsgJsonWriteFn demHandlers[] = DECLARE_DEM_HANDLER_ARRAY(JsonWrite); - if (type >= (sizeof(demHandlers) / sizeof(DemMsgJsonWriteFn))) - { - return false; - } - return demHandlers[type](jsonbuf, data); -} diff --git a/demboyz/demmessages/demhandlers.h b/demboyz/demmessages/demhandlers.h index a6fd5b1..c6a0841 100644 --- a/demboyz/demmessages/demhandlers.h +++ b/demboyz/demmessages/demhandlers.h @@ -5,48 +5,20 @@ #include #include "demmessages.h" -namespace base -{ - class JsonReaderFile; - class JsonWriterFile; -} - class DemoFileReader; -class DemoFileWriter; -class DemoFileReader2; -class DemoFileWriter2; - namespace DemHandlers { using FileRead = DemoFileReader; - using FileWrite = DemoFileWriter; - using JsonRead = base::JsonReaderFile; - using JsonWrite = base::JsonWriterFile; } #define DECLARE_DEM_HANDLERS(msgname) \ namespace DemHandlers \ { \ bool msgname##_FileRead_Internal(FileRead& demofile, DemMsg::msgname* data); \ - bool msgname##_FileWrite_Internal(FileWrite& demofile, DemMsg::msgname* data); \ - bool msgname##_JsonRead_Internal(JsonRead& jsonbuf, DemMsg::msgname* data); \ - bool msgname##_JsonWrite_Internal(JsonWrite& jsonbuf, DemMsg::msgname* data); \ inline bool msgname##_FileRead(FileRead& demofile, void* data) \ { \ return msgname##_FileRead_Internal(demofile, reinterpret_cast(data)); \ } \ - inline bool msgname##_FileWrite(FileWrite& demofile, void* data) \ - { \ - return msgname##_FileWrite_Internal(demofile, reinterpret_cast(data)); \ - } \ - inline bool msgname##_JsonRead(JsonRead& jsonbuf, void* data) \ - { \ - return msgname##_JsonRead_Internal(jsonbuf, reinterpret_cast(data)); \ - } \ - inline bool msgname##_JsonWrite(JsonWrite& jsonbuf, void* data) \ - { \ - return msgname##_JsonWrite_Internal(jsonbuf, reinterpret_cast(data)); \ - } \ } namespace DemHandlers @@ -56,7 +28,4 @@ namespace DemHandlers void DestroyDemMsgStructs(DemDataStructArray& demDataStructs); bool DemMsg_FileRead(uint32_t type, FileRead& demofile, void* data); - bool DemMsg_FileWrite(uint32_t type, FileWrite& demofile, void* data); - bool DemMsg_JsonRead(uint32_t type, JsonRead& jsonbuf, void* data); - bool DemMsg_JsonWrite(uint32_t type, JsonWrite& jsonbuf, void* data); } diff --git a/demboyz/demofile/demofile.cpp b/demboyz/demofile/demofile.cpp index ce60ae2..4a0b76e 100644 --- a/demboyz/demofile/demofile.cpp +++ b/demboyz/demofile/demofile.cpp @@ -6,6 +6,14 @@ // DemoFileReader +size_t myfread ( void * ptr, size_t size, size_t count, FILE * stream ) +{ + size_t ret = fread(ptr, size, count, stream); + if (ret != count) + throw("fread error"); + return ret; +} + DemoFileReader::DemoFileReader(FILE* fp): m_demoFp(fp) { @@ -18,7 +26,7 @@ bool DemoFileReader::IsOk() const void DemoFileReader::ReadDemoHeader(demoheader_t& header) { - fread(&header, sizeof(demoheader_t), 1, m_demoFp); + myfread(&header, sizeof(demoheader_t), 1, m_demoFp); } int32_t DemoFileReader::ReadRawData(uint8_t* buffer, int32_t maxLength) @@ -26,7 +34,7 @@ int32_t DemoFileReader::ReadRawData(uint8_t* buffer, int32_t maxLength) FILE* fp = m_demoFp; int32_t size; - fread(&size, sizeof(int32_t), 1, fp); + myfread(&size, sizeof(int32_t), 1, fp); if (buffer && (maxLength < size)) { @@ -35,7 +43,7 @@ int32_t DemoFileReader::ReadRawData(uint8_t* buffer, int32_t maxLength) if (buffer) { - fread(buffer, 1, size, fp); + myfread(buffer, 1, size, fp); } else { @@ -49,104 +57,51 @@ Array DemoFileReader::ReadRawData(int32_t maxLength) FILE* fp = m_demoFp; int32_t size; - fread(&size, sizeof(int32_t), 1, fp); + myfread(&size, sizeof(int32_t), 1, fp); Array data; if (maxLength < size) { - return std::move(data); + return data; } data.reset(size); - fread(data.begin(), 1, size, fp); - return std::move(data); + myfread(data.begin(), 1, size, fp); + return data; } void DemoFileReader::ReadSequenceInfo(int32_t& seqNum1, int32_t& seqNum2) { FILE* fp = m_demoFp; - fread(&seqNum1, sizeof(int32_t), 1, fp); - fread(&seqNum2, sizeof(int32_t), 1, fp); + myfread(&seqNum1, sizeof(int32_t), 1, fp); + myfread(&seqNum2, sizeof(int32_t), 1, fp); } void DemoFileReader::ReadCmdInfo(democmdinfo_t& info) { - fread(&info, sizeof(democmdinfo_t), 1, m_demoFp); + myfread(&info, sizeof(democmdinfo_t), 1, m_demoFp); } void DemoFileReader::ReadCmdHeader(unsigned char& cmd, int32_t& tick) { FILE* fp = m_demoFp; - fread(&cmd, 1, sizeof(unsigned char), fp); - fread(&tick, 1, sizeof(int32_t), fp); + myfread(&cmd, 1, sizeof(unsigned char), fp); if (cmd > dem_lastcmd) { cmd = dem_stop; } + if (cmd != dem_stop) + myfread(&tick, 1, sizeof(int32_t), fp); } int32_t DemoFileReader::ReadUserCmd(int32_t& cmdNum, uint8_t* buffer, int32_t maxLength) { - fread(&cmdNum, sizeof(int32_t), 1, m_demoFp); + myfread(&cmdNum, sizeof(int32_t), 1, m_demoFp); return ReadRawData(buffer, maxLength); } Array DemoFileReader::ReadUserCmd(int32_t& cmdNum, int32_t maxLength) { - fread(&cmdNum, sizeof(int32_t), 1, m_demoFp); + myfread(&cmdNum, sizeof(int32_t), 1, m_demoFp); return ReadRawData(maxLength); } - -// DemoFileWriter - -DemoFileWriter::DemoFileWriter(FILE* fp) : - m_demoFp(fp) -{ -} - -FILE* DemoFileWriter::GetFp() const -{ - return m_demoFp; -} - -bool DemoFileWriter::IsOk() const -{ - return ferror(m_demoFp) == 0; -} - -void DemoFileWriter::WriteDemoHeader(const demoheader_t& header) -{ - fwrite(&header, sizeof(demoheader_t), 1, m_demoFp); -} - -void DemoFileWriter::WriteRawData(const uint8_t* buffer, int32_t length) -{ - FILE* fp = m_demoFp; - fwrite(&length, sizeof(int32_t), 1, fp); - fwrite(buffer, length, 1, fp); -} - -void DemoFileWriter::WriteSequenceInfo(int32_t seqNum1, int32_t seqNum2) -{ - FILE* fp = m_demoFp; - fwrite(&seqNum1, sizeof(int32_t), 1, fp); - fwrite(&seqNum2, sizeof(int32_t), 1, fp); -} - -void DemoFileWriter::WriteCmdInfo(const democmdinfo_t& info) -{ - fwrite(&info, sizeof(democmdinfo_t), 1, m_demoFp); -} - -void DemoFileWriter::WriteCmdHeader(unsigned char cmd, int32_t tick) -{ - FILE* fp = m_demoFp; - fwrite(&cmd, sizeof(unsigned char), 1, fp); - fwrite(&tick, sizeof(int32_t), 1, fp); -} - -void DemoFileWriter::WriteUserCmd(int32_t cmdNum, const uint8_t* buffer, int32_t length) -{ - fwrite(&cmdNum, sizeof(int32_t), 1, m_demoFp); - WriteRawData(buffer, length); -} diff --git a/demboyz/demofile/demofile.h b/demboyz/demofile/demofile.h index daeb602..a2e7c06 100644 --- a/demboyz/demofile/demofile.h +++ b/demboyz/demofile/demofile.h @@ -26,21 +26,3 @@ public: private: FILE* m_demoFp; }; - -class DemoFileWriter -{ -public: - DemoFileWriter(FILE* fp); - - FILE* GetFp() const; - bool IsOk() const; - void WriteDemoHeader(const demoheader_t& header); - void WriteRawData(const uint8_t* buffer, int32_t length); - void WriteSequenceInfo(int32_t seqNum1, int32_t seqNum2); - void WriteCmdInfo(const democmdinfo_t& info); - void WriteCmdHeader(unsigned char cmd, int32_t tick); - void WriteUserCmd(int32_t cmdNum, const uint8_t* buffer, int32_t length); - -private: - FILE* m_demoFp; -}; diff --git a/demboyz/demofile/demojson.cpp b/demboyz/demofile/demojson.cpp deleted file mode 100644 index 731030b..0000000 --- a/demboyz/demofile/demojson.cpp +++ /dev/null @@ -1,161 +0,0 @@ - -#include "demojson.h" -#include "demofile/demotypes.h" -#include - -bool DemoJsonReader::ReadDemoHeader(base::JsonReaderObject& reader, demoheader_t& header) -{ - base::JsonReaderObject object = reader.ReadObject("demoheader"); - object.ReadString("demofilestamp", header.demofilestamp, sizeof(header.demofilestamp)); - header.demoprotocol = object.ReadInt32("demoprotocol"); - header.networkprotocol = object.ReadInt32("networkprotocol"); - object.ReadString("servername", header.servername, sizeof(header.servername)); - object.ReadString("clientname", header.clientname, sizeof(header.clientname)); - object.ReadString("mapname", header.mapname, sizeof(header.mapname)); - object.ReadString("gamedirectory", header.gamedirectory, sizeof(header.gamedirectory)); - header.playback_time = object.ReadFloat("playback_time"); - header.playback_ticks = object.ReadInt32("playback_ticks"); - header.playback_frames = object.ReadInt32("playback_frames"); - header.signonlength = object.ReadInt32("signonlength"); - return !reader.HasReadError() && !object.HasReadError(); -} - -bool DemoJsonReader::ReadSequenceInfo(base::JsonReaderObject& reader, - int32_t& seqNum1, int32_t& seqNum2) -{ - seqNum1 = reader.ReadInt32("sequenceNum1"); - seqNum2 = reader.ReadInt32("sequenceNum2"); - return !reader.HasReadError(); -} - -bool DemoJsonReader::ReadCmdInfo(base::JsonReaderObject& reader, democmdinfo_t& info) -{ - democmdinfo_t::Split_t& split = info.u[0]; - base::JsonReaderObject object = reader.ReadObject("democmdinfo"); - split.flags = object.ReadInt32("flags"); - bool readError = ReadVector(object, "viewOrigin", split.viewOrigin); - readError |= ReadAngle(object, "viewAngles", split.viewAngles); - readError |= ReadAngle(object, "localViewAngles", split.localViewAngles); - readError |= ReadVector(object, "viewOrigin2", split.viewOrigin2); - readError |= ReadAngle(object, "viewAngles2", split.viewAngles2); - readError |= ReadAngle(object, "localViewAngles2", split.localViewAngles2); - return !readError && !reader.HasReadError() && !object.HasReadError(); -} - -bool DemoJsonReader::ReadCmdHeader(base::JsonReaderObject& reader, unsigned char& cmd, int32_t& tick) -{ - cmd = reader.ReadUInt32("cmd"); - tick = reader.ReadInt32("tick"); - return !reader.HasReadError(); -} - -bool DemoJsonReader::ReadUserCmd(base::JsonReaderObject& reader, int32_t& cmdNum, - uint8_t* buffer, int32_t length, int32_t& bytesRead) -{ - base::JsonReaderObject object = reader.ReadObject("usercmd"); - cmdNum = object.ReadInt32("cmd"); - bytesRead = object.ReadBytes("data", buffer, length); - return !object.HasReadError(); -} - -bool DemoJsonReader::ReadUserCmd(base::JsonReaderObject& reader, int32_t cmdNum, - Array& dest, int32_t maxLength) -{ - base::JsonReaderObject object = reader.ReadObject("usercmd"); - cmdNum = object.ReadInt32("cmd"); - - const int32_t numBytes = object.ReadBytes("data", nullptr, 0); - dest.reset(std::min(maxLength, numBytes)); - object.ReadBytes("data", dest.begin(), dest.length()); - return !object.HasReadError(); -} - -bool DemoJsonReader::ReadVector(base::JsonReaderObject& reader, const char* name, Vector& vec) -{ - base::JsonReaderObject object = reader.ReadObject(name); - vec.x = object.ReadFloat("x"); - vec.y = object.ReadFloat("y"); - vec.z = object.ReadFloat("z"); - return !reader.HasReadError() && !object.HasReadError(); -} - -bool DemoJsonReader::ReadAngle(base::JsonReaderObject& reader, const char* name, QAngle& angles) -{ - base::JsonReaderObject object = reader.ReadObject(name); - angles.x = object.ReadFloat("pitch"); - angles.y = object.ReadFloat("yaw"); - angles.z = object.ReadFloat("roll"); - return !reader.HasReadError() && !object.HasReadError(); -} - -void DemoJsonWriter::WriteDemoHeader(base::JsonWriterFile& writer, const demoheader_t& header) -{ - writer.StartObject("demoheader"); - writer.WriteString("demofilestamp", header.demofilestamp); - writer.WriteInt32("demoprotocol", header.demoprotocol); - writer.WriteInt32("networkprotocol", header.networkprotocol); - writer.WriteString("servername", header.servername); - writer.WriteString("clientname", header.clientname); - writer.WriteString("mapname", header.mapname); - writer.WriteString("gamedirectory", header.gamedirectory); - writer.WriteFloat("playback_time", header.playback_time); - writer.WriteInt32("playback_ticks", header.playback_ticks); - writer.WriteInt32("playback_frames", header.playback_frames); - writer.WriteInt32("signonlength", header.signonlength); - writer.EndObject(); -} - -void DemoJsonWriter::WriteSequenceInfo(base::JsonWriterFile& writer, - int32_t seqNum1, int32_t seqNum2) -{ - writer.WriteInt32("sequenceNum1", seqNum1); - writer.WriteInt32("sequenceNum2", seqNum2); -} - -void DemoJsonWriter::WriteCmdInfo(base::JsonWriterFile& writer, - const democmdinfo_t& info) -{ - const democmdinfo_t::Split_t& split = info.u[0]; - writer.StartObject("democmdinfo"); - writer.WriteInt32("flags", split.flags); - WriteVector(writer, "viewOrigin", split.viewOrigin); - WriteAngle(writer, "viewAngles", split.viewAngles); - WriteAngle(writer, "localViewAngles", split.localViewAngles); - WriteVector(writer, "viewOrigin2", split.viewOrigin2); - WriteAngle(writer, "viewAngles2", split.viewAngles2); - WriteAngle(writer, "localViewAngles2", split.localViewAngles2); - writer.EndObject(); -} - -void DemoJsonWriter::WriteCmdHeader(base::JsonWriterFile& writer, unsigned char cmd, int32_t tick) -{ - writer.WriteUInt32("cmd", cmd); - writer.WriteInt32("tick", tick); -} - -void DemoJsonWriter::WriteUserCmd(base::JsonWriterFile& writer, - int32_t cmdNum, const uint8_t* buffer, int32_t length) -{ - writer.StartObject("usercmd"); - writer.WriteInt32("cmd", cmdNum); - writer.WriteBytes("data", buffer, length); - writer.EndObject(); -} - -void DemoJsonWriter::WriteVector(base::JsonWriterFile& writer, const char* name, const Vector& vec) -{ - writer.StartObject(name); - writer.WriteFloat("x", vec.x); - writer.WriteFloat("y", vec.y); - writer.WriteFloat("z", vec.z); - writer.EndObject(); -} - -void DemoJsonWriter::WriteAngle(base::JsonWriterFile& writer, const char* name, const QAngle& angles) -{ - writer.StartObject(name); - writer.WriteFloat("pitch", angles.x); - writer.WriteFloat("yaw", angles.y); - writer.WriteFloat("roll", angles.z); - writer.EndObject(); -} diff --git a/demboyz/demofile/demojson.h b/demboyz/demofile/demojson.h deleted file mode 100644 index fe86218..0000000 --- a/demboyz/demofile/demojson.h +++ /dev/null @@ -1,36 +0,0 @@ - -#pragma once - -#include "base/array.h" -#include "base/jsonfile.h" -#include -#include - -struct demoheader_t; -struct democmdinfo_t; -class Vector; -class QAngle; - -namespace DemoJsonReader -{ - bool ReadDemoHeader(base::JsonReaderObject& reader, demoheader_t& header); - bool ReadSequenceInfo(base::JsonReaderObject& reader, int32_t& seqNum1, int32_t& seqNum2); - bool ReadCmdInfo(base::JsonReaderObject& reader, democmdinfo_t& info); - bool ReadCmdHeader(base::JsonReaderObject& reader, unsigned char& cmd, int32_t& tick); - bool ReadUserCmd(base::JsonReaderObject& reader, int32_t& cmdNum, - uint8_t* buffer, int32_t length, int32_t& bytesRead); - bool ReadUserCmd(base::JsonReaderObject& reader, int32_t cmdNum, Array& dest, int32_t maxLength); - bool ReadVector(base::JsonReaderObject& reader, const char* name, Vector& vec); - bool ReadAngle(base::JsonReaderObject& reader, const char* name, QAngle& angle); -} - -namespace DemoJsonWriter -{ - void WriteDemoHeader(base::JsonWriterFile& writer, const demoheader_t& header); - void WriteSequenceInfo(base::JsonWriterFile& writer, int32_t seqNum1, int32_t seqNum2); - void WriteCmdInfo(base::JsonWriterFile& writer, const democmdinfo_t& info); - void WriteCmdHeader(base::JsonWriterFile& writer, unsigned char cmd, int32_t tick); - void WriteUserCmd(base::JsonWriterFile& writer, int32_t cmdNum, const uint8_t* buffer, int32_t length); - void WriteVector(base::JsonWriterFile& writer, const char* name, const Vector& vec); - void WriteAngle(base::JsonWriterFile& writer, const char* name, const QAngle& angle); -} diff --git a/demboyz/game/gameevents.cpp b/demboyz/game/gameevents.cpp index 85e884d..3fca682 100644 --- a/demboyz/game/gameevents.cpp +++ b/demboyz/game/gameevents.cpp @@ -2,12 +2,12 @@ #include "gameevents.h" #include "base/bitfile.h" #include +#include namespace GameEvents { - EventDataMap ParseEventData(bf_read& bitbuf, const EventDescriptor& desc, std::vector& stringMem) + EventDataMap ParseEventData(bf_read& bitbuf, const EventDescriptor& desc) { - stringMem.reserve(stringMem.size() + MAX_EVENT_BYTES); EventDataMap data; char tempStr[MAX_EVENT_BYTES]; for (const EventValue& value : desc.values) @@ -18,13 +18,9 @@ namespace GameEvents { case EventValueType::String: { - int length = 0; - const bool ok = bitbuf.ReadString(tempStr, sizeof(tempStr), false, &length); + const bool ok = bitbuf.ReadString(tempStr, sizeof(tempStr), false); assert(ok); - length += 1; // for null terminator - - eventData.strOffset = stringMem.size(); - stringMem.insert(stringMem.end(), tempStr, tempStr + length + 1); + eventData.strValue.assign(tempStr); break; } case EventValueType::Float: @@ -61,51 +57,41 @@ namespace GameEvents return data; } - void PrintEventData(bf_read& bitbuf, const EventDescriptor& desc) + void PrintEvent(const char* name, EventDataMap& data) { - char tempStr[MAX_EVENT_BYTES]; - printf("%s:\n", desc.name); - for (const EventValue& value : desc.values) + std::cout << "[EVENT] " << name << "\n"; + for (const auto& d : data) { - printf(" %s: ", value.name); - switch(value.type) + std::cout << "\t" << d.first << ": "; + switch(d.second.type) { - case EventValueType::String: + case GameEvents::EventValueType::String: { - const bool ok = bitbuf.ReadString(tempStr, sizeof(tempStr), false, nullptr); - assert(ok); - printf("%s\n", tempStr); - break; - } - case EventValueType::Float: + std::cout << d.second.strValue << "\n"; + } break; + case GameEvents::EventValueType::Float: { - printf("%f\n", bitbuf.ReadFloat()); - break; - } - case EventValueType::Long: + std::cout << d.second.flValue << "\n"; + } break; + case GameEvents::EventValueType::Long: { - printf("%i\n", bitbuf.ReadSBitLong(32)); - break; - } - case EventValueType::Short: + std::cout << d.second.i32Value << "\n"; + } break; + case GameEvents::EventValueType::Short: { - printf("%i\n", bitbuf.ReadSBitLong(16)); - break; - } - case EventValueType::Byte: + std::cout << d.second.i16Value << "\n"; + } break; + case GameEvents::EventValueType::Byte: { - printf("%u\n", bitbuf.ReadUBitLong(8)); - break; - } - case EventValueType::Bool: + std::cout << d.second.u8Value << "\n"; + } break; + case GameEvents::EventValueType::Bool: { - printf("%s\n", (bitbuf.ReadOneBit() != 0) ? "true" : "false"); - break; - } - case EventValueType::Local: + std::cout << d.second.bValue << "\n"; + } break; default: - assert(false); - break; + { + } break; } } } diff --git a/demboyz/game/gameevents.h b/demboyz/game/gameevents.h index 4df4695..06e7d16 100644 --- a/demboyz/game/gameevents.h +++ b/demboyz/game/gameevents.h @@ -8,8 +8,6 @@ #include #include -//#define WIP_GAMEEVENTS - class bf_read; namespace GameEvents @@ -43,16 +41,16 @@ namespace GameEvents EventValueType type; union { - ptrdiff_t strOffset; float flValue; int32_t i32Value; int16_t i16Value; uint8_t u8Value; bool bValue; }; + std::string strValue; }; using EventDataMap = std::map; - EventDataMap ParseEventData(bf_read& bitbuf, const EventDescriptor& desc, std::vector& stringMem); - void PrintEventData(bf_read& bitbuf, const EventDescriptor& desc); + EventDataMap ParseEventData(bf_read& bitbuf, const EventDescriptor& desc); + void PrintEvent(const char* name, EventDataMap& data); } diff --git a/demboyz/game/logic.cpp b/demboyz/game/logic.cpp new file mode 100644 index 0000000..be2a1fe --- /dev/null +++ b/demboyz/game/logic.cpp @@ -0,0 +1,196 @@ + +#include "logic.h" +#include "netmessages/svc_serverinfo.h" +#include +#include + + +Logic::Logic(SourceGameContext* context): + context(context) +{ + //memset(clients, 0, sizeof(clients)); + data = json({ + {"header", {}}, + {"serverinfo", {}}, + {"players", {}}, + {"chat", {}} + }); +} + +Logic::~Logic() +{ +} + +void Logic::Start() +{ + data["demoheader"] = json({ + {"demofilestamp", context->header.demofilestamp}, + {"demoprotocol", context->header.demoprotocol}, + {"networkprotocol", context->header.networkprotocol}, + {"servername", context->header.servername}, + {"clientname", context->header.clientname}, + {"mapname", context->header.mapname}, + {"gamedirectory", context->header.gamedirectory}, + {"playback_time", context->header.playback_time}, + {"playback_ticks", context->header.playback_ticks}, + {"playback_frames", context->header.playback_frames}, + {"signonlength", context->header.signonlength} + }); + + // std::cout << data.dump(2, ' ', false, json::error_handler_t::replace) << "\n"; +} + +void Logic::Finish(bool dirty) +{ + // disconnect all remaining clients + for (int client = 0; client < MAX_PLAYERS; client++) + { + if (clients[client].connected == -1) + continue; + + OnClientDisconnected(client, "#demoend"); + } + + // fix header if demo is corrupt + data["demoheader"]["dirty"] = dirty; + if (dirty) + { + data["demoheader"]["playback_ticks"] = curTick; + data["demoheader"]["playback_time"] = curTick * context->fTickRate; + data["demoheader"]["playback_frames"] = context->curFrame; + } + + std::string out = data.dump(2, ' ', false, json::error_handler_t::replace); + out.append("\n"); + fwrite(out.c_str(), out.size(), 1, context->outputFp); +} + +void Logic::OnServerInfo(NetMsg::SVC_ServerInfo* serverInfo) +{ + char mapMD5[32+1]; + for (int i = 0; i < 16; ++i) + { + mapMD5[(i * 2)] = "0123456789ABCDEF"[serverInfo->mapMD5[i] / 16]; + mapMD5[(i * 2) + 1] = "0123456789ABCDEF"[serverInfo->mapMD5[i] % 16]; + } + mapMD5[32] = 0; + + json info = { + {"protocol", serverInfo->protocol}, + {"serverCount", serverInfo->serverCount}, + {"isHLTV", serverInfo->isHLTV}, + {"isDedicated", serverInfo->isDedicated}, + {"clientCRC", serverInfo->clientCRC}, + {"maxClasses", serverInfo->maxClasses}, + {"mapCRC", serverInfo->mapCRC}, + {"mapMD5", mapMD5}, + {"playerSlot", serverInfo->playerSlot}, + {"maxClients", serverInfo->maxClients}, + {"tickInterval", serverInfo->tickInterval}, + {"os", serverInfo->os}, + {"gameDir", serverInfo->gameDir}, + {"mapName", serverInfo->mapName}, + {"skyName", serverInfo->skyName}, + {"hostName", serverInfo->hostName}, + {"isReplay", serverInfo->isReplay} + }; + data["serverinfo"] = info; + + // std::cout << info.dump(2, ' ', false, json::error_handler_t::replace) << "\n"; +} + +void Logic::OnClientConnected(int client) +{ + assert(clients[client].connected == -1); + + const auto& info = context->players[client].info; + auto& player = data["players"][info.guid]; + + if (player.is_null()) + { + player = json({ + {"names", {}}, + {"sprays", {}}, + {"disconnect_reasons", {}}, + {"playtime", 0}, + {"voicetime", 0.0f} + }); + } + + clients[client].connected = curTick; + + OnClientSettingsChanged(client); +} + +void Logic::OnClientDisconnected(int client, const char* reason) +{ + assert(clients[client].connected != -1); + + const auto& info = context->players[client].info; + auto& player = data["players"][info.guid]; + + // cumulative play time + unsigned int playtime = curTick - clients[client].connected; + playtime += player["playtime"].get(); + player["playtime"] = playtime; + + // cumulative voice chat time + float voicetime = clients[client].voiceTime; + voicetime += player["voicetime"].get(); + player["voicetime"] = voicetime; + + player["disconnect_reasons"] += reason; + + clients[client].connected = -1; +} + +void Logic::OnClientSettingsChanged(int client) +{ + assert(clients[client].connected != -1); + + const auto& info = context->players[client].info; + auto& player = data["players"][info.guid]; + + // list of names + if (std::find(player["names"].begin(), player["names"].end(), info.name) == player["names"].end()) + player["names"].push_back(info.name); + + // list of spray hashes + if (info.customFiles[0]) + { + char logohex[16]; + sprintf(logohex, "%08x", info.customFiles[0]); + if (std::find(player["sprays"].begin(), player["sprays"].end(), logohex) == player["sprays"].end()) + player["sprays"].push_back(logohex); + } +} + +void Logic::OnClientChat(int client, bool bWantsToChat, const char* msgName, const char* msgSender, const char* msgText) +{ + const auto& info = context->players[client].info; + json chat = { + {"tick", curTick}, + {"steamid", info.guid}, + {"msgName", msgName}, + {"msgSender", msgSender}, + {"msgText", msgText} + }; + + data["chat"] += chat; +} + +void Logic::OnClientVoiceChat(int client, float length) +{ + assert(clients[client].connected != -1); + + clients[client].voiceTime += length; +} + +void Logic::OnVoiceCodec(const char* codec, int quality, int sampleRate) +{ + data["voice_init"] = json({ + {"codec", codec}, + {"quality", quality}, + {"sampleRate", sampleRate} + }); +} \ No newline at end of file diff --git a/demboyz/game/logic.h b/demboyz/game/logic.h new file mode 100644 index 0000000..3c78043 --- /dev/null +++ b/demboyz/game/logic.h @@ -0,0 +1,39 @@ + +#pragma once + +#include "base/json.hpp" +#include "game/sourcecontext.h" + +using nlohmann::json; + +namespace NetMsg +{ + struct SVC_ServerInfo; +} + +struct Logic +{ + Logic(SourceGameContext* context); + ~Logic(); + + void Start(); + void Finish(bool dirty); + + struct + { + int32_t connected = -1; + float voiceTime = 0.0f; + } clients[MAX_PLAYERS]; + + void OnServerInfo(NetMsg::SVC_ServerInfo* serverInfo); + void OnClientConnected(int client); + void OnClientDisconnected(int client, const char* reason); + void OnClientSettingsChanged(int client); + void OnClientChat(int client, bool bWantsToChat, const char* msgName, const char* msgSender, const char* msgText); + void OnClientVoiceChat(int client, float length); + void OnVoiceCodec(const char* codec, int quality, int sampleRate); + + int32_t curTick = 0; + SourceGameContext* context = nullptr; + json data; +}; diff --git a/demboyz/game/sourcecontext.cpp b/demboyz/game/sourcecontext.cpp index fb4737a..ae69698 100644 --- a/demboyz/game/sourcecontext.cpp +++ b/demboyz/game/sourcecontext.cpp @@ -1,16 +1,177 @@ #include "sourcecontext.h" +#include "netmessages/netmath.h" #include "netmessages/svc_gameeventlist.h" +#include "netmessages/usermessages.h" +#include "netmessages/svc_usermessage.h" +#include "netmessages/svc_serverinfo.h" +#include "sourcesdk/bitbuf.h" +#include "game/gameevents.h" +#include "game/logic.h" +#include "io/voicewriter/voicedatawriter.h" +#include -SourceGameContext::SourceGameContext(): - protocol(0), - gameEventList(nullptr) +#include "netmessages/svc_voiceinit.h" +#include "netmessages/svc_voicedata.h" + +SourceGameContext::SourceGameContext(std::string outputDir, std::string outputDirVoice): + outputDir(outputDir), + outputDirVoice(outputDirVoice) { + stringTables = new StringTableContainer(this); + memset(players, 0, sizeof(players)); } SourceGameContext::~SourceGameContext() { + delete logic; + logic = nullptr; + protocol = 0; delete gameEventList; gameEventList = nullptr; + delete stringTables; + stringTables = nullptr; + + fclose(outputFp); +} + +bool SourceGameContext::init() +{ + outputFp = fopen((outputDir + "/out.json").c_str(), "wb"); + if (!outputFp) + { + fprintf(stderr, "Error: Could not open out.json\n"); + return false; + } + + voiceWriter = new VoiceDataWriter(this, outputDirVoice.c_str()); + logic = new Logic(this); + return true; +} + +void SourceGameContext::Start() +{ + logic->Start(); + voiceWriter->Start(); +} + +void SourceGameContext::Finish(bool dirty) +{ + logic->Finish(dirty); + voiceWriter->Finish(); +} + +void SourceGameContext::StartCommandPacket(const CommandPacket& packet) +{ + curFrame += (packet.cmd == dem_packet); + + if(curTick == -1 && packet.tick > 0) + return; + + curTick = packet.tick; + logic->curTick = curTick; + + voiceWriter->StartCommandPacket(packet); +} + +void SourceGameContext::EndCommandPacket(const PacketTrailingBits& trailingBits) +{ + if(curTick == -1) + return; + + voiceWriter->EndCommandPacket(trailingBits); +} + +void SourceGameContext::OnNetPacket(NetPacket& packet) +{ + if(packet.type == NetMsg::svc_ServerInfo) + { + NetMsg::SVC_ServerInfo* serverInfo = static_cast(packet.data); + fTickInterval = serverInfo->tickInterval; + fTickRate = 1.f / fTickInterval; + logic->OnServerInfo(serverInfo); + } + + else if(packet.type == NetMsg::svc_UserMessage) + { + NetMsg::SVC_UserMessage* umsg = static_cast(packet.data); + + bf_read msg(umsg->data.get(), math::BitsToBytes(umsg->dataLengthInBits)); + + if(umsg->msgType == UserMsg::SayText2) + { + int client = msg.ReadByte(); + bool bWantsToChat = msg.ReadByte(); + + char msgName[2048] = {0}; + char msgSender[2048] = {0}; + char msgText[2048] = {0}; + + msg.ReadString(msgName, sizeof(msgName)); + msg.ReadString(msgSender, sizeof(msgSender)); + msg.ReadString(msgText, sizeof(msgText)); + + logic->OnClientChat(client, bWantsToChat, msgName, msgSender, msgText); + } + } + + else if(packet.type == NetMsg::svc_VoiceInit || packet.type == NetMsg::svc_VoiceData) + { + voiceWriter->OnNetPacket(packet); + } + +} + +void SourceGameContext::OnGameEvent(const char *name, GameEvents::EventDataMap &data) +{ + // GameEvents::PrintEvent(name, data); + + if (strcmp(name, "player_disconnect") == 0) + { + int userid = data["userid"].i16Value; + for (int client = 0; client < MAX_PLAYERS; client++) + { + auto& p = players[client]; + if (!p.connected || p.info.userID != userid) + continue; + + p.connected = false; + logic->OnClientDisconnected(client, data["reason"].strValue.c_str()); + } + } +} + +void SourceGameContext::OnStringtable(StringTable* table) +{ + if (table->tableName == "userinfo") + { + table->callback = std::bind(&SourceGameContext::UserInfoChanged, this, std::placeholders::_1, std::placeholders::_2); + } +} + +void SourceGameContext::UserInfoChanged(int tableIdx, int entryIdx) +{ + StringTableEntry &entry = stringTables->tables[tableIdx].entries[entryIdx]; + + int client = std::stoi(entry.string); + player_info_t *info = (player_info_t *)entry.data.data(); + + if (entry.data.size() != sizeof(player_info_t)) + { + memset(&players[client].info, 0, sizeof(player_info_t)); + players[client].connected = false; + return; + } + + memcpy(&players[client].info, info, sizeof(player_info_t)); + + if (!players[client].connected) + logic->OnClientConnected(client); + else + logic->OnClientSettingsChanged(client); + + players[client].connected = true; + + //std::cout << client << " (" << info->userID << "): N:" << info->name << " G:" << info->guid << " F:" << info->friendsID << "\n"; } diff --git a/demboyz/game/sourcecontext.h b/demboyz/game/sourcecontext.h index 8140af0..0834bc2 100644 --- a/demboyz/game/sourcecontext.h +++ b/demboyz/game/sourcecontext.h @@ -1,18 +1,111 @@ #pragma once +#include "stringtables.h" +#include "game/gameevents.h" +#include "demofile/demotypes.h" #include namespace NetMsg { struct SVC_GameEventList; } +struct Logic; +class VoiceDataWriter; + +struct CommandPacket +{ + unsigned char cmd; + int32_t tick; + + void* data; +}; + +struct NetPacket +{ + int32_t type; + void* data; +}; + +struct PacketTrailingBits +{ + uint32_t numTrailingBits; + uint32_t value; +}; + +#define MAX_PLAYERS 65 +#define MAX_PLAYER_NAME_LENGTH 32 +#define SIGNED_GUID_LEN 32 +#define MAX_CUSTOM_FILES 4 + +// Engine player info, no game related infos here +// If you change this, change the two byteswap defintions: +// cdll_client_int.cpp and cdll_engine_int.cpp +typedef struct player_info_s +{ + // scoreboard information + char name[MAX_PLAYER_NAME_LENGTH]; + // local server user ID, unique while server is running + int userID; + // global unique player identifer + char guid[SIGNED_GUID_LEN + 1]; + // friends identification number + uint32_t friendsID; + // friends name + char friendsName[MAX_PLAYER_NAME_LENGTH]; + // true, if player is a bot controlled by game.dll + bool fakeplayer; + // true if player is the HLTV proxy + bool ishltv; +#if defined( REPLAY_ENABLED ) + // true if player is the Replay proxy + bool isreplay; +#endif + // custom files CRC for this player + uint32_t customFiles[MAX_CUSTOM_FILES]; + // this counter increases each time the server downloaded a new file + unsigned char filesDownloaded; +} player_info_t; struct SourceGameContext { - SourceGameContext(); + SourceGameContext(std::string outputDir, std::string outputDirVoice); ~SourceGameContext(); + bool init(); + void Start(); + void Finish(bool dirty); + + void StartCommandPacket(const CommandPacket& packet); + void EndCommandPacket(const PacketTrailingBits& trailingBits); + bool IgnoreNetPacketType(int32_t type); + + void OnNetPacket(NetPacket& packet); + void OnGameEvent(const char *name, GameEvents::EventDataMap &data); + void OnStringtable(StringTable* table); + void UserInfoChanged(int tableIdx, int entryIdx); + + std::string outputDir; + std::string outputDirVoice; + + FILE* outputFp; + Logic* logic; + + demoheader_t header; int16_t protocol; - NetMsg::SVC_GameEventList* gameEventList; + NetMsg::SVC_GameEventList* gameEventList = nullptr; + StringTableContainer* stringTables = nullptr; + VoiceDataWriter* voiceWriter = nullptr; + + int32_t curTick = -1; + int32_t curFrame = -1; + + float fTickInterval = -1.f; + float fTickRate = -1.f; + + struct + { + bool connected; + player_info_t info; + } players[MAX_PLAYERS]; }; diff --git a/demboyz/game/stringtables.cpp b/demboyz/game/stringtables.cpp new file mode 100644 index 0000000..a770947 --- /dev/null +++ b/demboyz/game/stringtables.cpp @@ -0,0 +1,174 @@ + +#include "base/bitfile.h" +#include "stringtables.h" +#include "game/sourcecontext.h" +#include + +static size_t strlcpy(char * dst, const char * src, size_t maxlen) { + const size_t srclen = strlen(src); + if (srclen + 1 < maxlen) { + memcpy(dst, src, srclen + 1); + } else if (maxlen != 0) { + memcpy(dst, src, maxlen - 1); + dst[maxlen-1] = '\0'; + } + return srclen; +} + +StringTableContainer::StringTableContainer(SourceGameContext *context): + context(context) +{ +} + +StringTable *StringTableContainer::GetStringTable(const char *name, bool create) +{ + StringTable *table = nullptr; + for (auto& t : tables) + { + if (t.tableName.compare(name) == 0) + { + table = &t; + break; + } + } + if (!table && create) + { + StringTable ttable; + tables.emplace_back(ttable); + table = &tables.back(); + table->id = tables.size() - 1; + table->tableName.assign(name); + table->entries.clear(); + context->OnStringtable(table); + } + return table; +} + +void StringTableContainer::DumpAll() +{ + for (auto& t : tables) + { + std::cout << "[STRINGTABLE] " << t.tableName << " (" << t.entries.size() << ")\n"; + int idx = 0; + for (auto& e : t.entries) + { + std::cout << idx++ << ":\t" << e.string << " (" << e.data << ")\n"; + } + std::cout << "\n"; + } +} + +StringTableEntry *StringTable::FindEntry(const char *string) +{ + for (auto& e : entries) + { + if (e.string.compare(string) == 0) + return &e; + } + return nullptr; +} + +#define SUBSTRING_BITS 5 +struct StringHistoryEntry +{ + char string[(1 << SUBSTRING_BITS)]; +}; + +void StringTable::AddEntry(StringTableEntry *entry) +{ + StringTableEntry *e = FindEntry(entry->string.c_str()); + if (!e) + { + entries.emplace_back(*entry); + return; + } + + e->string.assign(entry->string); + e->data.assign(entry->data); +} + +void StringTable::ParseUpdate(bf_read& bitbuf, int numEntries, SourceGameContext& context) +{ + std::vector history; + int entryIndex = -1; + for (int i = 0; i < numEntries; ++i) + { + entryIndex++; + + if (bitbuf.ReadOneBit() == 0) + { + entryIndex = bitbuf.ReadUBitLong(entryBits); + } + + const char *pEntry = NULL; + char entry[1024+1]; + char substr[1024]; + if (bitbuf.ReadOneBit() != 0) + { + bool substringcheck = bitbuf.ReadOneBit() != 0; + if (substringcheck) + { + int index = bitbuf.ReadUBitLong(5); + int bytestocopy = bitbuf.ReadUBitLong(SUBSTRING_BITS); + strlcpy(entry, history.at(index).string, MIN((int)sizeof(StringHistoryEntry::string), bytestocopy + 1)); + bitbuf.ReadString(substr, sizeof(substr)); + strncat(entry, substr, sizeof(entry) - 1); + } + else + { + bitbuf.ReadString(entry, sizeof(entry)); + } + pEntry = entry; + } + + const int MAX_USERDATA_BITS = 14; + unsigned char tempbuf[(1 << MAX_USERDATA_BITS)] = { 0 }; + const void *pUserData = NULL; + int nUserDataBytes = 0; + if (bitbuf.ReadOneBit() != 0) + { + if (isUserDataFixedSize) + { + bitbuf.ReadBits(tempbuf, userDataSizeBits); + } + else + { + nUserDataBytes = bitbuf.ReadUBitLong(MAX_USERDATA_BITS); + bitbuf.ReadBytes(tempbuf, nUserDataBytes); + } + pUserData = tempbuf; + } + + if (pEntry == NULL) + { + pEntry = ""; + } + + if (entryIndex >= (int)entries.size()) + { + StringTableEntry entry = {}; + entry.string.assign(pEntry); + entries.emplace_back(entry); +} + else + { + pEntry = entries[entryIndex].string.c_str(); + } + + assert(entryIndex < (int)entries.size()); + + entries[entryIndex].data.assign((const char *)pUserData, nUserDataBytes); + + if (callback) + callback(id, entryIndex); + + if (history.size() > 31) + { + history.erase(history.begin()); + } + + StringHistoryEntry she; + strlcpy(she.string, pEntry, sizeof(she.string)); + history.emplace_back(she); + } +} \ No newline at end of file diff --git a/demboyz/game/stringtables.h b/demboyz/game/stringtables.h new file mode 100644 index 0000000..05ade75 --- /dev/null +++ b/demboyz/game/stringtables.h @@ -0,0 +1,48 @@ + +#pragma once + +#include +#include +#include +#include + +class bf_read; +class SourceGameContext; + +struct StringTableEntry +{ + std::string string; + std::string data; +}; + +struct StringTable +{ + int id; + std::string tableName; + uint16_t maxEntries; + bool isUserDataFixedSize; + uint16_t userDataSize; + uint8_t userDataSizeBits; + int entryBits; + + void ParseUpdate(bf_read& bitbuf, int numEntries, SourceGameContext& context); + + void AddEntry(StringTableEntry *entry); + StringTableEntry *FindEntry(const char *string); + + std::vector entries; + std::function callback; +}; + +struct StringTableContainer +{ + StringTableContainer(SourceGameContext *context); + + StringTable *GetStringTable(const char *name, bool create); + + void DumpAll(); + + SourceGameContext *context; + std::vector tables; +}; + diff --git a/demboyz/io/conlogwriter.cpp b/demboyz/io/conlogwriter.cpp deleted file mode 100644 index b2546f1..0000000 --- a/demboyz/io/conlogwriter.cpp +++ /dev/null @@ -1,60 +0,0 @@ - -#include "idemowriter.h" -#include "netmessages/nethandlers.h" -#include "demofile/demotypes.h" -#include - -class ConLogWriter: public IDemoWriter -{ -public: - ConLogWriter(FILE* outputFp); - - virtual void StartWriting(demoheader_t& header) override final; - virtual void EndWriting() override final; - - virtual void StartCommandPacket(const CommandPacket& packet) override final; - virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) override final; - - virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final; - -private: - FILE* m_outputFp; -}; - -IDemoWriter* IDemoWriter::CreateConLogWriter(void* outputFp) -{ - return new ConLogWriter(reinterpret_cast(outputFp)); -} - -ConLogWriter::ConLogWriter(FILE* outputFp): - m_outputFp(outputFp) -{ -} - -void ConLogWriter::StartWriting(demoheader_t& header) -{ -} - -void ConLogWriter::EndWriting() -{ - fflush(m_outputFp); -} - -void ConLogWriter::StartCommandPacket(const CommandPacket& packet) -{ -} - -void ConLogWriter::EndCommandPacket(const PacketTrailingBits& trailingBits) -{ -} - -void ConLogWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context) -{ - std::ostringstream ss; - NetHandlers::NetMsg_ToString(packet.type, ss, packet.data); - if (ss.tellp() > 0) - { - ss << "\n"; - fputs(ss.str().c_str(), m_outputFp); - } -} diff --git a/demboyz/io/demoreader.cpp b/demboyz/io/demoreader.cpp new file mode 100644 index 0000000..c3b0b0c --- /dev/null +++ b/demboyz/io/demoreader.cpp @@ -0,0 +1,107 @@ +#include "demoreader.h" +#include "demofile/demofile.h" +#include "demofile/demotypes.h" + +#include "game/sourcecontext.h" +#include "netmessages/nethandlers.h" +#include "netmessages/netcontants.h" +#include "demmessages/demhandlers.h" +#include "demmessages/dem_stringtables.h" +#include "sourcesdk/bitbuf.h" +#include + +PacketTrailingBits ParsePacket(uint8_t* packet, size_t length, + SourceGameContext& context, + const NetHandlers::NetDataStructArray& netDataStructs) +{ + assert(length <= NET_MAX_PAYLOAD); + bf_read bitbuf(packet, length); + NetPacket netPacket; + while (bitbuf.GetNumBitsLeft() >= NETMSG_TYPE_BITS) + { + netPacket.type = bitbuf.ReadUBitLong(NETMSG_TYPE_BITS); + netPacket.data = netDataStructs[netPacket.type]; + NetHandlers::NetMsg_BitRead(netPacket.type, bitbuf, context, netPacket.data); + context.OnNetPacket(netPacket); + } + + PacketTrailingBits trailingBits; + trailingBits.numTrailingBits = bitbuf.GetNumBitsLeft(); + if (trailingBits.numTrailingBits) + { + trailingBits.value = bitbuf.ReadUBitLong(trailingBits.numTrailingBits); + } + else + { + trailingBits.value = 0; + } + return trailingBits; +} + +bool DemoReader::ProcessDem(std::FILE* inputFp, SourceGameContext* context) +{ + NetHandlers::NetDataStructArray netDataStructs; + DemHandlers::DemDataStructArray demDataStructs; + NetHandlers::CreateNetMsgStructs(netDataStructs); + DemHandlers::CreateDemMsgStructs(demDataStructs); + + DemoFileReader reader(inputFp); + { + reader.ReadDemoHeader(context->header); + context->protocol = context->header.networkprotocol; + context->Start(); + } + + bool dirty = false; + try + { + CommandPacket packet; + do + { + reader.ReadCmdHeader(packet.cmd, packet.tick); + packet.data = demDataStructs[packet.cmd]; + DemHandlers::DemMsg_FileRead(packet.cmd, reader, packet.data); + + PacketTrailingBits trailingBits = PacketTrailingBits(); + context->StartCommandPacket(packet); + + if (packet.cmd == dem_packet || packet.cmd == dem_signon) + { + Array buffer = reader.ReadRawData(NET_MAX_PAYLOAD); + trailingBits = ParsePacket(buffer.begin(), buffer.length(), *context, netDataStructs); + } + + else if (packet.cmd == dem_stringtables) + { + DemMsg::Dem_StringTables *stringTables = (DemMsg::Dem_StringTables *)packet.data; + for (const auto& s : stringTables->stringtables) + { + StringTable *table = context->stringTables->GetStringTable(s.tableName.c_str(), false); + if (!table) + continue; + for (const auto& e : s.entries) + { + StringTableEntry entry; + entry.string.assign(e.entryName); + entry.data.assign(e.data.begin(), e.data.end()); + table->AddEntry(&entry); + } + } + } + + context->EndCommandPacket(trailingBits); + } while (packet.cmd != dem_stop); + } + catch(const char *e) + { + dirty = true; + fprintf(stderr, "Error: %s\n", e); + } + + context->Finish(dirty); + + DemHandlers::DestroyDemMsgStructs(demDataStructs); + NetHandlers::DestroyNetMsgStructs(netDataStructs); + + return !dirty; +} diff --git a/demboyz/io/demoreader.h b/demboyz/io/demoreader.h index 3de4bb9..f6eddbc 100644 --- a/demboyz/io/demoreader.h +++ b/demboyz/io/demoreader.h @@ -1,12 +1,9 @@ - #pragma once +#include "game/sourcecontext.h" #include -class IDemoWriter; - namespace DemoReader { - void ProcessDem(std::FILE* inputFp, IDemoWriter* writer); - void ProcessJson(std::FILE* inputFp, IDemoWriter* writer); + bool ProcessDem(std::FILE* inputFp, SourceGameContext* context); } diff --git a/demboyz/io/demowriter.cpp b/demboyz/io/demowriter.cpp deleted file mode 100644 index e9be07d..0000000 --- a/demboyz/io/demowriter.cpp +++ /dev/null @@ -1,108 +0,0 @@ - -#include "idemowriter.h" -#include "demofile/demotypes.h" -#include "demofile/demofile.h" -#include "netmessages/nethandlers.h" -#include "netmessages/netcontants.h" -#include "demmessages/demhandlers.h" -#include "sourcesdk/bitbuf.h" -#include -#include - -#ifdef _WIN32 -#include -#else -#include -#endif -#include - -int truncate(FILE* fp, int relative_offset) -{ - fflush(fp); -#ifdef _WIN32 - const int fd = _fileno(fp); -#else - const int fd = fileno(fp); -#endif - struct stat statbuf; - fstat(fd, &statbuf); -#ifdef _WIN32 - return _chsize_s(fd, statbuf.st_size + relative_offset); -#else - return ftruncate(fd, statbuf.st_size + relative_offset); -#endif -} - -class DemoWriter: public IDemoWriter -{ -public: - DemoWriter(FILE* outputFp); - - virtual void StartWriting(demoheader_t& header) override final; - virtual void EndWriting() override final; - - virtual void StartCommandPacket(const CommandPacket& packet) override final; - virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) override final; - - virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final; - -private: - DemoFileWriter m_writer; - bf_write m_cmdPacketBuf; - std::unique_ptr m_packetBuffer; -}; - -IDemoWriter* IDemoWriter::CreateDemoWriter(void* outputFp) -{ - return new DemoWriter(reinterpret_cast(outputFp)); -} - -DemoWriter::DemoWriter(FILE* outputFp): - m_writer(outputFp), - m_cmdPacketBuf(), - m_packetBuffer(new uint8_t[NET_MAX_PAYLOAD]) -{ - m_cmdPacketBuf.StartWriting(m_packetBuffer.get(), NET_MAX_PAYLOAD); -} - -void DemoWriter::StartWriting(demoheader_t& header) -{ - m_writer.WriteDemoHeader(header); -} - -void DemoWriter::EndWriting() -{ - // stv demos have a byte chopped off of the end - // i dunno why, just doit - truncate(m_writer.GetFp(), -1); -} - -void DemoWriter::StartCommandPacket(const CommandPacket& packet) -{ - m_writer.WriteCmdHeader(packet.cmd, packet.tick); - DemHandlers::DemMsg_FileWrite(packet.cmd, m_writer, packet.data); - m_cmdPacketBuf.Reset(); -} - -void DemoWriter::EndCommandPacket(const PacketTrailingBits& trailingBits) -{ - if (trailingBits.numTrailingBits > 0) - { - m_cmdPacketBuf.WriteUBitLong(trailingBits.value, trailingBits.numTrailingBits); - } - const int numBitsToWrite = m_cmdPacketBuf.GetNumBitsWritten() % 8; - if (numBitsToWrite != 0) - { - assert(false); - } - if (m_cmdPacketBuf.GetNumBytesWritten() > 0) - { - m_writer.WriteRawData(m_cmdPacketBuf.GetBasePointer(), m_cmdPacketBuf.GetNumBytesWritten()); - } -} - -void DemoWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context) -{ - m_cmdPacketBuf.WriteUBitLong(packet.type, NETMSG_TYPE_BITS); - NetHandlers::NetMsg_BitWrite(packet.type, m_cmdPacketBuf, context, packet.data); -} diff --git a/demboyz/io/demreader.cpp b/demboyz/io/demreader.cpp deleted file mode 100644 index 45255e5..0000000 --- a/demboyz/io/demreader.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "demoreader.h" -#include "idemowriter.h" -#include "demofile/demofile.h" -#include "demofile/demotypes.h" - -#include "game/sourcecontext.h" -#include "netmessages/nethandlers.h" -#include "netmessages/netcontants.h" -#include "demmessages/demhandlers.h" -#include "sourcesdk/bitbuf.h" -#include - -PacketTrailingBits ParsePacket(uint8_t* packet, size_t length, - SourceGameContext& context, IDemoWriter* writer, - const NetHandlers::NetDataStructArray& netDataStructs) -{ - assert(length <= NET_MAX_PAYLOAD); - bf_read bitbuf(packet, length); - NetPacket netPacket; - while (bitbuf.GetNumBitsLeft() >= NETMSG_TYPE_BITS) - { - netPacket.type = bitbuf.ReadUBitLong(NETMSG_TYPE_BITS); - netPacket.data = netDataStructs[netPacket.type]; - NetHandlers::NetMsg_BitRead(netPacket.type, bitbuf, context, netPacket.data); - writer->WriteNetPacket(netPacket, context); - } - - PacketTrailingBits trailingBits; - trailingBits.numTrailingBits = bitbuf.GetNumBitsLeft(); - if (trailingBits.numTrailingBits) - { - trailingBits.value = bitbuf.ReadUBitLong(trailingBits.numTrailingBits); - } - else - { - trailingBits.value = 0; - } - return trailingBits; -} - -void DemoReader::ProcessDem(std::FILE* inputFp, IDemoWriter* writer) -{ - NetHandlers::NetDataStructArray netDataStructs; - DemHandlers::DemDataStructArray demDataStructs; - NetHandlers::CreateNetMsgStructs(netDataStructs); - DemHandlers::CreateDemMsgStructs(demDataStructs); - - SourceGameContext context = SourceGameContext(); - DemoFileReader reader(inputFp); - { - demoheader_t header; - reader.ReadDemoHeader(header); - writer->StartWriting(header); - context.protocol = header.networkprotocol; - } - - CommandPacket packet; - int frame = -1; - do - { - size_t rawDataSize = 0; - reader.ReadCmdHeader(packet.cmd, packet.tick); - packet.data = demDataStructs[packet.cmd]; - DemHandlers::DemMsg_FileRead(packet.cmd, reader, packet.data); - - PacketTrailingBits trailingBits = PacketTrailingBits(); - writer->StartCommandPacket(packet); - frame += (packet.cmd == dem_packet); - if (packet.cmd == dem_packet || packet.cmd == dem_signon) - { - Array buffer = reader.ReadRawData(NET_MAX_PAYLOAD); - trailingBits = ParsePacket(buffer.begin(), buffer.length(), context, writer, netDataStructs); - } - writer->EndCommandPacket(trailingBits); - } while (packet.cmd != dem_stop); - writer->EndWriting(); - - DemHandlers::DestroyDemMsgStructs(demDataStructs); - NetHandlers::DestroyNetMsgStructs(netDataStructs); -} diff --git a/demboyz/io/idemowriter.h b/demboyz/io/idemowriter.h deleted file mode 100644 index d38bb82..0000000 --- a/demboyz/io/idemowriter.h +++ /dev/null @@ -1,55 +0,0 @@ - -#pragma once - -#include - -struct democmdinfo_t; -struct demoheader_t; -struct CommandPacket; -struct NetPacket; -struct SourceGameContext; - -struct CommandPacket -{ - unsigned char cmd; - int32_t tick; - - void* data; -}; - -struct NetPacket -{ - int32_t type; - void* data; -}; - -struct PacketTrailingBits -{ - uint32_t numTrailingBits; - uint32_t value; -}; - -class IDemoWriter -{ -public: - virtual ~IDemoWriter() {} - - virtual void StartWriting(demoheader_t& header) = 0; - virtual void EndWriting() = 0; - - virtual void StartCommandPacket(const CommandPacket& packet) = 0; - virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) = 0; - - virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) = 0; - -public: - static IDemoWriter* CreateJsonWriter(void* outputFp); - static IDemoWriter* CreateDemoWriter(void* outputFp); - static IDemoWriter* CreateConLogWriter(void* outputFp); - static IDemoWriter* CreateVoiceDataWriter(const char* outputPath); - - static void FreeDemoWriter(IDemoWriter* writer) - { - delete writer; - } -}; diff --git a/demboyz/io/jsonreader.cpp b/demboyz/io/jsonreader.cpp deleted file mode 100644 index fa2da22..0000000 --- a/demboyz/io/jsonreader.cpp +++ /dev/null @@ -1,92 +0,0 @@ - -#include "demoreader.h" -#include "demofile/demotypes.h" -#include "demofile/demojson.h" -#include "base/jsonfile.h" -#include "io/idemowriter.h" - -#include "game/sourcecontext.h" -#include "netmessages/nethandlers.h" -#include "demmessages/demhandlers.h" - -int32_t ReadNetpacket(base::JsonReaderFile& jsonReader, PacketTrailingBits& trailingBits) -{ - base::JsonReaderObject reader = jsonReader.ParseObject(); - assert(!reader.HasReadError()); - const int32_t type = reader.ReadInt32("netpacket"); - if (type < 0) - { - base::JsonReaderObject reader = jsonReader.ParseObject(); - assert(!reader.HasReadError()); - trailingBits.numTrailingBits = reader.ReadInt32("numTrailingBits"); - trailingBits.value = reader.ReadInt32("trailingBitsValue"); - } - return type; -} - -PacketTrailingBits ParsePacket(base::JsonReaderFile& jsonReader, - SourceGameContext& context, IDemoWriter* writer, - const NetHandlers::NetDataStructArray& netDataStructs) -{ - PacketTrailingBits trailingBits = PacketTrailingBits(); - NetPacket netPacket = NetPacket(); - while ((netPacket.type = ReadNetpacket(jsonReader, trailingBits)) >= 0) - { - netPacket.data = netDataStructs[netPacket.type]; - NetHandlers::NetMsg_JsonRead(netPacket.type, jsonReader, context, netPacket.data); - writer->WriteNetPacket(netPacket, context); - } - return trailingBits; -} - -void DemoReader::ProcessJson(std::FILE* inputFp, IDemoWriter* writer) -{ - NetHandlers::NetDataStructArray netDataStructs; - DemHandlers::DemDataStructArray demDataStructs; - NetHandlers::CreateNetMsgStructs(netDataStructs); - DemHandlers::CreateDemMsgStructs(demDataStructs); - - SourceGameContext context = SourceGameContext(); - char buffer[4096]; - base::JsonReaderFile jsonReader(inputFp, buffer, sizeof(buffer)); - { - base::JsonReaderObject reader = jsonReader.ParseObject(); - assert(!reader.HasReadError()); - - demoheader_t header; - if (!DemoJsonReader::ReadDemoHeader(reader, header)) - { - return; - } - writer->StartWriting(header); - context.protocol = header.networkprotocol; - } - - CommandPacket packet; - do - { - { - base::JsonReaderObject reader = jsonReader.ParseObject(); - if (reader.HasReadError()) - { - assert(!reader.HasReadError()); - } - - DemoJsonReader::ReadCmdHeader(reader, packet.cmd, packet.tick); - } - packet.data = demDataStructs[packet.cmd]; - DemHandlers::DemMsg_JsonRead(packet.cmd, jsonReader, packet.data); - - PacketTrailingBits trailingBits = PacketTrailingBits(); - writer->StartCommandPacket(packet); - if (packet.cmd == dem_packet || packet.cmd == dem_signon) - { - trailingBits = ParsePacket(jsonReader, context, writer, netDataStructs); - } - writer->EndCommandPacket(trailingBits); - } while (packet.cmd != dem_stop); - writer->EndWriting(); - - DemHandlers::DestroyDemMsgStructs(demDataStructs); - NetHandlers::DestroyNetMsgStructs(netDataStructs); -} diff --git a/demboyz/io/jsonwriter.cpp b/demboyz/io/jsonwriter.cpp deleted file mode 100644 index 8ebe968..0000000 --- a/demboyz/io/jsonwriter.cpp +++ /dev/null @@ -1,104 +0,0 @@ - -#include "idemowriter.h" -#include "demofile/demojson.h" -#include "demofile/demotypes.h" -#include "base/jsonfile.h" -#include "demmessages/demhandlers.h" -#include "netmessages/nethandlers.h" -#include -#include - -class JsonWriter: public IDemoWriter -{ -public: - JsonWriter(FILE* outputFp); - - virtual void StartWriting(demoheader_t& header) override final; - virtual void EndWriting() override final; - - virtual void StartCommandPacket(const CommandPacket& packet) override final; - virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) override final; - - virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final; - -private: - base::JsonWriterFile m_jsonFile; - bool m_writingNetPackets; - char m_buffer[4096]; -}; - -IDemoWriter* IDemoWriter::CreateJsonWriter(void* outputFp) -{ - return new JsonWriter(reinterpret_cast(outputFp)); -} - -JsonWriter::JsonWriter(FILE* outputFp): - m_jsonFile(outputFp, m_buffer, sizeof(m_buffer)), - m_writingNetPackets(false) -{ -} - -void JsonWriter::StartWriting(demoheader_t& header) -{ - auto& jsonFile = m_jsonFile; - jsonFile.Reset(); - jsonFile.StartObject(); - DemoJsonWriter::WriteDemoHeader(jsonFile, header); - jsonFile.EndObject(); -} - -void JsonWriter::EndWriting() -{ - auto& jsonFile = m_jsonFile; - jsonFile.Flush(); - assert(jsonFile.IsComplete()); -} - -void JsonWriter::StartCommandPacket(const CommandPacket& packet) -{ - auto& jsonFile = m_jsonFile; - jsonFile.Reset(); - jsonFile.StartObject(); - DemoJsonWriter::WriteCmdHeader(jsonFile, packet.cmd, packet.tick); - jsonFile.EndObject(); - - DemHandlers::DemMsg_JsonWrite(packet.cmd, jsonFile, packet.data); - assert(jsonFile.IsComplete()); - - if (packet.cmd == dem_packet || packet.cmd == dem_signon) - { - m_writingNetPackets = true; - } -} - -void JsonWriter::EndCommandPacket(const PacketTrailingBits& trailingBits) -{ - if (m_writingNetPackets) - { - m_writingNetPackets = false; - auto& jsonFile = m_jsonFile; - jsonFile.Reset(); - jsonFile.StartObject(); - jsonFile.WriteInt32("netpacket", -1); - jsonFile.EndObject(); - - jsonFile.Reset(); - jsonFile.StartObject(); - jsonFile.WriteInt32("numTrailingBits", trailingBits.numTrailingBits); - jsonFile.WriteInt32("trailingBitsValue", trailingBits.value, (trailingBits.numTrailingBits > 0)); - jsonFile.EndObject(); - assert(jsonFile.IsComplete()); - } -} - -void JsonWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context) -{ - auto& jsonFile = m_jsonFile; - jsonFile.Reset(); - jsonFile.StartObject(); - jsonFile.WriteInt32("netpacket", packet.type); - jsonFile.EndObject(); - - NetHandlers::NetMsg_JsonWrite(packet.type, jsonFile, context, packet.data); - assert(jsonFile.IsComplete()); -} diff --git a/demboyz/io/voicewriter/opusfilewriter.h b/demboyz/io/voicewriter/opusfilewriter.h new file mode 100644 index 0000000..ac106f5 --- /dev/null +++ b/demboyz/io/voicewriter/opusfilewriter.h @@ -0,0 +1,81 @@ + +#pragma once + +#include +#include +#include +#include + +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) + +class OpusFileWriter +{ +public: + OpusFileWriter() + { + } + + ~OpusFileWriter() + { + assert(!m_Enc); + } + + void Init(const char* file, uint32_t sampleRate) + { + assert(!m_Enc); + m_Samples = 0; + + m_Comments = ope_comments_create(); + + int error; + m_Enc = ope_encoder_create_file(file, m_Comments, sampleRate, 1, 0, &error); + assert(error == 0); + + ope_encoder_ctl(m_Enc, OPUS_SET_DTX(1)); + } + + void Close() + { + if(!m_Enc) + return; + + ope_encoder_drain(m_Enc); + ope_encoder_destroy(m_Enc); + ope_comments_destroy(m_Comments); + m_Enc = nullptr; + m_Comments = nullptr; + } + + void WriteSamples(const int16_t* samples, uint32_t numSamples) + { + if(!m_Enc) + return; + + ope_encoder_write(m_Enc, samples, numSamples); + m_Samples += numSamples; + } + + void PadSilence(uint32_t numSamples) + { + if(!m_Enc || m_Samples >= numSamples) + return; + + static const int16_t silence[128] = {0}; + uint32_t pad = numSamples - m_Samples; + while(pad > 0) + { + const int samples = MIN(sizeof(silence) / bytesPerSample, pad); + ope_encoder_write(m_Enc, silence, samples); + pad -= samples; + } + m_Samples = numSamples; + } + +private: + OggOpusComments *m_Comments = nullptr; + OggOpusEnc *m_Enc = nullptr; + uint32_t m_Samples = 0; + + static const uint32_t bytesPerSample = 2; +}; diff --git a/demboyz/io/voicewriter/voicedatawriter.cpp b/demboyz/io/voicewriter/voicedatawriter.cpp index 7613fda..9987d97 100644 --- a/demboyz/io/voicewriter/voicedatawriter.cpp +++ b/demboyz/io/voicewriter/voicedatawriter.cpp @@ -1,27 +1,17 @@ - -#include "../idemowriter.h" #include "netmessages/netmessages.h" #include "netmessages/svc_voiceinit.h" #include "netmessages/svc_voicedata.h" -#include "celt/celt.h" +#include +#include #include -#include "wavfilewriter.h" - -#ifdef _WIN32 -//#define USE_VAUDIO_CELT -#endif - -#define MAX_PLAYERS 33 - -#ifdef USE_VAUDIO_CELT -#define VC_EXTRALEAN -#define WIN32_LEAN_AND_MEAN -#include -#endif +#include "base/CRC.h" +#include "game/logic.h" +#include "voicedatawriter.h" +#include struct CeltConfig { @@ -39,198 +29,141 @@ static CeltConfig sCeltConfigs[] = { 44100, 1024, 128 } // vaudio_celt_high }; -#ifdef USE_VAUDIO_CELT - -class IVoiceCodec +bool CeltVoiceDecoder::DoInit(CELTMode* celtMode, uint32_t frameSizeSamples, uint32_t encodedFrameSizeBytes) { -protected: - virtual ~IVoiceCodec() {} - -public: - // Initialize the object. The uncompressed format is always 8-bit signed mono. - virtual bool Init( int quality ) = 0; - - // Use this to delete the object. - virtual void Release() = 0; - - // Compress the voice data. - // pUncompressed - 16-bit signed mono voice data. - // maxCompressedBytes - The length of the pCompressed buffer. Don't exceed this. - // bFinal - Set to true on the last call to Compress (the user stopped talking). - // Some codecs like big block sizes and will hang onto data you give them in Compress calls. - // When you call with bFinal, the codec will give you compressed data no matter what. - // Return the number of bytes you filled into pCompressed. - virtual int Compress(const char *pUncompressed, int nSamples, char *pCompressed, int maxCompressedBytes, bool bFinal) = 0; - - // Decompress voice data. pUncompressed is 16-bit signed mono. - virtual int Decompress(const char *pCompressed, int compressedBytes, char *pUncompressed, int maxUncompressedBytes) = 0; - - // Some codecs maintain state between Compress and Decompress calls. This should clear that state. - virtual bool ResetState() = 0; -}; - -typedef void* (CreateInterfaceFn)(const char *pName, int *pReturnCode); -static HINSTANCE celtDll; -static CreateInterfaceFn* createInterfaceFunc; - -#else - -class CeltVoiceDecoder -{ -public: - bool DoInit(CELTMode* celtMode, uint32_t frameSizeSamples, uint32_t encodedFrameSizeBytes) + if(m_celtDecoder) { - if(m_celtDecoder) - { - return false; - } - - int error = CELT_OK; - m_celtDecoder = celt_decoder_create_custom(celtMode, sCeltChannels, &error); - assert(error == CELT_OK); - assert(m_celtDecoder); - - m_frameSizeSamples = frameSizeSamples; - m_encodedFrameSizeBytes = encodedFrameSizeBytes; - return true; + return false; } - void Destroy() - { - celt_decoder_destroy(m_celtDecoder); - m_celtDecoder = NULL; - } + int error = CELT_OK; + m_celtDecoder = celt_decoder_create_custom(celtMode, sCeltChannels, &error); + assert(error == CELT_OK); + assert(m_celtDecoder); - void Reset() - { - } - - int Decompress( - const uint8_t* compressedData, - int compressedBytes, - int16_t* uncompressedData, - int maxUncompressedSamples) - { - int curCompressedByte = 0; - int curDecompressedSample = 0; - - const uint32_t encodedframeSizeBytes = m_encodedFrameSizeBytes; - const uint32_t frameSizeSamples = m_frameSizeSamples; - while( - ((compressedBytes - curCompressedByte) >= encodedframeSizeBytes) && - ((maxUncompressedSamples - curDecompressedSample) >= frameSizeSamples)) - { - DecodeFrame(&compressedData[curCompressedByte], &uncompressedData[curDecompressedSample]); - curCompressedByte += encodedframeSizeBytes; - curDecompressedSample += frameSizeSamples; - } - return curDecompressedSample; - } - -private: - void DecodeFrame(const uint8_t* compressedData, int16_t* uncompressedData) - { - int error = celt_decode(m_celtDecoder, compressedData, m_encodedFrameSizeBytes, uncompressedData, m_frameSizeSamples); - assert(error >= CELT_OK); - } - -private: - static const int sCeltChannels = 1; - -private: - CELTDecoder* m_celtDecoder = NULL; - uint32_t m_frameSizeSamples = 0; - uint32_t m_encodedFrameSizeBytes = 0; -}; - -#endif // USE_VAUDIO_CELT - -class VoiceDataWriter: public IDemoWriter -{ -public: - VoiceDataWriter(const char* outputPath); - - virtual void StartWriting(demoheader_t& header) override final; - virtual void EndWriting() override final; - - virtual void StartCommandPacket(const CommandPacket& packet) override final; - virtual void EndCommandPacket(const PacketTrailingBits& trailingBits) override final; - - virtual void WriteNetPacket(NetPacket& packet, SourceGameContext& context) override final; - -private: - struct PlayerVoiceState - { -#ifdef USE_VAUDIO_CELT - IVoiceCodec* celtDecoder = nullptr; -#else - CeltVoiceDecoder decoder; -#endif - WaveFileWriter wavWriter; - int32_t lastVoiceDataTick = -1; - }; - -private: - CELTMode* m_celtMode; - PlayerVoiceState m_playerVoiceStates[MAX_PLAYERS]; - - int32_t m_curTick; - const char* m_outputPath; - - int16_t m_decodeBuffer[8192]; - - static const int sQuality = 3; -}; - -IDemoWriter* IDemoWriter::CreateVoiceDataWriter(const char* outputPath) -{ - return new VoiceDataWriter(outputPath); + m_frameSizeSamples = frameSizeSamples; + m_encodedFrameSizeBytes = encodedFrameSizeBytes; + return true; } -VoiceDataWriter::VoiceDataWriter(const char* outputPath): - m_celtMode(nullptr), - m_playerVoiceStates(), - m_curTick(-1), +void CeltVoiceDecoder::Destroy() +{ + celt_decoder_destroy(m_celtDecoder); + m_celtDecoder = NULL; +} + +void CeltVoiceDecoder::Reset() +{ +} + +int CeltVoiceDecoder::Decompress( + const uint8_t* compressedData, + uint32_t compressedBytes, + int16_t* uncompressedData, + uint32_t maxUncompressedSamples) +{ + uint32_t curCompressedByte = 0; + uint32_t curDecompressedSample = 0; + + const uint32_t encodedframeSizeBytes = m_encodedFrameSizeBytes; + const uint32_t frameSizeSamples = m_frameSizeSamples; + while( + ((compressedBytes - curCompressedByte) >= encodedframeSizeBytes) && + ((maxUncompressedSamples - curDecompressedSample) >= frameSizeSamples)) + { + DecodeFrame(&compressedData[curCompressedByte], &uncompressedData[curDecompressedSample]); + curCompressedByte += encodedframeSizeBytes; + curDecompressedSample += frameSizeSamples; + } + return curDecompressedSample; +} + +void CeltVoiceDecoder::DecodeFrame(const uint8_t* compressedData, int16_t* uncompressedData) +{ + int error = celt_decode(m_celtDecoder, compressedData, m_encodedFrameSizeBytes, uncompressedData, m_frameSizeSamples); + assert(error >= CELT_OK); +} + + +bool SilkVoiceDecoder::DoInit(int32_t sampleRate) +{ + m_Silk_DecoderControl.API_sampleRate = sampleRate; + if(m_Silk_DecoderState) + { + return false; + } + + int decoderSize; + SKP_Silk_SDK_Get_Decoder_Size(&decoderSize); + + m_Silk_DecoderState = malloc(decoderSize); + assert(m_Silk_DecoderState != NULL); + + int retEnc = SKP_Silk_SDK_InitDecoder(m_Silk_DecoderState); + assert(retEnc == SKP_SILK_NO_ERROR); + + return true; +} + +void SilkVoiceDecoder::Destroy() +{ + if(m_Silk_DecoderState) + free(m_Silk_DecoderState); + m_Silk_DecoderState = NULL; +} + +void SilkVoiceDecoder::Reset() +{ + SKP_Silk_SDK_InitDecoder(m_Silk_DecoderState); +} + +int SilkVoiceDecoder::Decompress( + const uint8_t* compressedData, + uint32_t compressedBytes, + int16_t* uncompressedData, + uint32_t maxUncompressedSamples) +{ + short nSamplesOut = maxUncompressedSamples; + int decodeRes = SKP_Silk_SDK_Decode(m_Silk_DecoderState, &m_Silk_DecoderControl, 0, compressedData, compressedBytes, uncompressedData, &nSamplesOut); + + if (SKP_SILK_NO_ERROR != decodeRes) + return 0; + return nSamplesOut; +} + + +VoiceDataWriter::VoiceDataWriter(SourceGameContext* context, const char* outputPath): + context(context), m_outputPath(outputPath) { } -void VoiceDataWriter::StartWriting(demoheader_t& header) +void VoiceDataWriter::Start() { -#ifdef USE_VAUDIO_CELT - celtDll = LoadLibrary(TEXT("vaudio_celt.dll")); - createInterfaceFunc = (CreateInterfaceFn*)GetProcAddress(celtDll, "CreateInterface"); -#else int error = CELT_OK; const CeltConfig& config = sCeltConfigs[sQuality]; m_celtMode = celt_mode_create(config.sampleRate, config.frameSizeSamples, &error); assert(error == CELT_OK); assert(m_celtMode); -#endif } -void VoiceDataWriter::EndWriting() +void VoiceDataWriter::Finish() { - for(PlayerVoiceState& state : m_playerVoiceStates) + for(auto& state : m_playerVoiceStates) { -#ifdef USE_VAUDIO_CELT - if(state.celtDecoder) - { - state.celtDecoder->Release(); - } -#else - state.decoder.Destroy(); -#endif - state.wavWriter.Close(); - state.lastVoiceDataTick = -1; + state.second.celt_decoder.Destroy(); + state.second.silk_decoder.Destroy(); + + state.second.fileWriter.PadSilence((m_curTick * state.second.sampleRate) / context->fTickRate); + state.second.fileWriter.Close(); + state.second.lastVoiceDataTick = -1; } -#ifndef USE_VAUDIO_CELT + if(m_celtMode) { celt_mode_destroy(m_celtMode); m_celtMode = nullptr; } -#endif } void VoiceDataWriter::StartCommandPacket(const CommandPacket& packet) @@ -240,53 +173,200 @@ void VoiceDataWriter::StartCommandPacket(const CommandPacket& packet) void VoiceDataWriter::EndCommandPacket(const PacketTrailingBits& trailingBits) { + const int tickMargin = context->fTickRate / 10.0; // 100ms + if (m_curTick <= tickMargin) + return; + + for(auto& state : m_playerVoiceStates) + { + if((m_curTick - state.second.lastVoiceDataTick) > tickMargin) + state.second.fileWriter.PadSilence((m_curTick * state.second.sampleRate) / context->fTickRate); + } } -void VoiceDataWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context) +int VoiceDataWriter::ParseSteamVoicePacket(uint8_t* bytes, int numBytes, PlayerVoiceState& state) +{ + int numDecompressedSamples = 0; + int pos = 0; + if(numBytes < 4+4+4+1+2) + return -1; + + int dataLen = numBytes - 4; // skip CRC + + uint32_t CRCdemo = *((uint32_t *)&bytes[dataLen]); + uint32_t CRCdata = CRC::Calculate(bytes, dataLen, CRC::CRC_32()); + if(CRCdata != CRCdemo) + return -1; + + //uint32_t iSteamAccountID = *((uint32_t *)&bytes[pos]); + pos += 4; + uint32_t iSteamCommunity = *((uint32_t *)&bytes[pos]); + pos += 4; + + if(iSteamCommunity != 0x1100001) + return -1; + + while (pos < dataLen) + { + uint8_t payloadType = bytes[pos]; + pos++; + + switch(payloadType) + { + case 11: // Sample Rate + { + if(pos + 2 > dataLen) + return numDecompressedSamples; + short rate = *((int16_t *)&bytes[pos]); + pos += 2; + state.silk_decoder.DoInit(rate); + state.sampleRate = rate; + } break; + case 10: // Unknown / Unused + { + if(pos + 2 > dataLen) + return numDecompressedSamples; + //short unk = *((int16_t *)&bytes[pos]); + pos += 2; + } break; + case 1: // Unknown Codec??? + case 2: // Speex Data (Unsupported) + case 3: // Uncompressed Data + case 4: // SILK Data + { + if(pos + 2 > dataLen) + return numDecompressedSamples; + short length = *((int16_t *)&bytes[pos]); + pos += 2; + + if(pos + length > dataLen) + return numDecompressedSamples; + + if(payloadType == 3) + { + memcpy(&m_decodeBuffer[numDecompressedSamples], &bytes[pos], length); + numDecompressedSamples += length / sizeof(int16_t); + } + else if(payloadType == 4) + { + int tpos = pos; + int maxpos = tpos + length; + while(tpos <= (maxpos - 2)) + { + short chunkLength = *((int16_t *)&bytes[tpos]); + tpos += 2; + + if(chunkLength == -1) + { + state.silk_decoder.Reset(); + continue; + } + else if(chunkLength == 0) + { + // DTX (discontinued transmission) + int numEmptySamples = state.sampleRate / 50; + memset(&m_decodeBuffer[numDecompressedSamples], 0, numEmptySamples * sizeof(int16_t)); + numDecompressedSamples += numEmptySamples; + continue; + } + + if(tpos + chunkLength > maxpos) + return numDecompressedSamples; + + int ret = state.silk_decoder.Decompress(&bytes[tpos], chunkLength, &m_decodeBuffer[numDecompressedSamples], + (sizeof(m_decodeBuffer) / sizeof(int16_t)) - numDecompressedSamples); + numDecompressedSamples += ret; + tpos += chunkLength; + } + } + pos += length; + + } break; + case 0: // Silence + { + if(pos + 2 > dataLen) + return numDecompressedSamples; + short numSamples = *((int16_t *)&bytes[pos]); + memset(&m_decodeBuffer[numDecompressedSamples], 0, numSamples * sizeof(int16_t)); + numDecompressedSamples += numSamples; + pos += 2; + } break; + } + } + + return numDecompressedSamples; +} + +void VoiceDataWriter::OnNetPacket(NetPacket& packet) { if(packet.type == NetMsg::svc_VoiceInit) { NetMsg::SVC_VoiceInit* voiceInit = static_cast(packet.data); - assert(!strcmp(voiceInit->voiceCodec, "vaudio_celt")); - assert(voiceInit->quality == NetMsg::SVC_VoiceInit::QUALITY_HAS_SAMPLE_RATE); - assert(voiceInit->sampleRate == sCeltConfigs[sQuality].sampleRate); + if(!strcmp(voiceInit->voiceCodec, "vaudio_celt")) + { + assert(voiceInit->quality == NetMsg::SVC_VoiceInit::QUALITY_HAS_SAMPLE_RATE); + assert(voiceInit->sampleRate == sCeltConfigs[sQuality].sampleRate); + m_Codec = CODEC_CELT; + } + else if(!strcmp(voiceInit->voiceCodec, "vaudio_speex")) + { + m_Codec = CODEC_SPEEX; + } + else //if(!strcmp(voiceInit->voiceCodec, "steam")) + { + m_Codec = CODEC_STEAM; + } + context->logic->OnVoiceCodec(voiceInit->voiceCodec, voiceInit->quality, voiceInit->sampleRate); } else if(packet.type == NetMsg::svc_VoiceData) { NetMsg::SVC_VoiceData* voiceData = static_cast(packet.data); assert(voiceData->fromClientIndex < MAX_PLAYERS); + const char* guid = context->players[voiceData->fromClientIndex].info.guid; - PlayerVoiceState& state = m_playerVoiceStates[voiceData->fromClientIndex]; - - const CeltConfig& config = sCeltConfigs[sQuality]; -#ifdef USE_VAUDIO_CELT - const bool initWavWriter = !state.celtDecoder; - if(!state.celtDecoder) - { - int ret = 0; - state.celtDecoder = static_cast(createInterfaceFunc("vaudio_celt", &ret)); - state.celtDecoder->Init(sQuality); - } -#else - const bool initWavWriter = state.decoder.DoInit(m_celtMode, config.frameSizeSamples, config.encodedFrameSizeBytes); -#endif - if(initWavWriter) - { - std::string name = std::string(m_outputPath) + "/client_" + std::to_string((uint32_t)voiceData->fromClientIndex) + ".wav"; - state.wavWriter.Init(name.c_str(), config.sampleRate); - assert(state.lastVoiceDataTick == -1); - state.lastVoiceDataTick = m_curTick; - } - + uint8_t* bytes = voiceData->data.get(); assert((voiceData->dataLengthInBits % 8) == 0); const int numBytes = voiceData->dataLengthInBits / 8; -#ifdef USE_VAUDIO_CELT - const int numDecompressedSamples = state.celtDecoder->Decompress((const char*)voiceData->data.get(), numBytes, (char*)m_decodeBuffer, 8192*2); -#else - const int numDecompressedSamples = state.decoder.Decompress(voiceData->data.get(), numBytes, m_decodeBuffer, 8192); -#endif - state.wavWriter.WriteSamples(m_decodeBuffer, numDecompressedSamples); + int numDecompressedSamples = 0; + + PlayerVoiceState& state = m_playerVoiceStates[guid]; + + if(m_Codec == CODEC_CELT) + { + const CeltConfig& config = sCeltConfigs[sQuality]; + state.sampleRate = config.sampleRate; + + state.celt_decoder.DoInit(m_celtMode, config.frameSizeSamples, config.encodedFrameSizeBytes); + numDecompressedSamples = state.celt_decoder.Decompress(bytes, numBytes, m_decodeBuffer, sizeof(m_decodeBuffer)); + } + else + { + // Try Steam Voice + if(numBytes >= 15) + { + numDecompressedSamples = ParseSteamVoicePacket(bytes, numBytes, state); + } + + // Would try speex here, if I cared... + if(numDecompressedSamples <= 0) + { + } + } + + if(numDecompressedSamples <= 0) + return; + + if(state.lastVoiceDataTick == -1) + { + std::string name = std::string(m_outputPath) + "/" + std::string(guid) + ".opus"; + state.fileWriter.Init(name.c_str(), state.sampleRate); + state.fileWriter.PadSilence((m_curTick * state.sampleRate) / context->fTickRate); + } + + state.fileWriter.WriteSamples(m_decodeBuffer, numDecompressedSamples); + + context->logic->OnClientVoiceChat(voiceData->fromClientIndex, (float)numDecompressedSamples / (float)state.sampleRate); state.lastVoiceDataTick = m_curTick; } diff --git a/demboyz/io/voicewriter/voicedatawriter.h b/demboyz/io/voicewriter/voicedatawriter.h new file mode 100644 index 0000000..dd597c9 --- /dev/null +++ b/demboyz/io/voicewriter/voicedatawriter.h @@ -0,0 +1,91 @@ +#pragma once + +#include "opusfilewriter.h" +#include "game/sourcecontext.h" +#include + +struct CELTMode; + +enum eCodec +{ + CODEC_NONE = 0, + CODEC_CELT = 1, + CODEC_SPEEX = 2, + CODEC_STEAM = 2 +}; + +class CeltVoiceDecoder +{ +public: + bool DoInit(CELTMode* celtMode, uint32_t frameSizeSamples, uint32_t encodedFrameSizeBytes); + void Destroy(); + void Reset(); + + int Decompress(const uint8_t* compressedData, uint32_t compressedBytes, int16_t* uncompressedData, uint32_t maxUncompressedSamples); + void DecodeFrame(const uint8_t* compressedData, int16_t* uncompressedData); + +private: + static const int sCeltChannels = 1; + +private: + struct CELTDecoder* m_celtDecoder = NULL; + uint32_t m_frameSizeSamples = 0; + uint32_t m_encodedFrameSizeBytes = 0; +}; + +class SilkVoiceDecoder +{ +public: + bool DoInit(int32_t sampleRate); + void Destroy(); + void Reset(); + + int Decompress(const uint8_t* compressedData, uint32_t compressedBytes, int16_t* uncompressedData, uint32_t maxUncompressedSamples); + +private: + static const int sSilkChannels = 1; + +private: + void* m_Silk_DecoderState = NULL; + SKP_SILK_SDK_DecControlStruct m_Silk_DecoderControl; +}; + +class VoiceDataWriter +{ +public: + VoiceDataWriter(SourceGameContext *context, const char* outputPath); + + void Start(); + void Finish(); + + void StartCommandPacket(const CommandPacket& packet); + void EndCommandPacket(const PacketTrailingBits& trailingBits); + + void OnNetPacket(NetPacket& packet); + +private: + struct PlayerVoiceState + { + CeltVoiceDecoder celt_decoder; + SilkVoiceDecoder silk_decoder; + + OpusFileWriter fileWriter; + int32_t lastVoiceDataTick = -1; + int sampleRate = 0; + }; + + int ParseSteamVoicePacket(uint8_t* bytes, int numBytes, PlayerVoiceState& state); + +private: + SourceGameContext *context = nullptr; + CELTMode* m_celtMode = nullptr; + std::map m_playerVoiceStates; + + int32_t m_curTick = -1; + const char* m_outputPath = nullptr; + + int16_t m_decodeBuffer[8192]; + + static const int sQuality = 3; + eCodec m_Codec = CODEC_NONE; +}; diff --git a/demboyz/io/voicewriter/wavfilewriter.h b/demboyz/io/voicewriter/wavfilewriter.h index 14274d5..1b92599 100644 --- a/demboyz/io/voicewriter/wavfilewriter.h +++ b/demboyz/io/voicewriter/wavfilewriter.h @@ -10,7 +10,7 @@ class WaveFileWriter public: WaveFileWriter(): m_file(nullptr), - m_DataBytes(0) + m_Samples(0) { } @@ -25,7 +25,7 @@ public: assert(fp); m_file = fp; - m_DataBytes = 0; + m_Samples = 0; const uint32_t chunkSize = 0; @@ -62,7 +62,7 @@ public: return; } - const uint32_t dataSize = m_DataBytes; + const uint32_t dataSize = m_Samples * bytesPerSample; const uint32_t chunkSize = dataSize + 36; fseek(fp, 4, SEEK_SET); @@ -78,13 +78,29 @@ public: void WriteSamples(const int16_t* samples, uint32_t numSamples) { - const uint32_t bytesPerSample = 2; + if(!m_file) + return; + const size_t elemsWritten = fwrite(samples, bytesPerSample, numSamples, m_file); assert(elemsWritten == numSamples); - m_DataBytes += (elemsWritten * bytesPerSample); + m_Samples += elemsWritten; + } + + void PadSilence(uint32_t numSamples) + { + if(!m_file || m_Samples >= numSamples) + return; + + const uint16_t silence[bytesPerSample] = {0}; + const uint32_t pad = numSamples - m_Samples; + for(uint32_t i = 0; i < pad; i++) + fwrite(silence, bytesPerSample, 1, m_file); + m_Samples += pad; } private: FILE* m_file; - uint32_t m_DataBytes; + uint32_t m_Samples; + + static const uint32_t bytesPerSample = 2; }; diff --git a/demboyz/netmessages/net_disconnect.cpp b/demboyz/netmessages/net_disconnect.cpp index 902462d..55a06f7 100644 --- a/demboyz/netmessages/net_disconnect.cpp +++ b/demboyz/netmessages/net_disconnect.cpp @@ -1,7 +1,6 @@ #include "net_disconnect.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -10,32 +9,4 @@ namespace NetHandlers bitbuf.ReadString(data->message, sizeof(data->message)); return !bitbuf.IsOverflowed(); } - - bool Net_Disconnect_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::Net_Disconnect* data) - { - bitbuf.WriteString(data->message); - return !bitbuf.IsOverflowed(); - } - - bool Net_Disconnect_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::Net_Disconnect* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - reader.ReadString("message", data->message, sizeof(data->message)); - return !reader.HasReadError(); - } - - bool Net_Disconnect_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_Disconnect* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteString("message", data->message); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void Net_Disconnect_ToString_Internal(std::ostringstream& out, NetMsg::Net_Disconnect* data) - { - // nothing - } } diff --git a/demboyz/netmessages/net_file.cpp b/demboyz/netmessages/net_file.cpp index 5863a5a..8f82d99 100644 --- a/demboyz/netmessages/net_file.cpp +++ b/demboyz/netmessages/net_file.cpp @@ -1,7 +1,6 @@ #include "net_file.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -12,38 +11,4 @@ namespace NetHandlers data->isRequest = bitbuf.ReadOneBit() != 0; return !bitbuf.IsOverflowed(); } - - bool Net_File_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::Net_File* data) - { - bitbuf.WriteUBitLong(data->transferID, 32); - bitbuf.WriteString(data->filename); - bitbuf.WriteOneBit(data->isRequest); - return !bitbuf.IsOverflowed(); - } - - bool Net_File_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::Net_File* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->transferID = reader.ReadUInt32("transferId"); - reader.ReadString("filename", data->filename, sizeof(data->filename)); - data->isRequest = reader.ReadBool("isRequest"); - return !reader.HasReadError(); - } - - bool Net_File_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_File* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("transferId", data->transferID); - jsonbuf.WriteString("filename", data->filename); - jsonbuf.WriteBool("isRequest", data->isRequest); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void Net_File_ToString_Internal(std::ostringstream& out, NetMsg::Net_File* data) - { - // nothing - } } diff --git a/demboyz/netmessages/net_nop.cpp b/demboyz/netmessages/net_nop.cpp index fabc98f..b7b8d8f 100644 --- a/demboyz/netmessages/net_nop.cpp +++ b/demboyz/netmessages/net_nop.cpp @@ -1,6 +1,5 @@ #include "net_nop.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -8,23 +7,4 @@ namespace NetHandlers { return true; } - - bool Net_NOP_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::Net_NOP* data) - { - return true; - } - - bool Net_NOP_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::Net_NOP* data) - { - return true; - } - - bool Net_NOP_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_NOP* data) - { - return true; - } - - void Net_NOP_ToString_Internal(std::ostringstream& out, NetMsg::Net_NOP* data) - { - } } diff --git a/demboyz/netmessages/net_setconvar.cpp b/demboyz/netmessages/net_setconvar.cpp index 9edc6e1..03c9fba 100644 --- a/demboyz/netmessages/net_setconvar.cpp +++ b/demboyz/netmessages/net_setconvar.cpp @@ -1,7 +1,6 @@ #include "net_setconvar.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -14,55 +13,8 @@ namespace NetHandlers { bitbuf.ReadString(cvar.name, sizeof(cvar.name)); bitbuf.ReadString(cvar.value, sizeof(cvar.value)); + //printf("%s -> %s\n", cvar.name, cvar.value); } return !bitbuf.IsOverflowed(); } - - bool Net_SetConVar_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::Net_SetConVar* data) - { - bitbuf.WriteByte(data->cvars.size()); - for (const cvar_t& cvar : data->cvars) - { - bitbuf.WriteString(cvar.name); - bitbuf.WriteString(cvar.value); - } - return !bitbuf.IsOverflowed(); - } - - bool Net_SetConVar_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::Net_SetConVar* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - - base::JsonReaderArray cvars = reader.ReadArray("cvars"); - cvars.TransformTo(data->cvars, [](base::JsonReaderObject& obj, cvar_t& cvar) - { - obj.ReadString("name", cvar.name, sizeof(cvar.name)); - obj.ReadString("value", cvar.value, sizeof(cvar.value)); - }); - return !reader.HasReadError(); - } - - bool Net_SetConVar_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_SetConVar* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.StartArray("cvars"); - for (const cvar_t& cvar : data->cvars) - { - jsonbuf.StartObject(); - jsonbuf.WriteString("name", cvar.name); - jsonbuf.WriteString("value", cvar.value); - jsonbuf.EndObject(); - } - jsonbuf.EndArray(); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void Net_SetConVar_ToString_Internal(std::ostringstream& out, NetMsg::Net_SetConVar* data) - { - cvar_t cvar = data->cvars[0]; - out << "net_SetConVar: " << data->cvars.size() << " cvars, \"" << cvar.name << "\"=\"" << cvar.value << '"'; - } } diff --git a/demboyz/netmessages/net_signonstate.cpp b/demboyz/netmessages/net_signonstate.cpp index 4080712..9c22fd1 100644 --- a/demboyz/netmessages/net_signonstate.cpp +++ b/demboyz/netmessages/net_signonstate.cpp @@ -1,7 +1,6 @@ #include "net_signonstate.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -12,36 +11,4 @@ namespace NetHandlers //assert(signonState >= SIGNONSTATE_NONE && signonState <= SIGNONSTATE_CHANGELEVEL); return !bitbuf.IsOverflowed(); } - - bool Net_SignonState_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::Net_SignonState* data) - { - bitbuf.WriteByte(data->signonState); - bitbuf.WriteLong(data->spawnCount); - return !bitbuf.IsOverflowed(); - } - - bool Net_SignonState_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::Net_SignonState* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->signonState = reader.ReadUInt32("signonState"); - data->spawnCount = reader.ReadUInt32("spawnCount"); - return !reader.HasReadError(); - } - - bool Net_SignonState_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_SignonState* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("signonState", data->signonState); - jsonbuf.WriteUInt32("spawnCount", data->spawnCount); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void Net_SignonState_ToString_Internal(std::ostringstream& out, NetMsg::Net_SignonState* data) - { - out << "net_SignonState: state " << static_cast(data->signonState) - << ", count " << data->spawnCount; - } } diff --git a/demboyz/netmessages/net_stringcmd.cpp b/demboyz/netmessages/net_stringcmd.cpp index d15d29f..1e4d47b 100644 --- a/demboyz/netmessages/net_stringcmd.cpp +++ b/demboyz/netmessages/net_stringcmd.cpp @@ -1,7 +1,6 @@ #include "net_stringcmd.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -10,32 +9,4 @@ namespace NetHandlers bitbuf.ReadString(data->command, sizeof(data->command)); return !bitbuf.IsOverflowed(); } - - bool Net_StringCmd_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::Net_StringCmd* data) - { - bitbuf.WriteString(data->command); - return !bitbuf.IsOverflowed(); - } - - bool Net_StringCmd_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::Net_StringCmd* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - reader.ReadString("command", data->command, sizeof(data->command)); - return !reader.HasReadError(); - } - - bool Net_StringCmd_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_StringCmd* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteString("command", data->command); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void Net_StringCmd_ToString_Internal(std::ostringstream& out, NetMsg::Net_StringCmd* data) - { - out << "net_StringCmd: \"" << data->command << '"'; - } } diff --git a/demboyz/netmessages/net_tick.cpp b/demboyz/netmessages/net_tick.cpp index 2ceb14c..7fde8d5 100644 --- a/demboyz/netmessages/net_tick.cpp +++ b/demboyz/netmessages/net_tick.cpp @@ -1,7 +1,6 @@ #include "net_tick.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -12,38 +11,4 @@ namespace NetHandlers data->hostFrameTimeStdDev = bitbuf.ReadUBitLong(16); return !bitbuf.IsOverflowed(); } - - bool Net_Tick_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::Net_Tick* data) - { - bitbuf.WriteUBitLong(data->tick, 32); - bitbuf.WriteUBitLong(data->hostFrameTime, 16); - bitbuf.WriteUBitLong(data->hostFrameTimeStdDev, 16); - return !bitbuf.IsOverflowed(); - } - - bool Net_Tick_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::Net_Tick* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->tick = reader.ReadInt32("tick"); - data->hostFrameTime = reader.ReadUInt32("hostFrameTime"); - data->hostFrameTimeStdDev = reader.ReadUInt32("hostFrameTimeStdDev"); - return !reader.HasReadError(); - } - - bool Net_Tick_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::Net_Tick* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteInt32("tick", data->tick); - jsonbuf.WriteUInt32("hostFrameTime", data->hostFrameTime); - jsonbuf.WriteUInt32("hostFrameTimeStdDev", data->hostFrameTimeStdDev); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void Net_Tick_ToString_Internal(std::ostringstream& out, NetMsg::Net_Tick* data) - { - out << "net_Tick: tick " << data->tick; - } } diff --git a/demboyz/netmessages/netcontants.h b/demboyz/netmessages/netcontants.h index d57db64..21dba81 100644 --- a/demboyz/netmessages/netcontants.h +++ b/demboyz/netmessages/netcontants.h @@ -49,5 +49,7 @@ enum constants SIGNONSTATE_FULL = 6, // we are fully connected, first non-delta packet received SIGNONSTATE_CHANGELEVEL = 7, // server is changing level, please wait - MAX_STRINGTABLE_DATA = 2 * 524288 // 2^19 + MAX_STRINGTABLE_DATA = 2 * 524288, // 2^19 + + NUM_NETWORKED_EHANDLE_SERIAL_NUMBER_BITS = 10 }; diff --git a/demboyz/netmessages/nethandlers.cpp b/demboyz/netmessages/nethandlers.cpp index 43c0251..d23f365 100644 --- a/demboyz/netmessages/nethandlers.cpp +++ b/demboyz/netmessages/nethandlers.cpp @@ -45,78 +45,78 @@ void NetHandlers::CreateNetMsgStructs(NetDataStructArray& netDataStructs) { - netDataStructs[0] = new NetMsg::Net_NOP(); - netDataStructs[1] = new NetMsg::Net_Disconnect(); - netDataStructs[2] = new NetMsg::Net_File(); - netDataStructs[3] = new NetMsg::Net_Tick(); - netDataStructs[4] = new NetMsg::Net_StringCmd(); - netDataStructs[5] = new NetMsg::Net_SetConVar(); - netDataStructs[6] = new NetMsg::Net_SignonState(); - netDataStructs[7] = new NetMsg::SVC_Print(); - netDataStructs[8] = new NetMsg::SVC_ServerInfo(); - netDataStructs[9] = new NetMsg::SVC_SendTable(); - netDataStructs[10] = new NetMsg::SVC_ClassInfo(); - netDataStructs[11] = new NetMsg::SVC_SetPause(); - netDataStructs[12] = new NetMsg::SVC_CreateStringTable(); - netDataStructs[13] = new NetMsg::SVC_UpdateStringTable(); - netDataStructs[14] = new NetMsg::SVC_VoiceInit(); - netDataStructs[15] = new NetMsg::SVC_VoiceData(); - netDataStructs[16] = new NetMsg::SVC_HLTV(); - netDataStructs[17] = new NetMsg::SVC_Sounds(); - netDataStructs[18] = new NetMsg::SVC_SetView(); - netDataStructs[19] = new NetMsg::SVC_FixAngle(); - netDataStructs[20] = new NetMsg::SVC_CrosshairAngle(); - netDataStructs[21] = new NetMsg::SVC_BSPDecal(); - netDataStructs[22] = new NetMsg::SVC_TerrainMod(); - netDataStructs[23] = new NetMsg::SVC_UserMessage(); - netDataStructs[24] = new NetMsg::SVC_EntityMessage(); - netDataStructs[25] = new NetMsg::SVC_GameEvent(); - netDataStructs[26] = new NetMsg::SVC_PacketEntities(); - netDataStructs[27] = new NetMsg::SVC_TempEntities(); - netDataStructs[28] = new NetMsg::SVC_Prefetch(); - netDataStructs[29] = new NetMsg::SVC_Menu(); - netDataStructs[30] = new NetMsg::SVC_GameEventList(); - netDataStructs[31] = new NetMsg::SVC_GetCvarValue(); - netDataStructs[32] = new NetMsg::SVC_CmdKeyValues(); - netDataStructs[33] = new NetMsg::SVC_SetPauseTimed(); + netDataStructs[NetMsg::net_NOP] = new NetMsg::Net_NOP(); + netDataStructs[NetMsg::net_Disconnect] = new NetMsg::Net_Disconnect(); + netDataStructs[NetMsg::net_File] = new NetMsg::Net_File(); + netDataStructs[NetMsg::net_Tick] = new NetMsg::Net_Tick(); + netDataStructs[NetMsg::net_StringCmd] = new NetMsg::Net_StringCmd(); + netDataStructs[NetMsg::net_SetConVar] = new NetMsg::Net_SetConVar(); + netDataStructs[NetMsg::net_SignonState] = new NetMsg::Net_SignonState(); + netDataStructs[NetMsg::svc_Print] = new NetMsg::SVC_Print(); + netDataStructs[NetMsg::svc_ServerInfo] = new NetMsg::SVC_ServerInfo(); + netDataStructs[NetMsg::svc_SendTable] = new NetMsg::SVC_SendTable(); + netDataStructs[NetMsg::svc_ClassInfo] = new NetMsg::SVC_ClassInfo(); + netDataStructs[NetMsg::svc_SetPause] = new NetMsg::SVC_SetPause(); + netDataStructs[NetMsg::svc_CreateStringTable] = new NetMsg::SVC_CreateStringTable(); + netDataStructs[NetMsg::svc_UpdateStringTable] = new NetMsg::SVC_UpdateStringTable(); + netDataStructs[NetMsg::svc_VoiceInit] = new NetMsg::SVC_VoiceInit(); + netDataStructs[NetMsg::svc_VoiceData] = new NetMsg::SVC_VoiceData(); + netDataStructs[NetMsg::svc_HLTV] = new NetMsg::SVC_HLTV(); + netDataStructs[NetMsg::svc_Sounds] = new NetMsg::SVC_Sounds(); + netDataStructs[NetMsg::svc_SetView] = new NetMsg::SVC_SetView(); + netDataStructs[NetMsg::svc_FixAngle] = new NetMsg::SVC_FixAngle(); + netDataStructs[NetMsg::svc_CrosshairAngle] = new NetMsg::SVC_CrosshairAngle(); + netDataStructs[NetMsg::svc_BSPDecal] = new NetMsg::SVC_BSPDecal(); + netDataStructs[NetMsg::svc_TerrainMod] = new NetMsg::SVC_TerrainMod(); + netDataStructs[NetMsg::svc_UserMessage] = new NetMsg::SVC_UserMessage(); + netDataStructs[NetMsg::svc_EntityMessage] = new NetMsg::SVC_EntityMessage(); + netDataStructs[NetMsg::svc_GameEvent] = new NetMsg::SVC_GameEvent(); + netDataStructs[NetMsg::svc_PacketEntities] = new NetMsg::SVC_PacketEntities(); + netDataStructs[NetMsg::svc_TempEntities] = new NetMsg::SVC_TempEntities(); + netDataStructs[NetMsg::svc_Prefetch] = new NetMsg::SVC_Prefetch(); + netDataStructs[NetMsg::svc_Menu] = new NetMsg::SVC_Menu(); + netDataStructs[NetMsg::svc_GameEventList] = new NetMsg::SVC_GameEventList(); + netDataStructs[NetMsg::svc_GetCvarValue] = new NetMsg::SVC_GetCvarValue(); + netDataStructs[NetMsg::svc_CmdKeyValues] = new NetMsg::SVC_CmdKeyValues(); + netDataStructs[NetMsg::svc_SetPauseTimed] = new NetMsg::SVC_SetPauseTimed(); } void NetHandlers::DestroyNetMsgStructs(NetDataStructArray& netDataStructs) { - delete reinterpret_cast(netDataStructs[0]); - delete reinterpret_cast(netDataStructs[1]); - delete reinterpret_cast(netDataStructs[2]); - delete reinterpret_cast(netDataStructs[3]); - delete reinterpret_cast(netDataStructs[4]); - delete reinterpret_cast(netDataStructs[5]); - delete reinterpret_cast(netDataStructs[6]); - delete reinterpret_cast(netDataStructs[7]); - delete reinterpret_cast(netDataStructs[8]); - delete reinterpret_cast(netDataStructs[9]); - delete reinterpret_cast(netDataStructs[10]); - delete reinterpret_cast(netDataStructs[11]); - delete reinterpret_cast(netDataStructs[12]); - delete reinterpret_cast(netDataStructs[13]); - delete reinterpret_cast(netDataStructs[14]); - delete reinterpret_cast(netDataStructs[15]); - delete reinterpret_cast(netDataStructs[16]); - delete reinterpret_cast(netDataStructs[17]); - delete reinterpret_cast(netDataStructs[18]); - delete reinterpret_cast(netDataStructs[19]); - delete reinterpret_cast(netDataStructs[20]); - delete reinterpret_cast(netDataStructs[21]); - delete reinterpret_cast(netDataStructs[22]); - delete reinterpret_cast(netDataStructs[23]); - delete reinterpret_cast(netDataStructs[24]); - delete reinterpret_cast(netDataStructs[25]); - delete reinterpret_cast(netDataStructs[26]); - delete reinterpret_cast(netDataStructs[27]); - delete reinterpret_cast(netDataStructs[28]); - delete reinterpret_cast(netDataStructs[29]); - delete reinterpret_cast(netDataStructs[30]); - delete reinterpret_cast(netDataStructs[31]); - delete reinterpret_cast(netDataStructs[32]); - delete reinterpret_cast(netDataStructs[33]); + delete reinterpret_cast(netDataStructs[NetMsg::net_NOP]); + delete reinterpret_cast(netDataStructs[NetMsg::net_Disconnect]); + delete reinterpret_cast(netDataStructs[NetMsg::net_File]); + delete reinterpret_cast(netDataStructs[NetMsg::net_Tick]); + delete reinterpret_cast(netDataStructs[NetMsg::net_StringCmd]); + delete reinterpret_cast(netDataStructs[NetMsg::net_SetConVar]); + delete reinterpret_cast(netDataStructs[NetMsg::net_SignonState]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_Print]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_ServerInfo]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_SendTable]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_ClassInfo]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_SetPause]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_CreateStringTable]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_UpdateStringTable]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_VoiceInit]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_VoiceData]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_HLTV]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_Sounds]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_SetView]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_FixAngle]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_CrosshairAngle]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_BSPDecal]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_TerrainMod]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_UserMessage]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_EntityMessage]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_GameEvent]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_PacketEntities]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_TempEntities]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_Prefetch]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_Menu]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_GameEventList]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_GetCvarValue]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_CmdKeyValues]); + delete reinterpret_cast(netDataStructs[NetMsg::svc_SetPauseTimed]); } #define DECLARE_NET_HANDLER_ARRAY(funcname) \ @@ -158,10 +158,6 @@ void NetHandlers::DestroyNetMsgStructs(NetDataStructArray& netDataStructs) } typedef bool (*NetMsgBitReadFn)(NetHandlers::BitRead& bitbuf, SourceGameContext& context, void* data); -typedef bool (*NetMsgBitWriteFn)(NetHandlers::BitWrite& bitbuf, const SourceGameContext& context, void* data); -typedef bool (*NetMsgJsonReadFn)(NetHandlers::JsonRead& jsonbuf, SourceGameContext& context, void* data); -typedef bool (*NetMsgJsonWriteFn)(NetHandlers::JsonWrite& jsonbuf, const SourceGameContext& context, void* data); -typedef void (*NetMsgToStringFn)(std::ostringstream& out, void* data); template bool NetMsgFuncRunner(const FnType (&netHandlers)[NumHandlers], uint32_t type, BufType& buf, ContextType& context, void* data) @@ -179,30 +175,3 @@ bool NetHandlers::NetMsg_BitRead(uint32_t type, BitRead& bitbuf, SourceGameConte return NetMsgFuncRunner(netHandlers, type, bitbuf, context, data); } -bool NetHandlers::NetMsg_BitWrite(uint32_t type, BitWrite& bitbuf, const SourceGameContext& context, void* data) -{ - static const NetMsgBitWriteFn netHandlers[] = DECLARE_NET_HANDLER_ARRAY(BitWrite); - return NetMsgFuncRunner(netHandlers, type, bitbuf, context, data); -} - -bool NetHandlers::NetMsg_JsonRead(uint32_t type, JsonRead& jsonbuf, SourceGameContext& context, void* data) -{ - static const NetMsgJsonReadFn netHandlers[] = DECLARE_NET_HANDLER_ARRAY(JsonRead); - return NetMsgFuncRunner(netHandlers, type, jsonbuf, context, data); -} - -bool NetHandlers::NetMsg_JsonWrite(uint32_t type, JsonWrite& jsonbuf, const SourceGameContext& context, void* data) -{ - static const NetMsgJsonWriteFn netHandlers[] = DECLARE_NET_HANDLER_ARRAY(JsonWrite); - return NetMsgFuncRunner(netHandlers, type, jsonbuf, context, data); -} - -void NetHandlers::NetMsg_ToString(uint32_t type, std::ostringstream& out, void* data) -{ - static const NetMsgToStringFn netHandlers[] = DECLARE_NET_HANDLER_ARRAY(ToString); - if (type >= (sizeof(netHandlers) / sizeof(NetMsgToStringFn))) - { - return; - } - netHandlers[type](out, data); -} diff --git a/demboyz/netmessages/nethandlers.h b/demboyz/netmessages/nethandlers.h index 6e63080..c067c82 100644 --- a/demboyz/netmessages/nethandlers.h +++ b/demboyz/netmessages/nethandlers.h @@ -6,23 +6,11 @@ #include #include "netmessages.h" -namespace base -{ - class JsonReaderFile; - class JsonWriterFile; - class BitFileRead; - class BitFileWrite; -} - class bf_read; -class bf_write; namespace NetHandlers { using BitRead = bf_read; - using BitWrite = bf_write; - using JsonRead = base::JsonReaderFile; - using JsonWrite = base::JsonWriterFile; } struct SourceGameContext; @@ -35,30 +23,10 @@ struct SourceGameContext; namespace NetHandlers \ { \ bool msgname##_BitRead_Internal(BitRead& bitbuf, SourceGameContext& context, NetMsg::msgname* data); \ - bool msgname##_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::msgname* data); \ - bool msgname##_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::msgname* data); \ - bool msgname##_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::msgname* data); \ - void msgname##_ToString_Internal(std::ostringstream& out, NetMsg::msgname* data); \ inline bool msgname##_BitRead(BitRead& bitbuf, SourceGameContext& context, void* data) \ { \ return msgname##_BitRead_Internal(bitbuf, context, reinterpret_cast(data)); \ } \ - inline bool msgname##_BitWrite(BitWrite& bitbuf, const SourceGameContext& context, void* data) \ - { \ - return msgname##_BitWrite_Internal(bitbuf, context, reinterpret_cast(data)); \ - } \ - inline bool msgname##_JsonRead(JsonRead& jsonbuf, SourceGameContext& context, void* data) \ - { \ - return msgname##_JsonRead_Internal(jsonbuf, context, reinterpret_cast(data)); \ - } \ - inline bool msgname##_JsonWrite(JsonWrite& jsonbuf, const SourceGameContext& context, void* data) \ - { \ - return msgname##_JsonWrite_Internal(jsonbuf, context, reinterpret_cast(data)); \ - } \ - inline void msgname##_ToString(std::ostringstream& out, void* data) \ - { \ - msgname##_ToString_Internal(out, reinterpret_cast(data)); \ - } \ } namespace NetHandlers @@ -68,8 +36,4 @@ namespace NetHandlers void DestroyNetMsgStructs(NetDataStructArray& netDataStructs); bool NetMsg_BitRead(uint32_t type, BitRead& bitbuf, SourceGameContext& context, void* data); - bool NetMsg_BitWrite(uint32_t type, BitWrite& bitbuf, const SourceGameContext& context, void* data); - bool NetMsg_JsonRead(uint32_t type, JsonRead& jsonbuf, SourceGameContext& context, void* data); - bool NetMsg_JsonWrite(uint32_t type, JsonWrite& jsonbuf, const SourceGameContext& context, void* data); - void NetMsg_ToString(uint32_t type, std::ostringstream& out, void* data); } diff --git a/demboyz/netmessages/netmath.cpp b/demboyz/netmessages/netmath.cpp new file mode 100644 index 0000000..abb6377 --- /dev/null +++ b/demboyz/netmessages/netmath.cpp @@ -0,0 +1,18 @@ + +#include "netmath.h" + +namespace math +{ + uint32_t log2(uint32_t value) + { + uint32_t res = 0; + while (value >>= 1) + ++res; + return res; + } + + uint32_t BitsToBytes(uint32_t bits) + { + return ((bits + 7) >> 3); + } +} diff --git a/demboyz/netmessages/netmath.h b/demboyz/netmessages/netmath.h index 95356b3..5804bce 100644 --- a/demboyz/netmessages/netmath.h +++ b/demboyz/netmessages/netmath.h @@ -1,20 +1,11 @@ #pragma once -#include +#include namespace math { - static size_t log2(size_t value) - { - size_t res = 0; - while (value >>= 1) - ++res; - return res; - } + uint32_t log2(uint32_t value); - static size_t BitsToBytes(size_t bits) - { - return ((bits + 7) >> 3); - } + uint32_t BitsToBytes(uint32_t bits); } diff --git a/demboyz/netmessages/netmessages.h b/demboyz/netmessages/netmessages.h index 1c1ee1b..6c131f7 100644 --- a/demboyz/netmessages/netmessages.h +++ b/demboyz/netmessages/netmessages.h @@ -31,7 +31,7 @@ namespace NetMsg svc_VoiceInit = 14, // inits used voice codecs & quality svc_VoiceData = 15, // Voicestream data from the server - //svc_HLTV = 16, // HLTV control messages + svc_HLTV = 16, // HLTV control messages svc_Sounds = 17, // starts playing sound @@ -42,10 +42,10 @@ namespace NetMsg svc_BSPDecal = 21, // add a static decal to the world BSP // NOTE: This is now unused! - // svc_TerrainMod = 22, // modification to the terrain/displacement + svc_TerrainMod = 22, // modification to the terrain/displacement // Message from server side to client side entity - svc_UserMessage = 23, // a game specific message + svc_UserMessage = 23, // a game specific message svc_EntityMessage = 24, // a message for an entity svc_GameEvent = 25, // global game event fired diff --git a/demboyz/netmessages/svc_bspdecal.cpp b/demboyz/netmessages/svc_bspdecal.cpp index d3434b8..55f18d3 100644 --- a/demboyz/netmessages/svc_bspdecal.cpp +++ b/demboyz/netmessages/svc_bspdecal.cpp @@ -1,8 +1,6 @@ #include "svc_bspdecal.h" #include "base/bitfile.h" -#include "base/jsonfile.h" -#include "demofile/demojson.h" #include "netcontants.h" namespace NetHandlers @@ -24,55 +22,4 @@ namespace NetHandlers data->lowPriority = bitbuf.ReadOneBit() != 0; return !bitbuf.IsOverflowed(); } - - bool SVC_BSPDecal_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_BSPDecal* data) - { - bitbuf.WriteBitVec3Coord(data->position); - bitbuf.WriteUBitLong(data->decalTextureIndex, MAX_DECAL_INDEX_BITS); - if (data->entIndex != 0) - { - bitbuf.WriteOneBit(1); - bitbuf.WriteUBitLong(data->entIndex, MAX_EDICT_BITS); - bitbuf.WriteUBitLong(data->modelIndex, SP_MODEL_INDEX_BITS); - } - else - { - bitbuf.WriteOneBit(0); - } - bitbuf.WriteOneBit(data->lowPriority); - return !bitbuf.IsOverflowed(); - } - - bool SVC_BSPDecal_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_BSPDecal* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - DemoJsonReader::ReadVector(reader, "position", data->position); - data->decalTextureIndex = reader.ReadUInt32("decalTextureIndex"); - data->entIndex = reader.ReadUInt32("entIndex"); - data->modelIndex = reader.ReadUInt32("modelIndex"); - data->lowPriority = reader.ReadBool("lowPriority"); - return !reader.HasReadError(); - } - - bool SVC_BSPDecal_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_BSPDecal* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - DemoJsonWriter::WriteVector(jsonbuf, "position", data->position); - jsonbuf.WriteUInt32("decalTextureIndex", data->decalTextureIndex); - jsonbuf.WriteUInt32("entIndex", data->entIndex); - jsonbuf.WriteUInt32("modelIndex", data->modelIndex); - jsonbuf.WriteBool("lowPriority", data->lowPriority); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_BSPDecal_ToString_Internal(std::ostringstream& out, NetMsg::SVC_BSPDecal* data) - { - out << "svc_BSPDecal: tex " << data->decalTextureIndex - << ", ent " << data->entIndex - << ", mod " << data->modelIndex - << " lowpriority " << data->lowPriority; - } } diff --git a/demboyz/netmessages/svc_classinfo.cpp b/demboyz/netmessages/svc_classinfo.cpp index 34489f6..eea1296 100644 --- a/demboyz/netmessages/svc_classinfo.cpp +++ b/demboyz/netmessages/svc_classinfo.cpp @@ -1,7 +1,6 @@ #include "svc_classinfo.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "netmath.h" using class_t = NetMsg::SVC_ClassInfo::class_t; @@ -27,67 +26,4 @@ namespace NetHandlers } return !bitbuf.IsOverflowed(); } - - bool SVC_ClassInfo_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_ClassInfo* data) - { - bitbuf.WriteShort(data->numServerClasses); - bitbuf.WriteOneBit(data->createOnClient); - if (!data->createOnClient) - { - const int numServerClassBits = math::log2(data->numServerClasses) + 1; - for (class_t& serverClass : data->serverClasses) - { - bitbuf.WriteUBitLong(serverClass.classID, numServerClassBits); - bitbuf.WriteString(serverClass.className); - bitbuf.WriteString(serverClass.dataTableName); - } - } - return !bitbuf.IsOverflowed(); - } - - bool SVC_ClassInfo_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_ClassInfo* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->numServerClasses = reader.ReadInt32("numServerClasses"); - data->createOnClient = reader.ReadBool("createOnClient"); - if (!data->createOnClient) - { - base::JsonReaderArray serverClasses = reader.ReadArray("serverClasses"); - serverClasses.TransformTo(data->serverClasses, [](base::JsonReaderObject& obj, class_t& serverClass) - { - serverClass.classID = obj.ReadUInt32("classId"); - obj.ReadString("className", serverClass.className, sizeof(serverClass.className)); - obj.ReadString("dataTableName", serverClass.dataTableName, sizeof(serverClass.dataTableName)); - }); - } - return !reader.HasReadError(); - } - - bool SVC_ClassInfo_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_ClassInfo* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteInt32("numServerClasses", data->numServerClasses); - jsonbuf.WriteBool("createOnClient", data->createOnClient); - if (!data->createOnClient) - { - jsonbuf.StartArray("serverClasses"); - for (class_t& serverClass : data->serverClasses) - { - jsonbuf.WriteUInt32("classId", serverClass.classID); - jsonbuf.WriteString("className", serverClass.className); - jsonbuf.WriteString("dataTableName", serverClass.dataTableName); - } - jsonbuf.EndArray(); - } - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_ClassInfo_ToString_Internal(std::ostringstream& out, NetMsg::SVC_ClassInfo* data) - { - out << "svc_ClassInfo: num " << data->numServerClasses - << ", " << (data->createOnClient ? "use client classes" : "full update"); - } } diff --git a/demboyz/netmessages/svc_cmdkeyvalues.cpp b/demboyz/netmessages/svc_cmdkeyvalues.cpp index 7e2e5fa..d393406 100644 --- a/demboyz/netmessages/svc_cmdkeyvalues.cpp +++ b/demboyz/netmessages/svc_cmdkeyvalues.cpp @@ -1,7 +1,6 @@ #include "svc_cmdkeyvalues.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -11,28 +10,4 @@ namespace NetHandlers assert(false); return true; } - - bool SVC_CmdKeyValues_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_CmdKeyValues* data) - { - assert(false); - return true; - } - - bool SVC_CmdKeyValues_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_CmdKeyValues* data) - { - assert(false); - return true; - } - - bool SVC_CmdKeyValues_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_CmdKeyValues* data) - { - assert(false); - return true; - } - - void SVC_CmdKeyValues_ToString_Internal(std::ostringstream& out, NetMsg::SVC_CmdKeyValues* data) - { - assert(false); - out << "svc_CmdKeyValues"; - } } diff --git a/demboyz/netmessages/svc_createstringtable.cpp b/demboyz/netmessages/svc_createstringtable.cpp index fd18c4a..0f0c9f6 100644 --- a/demboyz/netmessages/svc_createstringtable.cpp +++ b/demboyz/netmessages/svc_createstringtable.cpp @@ -1,94 +1,14 @@ #include "svc_createstringtable.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "game/sourcecontext.h" +#include "game/stringtables.h" #include "netmath.h" #include "netcontants.h" -// #define WIP_STRINGTABLE - -#ifdef WIP_STRINGTABLE #include "sourcesdk/common.h" #include -#define SUBSTRING_BITS 5 -struct StringHistoryEntry -{ - char string[(1 << SUBSTRING_BITS)]; -}; - -static void StringTable_BitRead(NetHandlers::BitRead& bitbuf, SourceGameContext& context, NetMsg::SVC_CreateStringTable* data) -{ - const size_t numEncodeBits = math::log2(data->maxEntries); - std::vector history; - int entryIndex = -1; - for (uint i = 0; i < data->numEntries; ++i) - { - entryIndex++; - - if (bitbuf.ReadOneBit() == 0) - { - entryIndex = bitbuf.ReadUBitLong(numEncodeBits); - } - - const char *pEntry = NULL; - char entry[1024]; - char substr[1024]; - if (bitbuf.ReadOneBit() != 0) - { - bool substringcheck = bitbuf.ReadOneBit() != 0; - if (substringcheck) - { - int index = bitbuf.ReadUBitLong(5); - int bytestocopy = bitbuf.ReadUBitLong(SUBSTRING_BITS); - strncpy(entry, history.at(index).string, bytestocopy + 1); - entry[bytestocopy + 1] = '\0'; - bitbuf.ReadString(substr, sizeof(substr)); - strncat(entry, substr, sizeof(entry)); - } - else - { - bitbuf.ReadString(entry, sizeof(entry)); - } - pEntry = entry; - printf("%s\n", pEntry); - } - const int MAX_USERDATA_BITS = 14; - unsigned char tempbuf[(1 << MAX_USERDATA_BITS)] = { 0 }; - const void *pUserData = NULL; - if (bitbuf.ReadOneBit() != 0) - { - if (data->isUserDataFixedSize) - { - bitbuf.ReadBits(tempbuf, data->userDataSizeBits); - } - else - { - int nBytes = bitbuf.ReadUBitLong(MAX_USERDATA_BITS); - bitbuf.ReadBytes(tempbuf, nBytes); - } - pUserData = tempbuf; - } - - if (pEntry == NULL) - { - pEntry = ""; - } - - if (history.size() > 31) - { - history.erase(history.begin()); - } - - StringHistoryEntry she; - strncpy(she.string, pEntry, sizeof(she.string)); - history.emplace_back(she); - } -} - -#endif // WIP_STRINGTABLE - namespace NetHandlers { bool SVC_CreateStringTable_BitRead_Internal(BitRead& bitbuf, SourceGameContext& context, NetMsg::SVC_CreateStringTable* data) @@ -105,21 +25,18 @@ namespace NetHandlers bitbuf.ReadString(data->tableName, sizeof(data->tableName)); data->maxEntries = bitbuf.ReadWord(); - const size_t numEncodeBits = math::log2(data->maxEntries); + const uint32_t numEncodeBits = math::log2(data->maxEntries); data->numEntries = bitbuf.ReadUBitLong(numEncodeBits + 1); - size_t dataLengthInBits; if (context.protocol > 23) { - dataLengthInBits = bitbuf.ReadVarInt32(); - data->dataLengthInBits = dataLengthInBits; + data->dataLengthInBits = bitbuf.ReadVarInt32(); } else { - dataLengthInBits = bitbuf.ReadUBitLong(NET_MAX_PAYLOAD_BITS_OLD + 3); - data->dataLengthInBits = dataLengthInBits; + data->dataLengthInBits = bitbuf.ReadUBitLong(NET_MAX_PAYLOAD_BITS_OLD + 3); } - const size_t dataLengthInBytes = math::BitsToBytes(dataLengthInBits); + const uint32_t dataLengthInBytes = math::BitsToBytes(data->dataLengthInBits); data->isUserDataFixedSize = bitbuf.ReadOneBit() != 0; if (data->isUserDataFixedSize) @@ -136,13 +53,24 @@ namespace NetHandlers { data->compressedData = bitbuf.ReadOneBit() != 0; } - data->data.reset(new uint8_t[dataLengthInBytes]); - bitbuf.ReadBits(data->data.get(), dataLengthInBits); + else + { + data->compressedData = false; + } + + data->data.reset(new uint8_t[dataLengthInBytes]); + bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); + + StringTable *table = context.stringTables->GetStringTable(data->tableName, true); + table->maxEntries = data->maxEntries; + table->isUserDataFixedSize = data->isUserDataFixedSize; + table->userDataSize = data->userDataSize; + table->userDataSizeBits = data->userDataSizeBits; + table->entryBits = math::log2(table->maxEntries); -#ifdef WIP_STRINGTABLE if (data->compressedData) { - bf_read bitbuf2(data->data.get(), dataLengthInBytes, dataLengthInBits); + bf_read bitbuf2(data->data.get(), dataLengthInBytes, data->dataLengthInBits); const uint32_t decompressedNumBytes = bitbuf2.ReadUBitLong(32); const uint32_t compressedNumBytes = bitbuf2.ReadUBitLong(32); std::unique_ptr compressedData(new uint8[compressedNumBytes]); @@ -150,98 +78,16 @@ namespace NetHandlers bitbuf2.ReadBytes(compressedData.get(), compressedNumBytes); uint32_t numWritten = COM_BufferToBufferDecompress(uncompressedData.get(), decompressedNumBytes, compressedData.get(), compressedNumBytes); + assert(numWritten == decompressedNumBytes); bitbuf2 = bf_read(uncompressedData.get(), decompressedNumBytes); - StringTable_BitRead(bitbuf2, context, data); + table->ParseUpdate(bitbuf2, data->numEntries, context); } - else + else if(dataLengthInBytes) { - bf_read bitbuf2(data->data.get(), dataLengthInBytes, dataLengthInBits); - StringTable_BitRead(bitbuf2, context, data); + bf_read bitbuf2(data->data.get(), dataLengthInBytes, data->dataLengthInBits); + table->ParseUpdate(bitbuf2, data->numEntries, context); } -#endif // WIP_STRINGTABLE return !bitbuf.IsOverflowed(); } - - bool SVC_CreateStringTable_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_CreateStringTable* data) - { - if (data->isFileNames) - { - bitbuf.WriteByte(':'); - } - bitbuf.WriteString(data->tableName); - bitbuf.WriteWord(data->maxEntries); - bitbuf.WriteUBitLong(data->numEntries, math::log2(data->maxEntries) + 1); - if (context.protocol > 23) - { - bitbuf.WriteVarInt32(data->dataLengthInBits); - } - else - { - bitbuf.WriteUBitLong(data->dataLengthInBits, NET_MAX_PAYLOAD_BITS_OLD + 3); - } - bitbuf.WriteOneBit(data->isUserDataFixedSize); - if (data->isUserDataFixedSize) - { - bitbuf.WriteUBitLong(data->userDataSize, 12); - bitbuf.WriteUBitLong(data->userDataSizeBits, 4); - } - if (context.protocol > 14) - { - bitbuf.WriteOneBit(data->compressedData); - } - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_CreateStringTable_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_CreateStringTable* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->isFileNames = reader.ReadBool("isFilenames"); - reader.ReadString("tableName", data->tableName, sizeof(data->tableName)); - data->maxEntries = reader.ReadUInt32("maxEntries"); - data->numEntries = reader.ReadUInt32("numEntries"); - data->dataLengthInBits = reader.ReadInt32("dataLengthInBits"); - data->isUserDataFixedSize = reader.ReadBool("isUserDataFixedSize"); - data->userDataSize = reader.ReadUInt32("userDataSize"); - data->userDataSizeBits = reader.ReadUInt32("userDataSizeBits"); - if (context.protocol > 14) - { - data->compressedData = reader.ReadBool("compressedData"); - } - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_CreateStringTable_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_CreateStringTable* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteBool("isFilenames", data->isFileNames); - jsonbuf.WriteString("tableName", data->tableName); - jsonbuf.WriteUInt32("maxEntries", data->maxEntries); - jsonbuf.WriteUInt32("numEntries", data->numEntries); - jsonbuf.WriteInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBool("isUserDataFixedSize", data->isUserDataFixedSize); - jsonbuf.WriteUInt32("userDataSize", data->userDataSize); - jsonbuf.WriteUInt32("userDataSizeBits", data->userDataSizeBits); - if (context.protocol > 14) - { - jsonbuf.WriteBool("compressedData", data->compressedData); - } - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_CreateStringTable_ToString_Internal(std::ostringstream& out, NetMsg::SVC_CreateStringTable* data) - { - out << "svc_CreateStringTable: table " << data->tableName - << ", entries " << data->numEntries - << ", bytes " << math::BitsToBytes(data->dataLengthInBits) - << " userdatasize " << data->userDataSize - << " userdatabits " << static_cast(data->userDataSizeBits); - } } diff --git a/demboyz/netmessages/svc_crosshairangle.cpp b/demboyz/netmessages/svc_crosshairangle.cpp index cfd7fa6..3191737 100644 --- a/demboyz/netmessages/svc_crosshairangle.cpp +++ b/demboyz/netmessages/svc_crosshairangle.cpp @@ -1,9 +1,6 @@ #include "svc_crosshairangle.h" #include "base/bitfile.h" -#include "base/jsonfile.h" -#include "demofile/demojson.h" -#include namespace NetHandlers { @@ -14,41 +11,4 @@ namespace NetHandlers data->angle.z = bitbuf.ReadBitAngle(16); return !bitbuf.IsOverflowed(); } - - bool SVC_CrosshairAngle_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_CrosshairAngle* data) - { - bitbuf.WriteBitAngle(data->angle.x, 16); - bitbuf.WriteBitAngle(data->angle.y, 16); - bitbuf.WriteBitAngle(data->angle.z, 16); - return !bitbuf.IsOverflowed(); - } - - bool SVC_CrosshairAngle_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_CrosshairAngle* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - DemoJsonReader::ReadAngle(reader, "angle", data->angle); - return !reader.HasReadError(); - } - - bool SVC_CrosshairAngle_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_CrosshairAngle* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - DemoJsonWriter::WriteAngle(jsonbuf, "angle", data->angle); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_CrosshairAngle_ToString_Internal(std::ostringstream& out, NetMsg::SVC_CrosshairAngle* data) - { - const std::streamsize oldPrecision = out.precision(); - out << "svc_CrosshairAngle:" - << std::setprecision(1) << std::fixed - << " (" << data->angle.x - << " " << data->angle.y - << " " << data->angle.z << ")" - << std::setprecision(oldPrecision); - out.unsetf(std::ios_base::floatfield); - } } diff --git a/demboyz/netmessages/svc_entitymessage.cpp b/demboyz/netmessages/svc_entitymessage.cpp index 125ed4b..85935d2 100644 --- a/demboyz/netmessages/svc_entitymessage.cpp +++ b/demboyz/netmessages/svc_entitymessage.cpp @@ -1,7 +1,6 @@ #include "svc_entitymessage.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "netcontants.h" #include "netmath.h" @@ -16,44 +15,4 @@ namespace NetHandlers bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); return !bitbuf.IsOverflowed(); } - - bool SVC_EntityMessage_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_EntityMessage* data) - { - bitbuf.WriteUBitLong(data->entIndex, MAX_EDICT_BITS); - bitbuf.WriteUBitLong(data->classID, MAX_SERVER_CLASS_BITS); - bitbuf.WriteUBitLong(data->dataLengthInBits, 11); - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_EntityMessage_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_EntityMessage* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->entIndex = reader.ReadUInt32("entIndex"); - data->classID = reader.ReadUInt32("classId"); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_EntityMessage_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_EntityMessage* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("entIndex", data->entIndex); - jsonbuf.WriteUInt32("classId", data->classID); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_EntityMessage_ToString_Internal(std::ostringstream& out, NetMsg::SVC_EntityMessage* data) - { - out << "svc_EntityMessage: entity " << data->entIndex - << ", class " << data->classID - << ", bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_fixangle.cpp b/demboyz/netmessages/svc_fixangle.cpp index d033e5a..b4ca1e6 100644 --- a/demboyz/netmessages/svc_fixangle.cpp +++ b/demboyz/netmessages/svc_fixangle.cpp @@ -1,9 +1,6 @@ #include "svc_fixangle.h" #include "base/bitfile.h" -#include "base/jsonfile.h" -#include "demofile/demojson.h" -#include namespace NetHandlers { @@ -15,44 +12,4 @@ namespace NetHandlers data->angle.z = bitbuf.ReadBitAngle(16); return !bitbuf.IsOverflowed(); } - - bool SVC_FixAngle_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_FixAngle* data) - { - bitbuf.WriteOneBit(data->relative); - bitbuf.WriteBitAngle(data->angle.x, 16); - bitbuf.WriteBitAngle(data->angle.y, 16); - bitbuf.WriteBitAngle(data->angle.z, 16); - return !bitbuf.IsOverflowed(); - } - - bool SVC_FixAngle_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_FixAngle* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->relative = reader.ReadBool("relative"); - DemoJsonReader::ReadAngle(reader, "angle", data->angle); - return !reader.HasReadError(); - } - - bool SVC_FixAngle_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_FixAngle* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteBool("relative", data->relative); - DemoJsonWriter::WriteAngle(jsonbuf, "angle", data->angle); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_FixAngle_ToString_Internal(std::ostringstream& out, NetMsg::SVC_FixAngle* data) - { - const std::streamsize oldPrecision = out.precision(); - out << "svc_FixAngle: " << (data->relative ? "relative" : "absolute") - << std::setprecision(1) << std::fixed - << " " << data->angle.x - << " " << data->angle.y - << " " << data->angle.z - << std::setprecision(oldPrecision); - out.unsetf(std::ios_base::floatfield); - } } diff --git a/demboyz/netmessages/svc_gameevent.cpp b/demboyz/netmessages/svc_gameevent.cpp index 50fd9f7..212db57 100644 --- a/demboyz/netmessages/svc_gameevent.cpp +++ b/demboyz/netmessages/svc_gameevent.cpp @@ -1,13 +1,10 @@ #include "svc_gameevent.h" #include "base/bitfile.h" -#include "base/jsonfile.h" +#include "game/sourcecontext.h" #include "netcontants.h" #include "netmath.h" - -#ifdef WIP_GAMEEVENTS #include "svc_gameeventlist.h" -#endif namespace NetHandlers { @@ -20,49 +17,12 @@ namespace NetHandlers data->data.reset(new uint8_t[numBytes]); bitbuf.ReadBits(data->data.get(), numBits); -#ifdef WIP_GAMEEVENTS - { - BitRead bitbuf2(data->data.get(), numBytes, numBits); - const size_t id = bitbuf2.ReadUBitLong(9); - //std::vector stringMem; - //GameEvents::ParseEventData(bitbuf2, context.gameEventList->eventDescriptors[id], stringMem); - GameEvents::PrintEventData(bitbuf2, context.gameEventList->eventDescriptors[id]); - printf("%i\n", id); - } -#endif // WIP_GAMEEVENTS + BitRead bitbuf2(data->data.get(), numBytes, numBits); + const size_t id = bitbuf2.ReadUBitLong(9); + GameEvents::EventDataMap eventData = GameEvents::ParseEventData(bitbuf2, context.gameEventList->eventDescriptors[id]); + + context.OnGameEvent(context.gameEventList->eventDescriptors[id].name, eventData); return !bitbuf.IsOverflowed(); } - - bool SVC_GameEvent_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_GameEvent* data) - { - bitbuf.WriteUBitLong(data->dataLengthInBits, 11); - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_GameEvent_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_GameEvent* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_GameEvent_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_GameEvent* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_GameEvent_ToString_Internal(std::ostringstream& out, NetMsg::SVC_GameEvent* data) - { - out << "svc_GameEvent: bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_gameeventlist.cpp b/demboyz/netmessages/svc_gameeventlist.cpp index 37856bc..85a035a 100644 --- a/demboyz/netmessages/svc_gameeventlist.cpp +++ b/demboyz/netmessages/svc_gameeventlist.cpp @@ -1,7 +1,6 @@ #include "svc_gameeventlist.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "game/sourcecontext.h" #include "netcontants.h" #include "netmath.h" @@ -47,84 +46,11 @@ namespace NetHandlers event.values.shrink_to_fit(); } -#ifdef WIP_GAMEEVENTS if (!context.gameEventList) { context.gameEventList = new NetMsg::SVC_GameEventList(*data); } -#endif + return !bitbuf.IsOverflowed(); } - - bool SVC_GameEventList_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_GameEventList* data) - { - bitbuf.WriteUBitLong(data->eventDescriptors.size(), MAX_EVENT_BITS); - bitbuf.WriteUBitLong(data->dataLengthInBits, 20); - assert(data->dataLengthInBits == CalculateNumDataBits(data->eventDescriptors)); - for (EventDescriptor& event : data->eventDescriptors) - { - bitbuf.WriteUBitLong(event.id, MAX_EVENT_BITS); - bitbuf.WriteString(event.name); - for (EventValue& value : event.values) - { - bitbuf.WriteUBitLong(value.type, 3); - bitbuf.WriteString(value.name); - } - bitbuf.WriteUBitLong(0, 3); - } - return !bitbuf.IsOverflowed(); - } - - bool SVC_GameEventList_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_GameEventList* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - - base::JsonReaderArray eventDescriptors = reader.ReadArray("eventDescriptors"); - eventDescriptors.TransformTo(data->eventDescriptors, [](base::JsonReaderObject& obj, EventDescriptor& event) - { - event.id = obj.ReadUInt32("id"); - obj.ReadString("name", event.name, sizeof(event.name)); - base::JsonReaderArray values = obj.ReadArray("values"); - values.TransformTo(event.values, [](base::JsonReaderObject& obj, EventValue& value) - { - value.type = static_cast(obj.ReadUInt32("type")); - obj.ReadString("name", value.name, sizeof(value.name)); - }); - }); - data->dataLengthInBits = CalculateNumDataBits(data->eventDescriptors); - return !reader.HasReadError(); - } - - bool SVC_GameEventList_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_GameEventList* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.StartArray("eventDescriptors"); - for (const EventDescriptor& event : data->eventDescriptors) - { - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("id", event.id); - jsonbuf.WriteString("name", event.name); - jsonbuf.StartArray("values"); - for (const EventValue& value : event.values) - { - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("type", value.type); - jsonbuf.WriteString("name", value.name); - jsonbuf.EndObject(); - } - jsonbuf.EndArray(); - jsonbuf.EndObject(); - } - jsonbuf.EndArray(); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_GameEventList_ToString_Internal(std::ostringstream& out, NetMsg::SVC_GameEventList* data) - { - out << "svc_GameEventList: number " << data->eventDescriptors.size() - << ", bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_getcvarvalue.cpp b/demboyz/netmessages/svc_getcvarvalue.cpp index e9defe1..641e779 100644 --- a/demboyz/netmessages/svc_getcvarvalue.cpp +++ b/demboyz/netmessages/svc_getcvarvalue.cpp @@ -1,7 +1,6 @@ #include "svc_getcvarvalue.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -11,36 +10,4 @@ namespace NetHandlers bitbuf.ReadString(data->cvarName, sizeof(data->cvarName)); return !bitbuf.IsOverflowed(); } - - bool SVC_GetCvarValue_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_GetCvarValue* data) - { - bitbuf.WriteSBitLong(data->cookie, 32); - bitbuf.WriteString(data->cvarName); - return !bitbuf.IsOverflowed(); - } - - bool SVC_GetCvarValue_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_GetCvarValue* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->cookie = reader.ReadInt32("cookie"); - reader.ReadString("cvarName", data->cvarName, sizeof(data->cvarName)); - return !reader.HasReadError(); - } - - bool SVC_GetCvarValue_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_GetCvarValue* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteInt32("cookie", data->cookie); - jsonbuf.WriteString("cvarName", data->cvarName); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_GetCvarValue_ToString_Internal(std::ostringstream& out, NetMsg::SVC_GetCvarValue* data) - { - out << "svc_GetCvarValue: cvar: " << data->cvarName - << ", cookie: " << data->cookie; - } } diff --git a/demboyz/netmessages/svc_hltv.cpp b/demboyz/netmessages/svc_hltv.cpp index f9aec64..6cd986d 100644 --- a/demboyz/netmessages/svc_hltv.cpp +++ b/demboyz/netmessages/svc_hltv.cpp @@ -9,27 +9,4 @@ namespace NetHandlers assert(false); return true; } - - bool SVC_HLTV_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_HLTV* data) - { - assert(false); - return true; - } - - bool SVC_HLTV_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_HLTV* data) - { - assert(false); - return true; - } - - bool SVC_HLTV_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_HLTV* data) - { - assert(false); - return true; - } - - void SVC_HLTV_ToString_Internal(std::ostringstream& out, NetMsg::SVC_HLTV* data) - { - out << "svc_HLTV"; - } } diff --git a/demboyz/netmessages/svc_menu.cpp b/demboyz/netmessages/svc_menu.cpp index e8f710b..ccc651b 100644 --- a/demboyz/netmessages/svc_menu.cpp +++ b/demboyz/netmessages/svc_menu.cpp @@ -1,21 +1,9 @@ #include "svc_menu.h" #include "base/bitfile.h" -#include "base/jsonfile.h" using DialogType = NetMsg::SVC_Menu::DialogType; -#define KEYVALUES_TOKEN_SIZE 1024 - -static const char* KeyValuesBin_GetName(uint8_t* data, size_t dataLength) -{ - if (dataLength <= 2) - { - return nullptr; - } - return reinterpret_cast(data + 1); -} - namespace NetHandlers { bool SVC_Menu_BitRead_Internal(BitRead& bitbuf, SourceGameContext& context, NetMsg::SVC_Menu* data) @@ -26,44 +14,4 @@ namespace NetHandlers bitbuf.ReadBytes(data->menuBinaryKeyValues.get(), data->dataLengthInBytes); return !bitbuf.IsOverflowed(); } - - bool SVC_Menu_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_Menu* data) - { - bitbuf.WriteShort(static_cast(data->type)); - bitbuf.WriteWord(data->dataLengthInBytes); - bitbuf.WriteBytes(data->menuBinaryKeyValues.get(), data->dataLengthInBytes); - return !bitbuf.IsOverflowed(); - } - - bool SVC_Menu_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_Menu* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->type = static_cast(reader.ReadInt32("dialogType")); - data->dataLengthInBytes = reader.ReadUInt32("dataLengthInBytes"); - data->menuBinaryKeyValues.reset(new uint8_t[data->dataLengthInBytes]); - reader.ReadBytes("data", data->menuBinaryKeyValues.get(), data->dataLengthInBytes); - return !reader.HasReadError(); - } - - bool SVC_Menu_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_Menu* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteInt32("dialogType", static_cast(data->type)); - jsonbuf.WriteUInt32("dataLengthInBytes", data->dataLengthInBytes); - jsonbuf.WriteBytes("data", data->menuBinaryKeyValues.get(), data->dataLengthInBytes); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_Menu_ToString_Internal(std::ostringstream& out, NetMsg::SVC_Menu* data) - { - // binary keyvalues in form [type][name][value] - // [char][cstr][type] - const char* name = KeyValuesBin_GetName(data->menuBinaryKeyValues.get(), data->dataLengthInBytes); - out << "svc_Menu: " << static_cast(data->type) - << " \"" << (name ? name : "No KeyValues") - << "\" (len:" << data->dataLengthInBytes << ")"; - } } diff --git a/demboyz/netmessages/svc_packetentities.cpp b/demboyz/netmessages/svc_packetentities.cpp index 5ec02e2..c92b08a 100644 --- a/demboyz/netmessages/svc_packetentities.cpp +++ b/demboyz/netmessages/svc_packetentities.cpp @@ -1,7 +1,6 @@ #include "svc_packetentities.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "netcontants.h" #include "netmath.h" @@ -25,67 +24,35 @@ namespace NetHandlers data->updateBaseline = bitbuf.ReadOneBit() != 0; data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_PacketEntities_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_PacketEntities* data) - { - bitbuf.WriteUBitLong(data->maxEntries, MAX_EDICT_BITS); - if (data->isDelta) +/* + int last_index = -1; + for (int i = 0; i < data->numUpdatedEntries; i++) { - bitbuf.WriteOneBit(1); - bitbuf.WriteLong(data->deltaFromTick); + last_index += 1 + bitbuf.ReadUBitVar(); + + int pvs = bitbuf.ReadUBitLong(2); + printf("%d - %d\n", last_index, pvs); + switch(pvs) + { + case 0: // delta + { + + } break; + case 2: // enter PVS + { + int iClass = bitbuf.ReadUBitLong(MAX_SERVER_CLASS_BITS); + int serial = bitbuf.ReadUBitLong(NUM_NETWORKED_EHANDLE_SERIAL_NUMBER_BITS); + printf("\t%d - %d\n", iClass, serial); + } break; + case 1: // leave PVS + case 3: // delete + { + + } break; + } + } - else - { - bitbuf.WriteOneBit(0); - } - bitbuf.WriteUBitLong(data->baselineIndex, 1); - bitbuf.WriteUBitLong(data->numUpdatedEntries, MAX_EDICT_BITS); - bitbuf.WriteUBitLong(data->dataLengthInBits, DELTASIZE_BITS); - bitbuf.WriteOneBit(data->updateBaseline); - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); +*/ return !bitbuf.IsOverflowed(); } - - bool SVC_PacketEntities_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_PacketEntities* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->maxEntries = reader.ReadInt32("maxEntries"); - data->isDelta = reader.ReadBool("isDelta"); - data->deltaFromTick = reader.ReadInt32("deltaFromTick"); - data->baselineIndex = reader.ReadUInt32("baselineIndex"); - data->numUpdatedEntries = reader.ReadUInt32("numUpdatedEntries"); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->updateBaseline = reader.ReadBool("updateBaseline"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_PacketEntities_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_PacketEntities* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteInt32("maxEntries", data->maxEntries); - jsonbuf.WriteBool("isDelta", data->isDelta); - jsonbuf.WriteInt32("deltaFromTick", data->deltaFromTick); - jsonbuf.WriteUInt32("baselineIndex", data->baselineIndex); - jsonbuf.WriteUInt32("numUpdatedEntries", data->numUpdatedEntries); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBool("updateBaseline", data->updateBaseline); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_PacketEntities_ToString_Internal(std::ostringstream& out, NetMsg::SVC_PacketEntities* data) - { - out << "svc_PacketEntities: delta " << data->deltaFromTick - << ", max " << data->maxEntries - << ", changed " << data->numUpdatedEntries - << "," << (data->updateBaseline ? " BL update," : "") - << " bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_prefetch.cpp b/demboyz/netmessages/svc_prefetch.cpp index 995303f..aa48d7c 100644 --- a/demboyz/netmessages/svc_prefetch.cpp +++ b/demboyz/netmessages/svc_prefetch.cpp @@ -1,7 +1,6 @@ #include "svc_prefetch.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "game/sourcecontext.h" #include "netcontants.h" @@ -20,42 +19,4 @@ namespace NetHandlers } return !bitbuf.IsOverflowed(); } - - bool SVC_Prefetch_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_Prefetch* data) - { - if (context.protocol > 23) - { - bitbuf.WriteUBitLong(data->soundIndex, MAX_SOUND_INDEX_BITS); - } - else - { - bitbuf.WriteUBitLong(data->soundIndex, MAX_SOUND_INDEX_BITS_OLD); - } - return !bitbuf.IsOverflowed(); - } - - bool SVC_Prefetch_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_Prefetch* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->type = reader.ReadUInt32("type"); - data->soundIndex = reader.ReadUInt32("soundIndex"); - return !reader.HasReadError(); - } - - bool SVC_Prefetch_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_Prefetch* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject();; - jsonbuf.WriteUInt32("type", data->type); - jsonbuf.WriteUInt32("soundIndex", data->soundIndex); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_Prefetch_ToString_Internal(std::ostringstream& out, NetMsg::SVC_Prefetch* data) - { - out << "svc_Prefetch: type " << data->type - << " index " << data->soundIndex; - } } diff --git a/demboyz/netmessages/svc_print.cpp b/demboyz/netmessages/svc_print.cpp index fadb0de..040c7b5 100644 --- a/demboyz/netmessages/svc_print.cpp +++ b/demboyz/netmessages/svc_print.cpp @@ -1,7 +1,6 @@ #include "svc_print.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -10,32 +9,4 @@ namespace NetHandlers bitbuf.ReadString(data->text, sizeof(data->text)); return !bitbuf.IsOverflowed(); } - - bool SVC_Print_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_Print* data) - { - bitbuf.WriteString(data->text); - return !bitbuf.IsOverflowed(); - } - - bool SVC_Print_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_Print* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - reader.ReadString("text", data->text, sizeof(data->text)); - return !reader.HasReadError(); - } - - bool SVC_Print_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_Print* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteString("text", data->text); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_Print_ToString_Internal(std::ostringstream& out, NetMsg::SVC_Print* data) - { - out << "svc_Print: \"" << data->text << '"'; - } } diff --git a/demboyz/netmessages/svc_sendtable.cpp b/demboyz/netmessages/svc_sendtable.cpp index e431cc9..f67a34a 100644 --- a/demboyz/netmessages/svc_sendtable.cpp +++ b/demboyz/netmessages/svc_sendtable.cpp @@ -1,7 +1,6 @@ #include "svc_sendtable.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "netmath.h" namespace NetHandlers @@ -14,40 +13,4 @@ namespace NetHandlers bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); return !bitbuf.IsOverflowed(); } - - bool SVC_SendTable_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_SendTable* data) - { - bitbuf.WriteOneBit(data->needsDecoder); - bitbuf.WriteShort(data->dataLengthInBits); - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_SendTable_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_SendTable* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->needsDecoder = reader.ReadBool("needsDecoder"); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_SendTable_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_SendTable* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteBool("needsDecoder", data->needsDecoder); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_SendTable_ToString_Internal(std::ostringstream& out, NetMsg::SVC_SendTable* data) - { - out << "svc_SendTable: needs Decoder " << (data->needsDecoder ? "yes" : "no") - << ",bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_serverinfo.cpp b/demboyz/netmessages/svc_serverinfo.cpp index 4fe81b1..a06933b 100644 --- a/demboyz/netmessages/svc_serverinfo.cpp +++ b/demboyz/netmessages/svc_serverinfo.cpp @@ -1,7 +1,6 @@ #include "svc_serverinfo.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "game/sourcecontext.h" namespace NetHandlers @@ -20,7 +19,7 @@ namespace NetHandlers } else { - bitbuf.ReadBytes(data->unk1, sizeof(data->unk1)); + bitbuf.ReadBytes(data->mapMD5, sizeof(data->mapMD5)); } data->playerSlot = bitbuf.ReadByte(); data->maxClients = bitbuf.ReadByte(); @@ -32,113 +31,8 @@ namespace NetHandlers bitbuf.ReadString(data->hostName, sizeof(data->hostName)); if (context.protocol > 15) { - data->unk2 = bitbuf.ReadOneBit() != 0; + data->isReplay = bitbuf.ReadOneBit() != 0; } return !bitbuf.IsOverflowed(); } - - bool SVC_ServerInfo_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_ServerInfo* data) - { - bitbuf.WriteShort(data->protocol); - bitbuf.WriteLong(data->serverCount); - bitbuf.WriteOneBit(data->isHLTV); - bitbuf.WriteOneBit(data->isDedicated); - bitbuf.WriteLong(data->clientCRC); - bitbuf.WriteWord(data->maxClasses); - if (context.protocol <= 17) - { - bitbuf.WriteLong(data->mapCRC); - } - else - { - bitbuf.WriteBytes(data->unk1, sizeof(data->unk1)); - } - bitbuf.WriteByte(data->playerSlot); - bitbuf.WriteByte(data->maxClients); - bitbuf.WriteFloat(data->tickInterval); - bitbuf.WriteChar(data->os); - bitbuf.WriteString(data->gameDir); - bitbuf.WriteString(data->mapName); - bitbuf.WriteString(data->skyName); - bitbuf.WriteString(data->hostName); - if (context.protocol > 15) - { - bitbuf.WriteOneBit(data->unk2); - } - return !bitbuf.IsOverflowed(); - } - - bool SVC_ServerInfo_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_ServerInfo* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->protocol = reader.ReadInt32("protocol"); - data->serverCount = reader.ReadUInt32("serverCount"); - data->isHLTV = reader.ReadBool("isHltv"); - data->isDedicated = reader.ReadBool("isDedicated"); - data->clientCRC = reader.ReadUInt32("clientCrc"); - data->maxClasses = reader.ReadUInt32("maxClasses"); - if (context.protocol <= 17) - { - data->mapCRC = reader.ReadUInt32("mapCRC"); - } - else - { - reader.ReadBytes("unk1", data->unk1, sizeof(data->unk1)); - } - data->playerSlot = reader.ReadUInt32("playerSlot"); - data->maxClients = reader.ReadUInt32("maxClients"); - data->tickInterval = reader.ReadFloat("tickInterval"); - data->os = reader.ReadChar("os"); - reader.ReadString("gameDir", data->gameDir, sizeof(data->gameDir)); - reader.ReadString("mapName", data->mapName, sizeof(data->mapName)); - reader.ReadString("skyName", data->skyName, sizeof(data->skyName)); - reader.ReadString("hostName", data->hostName, sizeof(data->hostName)); - if (context.protocol > 15) - { - data->unk2 = reader.ReadBool("unk2"); - } - return !reader.HasReadError(); - } - - bool SVC_ServerInfo_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_ServerInfo* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteInt32("protocol", data->protocol); - jsonbuf.WriteUInt32("serverCount", data->serverCount); - jsonbuf.WriteBool("isHltv", data->isHLTV); - jsonbuf.WriteBool("isDedicated", data->isDedicated); - jsonbuf.WriteUInt32("clientCrc", data->clientCRC); - jsonbuf.WriteUInt32("maxClasses", data->maxClasses); - if (context.protocol <= 17) - { - jsonbuf.WriteUInt32("mapCRC", data->mapCRC); - } - else - { - jsonbuf.WriteBytes("unk1", data->unk1, sizeof(data->unk1)); - } - jsonbuf.WriteUInt32("playerSlot", data->playerSlot); - jsonbuf.WriteUInt32("maxClients", data->maxClients); - jsonbuf.WriteFloat("tickInterval", data->tickInterval); - jsonbuf.WriteChar("os", data->os); - jsonbuf.WriteString("gameDir", data->gameDir); - jsonbuf.WriteString("mapName", data->mapName); - jsonbuf.WriteString("skyName", data->skyName); - jsonbuf.WriteString("hostName", data->hostName); - if (context.protocol > 15) - { - jsonbuf.WriteBool("unk2", data->unk2); - } - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_ServerInfo_ToString_Internal(std::ostringstream& out, NetMsg::SVC_ServerInfo* data) - { - out << "svc_ServerInfo: game \"" << data->gameDir - << "\", map \"" << data->mapName - << "\", max " << static_cast(data->maxClients); - } } diff --git a/demboyz/netmessages/svc_serverinfo.h b/demboyz/netmessages/svc_serverinfo.h index 632933d..c1c7c62 100644 --- a/demboyz/netmessages/svc_serverinfo.h +++ b/demboyz/netmessages/svc_serverinfo.h @@ -14,7 +14,7 @@ namespace NetMsg uint32_t clientCRC; // client.dll CRC server is using uint16_t maxClasses; // max number of server classes uint32_t mapCRC; // server map CRC - uint8_t unk1[16]; + uint8_t mapMD5[16]; uint8_t playerSlot; // our client slot number uint8_t maxClients; // max number of clients on server float tickInterval; // server tick interval @@ -23,7 +23,7 @@ namespace NetMsg char mapName[MAX_OSPATH]; // name of current map char skyName[MAX_OSPATH]; // name of current skybox char hostName[MAX_OSPATH]; // host name - bool unk2; + bool isReplay; }; } diff --git a/demboyz/netmessages/svc_setpause.cpp b/demboyz/netmessages/svc_setpause.cpp index b3f1d74..450a2fd 100644 --- a/demboyz/netmessages/svc_setpause.cpp +++ b/demboyz/netmessages/svc_setpause.cpp @@ -1,7 +1,6 @@ #include "svc_setpause.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -10,32 +9,4 @@ namespace NetHandlers data->isPaused = bitbuf.ReadOneBit() != 0; return !bitbuf.IsOverflowed(); } - - bool SVC_SetPause_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_SetPause* data) - { - bitbuf.WriteOneBit(data->isPaused); - return !bitbuf.IsOverflowed(); - } - - bool SVC_SetPause_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_SetPause* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->isPaused = reader.ReadBool("isPaused"); - return !reader.HasReadError(); - } - - bool SVC_SetPause_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_SetPause* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteBool("isPaused", data->isPaused); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_SetPause_ToString_Internal(std::ostringstream& out, NetMsg::SVC_SetPause* data) - { - out << "svc_SetPause: " << (data->isPaused ? "paused" : "unpaused"); - } } diff --git a/demboyz/netmessages/svc_setpausetimed.cpp b/demboyz/netmessages/svc_setpausetimed.cpp index 5da2e68..2fa5846 100644 --- a/demboyz/netmessages/svc_setpausetimed.cpp +++ b/demboyz/netmessages/svc_setpausetimed.cpp @@ -1,7 +1,6 @@ #include "svc_setpausetimed.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -11,35 +10,4 @@ namespace NetHandlers data->time = bitbuf.ReadFloat(); return !bitbuf.IsOverflowed(); } - - bool SVC_SetPauseTimed_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_SetPauseTimed* data) - { - bitbuf.WriteOneBit(data->isPaused); - bitbuf.WriteFloat(data->time); - return !bitbuf.IsOverflowed(); - } - - bool SVC_SetPauseTimed_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_SetPauseTimed* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->isPaused = reader.ReadBool("isPaused"); - data->time = reader.ReadFloat("time"); - return !reader.HasReadError(); - } - - bool SVC_SetPauseTimed_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_SetPauseTimed* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteBool("isPaused", data->isPaused); - jsonbuf.WriteFloat("time", data->time); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_SetPauseTimed_ToString_Internal(std::ostringstream& out, NetMsg::SVC_SetPauseTimed* data) - { - out << "svc_SetPauseTimed: " << (data->isPaused ? "paused" : "unpaused"); - } } diff --git a/demboyz/netmessages/svc_setview.cpp b/demboyz/netmessages/svc_setview.cpp index 7b1de45..531ce1f 100644 --- a/demboyz/netmessages/svc_setview.cpp +++ b/demboyz/netmessages/svc_setview.cpp @@ -1,7 +1,6 @@ #include "svc_setview.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "netcontants.h" namespace NetHandlers @@ -11,32 +10,4 @@ namespace NetHandlers data->entIndex = bitbuf.ReadUBitLong(MAX_EDICT_BITS); return !bitbuf.IsOverflowed(); } - - bool SVC_SetView_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_SetView* data) - { - bitbuf.WriteUBitLong(data->entIndex, MAX_EDICT_BITS); - return !bitbuf.IsOverflowed(); - } - - bool SVC_SetView_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_SetView* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->entIndex = reader.ReadUInt32("entIndex"); - return !reader.HasReadError(); - } - - bool SVC_SetView_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_SetView* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("entIndex", data->entIndex); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_SetView_ToString_Internal(std::ostringstream& out, NetMsg::SVC_SetView* data) - { - out << "svc_SetView: view entity " << data->entIndex; - } } diff --git a/demboyz/netmessages/svc_sounds.cpp b/demboyz/netmessages/svc_sounds.cpp index 669c114..8a87f26 100644 --- a/demboyz/netmessages/svc_sounds.cpp +++ b/demboyz/netmessages/svc_sounds.cpp @@ -1,7 +1,6 @@ #include "svc_sounds.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "netmath.h" namespace NetHandlers @@ -23,52 +22,4 @@ namespace NetHandlers bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); return !bitbuf.IsOverflowed(); } - - bool SVC_Sounds_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_Sounds* data) - { - if (data->reliableSound) - { - bitbuf.WriteOneBit(1); - bitbuf.WriteUBitLong(data->dataLengthInBits, 8); - } - else - { - bitbuf.WriteOneBit(0); - bitbuf.WriteUBitLong(data->numSounds, 8); - bitbuf.WriteUBitLong(data->dataLengthInBits, 16); - } - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_Sounds_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_Sounds* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->reliableSound = reader.ReadBool("reliableSound"); - data->numSounds = reader.ReadUInt32("numSounds"); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_Sounds_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_Sounds* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteBool("reliableSound", data->reliableSound); - jsonbuf.WriteUInt32("numSounds", data->numSounds); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_Sounds_ToString_Internal(std::ostringstream& out, NetMsg::SVC_Sounds* data) - { - out << "svc_Sounds: number " << static_cast(data->numSounds) - << (data->reliableSound ? ", reliable" : "") - << ", bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_tempentities.cpp b/demboyz/netmessages/svc_tempentities.cpp index cef52a7..6e26062 100644 --- a/demboyz/netmessages/svc_tempentities.cpp +++ b/demboyz/netmessages/svc_tempentities.cpp @@ -1,7 +1,6 @@ #include "svc_tempentities.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "game/sourcecontext.h" #include "netcontants.h" #include "netmath.h" @@ -23,47 +22,4 @@ namespace NetHandlers bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); return !bitbuf.IsOverflowed(); } - - bool SVC_TempEntities_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_TempEntities* data) - { - bitbuf.WriteUBitLong(data->numEntries, EVENT_INDEX_BITS); - if (context.protocol > 23) - { - bitbuf.WriteVarInt32(data->dataLengthInBits); - } - else - { - bitbuf.WriteUBitLong(data->dataLengthInBits, NET_MAX_PAYLOAD_BITS_OLD); - } - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_TempEntities_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_TempEntities* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->numEntries = reader.ReadUInt32("numEntries"); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_TempEntities_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_TempEntities* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("numEntries", data->numEntries); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_TempEntities_ToString_Internal(std::ostringstream& out, NetMsg::SVC_TempEntities* data) - { - out << "svc_TempEntities: number " << data->numEntries - << ", bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_terrainmod.cpp b/demboyz/netmessages/svc_terrainmod.cpp index 21fcc38..88d1895 100644 --- a/demboyz/netmessages/svc_terrainmod.cpp +++ b/demboyz/netmessages/svc_terrainmod.cpp @@ -9,27 +9,4 @@ namespace NetHandlers assert(false); return true; } - - bool SVC_TerrainMod_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_TerrainMod* data) - { - assert(false); - return true; - } - - bool SVC_TerrainMod_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_TerrainMod* data) - { - assert(false); - return true; - } - - bool SVC_TerrainMod_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_TerrainMod* data) - { - assert(false); - return true; - } - - void SVC_TerrainMod_ToString_Internal(std::ostringstream& out, NetMsg::SVC_TerrainMod* data) - { - out << "svc_TerrainMod"; - } } diff --git a/demboyz/netmessages/svc_updatestringtable.cpp b/demboyz/netmessages/svc_updatestringtable.cpp index 144e2fe..7ffa0be 100644 --- a/demboyz/netmessages/svc_updatestringtable.cpp +++ b/demboyz/netmessages/svc_updatestringtable.cpp @@ -1,7 +1,8 @@ #include "svc_updatestringtable.h" #include "base/bitfile.h" -#include "base/jsonfile.h" +#include "game/sourcecontext.h" +#include "game/stringtables.h" #include "netmath.h" #include "netcontants.h" @@ -14,54 +15,11 @@ namespace NetHandlers data->dataLengthInBits = bitbuf.ReadUBitLong(20); data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); + + StringTable *table = &context.stringTables->tables[data->tableID]; + bf_read bitbuf2(data->data.get(), math::BitsToBytes(data->dataLengthInBits), data->dataLengthInBits); + table->ParseUpdate(bitbuf2, data->numChangedEntries, context); + return !bitbuf.IsOverflowed(); } - - bool SVC_UpdateStringTable_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_UpdateStringTable* data) - { - bitbuf.WriteUBitLong(data->tableID, math::log2(MAX_TABLES)); - if (data->numChangedEntries != 1) - { - bitbuf.WriteOneBit(1); - bitbuf.WriteWord(data->numChangedEntries); - } - else - { - bitbuf.WriteOneBit(0); - } - bitbuf.WriteUBitLong(data->dataLengthInBits, 20); - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_UpdateStringTable_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_UpdateStringTable* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->tableID = reader.ReadUInt32("tableId"); - data->numChangedEntries = reader.ReadUInt32("numChangedEntries"); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_UpdateStringTable_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_UpdateStringTable* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("tableId", data->tableID); - jsonbuf.WriteUInt32("numChangedEntries", data->numChangedEntries); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_UpdateStringTable_ToString_Internal(std::ostringstream& out, NetMsg::SVC_UpdateStringTable* data) - { - out << "svc_UpdateStringTable: table " << data->tableID - << ", changed " << data->numChangedEntries - << ", bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_usermessage.cpp b/demboyz/netmessages/svc_usermessage.cpp index 5f5e276..4f4f118 100644 --- a/demboyz/netmessages/svc_usermessage.cpp +++ b/demboyz/netmessages/svc_usermessage.cpp @@ -1,7 +1,6 @@ #include "svc_usermessage.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "netmath.h" #include "netcontants.h" #include @@ -17,40 +16,4 @@ namespace NetHandlers bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); return !bitbuf.IsOverflowed(); } - - bool SVC_UserMessage_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_UserMessage* data) - { - bitbuf.WriteByte(data->msgType); - bitbuf.WriteUBitLong(data->dataLengthInBits, 11); - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_UserMessage_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_UserMessage* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->msgType = reader.ReadUInt32("msgType"); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_UserMessage_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_UserMessage* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("msgType", data->msgType); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_UserMessage_ToString_Internal(std::ostringstream& out, NetMsg::SVC_UserMessage* data) - { - out << "svc_UserMessage: type " << static_cast(data->msgType) - << ", bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_voicedata.cpp b/demboyz/netmessages/svc_voicedata.cpp index b9114e4..ecd80b6 100644 --- a/demboyz/netmessages/svc_voicedata.cpp +++ b/demboyz/netmessages/svc_voicedata.cpp @@ -1,7 +1,7 @@ #include "svc_voicedata.h" +#include "svc_voiceinit.h" #include "base/bitfile.h" -#include "base/jsonfile.h" #include "netmath.h" namespace NetHandlers @@ -15,43 +15,4 @@ namespace NetHandlers bitbuf.ReadBits(data->data.get(), data->dataLengthInBits); return !bitbuf.IsOverflowed(); } - - bool SVC_VoiceData_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_VoiceData* data) - { - bitbuf.WriteByte(data->fromClientIndex); - bitbuf.WriteByte(data->proximity); - bitbuf.WriteWord(data->dataLengthInBits); - bitbuf.WriteBits(data->data.get(), data->dataLengthInBits); - return !bitbuf.IsOverflowed(); - } - - bool SVC_VoiceData_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_VoiceData* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - data->fromClientIndex = reader.ReadUInt32("fromClientIndex"); - data->proximity = reader.ReadBool("proximity"); - data->dataLengthInBits = reader.ReadUInt32("dataLengthInBits"); - data->data.reset(new uint8_t[math::BitsToBytes(data->dataLengthInBits)]); - reader.ReadBits("data", data->data.get(), data->dataLengthInBits); - return !reader.HasReadError(); - } - - bool SVC_VoiceData_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_VoiceData* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteUInt32("fromClientIndex", data->fromClientIndex); - jsonbuf.WriteBool("proximity", data->proximity); - jsonbuf.WriteUInt32("dataLengthInBits", data->dataLengthInBits); - jsonbuf.WriteBits("data", data->data.get(), data->dataLengthInBits); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_VoiceData_ToString_Internal(std::ostringstream& out, NetMsg::SVC_VoiceData* data) - { - out << "svc_VoiceData: client " << static_cast(data->fromClientIndex) - << ", bytes " << math::BitsToBytes(data->dataLengthInBits); - } } diff --git a/demboyz/netmessages/svc_voiceinit.cpp b/demboyz/netmessages/svc_voiceinit.cpp index 95fd0b9..b85e97b 100644 --- a/demboyz/netmessages/svc_voiceinit.cpp +++ b/demboyz/netmessages/svc_voiceinit.cpp @@ -1,7 +1,6 @@ #include "svc_voiceinit.h" #include "base/bitfile.h" -#include "base/jsonfile.h" namespace NetHandlers { @@ -20,49 +19,4 @@ namespace NetHandlers } return !bitbuf.IsOverflowed(); } - - bool SVC_VoiceInit_BitWrite_Internal(BitWrite& bitbuf, const SourceGameContext& context, NetMsg::SVC_VoiceInit* data) - { - bitbuf.WriteString(data->voiceCodec); - bitbuf.WriteByte(data->quality); - if(data->quality == NetMsg::SVC_VoiceInit::QUALITY_HAS_SAMPLE_RATE) - { - bitbuf.WriteShort(data->sampleRate); - } - return !bitbuf.IsOverflowed(); - } - - bool SVC_VoiceInit_JsonRead_Internal(JsonRead& jsonbuf, SourceGameContext& context, NetMsg::SVC_VoiceInit* data) - { - base::JsonReaderObject reader = jsonbuf.ParseObject(); - assert(!reader.HasReadError()); - reader.ReadString("voiceCodec", data->voiceCodec, sizeof(data->voiceCodec)); - data->quality = reader.ReadUInt32("quality"); - data->sampleRate = reader.ReadInt32("sampleRate"); - return !reader.HasReadError(); - } - - bool SVC_VoiceInit_JsonWrite_Internal(JsonWrite& jsonbuf, const SourceGameContext& context, NetMsg::SVC_VoiceInit* data) - { - jsonbuf.Reset(); - jsonbuf.StartObject(); - jsonbuf.WriteString("voiceCodec", data->voiceCodec); - jsonbuf.WriteUInt32("quality", data->quality); - jsonbuf.WriteInt32("sampleRate", data->sampleRate); - jsonbuf.EndObject(); - return jsonbuf.IsComplete(); - } - - void SVC_VoiceInit_ToString_Internal(std::ostringstream& out, NetMsg::SVC_VoiceInit* data) - { - out << "svc_VoiceInit: codec \"" << data->voiceCodec; - if(data->quality == NetMsg::SVC_VoiceInit::QUALITY_HAS_SAMPLE_RATE) - { - out << "\", sample rate " << static_cast(data->sampleRate); - } - else - { - out << "\", qualitty " << static_cast(data->quality); - } - } } diff --git a/demboyz/netmessages/usermessages.h b/demboyz/netmessages/usermessages.h new file mode 100644 index 0000000..73c3dae --- /dev/null +++ b/demboyz/netmessages/usermessages.h @@ -0,0 +1,56 @@ + +#pragma once + +namespace UserMsg +{ + enum + { + Geiger = 0, + Train = 1, + HudText = 2, + SayText = 3, + SayText2 = 4, + TextMsg = 5, + HudMsg = 6, + ResetHUD = 7, + GameTitle = 8, + ItemPickup = 9, + ShowMenu = 10, + Shake = 11, + Fade = 12, + VGUIMenu = 13, + Rumble = 14, + CloseCaption = 15, + SendAudio = 16, + RawAudio = 17, + VoiceMask = 18, + RequestState = 19, + BarTime = 20, + Damage = 21, + RadioText = 22, + HintText = 23, + KeyHintText = 24, + ReloadEffect = 25, + PlayerAnimEvent = 26, + AmmoDenied = 27, + UpdateRadar = 28, + KillCam = 29, + MarkAchievement = 30, + CallVoteFailed = 31, + VoteStart = 32, + VotePass = 33, + VoteFailed = 34, + VoteSetup = 35, + SPHapWeapEvent = 36, + HapDmg = 37, + HapPunch = 38, + HapSetDrag = 39, + HapSetConst = 40, + HapMeleeContact = 41, + PlayerStatsUpdate_DEPRECATED = 42, + AchievementEvent = 43, + MatchEndConditions = 44, + MatchStatsUpdate = 45, + PlayerStatsUpdate = 46 + }; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/Makefile b/external/SILK_SDK_SRC_FLP_v1.0.9/Makefile new file mode 100755 index 0000000..ccdd3f7 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/Makefile @@ -0,0 +1,98 @@ +# +# Makefile for Silk SDK +# +# Copyright (c) 2012, Skype Limited +# All rights reserved. +# + +#Platform detection and settings + +BUILD_OS := $(shell uname | sed -e 's/^.*Darwin.*/MacOS-X/ ; s/^.*CYGWIN.*/Windows/') +BUILD_ARCHITECTURE := $(shell uname -m | sed -e 's/i686/i386/') + +EXESUFFIX = +LIBPREFIX = lib +LIBSUFFIX = .a +OBJSUFFIX = .o + +CC = $(TOOLCHAIN_PREFIX)gcc$(TOOLCHAIN_SUFFIX) +AR = $(TOOLCHAIN_PREFIX)ar +RANLIB = $(TOOLCHAIN_PREFIX)ranlib +CP = $(TOOLCHAIN_PREFIX)cp + +cflags-from-defines = $(addprefix -D,$(1)) +cflags-from-includes = $(addprefix -I,$(1)) +ldflags-from-ldlibdirs = $(addprefix -L,$(1)) +ldlibs-from-libs = $(addprefix -l,$(1)) + +CFLAGS += -Wall -enable-threads -O3 + +CFLAGS += $(call cflags-from-defines,$(CDEFINES)) +CFLAGS += $(call cflags-from-defines,$(ADDED_DEFINES)) +CFLAGS += $(call cflags-from-includes,$(CINCLUDES)) +LDFLAGS += $(call ldflags-from-ldlibdirs,$(LDLIBDIRS)) +LDLIBS += $(call ldlibs-from-libs,$(LIBS)) + +COMPILE.c.cmdline = $(CC) -c $(CFLAGS) -o $@ $< +LINK.o.cmdline = $(LINK.o) $^ $(LDLIBS) -lm -o $@$(EXESUFFIX) +ARCHIVE.cmdline = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@ + +%$(OBJSUFFIX):%.c + $(COMPILE.c.cmdline) + +# Directives + +CINCLUDES += interface src test + +# VPATH e.g. VPATH = src:../headers +VPATH = ./ \ + interface \ + src \ + test + +# Variable definitions +LIB_NAME = SKP_SILK_SDK +TARGET = $(LIBPREFIX)$(LIB_NAME)$(LIBSUFFIX) + +SRCS_C = $(wildcard src/*.c) + +OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C)) + +ENCODER_SRCS_C = test/Encoder.c +ENCODER_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(ENCODER_SRCS_C)) + +DECODER_SRCS_C = test/Decoder.c +DECODER_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(DECODER_SRCS_C)) + +SIGNALCMP_SRCS_C = test/signalCompare.c +SIGNALCMP_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SIGNALCMP_SRCS_C)) + +LIBS = \ + $(LIB_NAME) + +LDLIBDIRS = ./ + +# Rules +default: all + +all: $(TARGET) encoder decoder signalcompare + +lib: $(TARGET) + +$(TARGET): $(OBJS) + $(ARCHIVE.cmdline) + +encoder$(EXESUFFIX): $(ENCODER_OBJS) + $(LINK.o.cmdline) + +decoder$(EXESUFFIX): $(DECODER_OBJS) + $(LINK.o.cmdline) + +signalcompare$(EXESUFFIX): $(SIGNALCMP_OBJS) + $(LINK.o.cmdline) + +clean: + $(RM) $(TARGET)* $(OBJS) $(ENCODER_OBJS) $(DECODER_OBJS) \ + $(SIGNALCMP_OBJS) $(TEST_OBJS) \ + encoder$(EXESUFFIX) decoder$(EXESUFFIX) signalcompare$(EXESUFFIX) + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/Silk_SDK.sln b/external/SILK_SDK_SRC_FLP_v1.0.9/Silk_SDK.sln new file mode 100755 index 0000000..fd887d7 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/Silk_SDK.sln @@ -0,0 +1,56 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dec_SDK", "test\Dec_SDK.vcxproj", "{82685D7F-0589-42BD-877C-31A952D53A8E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Enc_SDK", "test\Enc_SDK.vcxproj", "{6D97A8EF-5724-4D85-8BF4-C583714BBA78}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Silk_FLP", "src\Silk_FLP.vcxproj", "{56B91D01-9150-4BBF-AFA1-5B68AB991B76}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SignalCompare", "test\SignalCompare.vcxproj", "{7FE8F544-9175-40C3-A187-7F15CE9A75D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {82685D7F-0589-42BD-877C-31A952D53A8E}.Debug|Win32.ActiveCfg = Debug|Win32 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Debug|Win32.Build.0 = Debug|Win32 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Debug|x64.ActiveCfg = Debug|x64 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Debug|x64.Build.0 = Debug|x64 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Release|Win32.ActiveCfg = Release|Win32 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Release|Win32.Build.0 = Release|Win32 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Release|x64.ActiveCfg = Release|x64 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Release|x64.Build.0 = Release|x64 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Debug|Win32.ActiveCfg = Debug|Win32 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Debug|Win32.Build.0 = Debug|Win32 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Debug|x64.ActiveCfg = Debug|x64 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Debug|x64.Build.0 = Debug|x64 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Release|Win32.ActiveCfg = Release|Win32 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Release|Win32.Build.0 = Release|Win32 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Release|x64.ActiveCfg = Release|x64 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Release|x64.Build.0 = Release|x64 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.ActiveCfg = Debug|Win32 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.Build.0 = Debug|Win32 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|x64.ActiveCfg = Debug|x64 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|x64.Build.0 = Debug|x64 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.ActiveCfg = Release|Win32 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.Build.0 = Release|Win32 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|x64.ActiveCfg = Release|x64 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|x64.Build.0 = Release|x64 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Debug|Win32.Build.0 = Debug|Win32 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Debug|x64.ActiveCfg = Debug|x64 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Debug|x64.Build.0 = Debug|x64 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Release|Win32.ActiveCfg = Release|Win32 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Release|Win32.Build.0 = Release|Win32 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Release|x64.ActiveCfg = Release|x64 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/Silk_SDK_VS2005.sln b/external/SILK_SDK_SRC_FLP_v1.0.9/Silk_SDK_VS2005.sln new file mode 100755 index 0000000..b982e0e --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/Silk_SDK_VS2005.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dec_SDK", "test\Dec_SDK.vcproj", "{82685D7F-0589-42BD-877C-31A952D53A8E}" + ProjectSection(ProjectDependencies) = postProject + {56B91D01-9150-4BBF-AFA1-5B68AB991B76} = {56B91D01-9150-4BBF-AFA1-5B68AB991B76} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Enc_SDK", "test\Enc_SDK.vcproj", "{6D97A8EF-5724-4D85-8BF4-C583714BBA78}" + ProjectSection(ProjectDependencies) = postProject + {56B91D01-9150-4BBF-AFA1-5B68AB991B76} = {56B91D01-9150-4BBF-AFA1-5B68AB991B76} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Silk_FLP", "src\Silk_FLP.vcproj", "{56B91D01-9150-4BBF-AFA1-5B68AB991B76}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SignalCompare", "test\SignalCompare.vcproj", "{7FE8F544-9175-40C3-A187-7F15CE9A75D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {82685D7F-0589-42BD-877C-31A952D53A8E}.Debug|Win32.ActiveCfg = Debug|Win32 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Debug|Win32.Build.0 = Debug|Win32 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Release|Win32.ActiveCfg = Release|Win32 + {82685D7F-0589-42BD-877C-31A952D53A8E}.Release|Win32.Build.0 = Release|Win32 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Debug|Win32.ActiveCfg = Debug|Win32 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Debug|Win32.Build.0 = Debug|Win32 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Release|Win32.ActiveCfg = Release|Win32 + {6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Release|Win32.Build.0 = Release|Win32 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.ActiveCfg = Debug|Win32 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.Build.0 = Debug|Win32 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.ActiveCfg = Release|Win32 + {56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.Build.0 = Release|Win32 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Debug|Win32.ActiveCfg = Debug|Win32 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Debug|Win32.Build.0 = Debug|Win32 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Release|Win32.ActiveCfg = Release|Win32 + {7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_Evaluation.pdf b/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_Evaluation.pdf new file mode 100755 index 0000000..07a9233 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_Evaluation.pdf differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_RTP_PayloadFormat.pdf b/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_RTP_PayloadFormat.pdf new file mode 100755 index 0000000..022792f Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_RTP_PayloadFormat.pdf differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_SDK_API.pdf b/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_SDK_API.pdf new file mode 100755 index 0000000..60973aa Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/doc/SILK_SDK_API.pdf differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_SDK_API.h b/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_SDK_API.h new file mode 100755 index 0000000..aa911f2 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_SDK_API.h @@ -0,0 +1,152 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_SDK_API_H +#define SKP_SILK_SDK_API_H + +#include "SKP_Silk_control.h" +#include "SKP_Silk_typedef.h" +#include "SKP_Silk_errors.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define SILK_MAX_FRAMES_PER_PACKET 5 + +/* Struct for TOC (Table of Contents) */ +typedef struct { + SKP_int framesInPacket; /* Number of 20 ms frames in packet */ + SKP_int fs_kHz; /* Sampling frequency in packet */ + SKP_int inbandLBRR; /* Does packet contain LBRR information */ + SKP_int corrupt; /* Packet is corrupt */ + SKP_int vadFlags[ SILK_MAX_FRAMES_PER_PACKET ]; /* VAD flag for each frame in packet */ + SKP_int sigtypeFlags[ SILK_MAX_FRAMES_PER_PACKET ]; /* Signal type for each frame in packet */ +} SKP_Silk_TOC_struct; + +/****************************************/ +/* Encoder functions */ +/****************************************/ + +/***********************************************/ +/* Get size in bytes of the Silk encoder state */ +/***********************************************/ +SKP_int SKP_Silk_SDK_Get_Encoder_Size( + SKP_int32 *encSizeBytes /* O: Number of bytes in SILK encoder state */ +); + +/*************************/ +/* Init or reset encoder */ +/*************************/ +SKP_int SKP_Silk_SDK_InitEncoder( + void *encState, /* I/O: State */ + SKP_SILK_SDK_EncControlStruct *encStatus /* O: Encoder Status */ +); + +/***************************************/ +/* Read control structure from encoder */ +/***************************************/ +SKP_int SKP_Silk_SDK_QueryEncoder( + const void *encState, /* I: State */ + SKP_SILK_SDK_EncControlStruct *encStatus /* O: Encoder Status */ +); + +/**************************/ +/* Encode frame with Silk */ +/**************************/ +SKP_int SKP_Silk_SDK_Encode( + void *encState, /* I/O: State */ + const SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control status */ + const SKP_int16 *samplesIn, /* I: Speech sample input vector */ + SKP_int nSamplesIn, /* I: Number of samples in input vector */ + SKP_uint8 *outData, /* O: Encoded output vector */ + SKP_int16 *nBytesOut /* I/O: Number of bytes in outData (input: Max bytes) */ +); + +/****************************************/ +/* Decoder functions */ +/****************************************/ + +/***********************************************/ +/* Get size in bytes of the Silk decoder state */ +/***********************************************/ +SKP_int SKP_Silk_SDK_Get_Decoder_Size( + SKP_int32 *decSizeBytes /* O: Number of bytes in SILK decoder state */ +); + +/*************************/ +/* Init or Reset decoder */ +/*************************/ +SKP_int SKP_Silk_SDK_InitDecoder( + void *decState /* I/O: State */ +); + +/******************/ +/* Decode a frame */ +/******************/ +SKP_int SKP_Silk_SDK_Decode( + void* decState, /* I/O: State */ + SKP_SILK_SDK_DecControlStruct* decControl, /* I/O: Control Structure */ + SKP_int lostFlag, /* I: 0: no loss, 1 loss */ + const SKP_uint8 *inData, /* I: Encoded input vector */ + const SKP_int nBytesIn, /* I: Number of input bytes */ + SKP_int16 *samplesOut, /* O: Decoded output speech vector */ + SKP_int16 *nSamplesOut /* I/O: Number of samples (vector/decoded) */ +); + +/***************************************************************/ +/* Find Low Bit Rate Redundancy (LBRR) information in a packet */ +/***************************************************************/ +void SKP_Silk_SDK_search_for_LBRR( + const SKP_uint8 *inData, /* I: Encoded input vector */ + const SKP_int nBytesIn, /* I: Number of input Bytes */ + SKP_int lost_offset, /* I: Offset from lost packet */ + SKP_uint8 *LBRRData, /* O: LBRR payload */ + SKP_int16 *nLBRRBytes /* O: Number of LBRR Bytes */ +); + +/**************************************/ +/* Get table of contents for a packet */ +/**************************************/ +void SKP_Silk_SDK_get_TOC( + const SKP_uint8 *inData, /* I: Encoded input vector */ + const SKP_int nBytesIn, /* I: Number of input bytes */ + SKP_Silk_TOC_struct *Silk_TOC /* O: Table of contents */ +); + +/**************************/ +/* Get the version number */ +/**************************/ +/* Return a pointer to string specifying the version */ +const char *SKP_Silk_SDK_get_version(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_control.h b/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_control.h new file mode 100755 index 0000000..ee446aa --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_control.h @@ -0,0 +1,91 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_CONTROL_H +#define SKP_SILK_CONTROL_H + +#include "SKP_Silk_typedef.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/***********************************************/ +/* Structure for controlling encoder operation */ +/***********************************************/ +typedef struct { + /* I: Input signal sampling rate in Hertz; 8000/12000/16000/24000 */ + SKP_int32 API_sampleRate; + + /* I: Maximum internal sampling rate in Hertz; 8000/12000/16000/24000 */ + SKP_int32 maxInternalSampleRate; + + /* I: Number of samples per packet; must be equivalent of 20, 40, 60, 80 or 100 ms */ + SKP_int packetSize; + + /* I: Bitrate during active speech in bits/second; internally limited */ + SKP_int32 bitRate; + + /* I: Uplink packet loss in percent (0-100) */ + SKP_int packetLossPercentage; + + /* I: Complexity mode; 0 is lowest; 1 is medium and 2 is highest complexity */ + SKP_int complexity; + + /* I: Flag to enable in-band Forward Error Correction (FEC); 0/1 */ + SKP_int useInBandFEC; + + /* I: Flag to enable discontinuous transmission (DTX); 0/1 */ + SKP_int useDTX; +} SKP_SILK_SDK_EncControlStruct; + +/**************************************************************************/ +/* Structure for controlling decoder operation and reading decoder status */ +/**************************************************************************/ +typedef struct { + /* I: Output signal sampling rate in Hertz; 8000/12000/16000/24000 */ + SKP_int32 API_sampleRate; + + /* O: Number of samples per frame */ + SKP_int frameSize; + + /* O: Frames per packet 1, 2, 3, 4, 5 */ + SKP_int framesPerPacket; + + /* O: Flag to indicate that the decoder has remaining payloads internally */ + SKP_int moreInternalDecoderFrames; + + /* O: Distance between main payload and redundant payload in packets */ + SKP_int inBandFECOffset; +} SKP_SILK_SDK_DecControlStruct; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_errors.h b/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_errors.h new file mode 100755 index 0000000..bcf1c2a --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_errors.h @@ -0,0 +1,89 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_ERRORS_H +#define SKP_SILK_ERRORS_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************/ +/* Error messages */ +/******************/ +#define SKP_SILK_NO_ERROR 0 + +/**************************/ +/* Encoder error messages */ +/**************************/ + +/* Input length is not a multiplum of 10 ms, or length is longer than the packet length */ +#define SKP_SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES -1 + +/* Sampling frequency not 8000, 12000, 16000 or 24000 Hertz */ +#define SKP_SILK_ENC_FS_NOT_SUPPORTED -2 + +/* Packet size not 20, 40, 60, 80 or 100 ms */ +#define SKP_SILK_ENC_PACKET_SIZE_NOT_SUPPORTED -3 + +/* Allocated payload buffer too short */ +#define SKP_SILK_ENC_PAYLOAD_BUF_TOO_SHORT -4 + +/* Loss rate not between 0 and 100 percent */ +#define SKP_SILK_ENC_INVALID_LOSS_RATE -5 + +/* Complexity setting not valid, use 0, 1 or 2 */ +#define SKP_SILK_ENC_INVALID_COMPLEXITY_SETTING -6 + +/* Inband FEC setting not valid, use 0 or 1 */ +#define SKP_SILK_ENC_INVALID_INBAND_FEC_SETTING -7 + +/* DTX setting not valid, use 0 or 1 */ +#define SKP_SILK_ENC_INVALID_DTX_SETTING -8 + +/* Internal encoder error */ +#define SKP_SILK_ENC_INTERNAL_ERROR -9 + +/**************************/ +/* Decoder error messages */ +/**************************/ + +/* Output sampling frequency lower than internal decoded sampling frequency */ +#define SKP_SILK_DEC_INVALID_SAMPLING_FREQUENCY -10 + +/* Payload size exceeded the maximum allowed 1024 bytes */ +#define SKP_SILK_DEC_PAYLOAD_TOO_LARGE -11 + +/* Payload has bit errors */ +#define SKP_SILK_DEC_PAYLOAD_ERROR -12 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_typedef.h b/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_typedef.h new file mode 100755 index 0000000..6790897 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/interface/SKP_Silk_typedef.h @@ -0,0 +1,107 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef _SKP_SILK_API_TYPDEF_H_ +#define _SKP_SILK_API_TYPDEF_H_ + +#ifndef SKP_USE_DOUBLE_PRECISION_FLOATS +#define SKP_USE_DOUBLE_PRECISION_FLOATS 0 +#endif + +#include +#if defined( __GNUC__ ) +#include +#endif + +#define SKP_int int /* used for counters etc; at least 16 bits */ +#ifdef __GNUC__ +# define SKP_int64 int64_t +#else +# define SKP_int64 long long +#endif +#define SKP_int32 int +#define SKP_int16 short +#define SKP_int8 signed char + +#define SKP_uint unsigned int /* used for counters etc; at least 16 bits */ +#ifdef __GNUC__ +# define SKP_uint64 uint64_t +#else +# define SKP_uint64 unsigned long long +#endif +#define SKP_uint32 unsigned int +#define SKP_uint16 unsigned short +#define SKP_uint8 unsigned char + +#define SKP_int_ptr_size intptr_t + +#if SKP_USE_DOUBLE_PRECISION_FLOATS +# define SKP_float double +# define SKP_float_MAX DBL_MAX +#else +# define SKP_float float +# define SKP_float_MAX FLT_MAX +#endif + +#define SKP_INLINE static __inline + +#ifdef _WIN32 +# define SKP_STR_CASEINSENSITIVE_COMPARE(x, y) _stricmp(x, y) +#else +# define SKP_STR_CASEINSENSITIVE_COMPARE(x, y) strcasecmp(x, y) +#endif + +#define SKP_int64_MAX ((SKP_int64)0x7FFFFFFFFFFFFFFFLL) /* 2^63 - 1 */ +#define SKP_int64_MIN ((SKP_int64)0x8000000000000000LL) /* -2^63 */ +#define SKP_int32_MAX 0x7FFFFFFF /* 2^31 - 1 = 2147483647*/ +#define SKP_int32_MIN ((SKP_int32)0x80000000) /* -2^31 = -2147483648*/ +#define SKP_int16_MAX 0x7FFF /* 2^15 - 1 = 32767*/ +#define SKP_int16_MIN ((SKP_int16)0x8000) /* -2^15 = -32768*/ +#define SKP_int8_MAX 0x7F /* 2^7 - 1 = 127*/ +#define SKP_int8_MIN ((SKP_int8)0x80) /* -2^7 = -128*/ + +#define SKP_uint32_MAX 0xFFFFFFFF /* 2^32 - 1 = 4294967295 */ +#define SKP_uint32_MIN 0x00000000 +#define SKP_uint16_MAX 0xFFFF /* 2^16 - 1 = 65535 */ +#define SKP_uint16_MIN 0x0000 +#define SKP_uint8_MAX 0xFF /* 2^8 - 1 = 255 */ +#define SKP_uint8_MIN 0x00 + +#define SKP_TRUE 1 +#define SKP_FALSE 0 + +/* assertions */ +#if (defined _WIN32 && !defined _WINCE && !defined(__GNUC__) && !defined(NO_ASSERTS)) +# ifndef SKP_assert +# include /* ASSERTE() */ +# define SKP_assert(COND) _ASSERTE(COND) +# endif +#else +# define SKP_assert(COND) +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/readme.txt b/external/SILK_SDK_SRC_FLP_v1.0.9/readme.txt new file mode 100755 index 0000000..28b26cb --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/readme.txt @@ -0,0 +1,94 @@ +************************************************************************ +Floating Point SILK SDK 1.0.9 source code package +Copyright 2012 (c), Skype Limited +https://developer.skype.com/silk/ +************************************************************************ + +Date: 03/08/2012 (Format: DD/MM/YYYY) + +I. Description + +This package contains files for compilation and evaluation of the floating +point SILK SDK library. The following is included in this package: + + o Source code for the floating point SILK SDK library + o Source code for creating encoder and decoder executables + o Test vectors + o Comparison tool + o Microsoft Visual Studio solutions and project files + o Makefile for GNU C-compiler (GCC) + +II. Files and Folders + + o doc/ - contains more information about the SILK SDK + o interface/ - contains API header files + o src/ - contains all SILK SDK library source files + o test/ - contains source files for testing the SILK SDK + o test_vectors/ - contains test vectors + o Makefile - Makefile for compiling with GCC + o readme.txt - this file + o Silk_SDK.sln - Visual Studio 2010 solution for all SILK SDK code + o Silk_SDK_VS2005.sln - Visual Studio 2005 solution for all SILK SDK code + +III. How to use the Makefile + + 1. How to clean and compile the SILK SDK library: + + make clean lib + + 2. How to compile an encoder executable: + + make encoder + + 3. How to compile a decoder executable: + + make decoder + + 4. How to clean and compile all of the above: + + make clean all + + 5. How to build for big endian CPU's + + Make clean all ADDED_DEFINES+=_SYSTEM_IS_BIG_ENDIAN + To be able to use the test vectors with big endian CPU's the test programs + need to be compiled in a different way. Note that the 16 bit input and output + from the test programs will have the upper and lower bytes swapped with this setting. + + 6. How to use the comparison tool: + + See 'How to use the test vectors.txt' in the test_vectors folder. + +IV. History + + Version 1.0.9 - Added 64-bit support. Added iOS LLVM compiler support. Lowered DTX mode bitrate. Bugfixes for ARM builds. Various other small fixes. + Version 1.0.8 - Improved noise shaping, various other improvements, and various bugfixes. Added a MIPS version + Version 1.0.7 - Updated with bugfixes for LBRR and pitch estimator. SignalCompare updated + Version 1.0.6 - Updated with bugfixes for ARM builds + Version 1.0.5 - Updated with bugfixes for ARM builds + Version 1.0.4 - Updated with various bugfixes and improvements, including some API changes + Added support for big endian platforms + Added resampler support for additional API sample rates + Version 1.0.3 - Updated with various bugfixes and improvements + Version 1.0.2 - Updated with various bugfixes and improvements + Version 1.0.1 - First beta source code release + +V. Compatibility + + This package has been tested on the following platforms: + + Windows 7 Professional, 32-bit version, Intel Core i7 CPU + Windows 7 Professional, 64-bit version, Intel Core i7 CPU + Mac OS X Version 10.7.4, 64-bit version, Intel Core i7 CPU + Ubuntu Linux 10.04 LTS, 32-bit version, Intel Core i7 CPU + Ubuntu Linux 12.04 LTS, 64-bit version, Intel Core 2 Duo CPU + +VI. Known Issues + + None + +VII. Additional Resources + + For more information, visit the SILK SDK web site at: + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_A2NLSF.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_A2NLSF.c new file mode 100755 index 0000000..8307e02 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_A2NLSF.c @@ -0,0 +1,279 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* Conversion between prediction filter coefficients and NLSFs */ +/* Requires the order to be an even number */ +/* A piecewise linear approximation maps LSF <-> cos(LSF) */ +/* Therefore the result is not accurate NLSFs, but the two */ +/* function are accurate inverses of each other */ + +#include "SKP_Silk_SigProc_FIX.h" + +/* Number of binary divisions */ +#define BIN_DIV_STEPS_A2NLSF_FIX 3 /* must be no higher than 16 - log2( LSF_COS_TAB_SZ_FIX ) */ +#define QPoly 16 +#define MAX_ITERATIONS_A2NLSF_FIX 30 + +/* Flag for using 2x as many cosine sampling points, reduces the risk of missing a root */ +#define OVERSAMPLE_COSINE_TABLE 0 + +/* Helper function for A2NLSF(..) */ +/* Transforms polynomials from cos(n*f) to cos(f)^n */ +SKP_INLINE void SKP_Silk_A2NLSF_trans_poly( + SKP_int32 *p, /* I/O Polynomial */ + const SKP_int dd /* I Polynomial order (= filter order / 2 ) */ +) +{ + SKP_int k, n; + + for( k = 2; k <= dd; k++ ) { + for( n = dd; n > k; n-- ) { + p[ n - 2 ] -= p[ n ]; + } + p[ k - 2 ] -= SKP_LSHIFT( p[ k ], 1 ); + } +} +/* Helper function for A2NLSF(..) */ +/* Polynomial evaluation */ +SKP_INLINE SKP_int32 SKP_Silk_A2NLSF_eval_poly( /* return the polynomial evaluation, in QPoly */ + SKP_int32 *p, /* I Polynomial, QPoly */ + const SKP_int32 x, /* I Evaluation point, Q12 */ + const SKP_int dd /* I Order */ +) +{ + SKP_int n; + SKP_int32 x_Q16, y32; + + y32 = p[ dd ]; /* QPoly */ + x_Q16 = SKP_LSHIFT( x, 4 ); + for( n = dd - 1; n >= 0; n-- ) { + y32 = SKP_SMLAWW( p[ n ], y32, x_Q16 ); /* QPoly */ + } + return y32; +} + +SKP_INLINE void SKP_Silk_A2NLSF_init( + const SKP_int32 *a_Q16, + SKP_int32 *P, + SKP_int32 *Q, + const SKP_int dd +) +{ + SKP_int k; + + /* Convert filter coefs to even and odd polynomials */ + P[dd] = SKP_LSHIFT( 1, QPoly ); + Q[dd] = SKP_LSHIFT( 1, QPoly ); + for( k = 0; k < dd; k++ ) { +#if( QPoly < 16 ) + P[ k ] = SKP_RSHIFT_ROUND( -a_Q16[ dd - k - 1 ] - a_Q16[ dd + k ], 16 - QPoly ); /* QPoly */ + Q[ k ] = SKP_RSHIFT_ROUND( -a_Q16[ dd - k - 1 ] + a_Q16[ dd + k ], 16 - QPoly ); /* QPoly */ +#elif( QPoly == 16 ) + P[ k ] = -a_Q16[ dd - k - 1 ] - a_Q16[ dd + k ]; // QPoly + Q[ k ] = -a_Q16[ dd - k - 1 ] + a_Q16[ dd + k ]; // QPoly +#else + P[ k ] = SKP_LSHIFT( -a_Q16[ dd - k - 1 ] - a_Q16[ dd + k ], QPoly - 16 ); /* QPoly */ + Q[ k ] = SKP_LSHIFT( -a_Q16[ dd - k - 1 ] + a_Q16[ dd + k ], QPoly - 16 ); /* QPoly */ +#endif + } + + /* Divide out zeros as we have that for even filter orders, */ + /* z = 1 is always a root in Q, and */ + /* z = -1 is always a root in P */ + for( k = dd; k > 0; k-- ) { + P[ k - 1 ] -= P[ k ]; + Q[ k - 1 ] += Q[ k ]; + } + + /* Transform polynomials from cos(n*f) to cos(f)^n */ + SKP_Silk_A2NLSF_trans_poly( P, dd ); + SKP_Silk_A2NLSF_trans_poly( Q, dd ); +} + +/* Compute Normalized Line Spectral Frequencies (NLSFs) from whitening filter coefficients */ +/* If not all roots are found, the a_Q16 coefficients are bandwidth expanded until convergence. */ +void SKP_Silk_A2NLSF( + SKP_int *NLSF, /* O Normalized Line Spectral Frequencies, Q15 (0 - (2^15-1)), [d] */ + SKP_int32 *a_Q16, /* I/O Monic whitening filter coefficients in Q16 [d] */ + const SKP_int d /* I Filter order (must be even) */ +) +{ + SKP_int i, k, m, dd, root_ix, ffrac; + SKP_int32 xlo, xhi, xmid; + SKP_int32 ylo, yhi, ymid; + SKP_int32 nom, den; + SKP_int32 P[ SKP_Silk_MAX_ORDER_LPC / 2 + 1 ]; + SKP_int32 Q[ SKP_Silk_MAX_ORDER_LPC / 2 + 1 ]; + SKP_int32 *PQ[ 2 ]; + SKP_int32 *p; + + /* Store pointers to array */ + PQ[ 0 ] = P; + PQ[ 1 ] = Q; + + dd = SKP_RSHIFT( d, 1 ); + + SKP_Silk_A2NLSF_init( a_Q16, P, Q, dd ); + + /* Find roots, alternating between P and Q */ + p = P; /* Pointer to polynomial */ + + xlo = SKP_Silk_LSFCosTab_FIX_Q12[ 0 ]; // Q12 + ylo = SKP_Silk_A2NLSF_eval_poly( p, xlo, dd ); + + if( ylo < 0 ) { + /* Set the first NLSF to zero and move on to the next */ + NLSF[ 0 ] = 0; + p = Q; /* Pointer to polynomial */ + ylo = SKP_Silk_A2NLSF_eval_poly( p, xlo, dd ); + root_ix = 1; /* Index of current root */ + } else { + root_ix = 0; /* Index of current root */ + } + k = 1; /* Loop counter */ + i = 0; /* Counter for bandwidth expansions applied */ + while( 1 ) { + /* Evaluate polynomial */ +#if OVERSAMPLE_COSINE_TABLE + xhi = SKP_Silk_LSFCosTab_FIX_Q12[ k >> 1 ] + + ( ( SKP_Silk_LSFCosTab_FIX_Q12[ ( k + 1 ) >> 1 ] - + SKP_Silk_LSFCosTab_FIX_Q12[ k >> 1 ] ) >> 1 ); /* Q12 */ +#else + xhi = SKP_Silk_LSFCosTab_FIX_Q12[ k ]; /* Q12 */ +#endif + yhi = SKP_Silk_A2NLSF_eval_poly( p, xhi, dd ); + + /* Detect zero crossing */ + if( ( ylo <= 0 && yhi >= 0 ) || ( ylo >= 0 && yhi <= 0 ) ) { + /* Binary division */ +#if OVERSAMPLE_COSINE_TABLE + ffrac = -128; +#else + ffrac = -256; +#endif + for( m = 0; m < BIN_DIV_STEPS_A2NLSF_FIX; m++ ) { + /* Evaluate polynomial */ + xmid = SKP_RSHIFT_ROUND( xlo + xhi, 1 ); + ymid = SKP_Silk_A2NLSF_eval_poly( p, xmid, dd ); + + /* Detect zero crossing */ + if( ( ylo <= 0 && ymid >= 0 ) || ( ylo >= 0 && ymid <= 0 ) ) { + /* Reduce frequency */ + xhi = xmid; + yhi = ymid; + } else { + /* Increase frequency */ + xlo = xmid; + ylo = ymid; +#if OVERSAMPLE_COSINE_TABLE + ffrac = SKP_ADD_RSHIFT( ffrac, 64, m ); +#else + ffrac = SKP_ADD_RSHIFT( ffrac, 128, m ); +#endif + } + } + + /* Interpolate */ + if( SKP_abs( ylo ) < 65536 ) { + /* Avoid dividing by zero */ + den = ylo - yhi; + nom = SKP_LSHIFT( ylo, 8 - BIN_DIV_STEPS_A2NLSF_FIX ) + SKP_RSHIFT( den, 1 ); + if( den != 0 ) { + ffrac += SKP_DIV32( nom, den ); + } + } else { + /* No risk of dividing by zero because abs(ylo - yhi) >= abs(ylo) >= 65536 */ + ffrac += SKP_DIV32( ylo, SKP_RSHIFT( ylo - yhi, 8 - BIN_DIV_STEPS_A2NLSF_FIX ) ); + } +#if OVERSAMPLE_COSINE_TABLE + NLSF[ root_ix ] = (SKP_int)SKP_min_32( SKP_LSHIFT( (SKP_int32)k, 7 ) + ffrac, SKP_int16_MAX ); +#else + NLSF[ root_ix ] = (SKP_int)SKP_min_32( SKP_LSHIFT( (SKP_int32)k, 8 ) + ffrac, SKP_int16_MAX ); +#endif + + SKP_assert( NLSF[ root_ix ] >= 0 ); + SKP_assert( NLSF[ root_ix ] <= 32767 ); + + root_ix++; /* Next root */ + if( root_ix >= d ) { + /* Found all roots */ + break; + } + /* Alternate pointer to polynomial */ + p = PQ[ root_ix & 1 ]; + + /* Evaluate polynomial */ +#if OVERSAMPLE_COSINE_TABLE + xlo = SKP_Silk_LSFCosTab_FIX_Q12[ ( k - 1 ) >> 1 ] + + ( ( SKP_Silk_LSFCosTab_FIX_Q12[ k >> 1 ] - + SKP_Silk_LSFCosTab_FIX_Q12[ ( k - 1 ) >> 1 ] ) >> 1 ); // Q12 +#else + xlo = SKP_Silk_LSFCosTab_FIX_Q12[ k - 1 ]; // Q12 +#endif + ylo = SKP_LSHIFT( 1 - ( root_ix & 2 ), 12 ); + } else { + /* Increment loop counter */ + k++; + xlo = xhi; + ylo = yhi; + +#if OVERSAMPLE_COSINE_TABLE + if( k > 2 * LSF_COS_TAB_SZ_FIX ) { +#else + if( k > LSF_COS_TAB_SZ_FIX ) { +#endif + i++; + if( i > MAX_ITERATIONS_A2NLSF_FIX ) { + /* Set NLSFs to white spectrum and exit */ + NLSF[ 0 ] = SKP_DIV32_16( 1 << 15, d + 1 ); + for( k = 1; k < d; k++ ) { + NLSF[ k ] = SKP_SMULBB( k + 1, NLSF[ 0 ] ); + } + return; + } + + /* Error: Apply progressively more bandwidth expansion and run again */ + SKP_Silk_bwexpander_32( a_Q16, d, 65536 - SKP_SMULBB( 10 + i, i ) ); // 10_Q16 = 0.00015 + + SKP_Silk_A2NLSF_init( a_Q16, P, Q, dd ); + p = P; /* Pointer to polynomial */ + xlo = SKP_Silk_LSFCosTab_FIX_Q12[ 0 ]; // Q12 + ylo = SKP_Silk_A2NLSF_eval_poly( p, xlo, dd ); + if( ylo < 0 ) { + /* Set the first NLSF to zero and move on to the next */ + NLSF[ 0 ] = 0; + p = Q; /* Pointer to polynomial */ + ylo = SKP_Silk_A2NLSF_eval_poly( p, xlo, dd ); + root_ix = 1; /* Index of current root */ + } else { + root_ix = 0; /* Index of current root */ + } + k = 1; /* Reset loop counter */ + } + } + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_CNG.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_CNG.c new file mode 100755 index 0000000..c7b7905 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_CNG.c @@ -0,0 +1,149 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* Generates excitation for CNG LPC synthesis */ +SKP_INLINE void SKP_Silk_CNG_exc( + SKP_int16 residual[], /* O CNG residual signal Q0 */ + SKP_int32 exc_buf_Q10[], /* I Random samples buffer Q10 */ + SKP_int32 Gain_Q16, /* I Gain to apply */ + SKP_int length, /* I Length */ + SKP_int32 *rand_seed /* I/O Seed to random index generator */ +) +{ + SKP_int32 seed; + SKP_int i, idx, exc_mask; + + exc_mask = CNG_BUF_MASK_MAX; + while( exc_mask > length ) { + exc_mask = SKP_RSHIFT( exc_mask, 1 ); + } + + seed = *rand_seed; + for( i = 0; i < length; i++ ) { + seed = SKP_RAND( seed ); + idx = ( SKP_int )( SKP_RSHIFT( seed, 24 ) & exc_mask ); + SKP_assert( idx >= 0 ); + SKP_assert( idx <= CNG_BUF_MASK_MAX ); + residual[ i ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( SKP_SMULWW( exc_buf_Q10[ idx ], Gain_Q16 ), 10 ) ); + } + *rand_seed = seed; +} + +void SKP_Silk_CNG_Reset( + SKP_Silk_decoder_state *psDec /* I/O Decoder state */ +) +{ + SKP_int i, NLSF_step_Q15, NLSF_acc_Q15; + + NLSF_step_Q15 = SKP_DIV32_16( SKP_int16_MAX, psDec->LPC_order + 1 ); + NLSF_acc_Q15 = 0; + for( i = 0; i < psDec->LPC_order; i++ ) { + NLSF_acc_Q15 += NLSF_step_Q15; + psDec->sCNG.CNG_smth_NLSF_Q15[ i ] = NLSF_acc_Q15; + } + psDec->sCNG.CNG_smth_Gain_Q16 = 0; + psDec->sCNG.rand_seed = 3176576; +} + +/* Updates CNG estimate, and applies the CNG when packet was lost */ +void SKP_Silk_CNG( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int16 signal[], /* I/O Signal */ + SKP_int length /* I Length of residual */ +) +{ + SKP_int i, subfr; + SKP_int32 tmp_32, Gain_Q26, max_Gain_Q16; + SKP_int16 LPC_buf[ MAX_LPC_ORDER ]; + SKP_int16 CNG_sig[ MAX_FRAME_LENGTH ]; + SKP_Silk_CNG_struct *psCNG; + psCNG = &psDec->sCNG; + + if( psDec->fs_kHz != psCNG->fs_kHz ) { + /* Reset state */ + SKP_Silk_CNG_Reset( psDec ); + + psCNG->fs_kHz = psDec->fs_kHz; + } + if( psDec->lossCnt == 0 && psDec->vadFlag == NO_VOICE_ACTIVITY ) { + /* Update CNG parameters */ + + /* Smoothing of LSF's */ + for( i = 0; i < psDec->LPC_order; i++ ) { + psCNG->CNG_smth_NLSF_Q15[ i ] += SKP_SMULWB( psDec->prevNLSF_Q15[ i ] - psCNG->CNG_smth_NLSF_Q15[ i ], CNG_NLSF_SMTH_Q16 ); + } + /* Find the subframe with the highest gain */ + max_Gain_Q16 = 0; + subfr = 0; + for( i = 0; i < NB_SUBFR; i++ ) { + if( psDecCtrl->Gains_Q16[ i ] > max_Gain_Q16 ) { + max_Gain_Q16 = psDecCtrl->Gains_Q16[ i ]; + subfr = i; + } + } + /* Update CNG excitation buffer with excitation from this subframe */ + SKP_memmove( &psCNG->CNG_exc_buf_Q10[ psDec->subfr_length ], psCNG->CNG_exc_buf_Q10, ( NB_SUBFR - 1 ) * psDec->subfr_length * sizeof( SKP_int32 ) ); + SKP_memcpy( psCNG->CNG_exc_buf_Q10, &psDec->exc_Q10[ subfr * psDec->subfr_length ], psDec->subfr_length * sizeof( SKP_int32 ) ); + + /* Smooth gains */ + for( i = 0; i < NB_SUBFR; i++ ) { + psCNG->CNG_smth_Gain_Q16 += SKP_SMULWB( psDecCtrl->Gains_Q16[ i ] - psCNG->CNG_smth_Gain_Q16, CNG_GAIN_SMTH_Q16 ); + } + } + + /* Add CNG when packet is lost and / or when low speech activity */ + if( psDec->lossCnt ) {//|| psDec->vadFlag == NO_VOICE_ACTIVITY ) { + + /* Generate CNG excitation */ + SKP_Silk_CNG_exc( CNG_sig, psCNG->CNG_exc_buf_Q10, + psCNG->CNG_smth_Gain_Q16, length, &psCNG->rand_seed ); + + /* Convert CNG NLSF to filter representation */ + SKP_Silk_NLSF2A_stable( LPC_buf, psCNG->CNG_smth_NLSF_Q15, psDec->LPC_order ); + + Gain_Q26 = ( SKP_int32 )1 << 26; /* 1.0 */ + + /* Generate CNG signal, by synthesis filtering */ + if( psDec->LPC_order == 16 ) { + SKP_Silk_LPC_synthesis_order16( CNG_sig, LPC_buf, + Gain_Q26, psCNG->CNG_synth_state, CNG_sig, length ); + } else { + SKP_Silk_LPC_synthesis_filter( CNG_sig, LPC_buf, + Gain_Q26, psCNG->CNG_synth_state, CNG_sig, length, psDec->LPC_order ); + } + /* Mix with signal */ + for( i = 0; i < length; i++ ) { + tmp_32 = signal[ i ] + CNG_sig[ i ]; + signal[ i ] = SKP_SAT16( tmp_32 ); + } + } else { + SKP_memset( psCNG->CNG_synth_state, 0, psDec->LPC_order * sizeof( SKP_int32 ) ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_HP_variable_cutoff_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_HP_variable_cutoff_FLP.c new file mode 100755 index 0000000..0e3f97f --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_HP_variable_cutoff_FLP.c @@ -0,0 +1,104 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +#if HIGH_PASS_INPUT + +/* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */ +void SKP_Silk_HP_variable_cutoff_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SKP_int16 *out, /* O High-pass filtered output signal */ + const SKP_int16 *in /* I Input signal */ +) +{ + SKP_float pitch_freq_Hz, pitch_freq_log, quality, delta_freq, smth_coef, Fc, r; + SKP_int32 B_Q28[ 3 ], A_Q28[ 2 ]; + + /*********************************************/ + /* Estimate low end of pitch frequency range */ + /*********************************************/ + if( psEnc->sCmn.prev_sigtype == SIG_TYPE_VOICED ) { + + /* Difference, in log domain */ + pitch_freq_Hz = 1e3f * psEnc->sCmn.fs_kHz / psEnc->sCmn.prevLag; + pitch_freq_log = SKP_Silk_log2( pitch_freq_Hz ); + + /* Adjustment based on quality */ + quality = psEncCtrl->input_quality_bands[ 0 ]; + pitch_freq_log -= quality * quality * ( pitch_freq_log - SKP_Silk_log2( VARIABLE_HP_MIN_FREQ ) ); + pitch_freq_log += 0.5f * ( 0.6f - quality ); + + delta_freq = pitch_freq_log - psEnc->variable_HP_smth1; + if( delta_freq < 0.0 ) { + /* Less smoothing for decreasing pitch frequency, to track something close to the minimum */ + delta_freq *= 3.0f; + } + + /* Limit delta, to reduce impact of outliers */ + delta_freq = SKP_LIMIT_float( delta_freq, -VARIABLE_HP_MAX_DELTA_FREQ, VARIABLE_HP_MAX_DELTA_FREQ ); + + /* Update smoother */ + smth_coef = VARIABLE_HP_SMTH_COEF1 * psEnc->speech_activity; + psEnc->variable_HP_smth1 += smth_coef * delta_freq; + } + + /* Second smoother */ + psEnc->variable_HP_smth2 += VARIABLE_HP_SMTH_COEF2 * ( psEnc->variable_HP_smth1 - psEnc->variable_HP_smth2 ); + + /* Convert from log scale to Hertz */ + psEncCtrl->pitch_freq_low_Hz = ( SKP_float )pow( 2.0f, psEnc->variable_HP_smth2 ); + + /* Limit frequency range */ + psEncCtrl->pitch_freq_low_Hz = SKP_LIMIT_float( psEncCtrl->pitch_freq_low_Hz, VARIABLE_HP_MIN_FREQ, VARIABLE_HP_MAX_FREQ ); + + /*******************************/ + /* Compute filter coefficients */ + /*******************************/ + /* Compute cut-off frequency, in radians */ + Fc = ( SKP_float )( 0.45f * 2.0f * 3.14159265359 * psEncCtrl->pitch_freq_low_Hz / ( 1e3f * psEnc->sCmn.fs_kHz ) ); + + /* 2nd order ARMA coefficients */ + r = 1.0f - 0.92f * Fc; + + /* b = r * [1; -2; 1]; */ + /* a = [1; -2 * r * (1 - 0.5 * Fc^2); r^2]; */ + B_Q28[ 0 ] = SKP_float2int( ( 1 << 28 ) * r ); + B_Q28[ 1 ] = SKP_float2int( ( 1 << 28 ) * -2.0f * r ); + B_Q28[ 2 ] = B_Q28[ 0 ]; + A_Q28[ 0 ] = SKP_float2int( ( 1 << 28 ) * -2.0f * r * ( 1.0f - 0.5f * Fc * Fc ) ); + A_Q28[ 1 ] = SKP_float2int( ( 1 << 28 ) * r * r ); + + /********************/ + /* High-pass filter */ + /********************/ + SKP_Silk_biquad_alt( in, B_Q28, A_Q28, psEnc->sCmn.In_HP_State, out, psEnc->sCmn.frame_length ); +} + +#endif // HIGH_PASS_INPUT diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_Inlines.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_Inlines.h new file mode 100755 index 0000000..3409f6f --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_Inlines.h @@ -0,0 +1,278 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/*! \file SKP_Silk_Inlines.h + * \brief SigProcFix_Inlines.h defines inline signal processing functions. + */ + +#ifndef _SKP_SILK_FIX_INLINES_H_ +#define _SKP_SILK_FIX_INLINES_H_ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* count leading zeros of SKP_int64 */ +SKP_INLINE SKP_int32 SKP_Silk_CLZ64(SKP_int64 in) +{ + SKP_int32 in_upper; + + in_upper = (SKP_int32)SKP_RSHIFT64(in, 32); + if (in_upper == 0) { + /* Search in the lower 32 bits */ + return 32 + SKP_Silk_CLZ32( (SKP_int32) in ); + } else { + /* Search in the upper 32 bits */ + return SKP_Silk_CLZ32( in_upper ); + } +} + +/* get number of leading zeros and fractional part (the bits right after the leading one */ +SKP_INLINE void SKP_Silk_CLZ_FRAC(SKP_int32 in, /* I: input */ + SKP_int32 *lz, /* O: number of leading zeros */ + SKP_int32 *frac_Q7) /* O: the 7 bits right after the leading one */ +{ + SKP_int32 lzeros = SKP_Silk_CLZ32(in); + + * lz = lzeros; + * frac_Q7 = SKP_ROR32(in, 24 - lzeros) & 0x7f; +} + +/* Approximation of square root */ +/* Accuracy: < +/- 10% for output values > 15 */ +/* < +/- 2.5% for output values > 120 */ +SKP_INLINE SKP_int32 SKP_Silk_SQRT_APPROX(SKP_int32 x) +{ + SKP_int32 y, lz, frac_Q7; + + if( x <= 0 ) { + return 0; + } + + SKP_Silk_CLZ_FRAC(x, &lz, &frac_Q7); + + if( lz & 1 ) { + y = 32768; + } else { + y = 46214; /* 46214 = sqrt(2) * 32768 */ + } + + /* get scaling right */ + y >>= SKP_RSHIFT(lz, 1); + + /* increment using fractional part of input */ + y = SKP_SMLAWB(y, y, SKP_SMULBB(213, frac_Q7)); + + return y; +} + +/* returns the number of left shifts before overflow for a 16 bit number (ITU definition with norm(0)=0) */ +SKP_INLINE SKP_int32 SKP_Silk_norm16(SKP_int16 a) { + + SKP_int32 a32; + + /* if ((a == 0) || (a == SKP_int16_MIN)) return(0); */ + if ((a << 1) == 0) return(0); + + a32 = a; + /* if (a32 < 0) a32 = -a32 - 1; */ + a32 ^= SKP_RSHIFT(a32, 31); + + return SKP_Silk_CLZ32(a32) - 17; +} + +/* returns the number of left shifts before overflow for a 32 bit number (ITU definition with norm(0)=0) */ +SKP_INLINE SKP_int32 SKP_Silk_norm32(SKP_int32 a) { + + /* if ((a == 0) || (a == SKP_int32_MIN)) return(0); */ + if ((a << 1) == 0) return(0); + + /* if (a < 0) a = -a - 1; */ + a ^= SKP_RSHIFT(a, 31); + + return SKP_Silk_CLZ32(a) - 1; +} + +/* Divide two int32 values and return result as int32 in a given Q-domain */ +SKP_INLINE SKP_int32 SKP_DIV32_varQ( /* O returns a good approximation of "(a32 << Qres) / b32" */ + const SKP_int32 a32, /* I numerator (Q0) */ + const SKP_int32 b32, /* I denominator (Q0) */ + const SKP_int Qres /* I Q-domain of result (>= 0) */ +) +{ + SKP_int a_headrm, b_headrm, lshift; + SKP_int32 b32_inv, a32_nrm, b32_nrm, result; + + SKP_assert( b32 != 0 ); + SKP_assert( Qres >= 0 ); + + /* Compute number of bits head room and normalize inputs */ + a_headrm = SKP_Silk_CLZ32( SKP_abs(a32) ) - 1; + a32_nrm = SKP_LSHIFT(a32, a_headrm); /* Q: a_headrm */ + b_headrm = SKP_Silk_CLZ32( SKP_abs(b32) ) - 1; + b32_nrm = SKP_LSHIFT(b32, b_headrm); /* Q: b_headrm */ + + /* Inverse of b32, with 14 bits of precision */ + b32_inv = SKP_DIV32_16( SKP_int32_MAX >> 2, SKP_RSHIFT(b32_nrm, 16) ); /* Q: 29 + 16 - b_headrm */ + + /* First approximation */ + result = SKP_SMULWB(a32_nrm, b32_inv); /* Q: 29 + a_headrm - b_headrm */ + + /* Compute residual by subtracting product of denominator and first approximation */ + a32_nrm -= SKP_LSHIFT_ovflw( SKP_SMMUL(b32_nrm, result), 3 ); /* Q: a_headrm */ + + /* Refinement */ + result = SKP_SMLAWB(result, a32_nrm, b32_inv); /* Q: 29 + a_headrm - b_headrm */ + + /* Convert to Qres domain */ + lshift = 29 + a_headrm - b_headrm - Qres; + if( lshift <= 0 ) { + return SKP_LSHIFT_SAT32(result, -lshift); + } else { + if( lshift < 32){ + return SKP_RSHIFT(result, lshift); + } else { + /* Avoid undefined result */ + return 0; + } + } +} + +/* Invert int32 value and return result as int32 in a given Q-domain */ +SKP_INLINE SKP_int32 SKP_INVERSE32_varQ( /* O returns a good approximation of "(1 << Qres) / b32" */ + const SKP_int32 b32, /* I denominator (Q0) */ + const SKP_int Qres /* I Q-domain of result (> 0) */ +) +{ + SKP_int b_headrm, lshift; + SKP_int32 b32_inv, b32_nrm, err_Q32, result; + + SKP_assert( b32 != 0 ); + SKP_assert( b32 != SKP_int32_MIN ); /* SKP_int32_MIN is not handled by SKP_abs */ + SKP_assert( Qres > 0 ); + + /* Compute number of bits head room and normalize input */ + b_headrm = SKP_Silk_CLZ32( SKP_abs(b32) ) - 1; + b32_nrm = SKP_LSHIFT(b32, b_headrm); /* Q: b_headrm */ + + /* Inverse of b32, with 14 bits of precision */ + b32_inv = SKP_DIV32_16( SKP_int32_MAX >> 2, SKP_RSHIFT(b32_nrm, 16) ); /* Q: 29 + 16 - b_headrm */ + + /* First approximation */ + result = SKP_LSHIFT(b32_inv, 16); /* Q: 61 - b_headrm */ + + /* Compute residual by subtracting product of denominator and first approximation from one */ + err_Q32 = SKP_LSHIFT_ovflw( -SKP_SMULWB(b32_nrm, b32_inv), 3 ); /* Q32 */ + + /* Refinement */ + result = SKP_SMLAWW(result, err_Q32, b32_inv); /* Q: 61 - b_headrm */ + + /* Convert to Qres domain */ + lshift = 61 - b_headrm - Qres; + if( lshift <= 0 ) { + return SKP_LSHIFT_SAT32(result, -lshift); + } else { + if( lshift < 32){ + return SKP_RSHIFT(result, lshift); + }else{ + /* Avoid undefined result */ + return 0; + } + } +} + +#define SKP_SIN_APPROX_CONST0 (1073735400) +#define SKP_SIN_APPROX_CONST1 (-82778932) +#define SKP_SIN_APPROX_CONST2 (1059577) +#define SKP_SIN_APPROX_CONST3 (-5013) + +/* Sine approximation; an input of 65536 corresponds to 2 * pi */ +/* Uses polynomial expansion of the input to the power 0, 2, 4 and 6 */ +/* The relative error is below 1e-5 */ +SKP_INLINE SKP_int32 SKP_Silk_SIN_APPROX_Q24( /* O returns approximately 2^24 * sin(x * 2 * pi / 65536) */ + SKP_int32 x +) +{ + SKP_int y_Q30; + + /* Keep only bottom 16 bits (the function repeats itself with period 65536) */ + x &= 65535; + + /* Split range in four quadrants */ + if( x <= 32768 ) { + if( x < 16384 ) { + /* Return cos(pi/2 - x) */ + x = 16384 - x; + } else { + /* Return cos(x - pi/2) */ + x -= 16384; + } + if( x < 1100 ) { + /* Special case: high accuracy */ + return SKP_SMLAWB( 1 << 24, SKP_MUL( x, x ), -5053 ); + } + x = SKP_SMULWB( SKP_LSHIFT( x, 8 ), x ); /* contains x^2 in Q20 */ + y_Q30 = SKP_SMLAWB( SKP_SIN_APPROX_CONST2, x, SKP_SIN_APPROX_CONST3 ); + y_Q30 = SKP_SMLAWW( SKP_SIN_APPROX_CONST1, x, y_Q30 ); + y_Q30 = SKP_SMLAWW( SKP_SIN_APPROX_CONST0 + 66, x, y_Q30 ); + } else { + if( x < 49152 ) { + /* Return -cos(3*pi/2 - x) */ + x = 49152 - x; + } else { + /* Return -cos(x - 3*pi/2) */ + x -= 49152; + } + if( x < 1100 ) { + /* Special case: high accuracy */ + return SKP_SMLAWB( -1 << 24, SKP_MUL( x, x ), 5053 ); + } + x = SKP_SMULWB( SKP_LSHIFT( x, 8 ), x ); /* contains x^2 in Q20 */ + y_Q30 = SKP_SMLAWB( -SKP_SIN_APPROX_CONST2, x, -SKP_SIN_APPROX_CONST3 ); + y_Q30 = SKP_SMLAWW( -SKP_SIN_APPROX_CONST1, x, y_Q30 ); + y_Q30 = SKP_SMLAWW( -SKP_SIN_APPROX_CONST0, x, y_Q30 ); + } + return SKP_RSHIFT_ROUND( y_Q30, 6 ); +} + +/* Cosine approximation; an input of 65536 corresponds to 2 * pi */ +/* The relative error is below 1e-5 */ +SKP_INLINE SKP_int32 SKP_Silk_COS_APPROX_Q24( /* O returns approximately 2^24 * cos(x * 2 * pi / 65536) */ + SKP_int32 x +) +{ + return SKP_Silk_SIN_APPROX_Q24( x + 16384 ); +} + +#ifdef __cplusplus +} +#endif + +#endif /*_SKP_SILK_FIX_INLINES_H_*/ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LBRR_reset.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LBRR_reset.c new file mode 100755 index 0000000..57bcec6 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LBRR_reset.c @@ -0,0 +1,40 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* Resets LBRR buffer, used if packet size changes */ +void SKP_Silk_LBRR_reset( + SKP_Silk_encoder_state *psEncC /* I/O state */ +) +{ + SKP_int i; + + for( i = 0; i < MAX_LBRR_DELAY; i++ ) { + psEncC->LBRR_buffer[ i ].usage = SKP_SILK_NO_LBRR; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_analysis_filter_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_analysis_filter_FLP.c new file mode 100755 index 0000000..04918d9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_analysis_filter_FLP.c @@ -0,0 +1,238 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include +#include "SKP_Silk_main_FLP.h" + +/*******************************************/ +/* LPC analysis filter */ +/* NB! State is kept internally and the */ +/* filter always starts with zero state */ +/* first Order output samples are not set */ +/*******************************************/ + +void SKP_Silk_LPC_analysis_filter_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length, /* I Length of input signal */ + const SKP_int Order /* I LPC order */ +) +{ + SKP_assert( Order <= length ); + + switch( Order ) { + case 6: + SKP_Silk_LPC_analysis_filter6_FLP( r_LPC, PredCoef, s, length ); + break; + + case 8: + SKP_Silk_LPC_analysis_filter8_FLP( r_LPC, PredCoef, s, length ); + break; + + case 10: + SKP_Silk_LPC_analysis_filter10_FLP( r_LPC, PredCoef, s, length ); + break; + + case 12: + SKP_Silk_LPC_analysis_filter12_FLP( r_LPC, PredCoef, s, length ); + break; + + case 16: + SKP_Silk_LPC_analysis_filter16_FLP( r_LPC, PredCoef, s, length ); + break; + + default: + SKP_assert( 0 ); + break; + } + + /* Set first LPC Order samples to zero instead of undefined */ + SKP_memset( r_LPC, 0, Order * sizeof( SKP_float ) ); +} + +/* 16th order LPC analysis filter, does not write first 16 samples */ +void SKP_Silk_LPC_analysis_filter16_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +) +{ + SKP_int ix = 16; + SKP_float LPC_pred; + const SKP_float *s_ptr; + + for ( ; ix < length; ix++) { + s_ptr = &s[ix - 1]; + + /* short-term prediction */ + LPC_pred = s_ptr[ 0 ] * PredCoef[ 0 ] + + s_ptr[-1] * PredCoef[ 1 ] + + s_ptr[-2] * PredCoef[ 2 ] + + s_ptr[-3] * PredCoef[ 3 ] + + s_ptr[-4] * PredCoef[ 4 ] + + s_ptr[-5] * PredCoef[ 5 ] + + s_ptr[-6] * PredCoef[ 6 ] + + s_ptr[-7] * PredCoef[ 7 ] + + s_ptr[-8] * PredCoef[ 8 ] + + s_ptr[-9] * PredCoef[ 9 ] + + s_ptr[-10] * PredCoef[ 10 ] + + s_ptr[-11] * PredCoef[ 11 ] + + s_ptr[-12] * PredCoef[ 12 ] + + s_ptr[-13] * PredCoef[ 13 ] + + s_ptr[-14] * PredCoef[ 14 ] + + s_ptr[-15] * PredCoef[ 15 ]; + + /* prediction error */ + r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; + } +} + +/* 12th order LPC analysis filter, does not write first 12 samples */ +void SKP_Silk_LPC_analysis_filter12_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +) +{ + SKP_int ix = 12; + SKP_float LPC_pred; + const SKP_float *s_ptr; + + for ( ; ix < length; ix++) { + s_ptr = &s[ix - 1]; + + /* short-term prediction */ + LPC_pred = s_ptr[ 0 ] * PredCoef[ 0 ] + + s_ptr[-1] * PredCoef[ 1 ] + + s_ptr[-2] * PredCoef[ 2 ] + + s_ptr[-3] * PredCoef[ 3 ] + + s_ptr[-4] * PredCoef[ 4 ] + + s_ptr[-5] * PredCoef[ 5 ] + + s_ptr[-6] * PredCoef[ 6 ] + + s_ptr[-7] * PredCoef[ 7 ] + + s_ptr[-8] * PredCoef[ 8 ] + + s_ptr[-9] * PredCoef[ 9 ] + + s_ptr[-10] * PredCoef[ 10 ] + + s_ptr[-11] * PredCoef[ 11 ]; + + /* prediction error */ + r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; + } +} + +/* 10th order LPC analysis filter, does not write first 10 samples */ +void SKP_Silk_LPC_analysis_filter10_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +) +{ + SKP_int ix = 10; + SKP_float LPC_pred; + const SKP_float *s_ptr; + + for ( ; ix < length; ix++) { + s_ptr = &s[ix - 1]; + + /* short-term prediction */ + LPC_pred = s_ptr[ 0 ] * PredCoef[ 0 ] + + s_ptr[-1] * PredCoef[ 1 ] + + s_ptr[-2] * PredCoef[ 2 ] + + s_ptr[-3] * PredCoef[ 3 ] + + s_ptr[-4] * PredCoef[ 4 ] + + s_ptr[-5] * PredCoef[ 5 ] + + s_ptr[-6] * PredCoef[ 6 ] + + s_ptr[-7] * PredCoef[ 7 ] + + s_ptr[-8] * PredCoef[ 8 ] + + s_ptr[-9] * PredCoef[ 9 ]; + + /* prediction error */ + r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; + } +} + +/* 8th order LPC analysis filter, does not write first 8 samples */ +void SKP_Silk_LPC_analysis_filter8_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +) +{ + SKP_int ix = 8; + SKP_float LPC_pred; + const SKP_float *s_ptr; + + for ( ; ix < length; ix++) { + s_ptr = &s[ix - 1]; + + /* short-term prediction */ + LPC_pred = s_ptr[ 0 ] * PredCoef[ 0 ] + + s_ptr[ -1 ] * PredCoef[ 1 ] + + s_ptr[ -2 ] * PredCoef[ 2 ] + + s_ptr[ -3 ] * PredCoef[ 3 ] + + s_ptr[ -4 ] * PredCoef[ 4 ] + + s_ptr[ -5 ] * PredCoef[ 5 ] + + s_ptr[ -6 ] * PredCoef[ 6 ] + + s_ptr[ -7 ] * PredCoef[ 7 ]; + + /* prediction error */ + r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; + } +} + +/* 6th order LPC analysis filter, does not write first 6 samples */ +void SKP_Silk_LPC_analysis_filter6_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +) +{ + SKP_int ix = 6; + SKP_float LPC_pred; + const SKP_float *s_ptr; + + for ( ; ix < length; ix++) { + s_ptr = &s[ix - 1]; + + /* short-term prediction */ + LPC_pred = s_ptr[ 0 ] * PredCoef[ 0 ] + + s_ptr[ -1 ] * PredCoef[ 1 ] + + s_ptr[ -2 ] * PredCoef[ 2 ] + + s_ptr[ -3 ] * PredCoef[ 3 ] + + s_ptr[ -4 ] * PredCoef[ 4 ] + + s_ptr[ -5 ] * PredCoef[ 5 ]; + + /* prediction error */ + r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_inv_pred_gain.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_inv_pred_gain.c new file mode 100755 index 0000000..ddd1462 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_inv_pred_gain.c @@ -0,0 +1,153 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_LPC_inverse_pred_gain.c * + * * + * Compute inverse of LPC prediction gain, and * + * test if LPC coefficients are stable (all poles within unit circle) * + * * + * Copyright 2008 (c), Skype Limited * + * */ +#include "SKP_Silk_SigProc_FIX.h" + +#define QA 16 +#define A_LIMIT SKP_FIX_CONST( 0.99975, QA ) + +/* Compute inverse of LPC prediction gain, and */ +/* test if LPC coefficients are stable (all poles within unit circle) */ +static SKP_int LPC_inverse_pred_gain_QA( /* O: Returns 1 if unstable, otherwise 0 */ + SKP_int32 *invGain_Q30, /* O: Inverse prediction gain, Q30 energy domain */ + SKP_int32 A_QA[ 2 ][ SKP_Silk_MAX_ORDER_LPC ], + /* I: Prediction coefficients */ + const SKP_int order /* I: Prediction order */ +) +{ + SKP_int k, n, headrm; + SKP_int32 rc_Q31, rc_mult1_Q30, rc_mult2_Q16, tmp_QA; + SKP_int32 *Aold_QA, *Anew_QA; + + Anew_QA = A_QA[ order & 1 ]; + + *invGain_Q30 = ( 1 << 30 ); + for( k = order - 1; k > 0; k-- ) { + /* Check for stability */ + if( ( Anew_QA[ k ] > A_LIMIT ) || ( Anew_QA[ k ] < -A_LIMIT ) ) { + return 1; + } + + /* Set RC equal to negated AR coef */ + rc_Q31 = -SKP_LSHIFT( Anew_QA[ k ], 31 - QA ); + + /* rc_mult1_Q30 range: [ 1 : 2^30-1 ] */ + rc_mult1_Q30 = ( SKP_int32_MAX >> 1 ) - SKP_SMMUL( rc_Q31, rc_Q31 ); + SKP_assert( rc_mult1_Q30 > ( 1 << 15 ) ); /* reduce A_LIMIT if fails */ + SKP_assert( rc_mult1_Q30 < ( 1 << 30 ) ); + + /* rc_mult2_Q16 range: [ 2^16 : SKP_int32_MAX ] */ + rc_mult2_Q16 = SKP_INVERSE32_varQ( rc_mult1_Q30, 46 ); /* 16 = 46 - 30 */ + + /* Update inverse gain */ + /* invGain_Q30 range: [ 0 : 2^30 ] */ + *invGain_Q30 = SKP_LSHIFT( SKP_SMMUL( *invGain_Q30, rc_mult1_Q30 ), 2 ); + SKP_assert( *invGain_Q30 >= 0 ); + SKP_assert( *invGain_Q30 <= ( 1 << 30 ) ); + + /* Swap pointers */ + Aold_QA = Anew_QA; + Anew_QA = A_QA[ k & 1 ]; + + /* Update AR coefficient */ + headrm = SKP_Silk_CLZ32( rc_mult2_Q16 ) - 1; + rc_mult2_Q16 = SKP_LSHIFT( rc_mult2_Q16, headrm ); /* Q: 16 + headrm */ + for( n = 0; n < k; n++ ) { + tmp_QA = Aold_QA[ n ] - SKP_LSHIFT( SKP_SMMUL( Aold_QA[ k - n - 1 ], rc_Q31 ), 1 ); + Anew_QA[ n ] = SKP_LSHIFT( SKP_SMMUL( tmp_QA, rc_mult2_Q16 ), 16 - headrm ); + } + } + + /* Check for stability */ + if( ( Anew_QA[ 0 ] > A_LIMIT ) || ( Anew_QA[ 0 ] < -A_LIMIT ) ) { + return 1; + } + + /* Set RC equal to negated AR coef */ + rc_Q31 = -SKP_LSHIFT( Anew_QA[ 0 ], 31 - QA ); + + /* Range: [ 1 : 2^30 ] */ + rc_mult1_Q30 = ( SKP_int32_MAX >> 1 ) - SKP_SMMUL( rc_Q31, rc_Q31 ); + + /* Update inverse gain */ + /* Range: [ 0 : 2^30 ] */ + *invGain_Q30 = SKP_LSHIFT( SKP_SMMUL( *invGain_Q30, rc_mult1_Q30 ), 2 ); + SKP_assert( *invGain_Q30 >= 0 ); + SKP_assert( *invGain_Q30 <= 1<<30 ); + + return 0; +} +/* For input in Q12 domain */ +SKP_int SKP_Silk_LPC_inverse_pred_gain( /* O: Returns 1 if unstable, otherwise 0 */ + SKP_int32 *invGain_Q30, /* O: Inverse prediction gain, Q30 energy domain */ + const SKP_int16 *A_Q12, /* I: Prediction coefficients, Q12 [order] */ + const SKP_int order /* I: Prediction order */ +) +{ + SKP_int k; + SKP_int32 Atmp_QA[ 2 ][ SKP_Silk_MAX_ORDER_LPC ]; + SKP_int32 *Anew_QA; + + Anew_QA = Atmp_QA[ order & 1 ]; + + /* Increase Q domain of the AR coefficients */ + for( k = 0; k < order; k++ ) { + Anew_QA[ k ] = SKP_LSHIFT( (SKP_int32)A_Q12[ k ], QA - 12 ); + } + + return LPC_inverse_pred_gain_QA( invGain_Q30, Atmp_QA, order ); +} + +/* For input in Q24 domain */ +SKP_int SKP_Silk_LPC_inverse_pred_gain_Q24( /* O: Returns 1 if unstable, otherwise 0 */ + SKP_int32 *invGain_Q30, /* O: Inverse prediction gain, Q30 energy domain */ + const SKP_int32 *A_Q24, /* I: Prediction coefficients, Q24 [order] */ + const SKP_int order /* I: Prediction order */ +) +{ + SKP_int k; + SKP_int32 Atmp_QA[ 2 ][ SKP_Silk_MAX_ORDER_LPC ]; + SKP_int32 *Anew_QA; + + Anew_QA = Atmp_QA[ order & 1 ]; + + /* Increase Q domain of the AR coefficients */ + for( k = 0; k < order; k++ ) { + Anew_QA[ k ] = SKP_RSHIFT_ROUND( A_Q24[ k ], 24 - QA ); + } + + return LPC_inverse_pred_gain_QA( invGain_Q30, Atmp_QA, order ); +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_inv_pred_gain_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_inv_pred_gain_FLP.c new file mode 100755 index 0000000..d274a5a --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_inv_pred_gain_FLP.c @@ -0,0 +1,81 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_LPC_inverse_pred_gain.c * + * * + * compute inverse of LPC prediction gain, and * + * test if LPC coefficients are stable (all poles within unit circle) * + * * + * Copyright 2008 (c), Skype Limited * + * */ +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_SigProc_FLP.h" + +#define RC_THRESHOLD 0.9999f + +/* compute inverse of LPC prediction gain, and */ +/* test if LPC coefficients are stable (all poles within unit circle) */ +/* this code is based on SKP_Silk_a2k_FLP() */ +SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherwise 0 */ + SKP_float *invGain, /* O: inverse prediction gain, energy domain */ + const SKP_float *A, /* I: prediction coefficients [order] */ + SKP_int32 order /* I: prediction order */ +) +{ + SKP_int k, n; + double rc, rc_mult1, rc_mult2; + SKP_float Atmp[ 2 ][ SKP_Silk_MAX_ORDER_LPC ]; + SKP_float *Aold, *Anew; + + Anew = Atmp[ order & 1 ]; + SKP_memcpy( Anew, A, order * sizeof(SKP_float) ); + + *invGain = 1.0f; + for( k = order - 1; k > 0; k-- ) { + rc = -Anew[ k ]; + if (rc > RC_THRESHOLD || rc < -RC_THRESHOLD) { + return 1; + } + rc_mult1 = 1.0f - rc * rc; + rc_mult2 = 1.0f / rc_mult1; + *invGain *= (SKP_float)rc_mult1; + /* swap pointers */ + Aold = Anew; + Anew = Atmp[ k & 1 ]; + for( n = 0; n < k; n++ ) { + Anew[ n ] = (SKP_float)( ( Aold[ n ] - Aold[ k - n - 1 ] * rc ) * rc_mult2 ); + } + } + rc = -Anew[ 0 ]; + if ( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) { + return 1; + } + rc_mult1 = 1.0f - rc * rc; + *invGain *= (SKP_float)rc_mult1; + return 0; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_synthesis_filter.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_synthesis_filter.c new file mode 100755 index 0000000..9b3a562 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_synthesis_filter.c @@ -0,0 +1,84 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_LPC_synthesis_filter.c * + * Coefficients are in Q12 * + * * + * even order AR filter * + * */ +#include "SKP_Silk_SigProc_FIX.h" + +/* even order AR filter */ +void SKP_Silk_LPC_synthesis_filter( + const SKP_int16 *in, /* I: excitation signal */ + const SKP_int16 *A_Q12, /* I: AR coefficients [Order], between -8_Q0 and 8_Q0 */ + const SKP_int32 Gain_Q26, /* I: gain */ + SKP_int32 *S, /* I/O: state vector [Order] */ + SKP_int16 *out, /* O: output signal */ + const SKP_int32 len, /* I: signal length */ + const SKP_int Order /* I: filter order, must be even */ +) +{ + SKP_int k, j, idx, Order_half = SKP_RSHIFT( Order, 1 ); + SKP_int32 SA, SB, out32_Q10, out32; + + /* Order must be even */ + SKP_assert( 2 * Order_half == Order ); + + /* S[] values are in Q14 */ + for( k = 0; k < len; k++ ) { + SA = S[ Order - 1 ]; + out32_Q10 = 0; + for( j = 0; j < ( Order_half - 1 ); j++ ) { + idx = SKP_SMULBB( 2, j ) + 1; + SB = S[ Order - 1 - idx ]; + S[ Order - 1 - idx ] = SA; + out32_Q10 = SKP_SMLAWB( out32_Q10, SA, A_Q12[ ( j << 1 ) ] ); + out32_Q10 = SKP_SMLAWB( out32_Q10, SB, A_Q12[ ( j << 1 ) + 1 ] ); + SA = S[ Order - 2 - idx ]; + S[ Order - 2 - idx ] = SB; + } + + /* unrolled loop: epilog */ + SB = S[ 0 ]; + S[ 0 ] = SA; + out32_Q10 = SKP_SMLAWB( out32_Q10, SA, A_Q12[ Order - 2 ] ); + out32_Q10 = SKP_SMLAWB( out32_Q10, SB, A_Q12[ Order - 1 ] ); + /* apply gain to excitation signal and add to prediction */ + out32_Q10 = SKP_ADD_SAT32( out32_Q10, SKP_SMULWB( Gain_Q26, in[ k ] ) ); + + /* scale to Q0 */ + out32 = SKP_RSHIFT_ROUND( out32_Q10, 10 ); + + /* saturate output */ + out[ k ] = ( SKP_int16 )SKP_SAT16( out32 ); + + /* move result into delay line */ + S[ Order - 1 ] = SKP_LSHIFT_SAT32( out32_Q10, 4 ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_synthesis_order16.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_synthesis_order16.c new file mode 100755 index 0000000..f4d0bc3 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LPC_synthesis_order16.c @@ -0,0 +1,122 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_LPC_synthesis_order16.c * + * Coefficients are in Q12 * + * * + * 16th order AR filter * + * */ +#include "SKP_Silk_SigProc_FIX.h" + +/* 16th order AR filter */ +void SKP_Silk_LPC_synthesis_order16(const SKP_int16 *in, /* I: excitation signal */ + const SKP_int16 *A_Q12, /* I: AR coefficients [16], between -8_Q0 and 8_Q0 */ + const SKP_int32 Gain_Q26, /* I: gain */ + SKP_int32 *S, /* I/O: state vector [16] */ + SKP_int16 *out, /* O: output signal */ + const SKP_int32 len /* I: signal length, must be multiple of 16 */ +) +{ + SKP_int k; + SKP_int32 SA, SB, out32_Q10, out32; + for( k = 0; k < len; k++ ) { + /* unrolled loop: prolog */ + /* multiply-add two prediction coefficients per iteration */ + SA = S[ 15 ]; + SB = S[ 14 ]; + S[ 14 ] = SA; + out32_Q10 = SKP_SMULWB( SA, A_Q12[ 0 ] ); + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SB, A_Q12[ 1 ] ); + SA = S[ 13 ]; + S[ 13 ] = SB; + + /* unrolled loop: main loop */ + SB = S[ 12 ]; + S[ 12 ] = SA; + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SA, A_Q12[ 2 ] ); + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SB, A_Q12[ 3 ] ); + SA = S[ 11 ]; + S[ 11 ] = SB; + + SB = S[ 10 ]; + S[ 10 ] = SA; + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SA, A_Q12[ 4 ] ); + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SB, A_Q12[ 5 ] ); + SA = S[ 9 ]; + S[ 9 ] = SB; + + SB = S[ 8 ]; + S[ 8 ] = SA; + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SA, A_Q12[ 6 ] ); + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SB, A_Q12[ 7 ] ); + SA = S[ 7 ]; + S[ 7 ] = SB; + + SB = S[ 6 ]; + S[ 6 ] = SA; + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SA, A_Q12[ 8 ] ); + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SB, A_Q12[ 9 ] ); + SA = S[ 5 ]; + S[ 5 ] = SB; + + SB = S[ 4 ]; + S[ 4 ] = SA; + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SA, A_Q12[ 10 ] ); + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SB, A_Q12[ 11 ] ); + SA = S[ 3 ]; + S[ 3 ] = SB; + + SB = S[ 2 ]; + S[ 2 ] = SA; + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SA, A_Q12[ 12 ] ); + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SB, A_Q12[ 13 ] ); + SA = S[ 1 ]; + S[ 1 ] = SB; + + /* unrolled loop: epilog */ + SB = S[ 0 ]; + S[ 0 ] = SA; + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SA, A_Q12[ 14 ] ); + out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SB, A_Q12[ 15 ] ); + + /* unrolled loop: end */ + /* apply gain to excitation signal and add to prediction */ + out32_Q10 = SKP_ADD_SAT32( out32_Q10, SKP_SMULWB( Gain_Q26, in[ k ] ) ); + + /* scale to Q0 */ + out32 = SKP_RSHIFT_ROUND( out32_Q10, 10 ); + + /* saturate output */ + out[ k ] = ( SKP_int16 )SKP_SAT16( out32 ); + + /* move result into delay line */ + S[ 15 ] = SKP_LSHIFT_SAT32( out32_Q10, 4 ); + } +} + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LP_variable_cutoff.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LP_variable_cutoff.c new file mode 100755 index 0000000..b8e1b88 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LP_variable_cutoff.c @@ -0,0 +1,194 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* + + Elliptic/Cauer filters designed with 0.1 dB passband ripple, + 80 dB minimum stopband attenuation, and + [0.95 : 0.15 : 0.35] normalized cut off frequencies. + +*/ +#include "SKP_Silk_main.h" + +#if SWITCH_TRANSITION_FILTERING + +/* Helper function, that interpolates the filter taps */ +SKP_INLINE void SKP_Silk_LP_interpolate_filter_taps( + SKP_int32 B_Q28[ TRANSITION_NB ], + SKP_int32 A_Q28[ TRANSITION_NA ], + const SKP_int ind, + const SKP_int32 fac_Q16 +) +{ + SKP_int nb, na; + + if( ind < TRANSITION_INT_NUM - 1 ) { + if( fac_Q16 > 0 ) { + if( fac_Q16 == SKP_SAT16( fac_Q16 ) ) { /* fac_Q16 is in range of a 16-bit int */ + /* Piece-wise linear interpolation of B and A */ + for( nb = 0; nb < TRANSITION_NB; nb++ ) { + B_Q28[ nb ] = SKP_SMLAWB( + SKP_Silk_Transition_LP_B_Q28[ ind ][ nb ], + SKP_Silk_Transition_LP_B_Q28[ ind + 1 ][ nb ] - + SKP_Silk_Transition_LP_B_Q28[ ind ][ nb ], + fac_Q16 ); + } + for( na = 0; na < TRANSITION_NA; na++ ) { + A_Q28[ na ] = SKP_SMLAWB( + SKP_Silk_Transition_LP_A_Q28[ ind ][ na ], + SKP_Silk_Transition_LP_A_Q28[ ind + 1 ][ na ] - + SKP_Silk_Transition_LP_A_Q28[ ind ][ na ], + fac_Q16 ); + } + } else if( fac_Q16 == ( 1 << 15 ) ) { /* Neither fac_Q16 nor ( ( 1 << 16 ) - fac_Q16 ) is in range of a 16-bit int */ + + /* Piece-wise linear interpolation of B and A */ + for( nb = 0; nb < TRANSITION_NB; nb++ ) { + B_Q28[ nb ] = SKP_RSHIFT( + SKP_Silk_Transition_LP_B_Q28[ ind ][ nb ] + + SKP_Silk_Transition_LP_B_Q28[ ind + 1 ][ nb ], + 1 ); + } + for( na = 0; na < TRANSITION_NA; na++ ) { + A_Q28[ na ] = SKP_RSHIFT( + SKP_Silk_Transition_LP_A_Q28[ ind ][ na ] + + SKP_Silk_Transition_LP_A_Q28[ ind + 1 ][ na ], + 1 ); + } + } else { /* ( ( 1 << 16 ) - fac_Q16 ) is in range of a 16-bit int */ + + SKP_assert( ( ( 1 << 16 ) - fac_Q16 ) == SKP_SAT16( ( ( 1 << 16 ) - fac_Q16) ) ); + /* Piece-wise linear interpolation of B and A */ + for( nb = 0; nb < TRANSITION_NB; nb++ ) { + B_Q28[ nb ] = SKP_SMLAWB( + SKP_Silk_Transition_LP_B_Q28[ ind + 1 ][ nb ], + SKP_Silk_Transition_LP_B_Q28[ ind ][ nb ] - + SKP_Silk_Transition_LP_B_Q28[ ind + 1 ][ nb ], + ( 1 << 16 ) - fac_Q16 ); + } + for( na = 0; na < TRANSITION_NA; na++ ) { + A_Q28[ na ] = SKP_SMLAWB( + SKP_Silk_Transition_LP_A_Q28[ ind + 1 ][ na ], + SKP_Silk_Transition_LP_A_Q28[ ind ][ na ] - + SKP_Silk_Transition_LP_A_Q28[ ind + 1 ][ na ], + ( 1 << 16 ) - fac_Q16 ); + } + } + } else { + SKP_memcpy( B_Q28, SKP_Silk_Transition_LP_B_Q28[ ind ], TRANSITION_NB * sizeof( SKP_int32 ) ); + SKP_memcpy( A_Q28, SKP_Silk_Transition_LP_A_Q28[ ind ], TRANSITION_NA * sizeof( SKP_int32 ) ); + } + } else { + SKP_memcpy( B_Q28, SKP_Silk_Transition_LP_B_Q28[ TRANSITION_INT_NUM - 1 ], TRANSITION_NB * sizeof( SKP_int32 ) ); + SKP_memcpy( A_Q28, SKP_Silk_Transition_LP_A_Q28[ TRANSITION_INT_NUM - 1 ], TRANSITION_NA * sizeof( SKP_int32 ) ); + } +} + +/* Low-pass filter with variable cutoff frequency based on */ +/* piece-wise linear interpolation between elliptic filters */ +/* Start by setting psEncC->transition_frame_no = 1; */ +/* Deactivate by setting psEncC->transition_frame_no = 0; */ +void SKP_Silk_LP_variable_cutoff( + SKP_Silk_LP_state *psLP, /* I/O LP filter state */ + SKP_int16 *out, /* O Low-pass filtered output signal */ + const SKP_int16 *in, /* I Input signal */ + const SKP_int frame_length /* I Frame length */ +) +{ + SKP_int32 B_Q28[ TRANSITION_NB ], A_Q28[ TRANSITION_NA ], fac_Q16 = 0; + SKP_int ind = 0; + + SKP_assert( psLP->transition_frame_no >= 0 ); + SKP_assert( ( ( ( psLP->transition_frame_no <= TRANSITION_FRAMES_DOWN ) && ( psLP->mode == 0 ) ) || + ( ( psLP->transition_frame_no <= TRANSITION_FRAMES_UP ) && ( psLP->mode == 1 ) ) ) ); + + /* Interpolate filter coefficients if needed */ + if( psLP->transition_frame_no > 0 ) { + if( psLP->mode == 0 ) { + if( psLP->transition_frame_no < TRANSITION_FRAMES_DOWN ) { + /* Calculate index and interpolation factor for interpolation */ +#if( TRANSITION_INT_STEPS_DOWN == 32 ) + fac_Q16 = SKP_LSHIFT( psLP->transition_frame_no, 16 - 5 ); +#else + fac_Q16 = SKP_DIV32_16( SKP_LSHIFT( psLP->transition_frame_no, 16 ), TRANSITION_INT_STEPS_DOWN ); +#endif + ind = SKP_RSHIFT( fac_Q16, 16 ); + fac_Q16 -= SKP_LSHIFT( ind, 16 ); + + SKP_assert( ind >= 0 ); + SKP_assert( ind < TRANSITION_INT_NUM ); + + /* Interpolate filter coefficients */ + SKP_Silk_LP_interpolate_filter_taps( B_Q28, A_Q28, ind, fac_Q16 ); + + /* Increment transition frame number for next frame */ + psLP->transition_frame_no++; + + } else { + SKP_assert( psLP->transition_frame_no == TRANSITION_FRAMES_DOWN ); + /* End of transition phase */ + SKP_Silk_LP_interpolate_filter_taps( B_Q28, A_Q28, TRANSITION_INT_NUM - 1, 0 ); + } + } else { + SKP_assert( psLP->mode == 1 ); + if( psLP->transition_frame_no < TRANSITION_FRAMES_UP ) { + /* Calculate index and interpolation factor for interpolation */ +#if( TRANSITION_INT_STEPS_UP == 64 ) + fac_Q16 = SKP_LSHIFT( TRANSITION_FRAMES_UP - psLP->transition_frame_no, 16 - 6 ); +#else + fac_Q16 = SKP_DIV32_16( SKP_LSHIFT( TRANSITION_FRAMES_UP - psLP->transition_frame_no, 16 ), TRANSITION_INT_STEPS_UP ); +#endif + ind = SKP_RSHIFT( fac_Q16, 16 ); + fac_Q16 -= SKP_LSHIFT( ind, 16 ); + + SKP_assert( ind >= 0 ); + SKP_assert( ind < TRANSITION_INT_NUM ); + + /* Interpolate filter coefficients */ + SKP_Silk_LP_interpolate_filter_taps( B_Q28, A_Q28, ind, fac_Q16 ); + + /* Increment transition frame number for next frame */ + psLP->transition_frame_no++; + + } else { + SKP_assert( psLP->transition_frame_no == TRANSITION_FRAMES_UP ); + /* End of transition phase */ + SKP_Silk_LP_interpolate_filter_taps( B_Q28, A_Q28, 0, 0 ); + } + } + } + + if( psLP->transition_frame_no > 0 ) { + /* ARMA low-pass filtering */ + SKP_assert( TRANSITION_NB == 3 && TRANSITION_NA == 2 ); + SKP_Silk_biquad_alt( in, B_Q28, A_Q28, psLP->In_LP_State, out, frame_length ); + } else { + /* Instead of using the filter, copy input directly to output */ + SKP_memcpy( out, in, frame_length * sizeof( SKP_int16 ) ); + } +} +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LSF_cos_table.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LSF_cos_table.c new file mode 100755 index 0000000..aba3e1d --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LSF_cos_table.c @@ -0,0 +1,65 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FIX.h" + +// Q12 values (even) +const SKP_int SKP_Silk_LSFCosTab_FIX_Q12[LSF_COS_TAB_SZ_FIX + 1] = { + 8192, 8190, 8182, 8170, + 8152, 8130, 8104, 8072, + 8034, 7994, 7946, 7896, + 7840, 7778, 7714, 7644, + 7568, 7490, 7406, 7318, + 7226, 7128, 7026, 6922, + 6812, 6698, 6580, 6458, + 6332, 6204, 6070, 5934, + 5792, 5648, 5502, 5352, + 5198, 5040, 4880, 4718, + 4552, 4382, 4212, 4038, + 3862, 3684, 3502, 3320, + 3136, 2948, 2760, 2570, + 2378, 2186, 1990, 1794, + 1598, 1400, 1202, 1002, + 802, 602, 402, 202, + 0, -202, -402, -602, + -802, -1002, -1202, -1400, + -1598, -1794, -1990, -2186, + -2378, -2570, -2760, -2948, + -3136, -3320, -3502, -3684, + -3862, -4038, -4212, -4382, + -4552, -4718, -4880, -5040, + -5198, -5352, -5502, -5648, + -5792, -5934, -6070, -6204, + -6332, -6458, -6580, -6698, + -6812, -6922, -7026, -7128, + -7226, -7318, -7406, -7490, + -7568, -7644, -7714, -7778, + -7840, -7896, -7946, -7994, + -8034, -8072, -8104, -8130, + -8152, -8170, -8182, -8190, + -8192 +}; diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LTP_analysis_filter_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LTP_analysis_filter_FLP.c new file mode 100755 index 0000000..dd34892 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LTP_analysis_filter_FLP.c @@ -0,0 +1,70 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +void SKP_Silk_LTP_analysis_filter_FLP( + SKP_float *LTP_res, /* O LTP res NB_SUBFR*(pre_lgth+subfr_lngth) */ + const SKP_float *x, /* I Input signal, with preceeding samples */ + const SKP_float B[ LTP_ORDER * NB_SUBFR ], /* I LTP coefficients for each subframe */ + const SKP_int pitchL[ NB_SUBFR ], /* I Pitch lags */ + const SKP_float invGains[ NB_SUBFR ], /* I Inverse quantization gains */ + const SKP_int subfr_length, /* I Length of each subframe */ + const SKP_int pre_length /* I Preceeding samples for each subframe */ +) +{ + const SKP_float *x_ptr, *x_lag_ptr; + SKP_float Btmp[ LTP_ORDER ]; + SKP_float *LTP_res_ptr; + SKP_float inv_gain; + SKP_int k, i, j; + + x_ptr = x; + LTP_res_ptr = LTP_res; + for( k = 0; k < NB_SUBFR; k++ ) { + x_lag_ptr = x_ptr - pitchL[ k ]; + inv_gain = invGains[ k ]; + for( i = 0; i < LTP_ORDER; i++ ) { + Btmp[ i ] = B[ k * LTP_ORDER + i ]; + } + + /* LTP analysis FIR filter */ + for( i = 0; i < subfr_length + pre_length; i++ ) { + LTP_res_ptr[ i ] = x_ptr[ i ]; + /* Subtract long-term prediction */ + for( j = 0; j < LTP_ORDER; j++ ) { + LTP_res_ptr[ i ] -= Btmp[ j ] * x_lag_ptr[ LTP_ORDER / 2 - j ]; + } + LTP_res_ptr[ i ] *= inv_gain; + x_lag_ptr++; + } + + /* Update pointers */ + LTP_res_ptr += subfr_length + pre_length; + x_ptr += subfr_length; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LTP_scale_ctrl_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LTP_scale_ctrl_FLP.c new file mode 100755 index 0000000..59aaa70 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_LTP_scale_ctrl_FLP.c @@ -0,0 +1,85 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +#define NB_THRESHOLDS 11 +/* Table containing trained thresholds for LTP scaling */ +static const SKP_float LTPScaleThresholds[ NB_THRESHOLDS ] = +{ + 0.95f, 0.8f, 0.50f, 0.400f, 0.3f, 0.2f, + 0.15f, 0.1f, 0.08f, 0.075f, 0.0f +}; + + +void SKP_Silk_LTP_scale_ctrl_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl /* I/O Encoder control FLP */ +) +{ + SKP_int round_loss, frames_per_packet; + SKP_float g_out, g_limit, thrld1, thrld2; + + /* 1st order high-pass filter */ + //g_HP(n) = g(n) - g(n-1) + 0.5 * g_HP(n-1); // tune the 0.5: higher means longer impact of jump + psEnc->HPLTPredCodGain = SKP_max_float( psEncCtrl->LTPredCodGain - psEnc->prevLTPredCodGain, 0.0f ) + + 0.5f * psEnc->HPLTPredCodGain; + + psEnc->prevLTPredCodGain = psEncCtrl->LTPredCodGain; + + /* Combine input and filtered input */ + g_out = 0.5f * psEncCtrl->LTPredCodGain + ( 1.0f - 0.5f ) * psEnc->HPLTPredCodGain; + g_limit = SKP_sigmoid( 0.5f * ( g_out - 6 ) ); + + + /* Default is minimum scaling */ + psEncCtrl->sCmn.LTP_scaleIndex = 0; + + /* Round the loss measure to whole pct */ + round_loss = ( SKP_int )( psEnc->sCmn.PacketLoss_perc ); + round_loss = SKP_max( 0, round_loss ); + + /* Only scale if first frame in packet 0% */ + if( psEnc->sCmn.nFramesInPayloadBuf == 0 ){ + + frames_per_packet = psEnc->sCmn.PacketSize_ms / FRAME_LENGTH_MS; + + round_loss += ( frames_per_packet - 1 ); + thrld1 = LTPScaleThresholds[ SKP_min_int( round_loss, NB_THRESHOLDS - 1 ) ]; + thrld2 = LTPScaleThresholds[ SKP_min_int( round_loss + 1, NB_THRESHOLDS - 1 ) ]; + + if( g_limit > thrld1 ) { + /* High Scaling */ + psEncCtrl->sCmn.LTP_scaleIndex = 2; + } else if( g_limit > thrld2 ) { + /* Middle Scaling */ + psEncCtrl->sCmn.LTP_scaleIndex = 1; + } + } + psEncCtrl->LTP_scale = ( SKP_float)SKP_Silk_LTPScales_table_Q14[ psEncCtrl->sCmn.LTP_scaleIndex ] / 16384.0f; + +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_MA.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_MA.c new file mode 100755 index 0000000..461e291 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_MA.c @@ -0,0 +1,116 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_MA.c * + * * + * Variable order MA filter * + * * + * Copyright 2006 (c), Skype Limited * + * Date: 060221 * + * */ +#include "SKP_Silk_SigProc_FIX.h" + +/* Variable order MA prediction error filter */ +void SKP_Silk_MA_Prediction( + const SKP_int16 *in, /* I: Input signal */ + const SKP_int16 *B, /* I: MA prediction coefficients, Q12 [order] */ + SKP_int32 *S, /* I/O: State vector [order] */ + SKP_int16 *out, /* O: Output signal */ + const SKP_int32 len, /* I: Signal length */ + const SKP_int32 order /* I: Filter order */ +) +{ + SKP_int k, d, in16; + SKP_int32 out32; + + for( k = 0; k < len; k++ ) { + in16 = in[ k ]; + out32 = SKP_LSHIFT( in16, 12 ) - S[ 0 ]; + out32 = SKP_RSHIFT_ROUND( out32, 12 ); + + for( d = 0; d < order - 1; d++ ) { + S[ d ] = SKP_SMLABB_ovflw( S[ d + 1 ], in16, B[ d ] ); + } + S[ order - 1 ] = SKP_SMULBB( in16, B[ order - 1 ] ); + + /* Limit */ + out[ k ] = (SKP_int16)SKP_SAT16( out32 ); + } +} + + +void SKP_Silk_LPC_analysis_filter( + const SKP_int16 *in, /* I: Input signal */ + const SKP_int16 *B, /* I: MA prediction coefficients, Q12 [order] */ + SKP_int16 *S, /* I/O: State vector [order] */ + SKP_int16 *out, /* O: Output signal */ + const SKP_int32 len, /* I: Signal length */ + const SKP_int32 Order /* I: Filter order */ +) +{ + SKP_int k, j, idx, Order_half = SKP_RSHIFT( Order, 1 ); + SKP_int32 out32_Q12, out32; + SKP_int16 SA, SB; + /* Order must be even */ + SKP_assert( 2 * Order_half == Order ); + + /* S[] values are in Q0 */ + for( k = 0; k < len; k++ ) { + SA = S[ 0 ]; + out32_Q12 = 0; + for( j = 0; j < ( Order_half - 1 ); j++ ) { + idx = SKP_SMULBB( 2, j ) + 1; + /* Multiply-add two prediction coefficients for each loop */ + SB = S[ idx ]; + S[ idx ] = SA; + out32_Q12 = SKP_SMLABB( out32_Q12, SA, B[ idx - 1 ] ); + out32_Q12 = SKP_SMLABB( out32_Q12, SB, B[ idx ] ); + SA = S[ idx + 1 ]; + S[ idx + 1 ] = SB; + } + + /* Unrolled loop: epilog */ + SB = S[ Order - 1 ]; + S[ Order - 1 ] = SA; + out32_Q12 = SKP_SMLABB( out32_Q12, SA, B[ Order - 2 ] ); + out32_Q12 = SKP_SMLABB( out32_Q12, SB, B[ Order - 1 ] ); + + /* Subtract prediction */ + out32_Q12 = SKP_SUB_SAT32( SKP_LSHIFT( (SKP_int32)in[ k ], 12 ), out32_Q12 ); + + /* Scale to Q0 */ + out32 = SKP_RSHIFT_ROUND( out32_Q12, 12 ); + + /* Saturate output */ + out[ k ] = ( SKP_int16 )SKP_SAT16( out32 ); + + /* Move input line */ + S[ 0 ] = in[ k ]; + } +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF2A.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF2A.c new file mode 100755 index 0000000..47b62b9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF2A.c @@ -0,0 +1,151 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* conversion between prediction filter coefficients and LSFs */ +/* order should be even */ +/* a piecewise linear approximation maps LSF <-> cos(LSF) */ +/* therefore the result is not accurate LSFs, but the two */ +/* function are accurate inverses of each other */ + +#include "SKP_Silk_SigProc_FIX.h" + +/* helper function for NLSF2A(..) */ +SKP_INLINE void SKP_Silk_NLSF2A_find_poly( + SKP_int32 *out, /* o intermediate polynomial, Q20 */ + const SKP_int32 *cLSF, /* i vector of interleaved 2*cos(LSFs), Q20 */ + SKP_int dd /* i polynomial order (= 1/2 * filter order) */ +) +{ + SKP_int k, n; + SKP_int32 ftmp; + + out[0] = SKP_LSHIFT( 1, 20 ); + out[1] = -cLSF[0]; + for( k = 1; k < dd; k++ ) { + ftmp = cLSF[2*k]; // Q20 + out[k+1] = SKP_LSHIFT( out[k-1], 1 ) - (SKP_int32)SKP_RSHIFT_ROUND64( SKP_SMULL( ftmp, out[k] ), 20 ); + for( n = k; n > 1; n-- ) { + out[n] += out[n-2] - (SKP_int32)SKP_RSHIFT_ROUND64( SKP_SMULL( ftmp, out[n-1] ), 20 ); + } + out[1] -= ftmp; + } +} + +/* compute whitening filter coefficients from normalized line spectral frequencies */ +void SKP_Silk_NLSF2A( + SKP_int16 *a, /* o monic whitening filter coefficients in Q12, [d] */ + const SKP_int *NLSF, /* i normalized line spectral frequencies in Q15, [d] */ + const SKP_int d /* i filter order (should be even) */ +) +{ + SKP_int k, i, dd; + SKP_int32 cos_LSF_Q20[SKP_Silk_MAX_ORDER_LPC]; + SKP_int32 P[SKP_Silk_MAX_ORDER_LPC/2+1], Q[SKP_Silk_MAX_ORDER_LPC/2+1]; + SKP_int32 Ptmp, Qtmp; + SKP_int32 f_int; + SKP_int32 f_frac; + SKP_int32 cos_val, delta; + SKP_int32 a_int32[SKP_Silk_MAX_ORDER_LPC]; + SKP_int32 maxabs, absval, idx=0, sc_Q16; + + SKP_assert(LSF_COS_TAB_SZ_FIX == 128); + + /* convert LSFs to 2*cos(LSF(i)), using piecewise linear curve from table */ + for( k = 0; k < d; k++ ) { + SKP_assert(NLSF[k] >= 0 ); + SKP_assert(NLSF[k] <= 32767 ); + + /* f_int on a scale 0-127 (rounded down) */ + f_int = SKP_RSHIFT( NLSF[k], 15 - 7 ); + + /* f_frac, range: 0..255 */ + f_frac = NLSF[k] - SKP_LSHIFT( f_int, 15 - 7 ); + + SKP_assert(f_int >= 0); + SKP_assert(f_int < LSF_COS_TAB_SZ_FIX ); + + /* Read start and end value from table */ + cos_val = SKP_Silk_LSFCosTab_FIX_Q12[ f_int ]; /* Q12 */ + delta = SKP_Silk_LSFCosTab_FIX_Q12[ f_int + 1 ] - cos_val; /* Q12, with a range of 0..200 */ + + /* Linear interpolation */ + cos_LSF_Q20[k] = SKP_LSHIFT( cos_val, 8 ) + SKP_MUL( delta, f_frac ); /* Q20 */ + } + + dd = SKP_RSHIFT( d, 1 ); + + /* generate even and odd polynomials using convolution */ + SKP_Silk_NLSF2A_find_poly( P, &cos_LSF_Q20[0], dd ); + SKP_Silk_NLSF2A_find_poly( Q, &cos_LSF_Q20[1], dd ); + + /* convert even and odd polynomials to SKP_int32 Q12 filter coefs */ + for( k = 0; k < dd; k++ ) { + Ptmp = P[k+1] + P[k]; + Qtmp = Q[k+1] - Q[k]; + + /* the Ptmp and Qtmp values at this stage need to fit in int32 */ + + a_int32[k] = -SKP_RSHIFT_ROUND( Ptmp + Qtmp, 9 ); /* Q20 -> Q12 */ + a_int32[d-k-1] = SKP_RSHIFT_ROUND( Qtmp - Ptmp, 9 ); /* Q20 -> Q12 */ + } + + /* Limit the maximum absolute value of the prediction coefficients */ + for( i = 0; i < 10; i++ ) { + /* Find maximum absolute value and its index */ + maxabs = 0; + for( k = 0; k < d; k++ ) { + absval = SKP_abs( a_int32[k] ); + if( absval > maxabs ) { + maxabs = absval; + idx = k; + } + } + + if( maxabs > SKP_int16_MAX ) { + /* Reduce magnitude of prediction coefficients */ + maxabs = SKP_min( maxabs, 98369 ); // ( SKP_int32_MAX / ( 65470 >> 2 ) ) + SKP_int16_MAX = 98369 + sc_Q16 = 65470 - SKP_DIV32( SKP_MUL( 65470 >> 2, maxabs - SKP_int16_MAX ), + SKP_RSHIFT32( SKP_MUL( maxabs, idx + 1), 2 ) ); + SKP_Silk_bwexpander_32( a_int32, d, sc_Q16 ); + } else { + break; + } + } + + /* Reached the last iteration */ + if( i == 10 ) { + SKP_assert(0); + for( k = 0; k < d; k++ ) { + a_int32[k] = SKP_SAT16( a_int32[k] ); + } + } + + /* Return as SKP_int16 Q12 coefficients */ + for( k = 0; k < d; k++ ) { + a[k] = (SKP_int16)a_int32[k]; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF2A_stable.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF2A_stable.c new file mode 100755 index 0000000..d36b075 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF2A_stable.c @@ -0,0 +1,58 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* Convert NLSF parameters to stable AR prediction filter coefficients */ +void SKP_Silk_NLSF2A_stable( + SKP_int16 pAR_Q12[ MAX_LPC_ORDER ], /* O Stabilized AR coefs [LPC_order] */ + const SKP_int pNLSF[ MAX_LPC_ORDER ], /* I NLSF vector [LPC_order] */ + const SKP_int LPC_order /* I LPC/LSF order */ +) +{ + SKP_int i; + SKP_int32 invGain_Q30; + + SKP_Silk_NLSF2A( pAR_Q12, pNLSF, LPC_order ); + + /* Ensure stable LPCs */ + for( i = 0; i < MAX_LPC_STABILIZE_ITERATIONS; i++ ) { + if( SKP_Silk_LPC_inverse_pred_gain( &invGain_Q30, pAR_Q12, LPC_order ) == 1 ) { + SKP_Silk_bwexpander( pAR_Q12, LPC_order, 65536 - SKP_SMULBB( 10 + i, i ) ); /* 10_Q16 = 0.00015 */ + } else { + break; + } + } + + /* Reached the last iteration */ + if( i == MAX_LPC_STABILIZE_ITERATIONS ) { + SKP_assert( 0 ); + for( i = 0; i < LPC_order; i++ ) { + pAR_Q12[ i ] = 0; + } + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_decode.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_decode.c new file mode 100755 index 0000000..bb3baf8 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_decode.c @@ -0,0 +1,91 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* NLSF vector decoder */ +void SKP_Silk_NLSF_MSVQ_decode( + SKP_int *pNLSF_Q15, /* O Pointer to decoded output vector [LPC_ORDER x 1] */ + const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Pointer to NLSF codebook struct */ + const SKP_int *NLSFIndices, /* I Pointer to NLSF indices [nStages x 1] */ + const SKP_int LPC_order /* I LPC order used */ +) +{ + const SKP_int16 *pCB_element; + SKP_int s; + SKP_int i; + + /* Check that each index is within valid range */ + SKP_assert( 0 <= NLSFIndices[ 0 ] && NLSFIndices[ 0 ] < psNLSF_CB->CBStages[ 0 ].nVectors ); + + /* Point to the first vector element */ + pCB_element = &psNLSF_CB->CBStages[ 0 ].CB_NLSF_Q15[ SKP_MUL( NLSFIndices[ 0 ], LPC_order ) ]; + + /* Initialize with the codebook vector from stage 0 */ + for( i = 0; i < LPC_order; i++ ) { + pNLSF_Q15[ i ] = ( SKP_int )pCB_element[ i ]; + } + + for( s = 1; s < psNLSF_CB->nStages; s++ ) { + /* Check that each index is within valid range */ + SKP_assert( 0 <= NLSFIndices[ s ] && NLSFIndices[ s ] < psNLSF_CB->CBStages[ s ].nVectors ); + + if( LPC_order == 16 ) { + /* Point to the first vector element */ + pCB_element = &psNLSF_CB->CBStages[ s ].CB_NLSF_Q15[ SKP_LSHIFT( NLSFIndices[ s ], 4 ) ]; + + /* Add the codebook vector from the current stage */ + pNLSF_Q15[ 0 ] += pCB_element[ 0 ]; + pNLSF_Q15[ 1 ] += pCB_element[ 1 ]; + pNLSF_Q15[ 2 ] += pCB_element[ 2 ]; + pNLSF_Q15[ 3 ] += pCB_element[ 3 ]; + pNLSF_Q15[ 4 ] += pCB_element[ 4 ]; + pNLSF_Q15[ 5 ] += pCB_element[ 5 ]; + pNLSF_Q15[ 6 ] += pCB_element[ 6 ]; + pNLSF_Q15[ 7 ] += pCB_element[ 7 ]; + pNLSF_Q15[ 8 ] += pCB_element[ 8 ]; + pNLSF_Q15[ 9 ] += pCB_element[ 9 ]; + pNLSF_Q15[ 10 ] += pCB_element[ 10 ]; + pNLSF_Q15[ 11 ] += pCB_element[ 11 ]; + pNLSF_Q15[ 12 ] += pCB_element[ 12 ]; + pNLSF_Q15[ 13 ] += pCB_element[ 13 ]; + pNLSF_Q15[ 14 ] += pCB_element[ 14 ]; + pNLSF_Q15[ 15 ] += pCB_element[ 15 ]; + } else { + /* Point to the first vector element */ + pCB_element = &psNLSF_CB->CBStages[ s ].CB_NLSF_Q15[ SKP_SMULBB( NLSFIndices[ s ], LPC_order ) ]; + + /* Add the codebook vector from the current stage */ + for( i = 0; i < LPC_order; i++ ) { + pNLSF_Q15[ i ] += pCB_element[ i ]; + } + } + } + + /* NLSF stabilization */ + SKP_Silk_NLSF_stabilize( pNLSF_Q15, psNLSF_CB->NDeltaMin_Q15, LPC_order ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_decode_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_decode_FLP.c new file mode 100755 index 0000000..e7c560a --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_decode_FLP.c @@ -0,0 +1,89 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +/* NLSF vector decoder */ +void SKP_Silk_NLSF_MSVQ_decode_FLP( + SKP_float *pNLSF, /* O Decoded output vector [ LPC_ORDER ] */ + const SKP_Silk_NLSF_CB_FLP *psNLSF_CB_FLP, /* I NLSF codebook struct */ + const SKP_int *NLSFIndices, /* I NLSF indices [ nStages ] */ + const SKP_int LPC_order /* I LPC order used */ +) +{ + const SKP_float *pCB_element; + SKP_int s; + SKP_int i; + + /* Check that each index is within valid range */ + SKP_assert( 0 <= NLSFIndices[ 0 ] && NLSFIndices[ 0 ] < psNLSF_CB_FLP->CBStages[ 0 ].nVectors ); + + /* Point to the first vector element */ + pCB_element = &psNLSF_CB_FLP->CBStages[ 0 ].CB[ SKP_MUL( NLSFIndices[ 0 ], LPC_order ) ]; + + /* Initialize with the codebook vector from stage 0 */ + SKP_memcpy( pNLSF, pCB_element, LPC_order * sizeof( SKP_float ) ); + + for( s = 1; s < psNLSF_CB_FLP->nStages; s++ ) { + /* Check that each index is within valid range */ + SKP_assert( 0 <= NLSFIndices[ s ] && NLSFIndices[ s ] < psNLSF_CB_FLP->CBStages[ s ].nVectors ); + + if( LPC_order == 16 ) { + /* Point to the first vector element */ + pCB_element = &psNLSF_CB_FLP->CBStages[ s ].CB[ SKP_LSHIFT( NLSFIndices[ s ], 4 ) ]; + + /* Add the codebook vector from the current stage */ + pNLSF[ 0 ] += pCB_element[ 0 ]; + pNLSF[ 1 ] += pCB_element[ 1 ]; + pNLSF[ 2 ] += pCB_element[ 2 ]; + pNLSF[ 3 ] += pCB_element[ 3 ]; + pNLSF[ 4 ] += pCB_element[ 4 ]; + pNLSF[ 5 ] += pCB_element[ 5 ]; + pNLSF[ 6 ] += pCB_element[ 6 ]; + pNLSF[ 7 ] += pCB_element[ 7 ]; + pNLSF[ 8 ] += pCB_element[ 8 ]; + pNLSF[ 9 ] += pCB_element[ 9 ]; + pNLSF[ 10 ] += pCB_element[ 10 ]; + pNLSF[ 11 ] += pCB_element[ 11 ]; + pNLSF[ 12 ] += pCB_element[ 12 ]; + pNLSF[ 13 ] += pCB_element[ 13 ]; + pNLSF[ 14 ] += pCB_element[ 14 ]; + pNLSF[ 15 ] += pCB_element[ 15 ]; + } else { + /* Point to the first vector element */ + pCB_element = &psNLSF_CB_FLP->CBStages[ s ].CB[ NLSFIndices[ s ] * LPC_order ]; + + /* Add the codebook vector from the current stage */ + for( i = 0; i < LPC_order; i++ ) { + pNLSF[ i ] += pCB_element[ i ]; + } + } + } + + /* NLSF stabilization */ + SKP_Silk_NLSF_stabilize_FLP( pNLSF, psNLSF_CB_FLP->NDeltaMin, LPC_order ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_encode_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_encode_FLP.c new file mode 100755 index 0000000..22bc9d1 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_MSVQ_encode_FLP.c @@ -0,0 +1,233 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +/***********************/ +/* NLSF vector encoder */ +/***********************/ +void SKP_Silk_NLSF_MSVQ_encode_FLP( + SKP_int *NLSFIndices, /* O Codebook path vector [ CB_STAGES ] */ + SKP_float *pNLSF, /* I/O Quantized NLSF vector [ LPC_ORDER ] */ + const SKP_Silk_NLSF_CB_FLP *psNLSF_CB_FLP, /* I Codebook object */ + const SKP_float *pNLSF_q_prev, /* I Prev. quantized NLSF vector [LPC_ORDER] */ + const SKP_float *pW, /* I NLSF weight vector [ LPC_ORDER ] */ + const SKP_float NLSF_mu, /* I Rate weight for the RD optimization */ + const SKP_float NLSF_mu_fluc_red, /* I Fluctuation reduction error weight */ + const SKP_int NLSF_MSVQ_Survivors,/* I Max survivors from each stage */ + const SKP_int LPC_order, /* I LPC order */ + const SKP_int deactivate_fluc_red /* I Deactivate fluctuation reduction */ +) +{ + SKP_int i, s, k, cur_survivors, prev_survivors, min_survivors, input_index, cb_index, bestIndex; + SKP_float se, wsse, rateDistThreshold, bestRateDist; + +#if( LOW_COMPLEXITY_ONLY == 1 ) + SKP_float pRateDist[ NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED_LC_MODE ]; + SKP_float pRate[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ]; + SKP_float pRate_new[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ]; + SKP_int pTempIndices[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ]; + SKP_int pPath[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * NLSF_MSVQ_MAX_CB_STAGES ]; + SKP_int pPath_new[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * NLSF_MSVQ_MAX_CB_STAGES ]; + SKP_float pRes[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * MAX_LPC_ORDER ]; + SKP_float pRes_new[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * MAX_LPC_ORDER ]; +#else + SKP_float pRateDist[ NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED ]; + SKP_float pRate[ MAX_NLSF_MSVQ_SURVIVORS ]; + SKP_float pRate_new[ MAX_NLSF_MSVQ_SURVIVORS ]; + SKP_int pTempIndices[ MAX_NLSF_MSVQ_SURVIVORS ]; + SKP_int pPath[ MAX_NLSF_MSVQ_SURVIVORS * NLSF_MSVQ_MAX_CB_STAGES ]; + SKP_int pPath_new[ MAX_NLSF_MSVQ_SURVIVORS * NLSF_MSVQ_MAX_CB_STAGES ]; + SKP_float pRes[ MAX_NLSF_MSVQ_SURVIVORS * MAX_LPC_ORDER ]; + SKP_float pRes_new[ MAX_NLSF_MSVQ_SURVIVORS * MAX_LPC_ORDER ]; +#endif + + const SKP_float *pConstFloat; + SKP_float *pFloat; + const SKP_int *pConstInt; + SKP_int *pInt; + const SKP_float *pCB_element; + const SKP_Silk_NLSF_CBS_FLP *pCurrentCBStage; + +#ifdef USE_UNQUANTIZED_LSFS + SKP_float NLSF_orig[ MAX_LPC_ORDER ]; + SKP_memcpy( NLSF_orig, pNLSF, LPC_order * sizeof( SKP_float ) ); +#endif + + SKP_assert( NLSF_MSVQ_Survivors <= MAX_NLSF_MSVQ_SURVIVORS ); + SKP_assert( ( LOW_COMPLEXITY_ONLY == 0 ) || ( NLSF_MSVQ_Survivors <= MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ) ); + + cur_survivors = NLSF_MSVQ_Survivors; + + + /****************************************************/ + /* Tree search for the multi-stage vector quantizer */ + /****************************************************/ + + /* Clear accumulated rates */ + SKP_memset( pRate, 0, NLSF_MSVQ_Survivors * sizeof( SKP_float ) ); + + /* Copy NLSFs into residual signal vector */ + SKP_memcpy( pRes, pNLSF, LPC_order * sizeof( SKP_float ) ); + + /* Set first stage values */ + prev_survivors = 1; + + /* Minimum number of survivors */ + min_survivors = NLSF_MSVQ_Survivors / 2; + + /* Loop over all stages */ + for( s = 0; s < psNLSF_CB_FLP->nStages; s++ ) { + + /* Set a pointer to the current stage codebook */ + pCurrentCBStage = &psNLSF_CB_FLP->CBStages[ s ]; + + /* Calculate the number of survivors in the current stage */ + cur_survivors = SKP_min_32( NLSF_MSVQ_Survivors, prev_survivors * pCurrentCBStage->nVectors ); + +#if( NLSF_MSVQ_FLUCTUATION_REDUCTION == 0 ) + /* Find a single best survivor in the last stage, if we */ + /* do not need candidates for fluctuation reduction */ + if( s == psNLSF_CB_FLP->nStages - 1 ) { + cur_survivors = 1; + } +#endif + + /* Nearest neighbor clustering for multiple input data vectors */ + SKP_Silk_NLSF_VQ_rate_distortion_FLP( pRateDist, pCurrentCBStage, pRes, pW, pRate, NLSF_mu, prev_survivors, LPC_order ); + + /* Sort the rate-distortion errors */ + SKP_Silk_insertion_sort_increasing_FLP( pRateDist, pTempIndices, prev_survivors * pCurrentCBStage->nVectors, cur_survivors ); + + /* Discard survivors with rate-distortion values too far above the best one */ + rateDistThreshold = ( 1.0f + NLSF_MSVQ_Survivors * NLSF_MSVQ_SURV_MAX_REL_RD ) * pRateDist[ 0 ]; + while( pRateDist[ cur_survivors - 1 ] > rateDistThreshold && cur_survivors > min_survivors ) { + cur_survivors--; + } + + /* Update accumulated codebook contributions for the 'cur_survivors' best codebook indices */ + for( k = 0; k < cur_survivors; k++ ) { + if( s > 0 ) { + /* Find the indices of the input and the codebook vector */ + if( pCurrentCBStage->nVectors == 8 ) { + input_index = SKP_RSHIFT( pTempIndices[ k ], 3 ); + cb_index = pTempIndices[ k ] & 7; + } else { + input_index = pTempIndices[ k ] / pCurrentCBStage->nVectors; + cb_index = pTempIndices[ k ] - input_index * pCurrentCBStage->nVectors; + } + } else { + /* Find the indices of the input and the codebook vector */ + input_index = 0; + cb_index = pTempIndices[ k ]; + } + + /* Subtract new contribution from the previous residual vector for each of 'cur_survivors' */ + pConstFloat = &pRes[ input_index * LPC_order ]; + pCB_element = &pCurrentCBStage->CB[ cb_index * LPC_order ]; + pFloat = &pRes_new[ k * LPC_order ]; + for( i = 0; i < LPC_order; i++ ) { + pFloat[ i ] = pConstFloat[ i ] - pCB_element[ i ]; + } + + /* Update accumulated rate for stage 1 to the current */ + pRate_new[ k ] = pRate[ input_index ] + pCurrentCBStage->Rates[ cb_index ]; + + /* Copy paths from previous matrix, starting with the best path */ + pConstInt = &pPath[ input_index * psNLSF_CB_FLP->nStages ]; + pInt = &pPath_new[ k * psNLSF_CB_FLP->nStages ]; + for( i = 0; i < s; i++ ) { + pInt[ i ] = pConstInt[ i ]; + } + /* Write the current stage indices for the 'cur_survivors' to the best path matrix */ + pInt[ s ] = cb_index; + } + + if( s < psNLSF_CB_FLP->nStages - 1 ) { + /* Copy NLSF residual matrix for next stage */ + SKP_memcpy(pRes, pRes_new, cur_survivors * LPC_order * sizeof( SKP_float ) ); + + /* Copy rate vector for next stage */ + SKP_memcpy(pRate, pRate_new, cur_survivors * sizeof( SKP_float ) ); + + /* Copy best path matrix for next stage */ + SKP_memcpy(pPath, pPath_new, cur_survivors * psNLSF_CB_FLP->nStages * sizeof( SKP_int ) ); + } + + prev_survivors = cur_survivors; + } + + /* (Preliminary) index of the best survivor, later to be decoded */ + bestIndex = 0; + +#if( NLSF_MSVQ_FLUCTUATION_REDUCTION == 1 ) + /******************************/ + /* NLSF fluctuation reduction */ + /******************************/ + if( deactivate_fluc_red != 1 ) { + + /* Search among all survivors, now taking also weighted fluctuation errors into account */ + bestRateDist = SKP_float_MAX; + for( s = 0; s < cur_survivors; s++ ) { + /* Decode survivor to compare with previous quantized NLSF vector */ + SKP_Silk_NLSF_MSVQ_decode_FLP( pNLSF, psNLSF_CB_FLP, &pPath_new[ s * psNLSF_CB_FLP->nStages ], LPC_order ); + + /* Compare decoded NLSF vector with the previously quantized vector */ + wsse = 0; + for( i = 0; i < LPC_order; i += 2 ) { + /* Compute weighted squared quantization error for index i */ + se = pNLSF[ i ] - pNLSF_q_prev[ i ]; + wsse += pW[ i ] * se * se; + + /* Compute weighted squared quantization error for index i + 1 */ + se = pNLSF[ i + 1 ] - pNLSF_q_prev[ i + 1 ]; + wsse += pW[ i + 1 ] * se * se; + } + + /* Add the fluctuation reduction penalty to the rate distortion error */ + wsse = pRateDist[s] + wsse * NLSF_mu_fluc_red; + + /* Keep index of best survivor */ + if( wsse < bestRateDist ) { + bestRateDist = wsse; + bestIndex = s; + } + } + } +#endif + + /* Copy best path to output argument */ + SKP_memcpy( NLSFIndices, &pPath_new[ bestIndex * psNLSF_CB_FLP->nStages ], psNLSF_CB_FLP->nStages * sizeof( SKP_int ) ); + + /* Decode and stabilize the best survivor */ + SKP_Silk_NLSF_MSVQ_decode_FLP( pNLSF, psNLSF_CB_FLP, NLSFIndices, LPC_order ); + +#ifdef USE_UNQUANTIZED_LSFS + SKP_memcpy( pNLSF, NLSF_orig, LPC_order * sizeof( SKP_float ) ); +#endif + +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_rate_distortion_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_rate_distortion_FLP.c new file mode 100755 index 0000000..0635ce5 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_rate_distortion_FLP.c @@ -0,0 +1,57 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +/* Rate-Distortion calculations for multiple input data vectors */ +void SKP_Silk_NLSF_VQ_rate_distortion_FLP( + SKP_float *pRD, /* O Rate-distortion values [psNLSF_CBS_FLP->nVectors*N] */ + const SKP_Silk_NLSF_CBS_FLP *psNLSF_CBS_FLP, /* I NLSF codebook stage struct */ + const SKP_float *in, /* I Input vectors to be quantized */ + const SKP_float *w, /* I Weight vector */ + const SKP_float *rate_acc, /* I Accumulated rates from previous stage */ + const SKP_float mu, /* I Weight between weighted error and rate */ + const SKP_int N, /* I Number of input vectors to be quantized */ + const SKP_int LPC_order /* I LPC order */ +) +{ + SKP_float *pRD_vec; + SKP_int i, n; + + /* Compute weighted quantization errors for all input vectors over one codebook stage */ + SKP_Silk_NLSF_VQ_sum_error_FLP( pRD, in, w, psNLSF_CBS_FLP->CB, N, psNLSF_CBS_FLP->nVectors, LPC_order ); + + /* Loop over input vectors */ + pRD_vec = pRD; + for( n = 0; n < N; n++ ) { + /* Add rate cost to error for each codebook vector */ + for( i = 0; i < psNLSF_CBS_FLP->nVectors; i++ ) { + pRD_vec[ i ] += mu * ( rate_acc[n] + psNLSF_CBS_FLP->Rates[ i ] ); + } + pRD_vec += psNLSF_CBS_FLP->nVectors; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_sum_error_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_sum_error_FLP.c new file mode 100755 index 0000000..ae62683 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_sum_error_FLP.c @@ -0,0 +1,132 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +/* compute weighted quantization errors for LPC_order element input vectors, over one codebook stage */ +void SKP_Silk_NLSF_VQ_sum_error_FLP( + SKP_float *err, /* O Weighted quantization errors [ N * K ] */ + const SKP_float *in, /* I Input vectors [ N * LPC_order ] */ + const SKP_float *w, /* I Weighting vectors [ N * LPC_order ] */ + const SKP_float *pCB, /* I Codebook vectors [ K * LPC_order ] */ + const SKP_int N, /* I Number of input vectors */ + const SKP_int K, /* I Number of codebook vectors */ + const SKP_int LPC_order /* I LPC order */ +) +{ + SKP_int i, n; + SKP_float diff, sum_error; + SKP_float Wcpy[ MAX_LPC_ORDER ]; + const SKP_float *cb_vec; + + /* Copy to local stack */ + SKP_memcpy( Wcpy, w, LPC_order * sizeof( SKP_float ) ); + + if( LPC_order == 16 ) { + /* Loop over input vectors */ + for( n = 0; n < N; n++ ) { + /* Loop over codebook */ + cb_vec = pCB; + for( i = 0; i < K; i++ ) { + /* Compute weighted squared quantization error */ + diff = in[ 0 ] - cb_vec[ 0 ]; + sum_error = Wcpy[ 0 ] * diff * diff; + diff = in[ 1 ] - cb_vec[ 1 ]; + sum_error += Wcpy[ 1 ] * diff * diff; + diff = in[ 2 ] - cb_vec[ 2 ]; + sum_error += Wcpy[ 2 ] * diff * diff; + diff = in[ 3 ] - cb_vec[ 3 ]; + sum_error += Wcpy[ 3 ] * diff * diff; + diff = in[ 4 ] - cb_vec[ 4 ]; + sum_error += Wcpy[ 4 ] * diff * diff; + diff = in[ 5 ] - cb_vec[ 5 ]; + sum_error += Wcpy[ 5 ] * diff * diff; + diff = in[ 6 ] - cb_vec[ 6 ]; + sum_error += Wcpy[ 6 ] * diff * diff; + diff = in[ 7 ] - cb_vec[ 7 ]; + sum_error += Wcpy[ 7 ] * diff * diff; + diff = in[ 8 ] - cb_vec[ 8 ]; + sum_error += Wcpy[ 8 ] * diff * diff; + diff = in[ 9 ] - cb_vec[ 9 ]; + sum_error += Wcpy[ 9 ] * diff * diff; + diff = in[ 10 ] - cb_vec[ 10 ]; + sum_error += Wcpy[ 10 ] * diff * diff; + diff = in[ 11 ] - cb_vec[ 11 ]; + sum_error += Wcpy[ 11 ] * diff * diff; + diff = in[ 12 ] - cb_vec[ 12 ]; + sum_error += Wcpy[ 12 ] * diff * diff; + diff = in[ 13 ] - cb_vec[ 13 ]; + sum_error += Wcpy[ 13 ] * diff * diff; + diff = in[ 14 ] - cb_vec[ 14 ]; + sum_error += Wcpy[ 14 ] * diff * diff; + diff = in[ 15 ] - cb_vec[ 15 ]; + sum_error += Wcpy[ 15 ] * diff * diff; + + err[ i ] = sum_error; + cb_vec += 16; + } + err += K; + in += 16; + } + } else { + SKP_assert( LPC_order == 10 ); + + /* Loop over input vectors */ + for( n = 0; n < N; n++ ) { + /* Loop over codebook */ + cb_vec = pCB; + for( i = 0; i < K; i++ ) { + /* Compute weighted squared quantization error */ + diff = in[ 0 ] - cb_vec[ 0 ]; + sum_error = Wcpy[ 0 ] * diff * diff; + diff = in[ 1 ] - cb_vec[ 1 ]; + sum_error += Wcpy[ 1 ] * diff * diff; + diff = in[ 2 ] - cb_vec[ 2 ]; + sum_error += Wcpy[ 2 ] * diff * diff; + diff = in[ 3 ] - cb_vec[ 3 ]; + sum_error += Wcpy[ 3 ] * diff * diff; + diff = in[ 4 ] - cb_vec[ 4 ]; + sum_error += Wcpy[ 4 ] * diff * diff; + diff = in[ 5 ] - cb_vec[ 5 ]; + sum_error += Wcpy[ 5 ] * diff * diff; + diff = in[ 6 ] - cb_vec[ 6 ]; + sum_error += Wcpy[ 6 ] * diff * diff; + diff = in[ 7 ] - cb_vec[ 7 ]; + sum_error += Wcpy[ 7 ] * diff * diff; + diff = in[ 8 ] - cb_vec[ 8 ]; + sum_error += Wcpy[ 8 ] * diff * diff; + diff = in[ 9 ] - cb_vec[ 9 ]; + sum_error += Wcpy[ 9 ] * diff * diff; + + err[ i ] = sum_error; + cb_vec += 10; + } + err += K; + in += 10; + } + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_weights_laroia_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_weights_laroia_FLP.c new file mode 100755 index 0000000..76bf8f9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_VQ_weights_laroia_FLP.c @@ -0,0 +1,69 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FLP.h" + +/* +R. Laroia, N. Phamdo and N. Farvardin, "Robust and Efficient Quantization of Speech LSP +Parameters Using Structured Vector Quantization", Proc. IEEE Int. Conf. Acoust., Speech, +Signal Processing, pp. 641-644, 1991. +*/ + +#define MIN_NDELTA 1e-4f + +/* Laroia low complexity NLSF weights */ +void SKP_Silk_NLSF_VQ_weights_laroia_FLP( + SKP_float *pXW, /* 0: Pointer to input vector weights [D x 1] */ + const SKP_float *pX, /* I: Pointer to input vector [D x 1] */ + const SKP_int D /* I: Input vector dimension */ +) +{ + SKP_int k; + SKP_float tmp1, tmp2; + + /* Safety checks */ + SKP_assert( D > 0 ); + SKP_assert( ( D & 1 ) == 0 ); + + /* First value */ + tmp1 = 1.0f / SKP_max_float( pX[ 0 ], MIN_NDELTA ); + tmp2 = 1.0f / SKP_max_float( pX[ 1 ] - pX[ 0 ], MIN_NDELTA ); + pXW[ 0 ] = tmp1 + tmp2; + + /* Main loop */ + for( k = 1; k < D - 1; k += 2 ) { + tmp1 = 1.0f / SKP_max_float( pX[ k + 1 ] - pX[ k ], MIN_NDELTA ); + pXW[ k ] = tmp1 + tmp2; + + tmp2 = 1.0f / SKP_max_float( pX[ k + 2 ] - pX[ k + 1 ], MIN_NDELTA ); + pXW[ k + 1 ] = tmp1 + tmp2; + } + + /* Last value */ + tmp1 = 1.0f / SKP_max_float( 1.0f - pX[ D - 1 ], MIN_NDELTA ); + pXW[ D - 1 ] = tmp1 + tmp2; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_stabilize.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_stabilize.c new file mode 100755 index 0000000..70b554b --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NLSF_stabilize.c @@ -0,0 +1,139 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* NLSF stabilizer: */ +/* */ +/* - Moves NLSFs futher apart if they are too close */ +/* - Moves NLSFs away from borders if they are too close */ +/* - High effort to achieve a modification with minimum */ +/* Euclidean distance to input vector */ +/* - Output are sorted NLSF coefficients */ +/* */ +#include "SKP_Silk_SigProc_FIX.h" + +/* Constant Definitions */ +#define MAX_LOOPS 20 + +/* NLSF stabilizer, for a single input data vector */ +void SKP_Silk_NLSF_stabilize( + SKP_int *NLSF_Q15, /* I/O: Unstable/stabilized normalized LSF vector in Q15 [L] */ + const SKP_int *NDeltaMin_Q15, /* I: Normalized delta min vector in Q15, NDeltaMin_Q15[L] must be >= 1 [L+1] */ + const SKP_int L /* I: Number of NLSF parameters in the input vector */ +) +{ + SKP_int center_freq_Q15, diff_Q15, min_center_Q15, max_center_Q15; + SKP_int32 min_diff_Q15; + SKP_int loops; + SKP_int i, I=0, k; + + /* This is necessary to ensure an output within range of a SKP_int16 */ + SKP_assert( NDeltaMin_Q15[L] >= 1 ); + + for( loops = 0; loops < MAX_LOOPS; loops++ ) { + /**************************/ + /* Find smallest distance */ + /**************************/ + /* First element */ + min_diff_Q15 = NLSF_Q15[0] - NDeltaMin_Q15[0]; + I = 0; + /* Middle elements */ + for( i = 1; i <= L-1; i++ ) { + diff_Q15 = NLSF_Q15[i] - ( NLSF_Q15[i-1] + NDeltaMin_Q15[i] ); + if( diff_Q15 < min_diff_Q15 ) { + min_diff_Q15 = diff_Q15; + I = i; + } + } + /* Last element */ + diff_Q15 = (1<<15) - ( NLSF_Q15[L-1] + NDeltaMin_Q15[L] ); + if( diff_Q15 < min_diff_Q15 ) { + min_diff_Q15 = diff_Q15; + I = L; + } + + /***************************************************/ + /* Now check if the smallest distance non-negative */ + /***************************************************/ + if (min_diff_Q15 >= 0) { + return; + } + + if( I == 0 ) { + /* Move away from lower limit */ + NLSF_Q15[0] = NDeltaMin_Q15[0]; + + } else if( I == L) { + /* Move away from higher limit */ + NLSF_Q15[L-1] = (1<<15) - NDeltaMin_Q15[L]; + + } else { + /* Find the lower extreme for the location of the current center frequency */ + min_center_Q15 = 0; + for( k = 0; k < I; k++ ) { + min_center_Q15 += NDeltaMin_Q15[k]; + } + min_center_Q15 += SKP_RSHIFT( NDeltaMin_Q15[I], 1 ); + + /* Find the upper extreme for the location of the current center frequency */ + max_center_Q15 = (1<<15); + for( k = L; k > I; k-- ) { + max_center_Q15 -= NDeltaMin_Q15[k]; + } + max_center_Q15 -= ( NDeltaMin_Q15[I] - SKP_RSHIFT( NDeltaMin_Q15[I], 1 ) ); + + /* Move apart, sorted by value, keeping the same center frequency */ + center_freq_Q15 = SKP_LIMIT_32( SKP_RSHIFT_ROUND( (SKP_int32)NLSF_Q15[I-1] + (SKP_int32)NLSF_Q15[I], 1 ), + min_center_Q15, max_center_Q15 ); + NLSF_Q15[I-1] = center_freq_Q15 - SKP_RSHIFT( NDeltaMin_Q15[I], 1 ); + NLSF_Q15[I] = NLSF_Q15[I-1] + NDeltaMin_Q15[I]; + } + } + + /* Safe and simple fall back method, which is less ideal than the above */ + if( loops == MAX_LOOPS ) + { + /* Insertion sort (fast for already almost sorted arrays): */ + /* Best case: O(n) for an already sorted array */ + /* Worst case: O(n^2) for an inversely sorted array */ + SKP_Silk_insertion_sort_increasing_all_values(&NLSF_Q15[0], L); + + /* First NLSF should be no less than NDeltaMin[0] */ + NLSF_Q15[0] = SKP_max_int( NLSF_Q15[0], NDeltaMin_Q15[0] ); + + /* Keep delta_min distance between the NLSFs */ + for( i = 1; i < L; i++ ) + NLSF_Q15[i] = SKP_max_int( NLSF_Q15[i], NLSF_Q15[i-1] + NDeltaMin_Q15[i] ); + + /* Last NLSF should be no higher than 1 - NDeltaMin[L] */ + NLSF_Q15[L-1] = SKP_min_int( NLSF_Q15[L-1], (1<<15) - NDeltaMin_Q15[L] ); + + /* Keep NDeltaMin distance between the NLSFs */ + for( i = L-2; i >= 0; i-- ) + NLSF_Q15[i] = SKP_min_int( NLSF_Q15[i], NLSF_Q15[i+1] - NDeltaMin_Q15[i+1] ); + } +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NSQ.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NSQ.c new file mode 100755 index 0000000..1d9ba52 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NSQ.c @@ -0,0 +1,421 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +SKP_INLINE void SKP_Silk_nsq_scale_states( + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + const SKP_int16 x[], /* I input in Q0 */ + SKP_int32 x_sc_Q10[], /* O input scaled with 1/Gain */ + SKP_int subfr_length, /* I length of input */ + const SKP_int16 sLTP[], /* I re-whitened LTP state in Q0 */ + SKP_int32 sLTP_Q16[], /* O LTP state matching scaled input */ + SKP_int subfr, /* I subframe number */ + const SKP_int LTP_scale_Q14, /* I */ + const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */ + const SKP_int pitchL[ NB_SUBFR ] /* I */ +); + +SKP_INLINE void SKP_Silk_noise_shape_quantizer( + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + SKP_int sigtype, /* I Signal type */ + const SKP_int32 x_sc_Q10[], /* I */ + SKP_int8 q[], /* O */ + SKP_int16 xq[], /* O */ + SKP_int32 sLTP_Q16[], /* I/O LTP state */ + const SKP_int16 a_Q12[], /* I Short term prediction coefs */ + const SKP_int16 b_Q14[], /* I Long term prediction coefs */ + const SKP_int16 AR_shp_Q13[], /* I Noise shaping AR coefs */ + SKP_int lag, /* I Pitch lag */ + SKP_int32 HarmShapeFIRPacked_Q14, /* I */ + SKP_int Tilt_Q14, /* I Spectral tilt */ + SKP_int32 LF_shp_Q14, /* I */ + SKP_int32 Gain_Q16, /* I */ + SKP_int Lambda_Q10, /* I */ + SKP_int offset_Q10, /* I */ + SKP_int length, /* I Input length */ + SKP_int shapingLPCOrder, /* I Noise shaping AR filter order */ + SKP_int predictLPCOrder /* I Prediction filter order */ +); + +void SKP_Silk_NSQ( + SKP_Silk_encoder_state *psEncC, /* I/O Encoder State */ + SKP_Silk_encoder_control *psEncCtrlC, /* I Encoder Control */ + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + const SKP_int16 x[], /* I prefiltered input signal */ + SKP_int8 q[], /* O quantized qulse signal */ + const SKP_int LSFInterpFactor_Q2, /* I LSF interpolation factor in Q2 */ + const SKP_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefficients */ + const SKP_int16 LTPCoef_Q14[ LTP_ORDER * NB_SUBFR ], /* I Long term prediction coefficients */ + const SKP_int16 AR2_Q13[ NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I */ + const SKP_int HarmShapeGain_Q14[ NB_SUBFR ], /* I */ + const SKP_int Tilt_Q14[ NB_SUBFR ], /* I Spectral tilt */ + const SKP_int32 LF_shp_Q14[ NB_SUBFR ], /* I */ + const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */ + const SKP_int Lambda_Q10, /* I */ + const SKP_int LTP_scale_Q14 /* I LTP state scaling */ +) +{ + SKP_int k, lag, start_idx, LSF_interpolation_flag; + const SKP_int16 *A_Q12, *B_Q14, *AR_shp_Q13; + SKP_int16 *pxq; + SKP_int32 sLTP_Q16[ 2 * MAX_FRAME_LENGTH ]; + SKP_int16 sLTP[ 2 * MAX_FRAME_LENGTH ]; + SKP_int32 HarmShapeFIRPacked_Q14; + SKP_int offset_Q10; + SKP_int32 FiltState[ MAX_LPC_ORDER ]; + SKP_int32 x_sc_Q10[ MAX_FRAME_LENGTH / NB_SUBFR ]; + + NSQ->rand_seed = psEncCtrlC->Seed; + /* Set unvoiced lag to the previous one, overwrite later for voiced */ + lag = NSQ->lagPrev; + + SKP_assert( NSQ->prev_inv_gain_Q16 != 0 ); + + offset_Q10 = SKP_Silk_Quantization_Offsets_Q10[ psEncCtrlC->sigtype ][ psEncCtrlC->QuantOffsetType ]; + + if( LSFInterpFactor_Q2 == ( 1 << 2 ) ) { + LSF_interpolation_flag = 0; + } else { + LSF_interpolation_flag = 1; + } + + /* Setup pointers to start of sub frame */ + NSQ->sLTP_shp_buf_idx = psEncC->frame_length; + NSQ->sLTP_buf_idx = psEncC->frame_length; + pxq = &NSQ->xq[ psEncC->frame_length ]; + for( k = 0; k < NB_SUBFR; k++ ) { + A_Q12 = &PredCoef_Q12[ (( k >> 1 ) | ( 1 - LSF_interpolation_flag )) * MAX_LPC_ORDER ]; + B_Q14 = <PCoef_Q14[ k * LTP_ORDER ]; + AR_shp_Q13 = &AR2_Q13[ k * MAX_SHAPE_LPC_ORDER ]; + + /* Noise shape parameters */ + SKP_assert( HarmShapeGain_Q14[ k ] >= 0 ); + HarmShapeFIRPacked_Q14 = SKP_RSHIFT( HarmShapeGain_Q14[ k ], 2 ); + HarmShapeFIRPacked_Q14 |= SKP_LSHIFT( ( SKP_int32 )SKP_RSHIFT( HarmShapeGain_Q14[ k ], 1 ), 16 ); + + NSQ->rewhite_flag = 0; + if( psEncCtrlC->sigtype == SIG_TYPE_VOICED ) { + /* Voiced */ + lag = psEncCtrlC->pitchL[ k ]; + + /* Re-whitening */ + if( ( k & ( 3 - SKP_LSHIFT( LSF_interpolation_flag, 1 ) ) ) == 0 ) { + + /* Rewhiten with new A coefs */ + start_idx = psEncC->frame_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2; + SKP_assert( start_idx >= 0 ); + SKP_assert( start_idx <= psEncC->frame_length - psEncC->predictLPCOrder ); + + SKP_memset( FiltState, 0, psEncC->predictLPCOrder * sizeof( SKP_int32 ) ); + SKP_Silk_MA_Prediction( &NSQ->xq[ start_idx + k * ( psEncC->frame_length >> 2 ) ], + A_Q12, FiltState, sLTP + start_idx, psEncC->frame_length - start_idx, psEncC->predictLPCOrder ); + + NSQ->rewhite_flag = 1; + NSQ->sLTP_buf_idx = psEncC->frame_length; + } + } + + SKP_Silk_nsq_scale_states( NSQ, x, x_sc_Q10, psEncC->subfr_length, sLTP, + sLTP_Q16, k, LTP_scale_Q14, Gains_Q16, psEncCtrlC->pitchL ); + + SKP_Silk_noise_shape_quantizer( NSQ, psEncCtrlC->sigtype, x_sc_Q10, q, pxq, sLTP_Q16, A_Q12, B_Q14, + AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14[ k ], LF_shp_Q14[ k ], Gains_Q16[ k ], Lambda_Q10, + offset_Q10, psEncC->subfr_length, psEncC->shapingLPCOrder, psEncC->predictLPCOrder + ); + + x += psEncC->subfr_length; + q += psEncC->subfr_length; + pxq += psEncC->subfr_length; + } + + /* Update lagPrev for next frame */ + NSQ->lagPrev = psEncCtrlC->pitchL[ NB_SUBFR - 1 ]; + + /* Save quantized speech and noise shaping signals */ + SKP_memcpy( NSQ->xq, &NSQ->xq[ psEncC->frame_length ], psEncC->frame_length * sizeof( SKP_int16 ) ); + SKP_memcpy( NSQ->sLTP_shp_Q10, &NSQ->sLTP_shp_Q10[ psEncC->frame_length ], psEncC->frame_length * sizeof( SKP_int32 ) ); + +#ifdef USE_UNQUANTIZED_LSFS + DEBUG_STORE_DATA( xq_unq_lsfs.pcm, NSQ->xq, psEncC->frame_length * sizeof( SKP_int16 ) ); +#endif + +} + +/***********************************/ +/* SKP_Silk_noise_shape_quantizer */ +/***********************************/ +SKP_INLINE void SKP_Silk_noise_shape_quantizer( + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + SKP_int sigtype, /* I Signal type */ + const SKP_int32 x_sc_Q10[], /* I */ + SKP_int8 q[], /* O */ + SKP_int16 xq[], /* O */ + SKP_int32 sLTP_Q16[], /* I/O LTP state */ + const SKP_int16 a_Q12[], /* I Short term prediction coefs */ + const SKP_int16 b_Q14[], /* I Long term prediction coefs */ + const SKP_int16 AR_shp_Q13[], /* I Noise shaping AR coefs */ + SKP_int lag, /* I Pitch lag */ + SKP_int32 HarmShapeFIRPacked_Q14, /* I */ + SKP_int Tilt_Q14, /* I Spectral tilt */ + SKP_int32 LF_shp_Q14, /* I */ + SKP_int32 Gain_Q16, /* I */ + SKP_int Lambda_Q10, /* I */ + SKP_int offset_Q10, /* I */ + SKP_int length, /* I Input length */ + SKP_int shapingLPCOrder, /* I Noise shaping AR filter order */ + SKP_int predictLPCOrder /* I Prediction filter order */ +) +{ + SKP_int i, j; + SKP_int32 LTP_pred_Q14, LPC_pred_Q10, n_AR_Q10, n_LTP_Q14; + SKP_int32 n_LF_Q10, r_Q10, q_Q0, q_Q10; + SKP_int32 thr1_Q10, thr2_Q10, thr3_Q10; + SKP_int32 dither, exc_Q10, LPC_exc_Q10, xq_Q10; + SKP_int32 tmp1, tmp2, sLF_AR_shp_Q10; + SKP_int32 *psLPC_Q14, *shp_lag_ptr, *pred_lag_ptr; + + shp_lag_ptr = &NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ]; + pred_lag_ptr = &sLTP_Q16[ NSQ->sLTP_buf_idx - lag + LTP_ORDER / 2 ]; + + /* Setup short term AR state */ + psLPC_Q14 = &NSQ->sLPC_Q14[ NSQ_LPC_BUF_LENGTH - 1 ]; + + /* Quantization thresholds */ + thr1_Q10 = SKP_SUB_RSHIFT32( -1536, Lambda_Q10, 1 ); + thr2_Q10 = SKP_SUB_RSHIFT32( -512, Lambda_Q10, 1 ); + thr2_Q10 = SKP_ADD_RSHIFT32( thr2_Q10, SKP_SMULBB( offset_Q10, Lambda_Q10 ), 10 ); + thr3_Q10 = SKP_ADD_RSHIFT32( 512, Lambda_Q10, 1 ); + + for( i = 0; i < length; i++ ) { + /* Generate dither */ + NSQ->rand_seed = SKP_RAND( NSQ->rand_seed ); + + /* dither = rand_seed < 0 ? 0xFFFFFFFF : 0; */ + dither = SKP_RSHIFT( NSQ->rand_seed, 31 ); + + /* Short-term prediction */ + SKP_assert( ( predictLPCOrder & 1 ) == 0 ); /* check that order is even */ + /* check that array starts at 4-byte aligned address */ + SKP_assert( ( ( SKP_int64 )( ( SKP_int8* )a_Q12 - ( SKP_int8* )0 ) & 3 ) == 0 ); + SKP_assert( predictLPCOrder >= 10 ); /* check that unrolling works */ + /* Partially unrolled */ + LPC_pred_Q10 = SKP_SMULWB( psLPC_Q14[ 0 ], a_Q12[ 0 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -1 ], a_Q12[ 1 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -2 ], a_Q12[ 2 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -3 ], a_Q12[ 3 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -4 ], a_Q12[ 4 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -5 ], a_Q12[ 5 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -6 ], a_Q12[ 6 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -7 ], a_Q12[ 7 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -8 ], a_Q12[ 8 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -9 ], a_Q12[ 9 ] ); + for( j = 10; j < predictLPCOrder; j ++ ) { + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -j ], a_Q12[ j ] ); + } + /* Long-term prediction */ + if( sigtype == SIG_TYPE_VOICED ) { + /* Unrolled loop */ + LTP_pred_Q14 = SKP_SMULWB( pred_lag_ptr[ 0 ], b_Q14[ 0 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -1 ], b_Q14[ 1 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -2 ], b_Q14[ 2 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], b_Q14[ 3 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); + pred_lag_ptr++; + } else { + LTP_pred_Q14 = 0; + } + + /* Noise shape feedback */ + SKP_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ + tmp2 = psLPC_Q14[ 0 ]; + tmp1 = NSQ->sAR2_Q14[ 0 ]; + NSQ->sAR2_Q14[ 0 ] = tmp2; + n_AR_Q10 = SKP_SMULWB( tmp2, AR_shp_Q13[ 0 ] ); + for( j = 2; j < shapingLPCOrder; j += 2 ) { + tmp2 = NSQ->sAR2_Q14[ j - 1 ]; + NSQ->sAR2_Q14[ j - 1 ] = tmp1; + n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, tmp1, AR_shp_Q13[ j - 1 ] ); + tmp1 = NSQ->sAR2_Q14[ j + 0 ]; + NSQ->sAR2_Q14[ j + 0 ] = tmp2; + n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, tmp2, AR_shp_Q13[ j ] ); + } + NSQ->sAR2_Q14[ shapingLPCOrder - 1 ] = tmp1; + n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] ); + + n_AR_Q10 = SKP_RSHIFT( n_AR_Q10, 1 ); /* Q11 -> Q10 */ + n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, NSQ->sLF_AR_shp_Q12, Tilt_Q14 ); + + n_LF_Q10 = SKP_LSHIFT( SKP_SMULWB( NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 ), 2 ); + n_LF_Q10 = SKP_SMLAWT( n_LF_Q10, NSQ->sLF_AR_shp_Q12, LF_shp_Q14 ); + + SKP_assert( lag > 0 || sigtype == SIG_TYPE_UNVOICED ); + + /* Long-term shaping */ + if( lag > 0 ) { + /* Symmetric, packed FIR coefficients */ + n_LTP_Q14 = SKP_SMULWB( SKP_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = SKP_SMLAWT( n_LTP_Q14, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = SKP_LSHIFT( n_LTP_Q14, 6 ); + shp_lag_ptr++; + } else { + n_LTP_Q14 = 0; + } + + /* Input minus prediction plus noise feedback */ + //r = x[ i ] - LTP_pred - LPC_pred + n_AR + n_Tilt + n_LF + n_LTP; + tmp1 = SKP_SUB32( LTP_pred_Q14, n_LTP_Q14 ); /* Add Q14 stuff */ + tmp1 = SKP_RSHIFT( tmp1, 4 ); /* convert to Q10 */ + tmp1 = SKP_ADD32( tmp1, LPC_pred_Q10 ); /* add Q10 stuff */ + tmp1 = SKP_SUB32( tmp1, n_AR_Q10 ); /* subtract Q10 stuff */ + tmp1 = SKP_SUB32( tmp1, n_LF_Q10 ); /* subtract Q10 stuff */ + r_Q10 = SKP_SUB32( x_sc_Q10[ i ], tmp1 ); + + /* Flip sign depending on dither */ + r_Q10 = ( r_Q10 ^ dither ) - dither; + r_Q10 = SKP_SUB32( r_Q10, offset_Q10 ); + r_Q10 = SKP_LIMIT_32( r_Q10, -64 << 10, 64 << 10 ); + + /* Quantize */ + q_Q0 = 0; + q_Q10 = 0; + if( r_Q10 < thr2_Q10 ) { + if( r_Q10 < thr1_Q10 ) { + q_Q0 = SKP_RSHIFT_ROUND( SKP_ADD_RSHIFT32( r_Q10, Lambda_Q10, 1 ), 10 ); + q_Q10 = SKP_LSHIFT( q_Q0, 10 ); + } else { + q_Q0 = -1; + q_Q10 = -1024; + } + } else { + if( r_Q10 > thr3_Q10 ) { + q_Q0 = SKP_RSHIFT_ROUND( SKP_SUB_RSHIFT32( r_Q10, Lambda_Q10, 1 ), 10 ); + q_Q10 = SKP_LSHIFT( q_Q0, 10 ); + } + } + q[ i ] = ( SKP_int8 )q_Q0; /* No saturation needed because max is 64 */ + + /* Excitation */ + exc_Q10 = SKP_ADD32( q_Q10, offset_Q10 ); + exc_Q10 = ( exc_Q10 ^ dither ) - dither; + + /* Add predictions */ + LPC_exc_Q10 = SKP_ADD32( exc_Q10, SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ) ); + xq_Q10 = SKP_ADD32( LPC_exc_Q10, LPC_pred_Q10 ); + + /* Scale XQ back to normal level before saving */ + xq[ i ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( SKP_SMULWW( xq_Q10, Gain_Q16 ), 10 ) ); + + + /* Update states */ + psLPC_Q14++; + *psLPC_Q14 = SKP_LSHIFT( xq_Q10, 4 ); + sLF_AR_shp_Q10 = SKP_SUB32( xq_Q10, n_AR_Q10 ); + NSQ->sLF_AR_shp_Q12 = SKP_LSHIFT( sLF_AR_shp_Q10, 2 ); + + NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx ] = SKP_SUB32( sLF_AR_shp_Q10, n_LF_Q10 ); + sLTP_Q16[ NSQ->sLTP_buf_idx ] = SKP_LSHIFT( LPC_exc_Q10, 6 ); + NSQ->sLTP_shp_buf_idx++; + NSQ->sLTP_buf_idx++; + + /* Make dither dependent on quantized signal */ + NSQ->rand_seed += q[ i ]; + } + + /* Update LPC synth buffer */ + SKP_memcpy( NSQ->sLPC_Q14, &NSQ->sLPC_Q14[ length ], NSQ_LPC_BUF_LENGTH * sizeof( SKP_int32 ) ); +} + +SKP_INLINE void SKP_Silk_nsq_scale_states( + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + const SKP_int16 x[], /* I input in Q0 */ + SKP_int32 x_sc_Q10[], /* O input scaled with 1/Gain */ + SKP_int subfr_length, /* I length of input */ + const SKP_int16 sLTP[], /* I re-whitened LTP state in Q0 */ + SKP_int32 sLTP_Q16[], /* O LTP state matching scaled input */ + SKP_int subfr, /* I subframe number */ + const SKP_int LTP_scale_Q14, /* I */ + const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */ + const SKP_int pitchL[ NB_SUBFR ] /* I */ +) +{ + SKP_int i, lag; + SKP_int32 inv_gain_Q16, gain_adj_Q16, inv_gain_Q32; + + inv_gain_Q16 = SKP_INVERSE32_varQ( SKP_max( Gains_Q16[ subfr ], 1 ), 32 ); + inv_gain_Q16 = SKP_min( inv_gain_Q16, SKP_int16_MAX ); + lag = pitchL[ subfr ]; + + /* After rewhitening the LTP state is un-scaled, so scale with inv_gain_Q16 */ + if( NSQ->rewhite_flag ) { + inv_gain_Q32 = SKP_LSHIFT( inv_gain_Q16, 16 ); + if( subfr == 0 ) { + /* Do LTP downscaling */ + inv_gain_Q32 = SKP_LSHIFT( SKP_SMULWB( inv_gain_Q32, LTP_scale_Q14 ), 2 ); + } + for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { + SKP_assert( i < MAX_FRAME_LENGTH ); + sLTP_Q16[ i ] = SKP_SMULWB( inv_gain_Q32, sLTP[ i ] ); + } + } + + /* Adjust for changing gain */ + if( inv_gain_Q16 != NSQ->prev_inv_gain_Q16 ) { + gain_adj_Q16 = SKP_DIV32_varQ( inv_gain_Q16, NSQ->prev_inv_gain_Q16, 16 ); + + /* Scale long-term shaping state */ + for( i = NSQ->sLTP_shp_buf_idx - subfr_length * NB_SUBFR; i < NSQ->sLTP_shp_buf_idx; i++ ) { + NSQ->sLTP_shp_Q10[ i ] = SKP_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q10[ i ] ); + } + + /* Scale long-term prediction state */ + if( NSQ->rewhite_flag == 0 ) { + for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { + sLTP_Q16[ i ] = SKP_SMULWW( gain_adj_Q16, sLTP_Q16[ i ] ); + } + } + + NSQ->sLF_AR_shp_Q12 = SKP_SMULWW( gain_adj_Q16, NSQ->sLF_AR_shp_Q12 ); + + /* Scale short-term prediction and shaping states */ + for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { + NSQ->sLPC_Q14[ i ] = SKP_SMULWW( gain_adj_Q16, NSQ->sLPC_Q14[ i ] ); + } + for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { + NSQ->sAR2_Q14[ i ] = SKP_SMULWW( gain_adj_Q16, NSQ->sAR2_Q14[ i ] ); + } + } + + /* Scale input */ + for( i = 0; i < subfr_length; i++ ) { + x_sc_Q10[ i ] = SKP_RSHIFT( SKP_SMULBB( x[ i ], ( SKP_int16 )inv_gain_Q16 ), 6 ); + } + + /* save inv_gain */ + SKP_assert( inv_gain_Q16 != 0 ); + NSQ->prev_inv_gain_Q16 = inv_gain_Q16; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NSQ_del_dec.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NSQ_del_dec.c new file mode 100755 index 0000000..928187d --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_NSQ_del_dec.c @@ -0,0 +1,703 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +typedef struct { + SKP_int32 RandState[ DECISION_DELAY ]; + SKP_int32 Q_Q10[ DECISION_DELAY ]; + SKP_int32 Xq_Q10[ DECISION_DELAY ]; + SKP_int32 Pred_Q16[ DECISION_DELAY ]; + SKP_int32 Shape_Q10[ DECISION_DELAY ]; + SKP_int32 Gain_Q16[ DECISION_DELAY ]; + SKP_int32 sAR2_Q14[ MAX_SHAPE_LPC_ORDER ]; + SKP_int32 sLPC_Q14[ MAX_FRAME_LENGTH / NB_SUBFR + NSQ_LPC_BUF_LENGTH ]; + SKP_int32 LF_AR_Q12; + SKP_int32 Seed; + SKP_int32 SeedInit; + SKP_int32 RD_Q10; +} NSQ_del_dec_struct; + +typedef struct { + SKP_int32 Q_Q10; + SKP_int32 RD_Q10; + SKP_int32 xq_Q14; + SKP_int32 LF_AR_Q12; + SKP_int32 sLTP_shp_Q10; + SKP_int32 LPC_exc_Q16; +} NSQ_sample_struct; + +SKP_INLINE void SKP_Silk_copy_del_dec_state( + NSQ_del_dec_struct *DD_dst, /* I Dst del dec state */ + NSQ_del_dec_struct *DD_src, /* I Src del dec state */ + SKP_int LPC_state_idx /* I Index to LPC buffer */ +); + +SKP_INLINE void SKP_Silk_nsq_del_dec_scale_states( + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states */ + const SKP_int16 x[], /* I Input in Q0 */ + SKP_int32 x_sc_Q10[], /* O Input scaled with 1/Gain in Q10 */ + SKP_int subfr_length, /* I Length of input */ + const SKP_int16 sLTP[], /* I Re-whitened LTP state in Q0 */ + SKP_int32 sLTP_Q16[], /* O LTP state matching scaled input */ + SKP_int subfr, /* I Subframe number */ + SKP_int nStatesDelayedDecision, /* I Number of del dec states */ + SKP_int smpl_buf_idx, /* I Index to newest samples in buffers */ + const SKP_int LTP_scale_Q14, /* I LTP state scaling */ + const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */ + const SKP_int pitchL[ NB_SUBFR ] /* I Pitch lag */ +); + +/******************************************/ +/* Noise shape quantizer for one subframe */ +/******************************************/ +SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec( + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states */ + SKP_int sigtype, /* I Signal type */ + const SKP_int32 x_Q10[], /* I */ + SKP_int8 q[], /* O */ + SKP_int16 xq[], /* O */ + SKP_int32 sLTP_Q16[], /* I/O LTP filter state */ + const SKP_int16 a_Q12[], /* I Short term prediction coefs */ + const SKP_int16 b_Q14[], /* I Long term prediction coefs */ + const SKP_int16 AR_shp_Q13[], /* I Noise shaping coefs */ + SKP_int lag, /* I Pitch lag */ + SKP_int32 HarmShapeFIRPacked_Q14, /* I */ + SKP_int Tilt_Q14, /* I Spectral tilt */ + SKP_int32 LF_shp_Q14, /* I */ + SKP_int32 Gain_Q16, /* I */ + SKP_int Lambda_Q10, /* I */ + SKP_int offset_Q10, /* I */ + SKP_int length, /* I Input length */ + SKP_int subfr, /* I Subframe number */ + SKP_int shapingLPCOrder, /* I Shaping LPC filter order */ + SKP_int predictLPCOrder, /* I Prediction filter order */ + SKP_int warping_Q16, /* I */ + SKP_int nStatesDelayedDecision, /* I Number of states in decision tree */ + SKP_int *smpl_buf_idx, /* I Index to newest samples in buffers */ + SKP_int decisionDelay /* I */ +); + +void SKP_Silk_NSQ_del_dec( + SKP_Silk_encoder_state *psEncC, /* I/O Encoder State */ + SKP_Silk_encoder_control *psEncCtrlC, /* I Encoder Control */ + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + const SKP_int16 x[], /* I Prefiltered input signal */ + SKP_int8 q[], /* O Quantized pulse signal */ + const SKP_int LSFInterpFactor_Q2, /* I LSF interpolation factor in Q2 */ + const SKP_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Prediction coefs */ + const SKP_int16 LTPCoef_Q14[ LTP_ORDER * NB_SUBFR ], /* I LT prediction coefs */ + const SKP_int16 AR2_Q13[ NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I */ + const SKP_int HarmShapeGain_Q14[ NB_SUBFR ], /* I */ + const SKP_int Tilt_Q14[ NB_SUBFR ], /* I Spectral tilt */ + const SKP_int32 LF_shp_Q14[ NB_SUBFR ], /* I */ + const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */ + const SKP_int Lambda_Q10, /* I */ + const SKP_int LTP_scale_Q14 /* I LTP state scaling */ +) +{ + SKP_int i, k, lag, start_idx, LSF_interpolation_flag, Winner_ind, subfr; + SKP_int last_smple_idx, smpl_buf_idx, decisionDelay, subfr_length; + const SKP_int16 *A_Q12, *B_Q14, *AR_shp_Q13; + SKP_int16 *pxq; + SKP_int32 sLTP_Q16[ 2 * MAX_FRAME_LENGTH ]; + SKP_int16 sLTP[ 2 * MAX_FRAME_LENGTH ]; + SKP_int32 HarmShapeFIRPacked_Q14; + SKP_int offset_Q10; + SKP_int32 FiltState[ MAX_LPC_ORDER ], RDmin_Q10; + SKP_int32 x_sc_Q10[ MAX_FRAME_LENGTH / NB_SUBFR ]; + NSQ_del_dec_struct psDelDec[ MAX_DEL_DEC_STATES ]; + NSQ_del_dec_struct *psDD; + + subfr_length = psEncC->frame_length / NB_SUBFR; + + /* Set unvoiced lag to the previous one, overwrite later for voiced */ + lag = NSQ->lagPrev; + + SKP_assert( NSQ->prev_inv_gain_Q16 != 0 ); + + /* Initialize delayed decision states */ + SKP_memset( psDelDec, 0, psEncC->nStatesDelayedDecision * sizeof( NSQ_del_dec_struct ) ); + for( k = 0; k < psEncC->nStatesDelayedDecision; k++ ) { + psDD = &psDelDec[ k ]; + psDD->Seed = ( k + psEncCtrlC->Seed ) & 3; + psDD->SeedInit = psDD->Seed; + psDD->RD_Q10 = 0; + psDD->LF_AR_Q12 = NSQ->sLF_AR_shp_Q12; + psDD->Shape_Q10[ 0 ] = NSQ->sLTP_shp_Q10[ psEncC->frame_length - 1 ]; + SKP_memcpy( psDD->sLPC_Q14, NSQ->sLPC_Q14, NSQ_LPC_BUF_LENGTH * sizeof( SKP_int32 ) ); + SKP_memcpy( psDD->sAR2_Q14, NSQ->sAR2_Q14, sizeof( NSQ->sAR2_Q14 ) ); + } + + offset_Q10 = SKP_Silk_Quantization_Offsets_Q10[ psEncCtrlC->sigtype ][ psEncCtrlC->QuantOffsetType ]; + smpl_buf_idx = 0; /* index of oldest samples */ + + decisionDelay = SKP_min_int( DECISION_DELAY, subfr_length ); + + /* For voiced frames limit the decision delay to lower than the pitch lag */ + if( psEncCtrlC->sigtype == SIG_TYPE_VOICED ) { + for( k = 0; k < NB_SUBFR; k++ ) { + decisionDelay = SKP_min_int( decisionDelay, psEncCtrlC->pitchL[ k ] - LTP_ORDER / 2 - 1 ); + } + } else { + if( lag > 0 ) { + decisionDelay = SKP_min_int( decisionDelay, lag - LTP_ORDER / 2 - 1 ); + } + } + + if( LSFInterpFactor_Q2 == ( 1 << 2 ) ) { + LSF_interpolation_flag = 0; + } else { + LSF_interpolation_flag = 1; + } + + /* Setup pointers to start of sub frame */ + pxq = &NSQ->xq[ psEncC->frame_length ]; + NSQ->sLTP_shp_buf_idx = psEncC->frame_length; + NSQ->sLTP_buf_idx = psEncC->frame_length; + subfr = 0; + for( k = 0; k < NB_SUBFR; k++ ) { + A_Q12 = &PredCoef_Q12[ ( ( k >> 1 ) | ( 1 - LSF_interpolation_flag ) ) * MAX_LPC_ORDER ]; + B_Q14 = <PCoef_Q14[ k * LTP_ORDER ]; + AR_shp_Q13 = &AR2_Q13[ k * MAX_SHAPE_LPC_ORDER ]; + + /* Noise shape parameters */ + SKP_assert( HarmShapeGain_Q14[ k ] >= 0 ); + HarmShapeFIRPacked_Q14 = SKP_RSHIFT( HarmShapeGain_Q14[ k ], 2 ); + HarmShapeFIRPacked_Q14 |= SKP_LSHIFT( ( SKP_int32 )SKP_RSHIFT( HarmShapeGain_Q14[ k ], 1 ), 16 ); + + NSQ->rewhite_flag = 0; + if( psEncCtrlC->sigtype == SIG_TYPE_VOICED ) { + /* Voiced */ + lag = psEncCtrlC->pitchL[ k ]; + + /* Re-whitening */ + if( ( k & ( 3 - SKP_LSHIFT( LSF_interpolation_flag, 1 ) ) ) == 0 ) { + if( k == 2 ) { + /* RESET DELAYED DECISIONS */ + /* Find winner */ + RDmin_Q10 = psDelDec[ 0 ].RD_Q10; + Winner_ind = 0; + for( i = 1; i < psEncC->nStatesDelayedDecision; i++ ) { + if( psDelDec[ i ].RD_Q10 < RDmin_Q10 ) { + RDmin_Q10 = psDelDec[ i ].RD_Q10; + Winner_ind = i; + } + } + for( i = 0; i < psEncC->nStatesDelayedDecision; i++ ) { + if( i != Winner_ind ) { + psDelDec[ i ].RD_Q10 += ( SKP_int32_MAX >> 4 ); + SKP_assert( psDelDec[ i ].RD_Q10 >= 0 ); + } + } + + /* Copy final part of signals from winner state to output and long-term filter states */ + psDD = &psDelDec[ Winner_ind ]; + last_smple_idx = smpl_buf_idx + decisionDelay; + for( i = 0; i < decisionDelay; i++ ) { + last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK; + q[ i - decisionDelay ] = ( SKP_int8 )SKP_RSHIFT( psDD->Q_Q10[ last_smple_idx ], 10 ); + pxq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( + SKP_SMULWW( psDD->Xq_Q10[ last_smple_idx ], + psDD->Gain_Q16[ last_smple_idx ] ), 10 ) ); + NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - decisionDelay + i ] = psDD->Shape_Q10[ last_smple_idx ]; + } + + subfr = 0; + } + + /* Rewhiten with new A coefs */ + start_idx = psEncC->frame_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2; + SKP_assert( start_idx >= 0 ); + SKP_assert( start_idx <= psEncC->frame_length - psEncC->predictLPCOrder ); + + SKP_memset( FiltState, 0, psEncC->predictLPCOrder * sizeof( SKP_int32 ) ); + SKP_Silk_MA_Prediction( &NSQ->xq[ start_idx + k * psEncC->subfr_length ], + A_Q12, FiltState, sLTP + start_idx, psEncC->frame_length - start_idx, psEncC->predictLPCOrder ); + + NSQ->sLTP_buf_idx = psEncC->frame_length; + NSQ->rewhite_flag = 1; + } + } + + SKP_Silk_nsq_del_dec_scale_states( NSQ, psDelDec, x, x_sc_Q10, + subfr_length, sLTP, sLTP_Q16, k, psEncC->nStatesDelayedDecision, smpl_buf_idx, + LTP_scale_Q14, Gains_Q16, psEncCtrlC->pitchL ); + + SKP_Silk_noise_shape_quantizer_del_dec( NSQ, psDelDec, psEncCtrlC->sigtype, x_sc_Q10, q, pxq, sLTP_Q16, + A_Q12, B_Q14, AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14[ k ], LF_shp_Q14[ k ], Gains_Q16[ k ], + Lambda_Q10, offset_Q10, psEncC->subfr_length, subfr++, psEncC->shapingLPCOrder, psEncC->predictLPCOrder, + psEncC->warping_Q16, psEncC->nStatesDelayedDecision, &smpl_buf_idx, decisionDelay ); + + x += psEncC->subfr_length; + q += psEncC->subfr_length; + pxq += psEncC->subfr_length; + } + + /* Find winner */ + RDmin_Q10 = psDelDec[ 0 ].RD_Q10; + Winner_ind = 0; + for( k = 1; k < psEncC->nStatesDelayedDecision; k++ ) { + if( psDelDec[ k ].RD_Q10 < RDmin_Q10 ) { + RDmin_Q10 = psDelDec[ k ].RD_Q10; + Winner_ind = k; + } + } + + /* Copy final part of signals from winner state to output and long-term filter states */ + psDD = &psDelDec[ Winner_ind ]; + psEncCtrlC->Seed = psDD->SeedInit; + last_smple_idx = smpl_buf_idx + decisionDelay; + for( i = 0; i < decisionDelay; i++ ) { + last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK; + q[ i - decisionDelay ] = ( SKP_int8 )SKP_RSHIFT( psDD->Q_Q10[ last_smple_idx ], 10 ); + pxq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( + SKP_SMULWW( psDD->Xq_Q10[ last_smple_idx ], psDD->Gain_Q16[ last_smple_idx ] ), 10 ) ); + NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - decisionDelay + i ] = psDD->Shape_Q10[ last_smple_idx ]; + sLTP_Q16[ NSQ->sLTP_buf_idx - decisionDelay + i ] = psDD->Pred_Q16[ last_smple_idx ]; + } + SKP_memcpy( NSQ->sLPC_Q14, &psDD->sLPC_Q14[ psEncC->subfr_length ], NSQ_LPC_BUF_LENGTH * sizeof( SKP_int32 ) ); + SKP_memcpy( NSQ->sAR2_Q14, psDD->sAR2_Q14, sizeof( psDD->sAR2_Q14 ) ); + + /* Update states */ + NSQ->sLF_AR_shp_Q12 = psDD->LF_AR_Q12; + NSQ->lagPrev = psEncCtrlC->pitchL[ NB_SUBFR - 1 ]; + + /* Save quantized speech and noise shaping signals */ + SKP_memcpy( NSQ->xq, &NSQ->xq[ psEncC->frame_length ], psEncC->frame_length * sizeof( SKP_int16 ) ); + SKP_memcpy( NSQ->sLTP_shp_Q10, &NSQ->sLTP_shp_Q10[ psEncC->frame_length ], psEncC->frame_length * sizeof( SKP_int32 ) ); + +#ifdef USE_UNQUANTIZED_LSFS + DEBUG_STORE_DATA( xq_unq_lsfs.pcm, NSQ->xq, psEncC->frame_length * sizeof( SKP_int16 ) ); +#endif + +} + +/******************************************/ +/* Noise shape quantizer for one subframe */ +/******************************************/ +SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec( + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states */ + SKP_int sigtype, /* I Signal type */ + const SKP_int32 x_Q10[], /* I */ + SKP_int8 q[], /* O */ + SKP_int16 xq[], /* O */ + SKP_int32 sLTP_Q16[], /* I/O LTP filter state */ + const SKP_int16 a_Q12[], /* I Short term prediction coefs */ + const SKP_int16 b_Q14[], /* I Long term prediction coefs */ + const SKP_int16 AR_shp_Q13[], /* I Noise shaping coefs */ + SKP_int lag, /* I Pitch lag */ + SKP_int32 HarmShapeFIRPacked_Q14, /* I */ + SKP_int Tilt_Q14, /* I Spectral tilt */ + SKP_int32 LF_shp_Q14, /* I */ + SKP_int32 Gain_Q16, /* I */ + SKP_int Lambda_Q10, /* I */ + SKP_int offset_Q10, /* I */ + SKP_int length, /* I Input length */ + SKP_int subfr, /* I Subframe number */ + SKP_int shapingLPCOrder, /* I Shaping LPC filter order */ + SKP_int predictLPCOrder, /* I Prediction filter order */ + SKP_int warping_Q16, /* I */ + SKP_int nStatesDelayedDecision, /* I Number of states in decision tree */ + SKP_int *smpl_buf_idx, /* I Index to newest samples in buffers */ + SKP_int decisionDelay /* I */ +) +{ + SKP_int i, j, k, Winner_ind, RDmin_ind, RDmax_ind, last_smple_idx; + SKP_int32 Winner_rand_state; + SKP_int32 LTP_pred_Q14, LPC_pred_Q10, n_AR_Q10, n_LTP_Q14; + SKP_int32 n_LF_Q10, r_Q10, rr_Q20, rd1_Q10, rd2_Q10, RDmin_Q10, RDmax_Q10; + SKP_int32 q1_Q10, q2_Q10, dither, exc_Q10, LPC_exc_Q10, xq_Q10; + SKP_int32 tmp1, tmp2, sLF_AR_shp_Q10; + SKP_int32 *pred_lag_ptr, *shp_lag_ptr, *psLPC_Q14; + NSQ_sample_struct psSampleState[ MAX_DEL_DEC_STATES ][ 2 ]; + NSQ_del_dec_struct *psDD; + NSQ_sample_struct *psSS; + + shp_lag_ptr = &NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ]; + pred_lag_ptr = &sLTP_Q16[ NSQ->sLTP_buf_idx - lag + LTP_ORDER / 2 ]; + + for( i = 0; i < length; i++ ) { + /* Perform common calculations used in all states */ + + /* Long-term prediction */ + if( sigtype == SIG_TYPE_VOICED ) { + /* Unrolled loop */ + LTP_pred_Q14 = SKP_SMULWB( pred_lag_ptr[ 0 ], b_Q14[ 0 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -1 ], b_Q14[ 1 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -2 ], b_Q14[ 2 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], b_Q14[ 3 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], b_Q14[ 4 ] ); + pred_lag_ptr++; + } else { + LTP_pred_Q14 = 0; + } + + /* Long-term shaping */ + if( lag > 0 ) { + /* Symmetric, packed FIR coefficients */ + n_LTP_Q14 = SKP_SMULWB( SKP_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = SKP_SMLAWT( n_LTP_Q14, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 ); + n_LTP_Q14 = SKP_LSHIFT( n_LTP_Q14, 6 ); + shp_lag_ptr++; + } else { + n_LTP_Q14 = 0; + } + + for( k = 0; k < nStatesDelayedDecision; k++ ) { + /* Delayed decision state */ + psDD = &psDelDec[ k ]; + + /* Sample state */ + psSS = psSampleState[ k ]; + + /* Generate dither */ + psDD->Seed = SKP_RAND( psDD->Seed ); + + /* dither = rand_seed < 0 ? 0xFFFFFFFF : 0; */ + dither = SKP_RSHIFT( psDD->Seed, 31 ); + + /* Pointer used in short term prediction and shaping */ + psLPC_Q14 = &psDD->sLPC_Q14[ NSQ_LPC_BUF_LENGTH - 1 + i ]; + /* Short-term prediction */ + SKP_assert( predictLPCOrder >= 10 ); /* check that unrolling works */ + SKP_assert( ( predictLPCOrder & 1 ) == 0 ); /* check that order is even */ + SKP_assert( ( ( ( int )( ( char* )( a_Q12 ) - ( ( char* ) 0 ) ) ) & 3 ) == 0 ); /* check that array starts at 4-byte aligned address */ + /* Partially unrolled */ + LPC_pred_Q10 = SKP_SMULWB( psLPC_Q14[ 0 ], a_Q12[ 0 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -1 ], a_Q12[ 1 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -2 ], a_Q12[ 2 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -3 ], a_Q12[ 3 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -4 ], a_Q12[ 4 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -5 ], a_Q12[ 5 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -6 ], a_Q12[ 6 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -7 ], a_Q12[ 7 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -8 ], a_Q12[ 8 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -9 ], a_Q12[ 9 ] ); + for( j = 10; j < predictLPCOrder; j ++ ) { + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -j ], a_Q12[ j ] ); + } + + /* Noise shape feedback */ + SKP_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */ + /* Output of lowpass section */ + tmp2 = SKP_SMLAWB( psLPC_Q14[ 0 ], psDD->sAR2_Q14[ 0 ], warping_Q16 ); + /* Output of allpass section */ + tmp1 = SKP_SMLAWB( psDD->sAR2_Q14[ 0 ], psDD->sAR2_Q14[ 1 ] - tmp2, warping_Q16 ); + psDD->sAR2_Q14[ 0 ] = tmp2; + n_AR_Q10 = SKP_SMULWB( tmp2, AR_shp_Q13[ 0 ] ); + /* Loop over allpass sections */ + for( j = 2; j < shapingLPCOrder; j += 2 ) { + /* Output of allpass section */ + tmp2 = SKP_SMLAWB( psDD->sAR2_Q14[ j - 1 ], psDD->sAR2_Q14[ j + 0 ] - tmp1, warping_Q16 ); + psDD->sAR2_Q14[ j - 1 ] = tmp1; + n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, tmp1, AR_shp_Q13[ j - 1 ] ); + /* Output of allpass section */ + tmp1 = SKP_SMLAWB( psDD->sAR2_Q14[ j + 0 ], psDD->sAR2_Q14[ j + 1 ] - tmp2, warping_Q16 ); + psDD->sAR2_Q14[ j + 0 ] = tmp2; + n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, tmp2, AR_shp_Q13[ j ] ); + } + psDD->sAR2_Q14[ shapingLPCOrder - 1 ] = tmp1; + n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, tmp1, AR_shp_Q13[ shapingLPCOrder - 1 ] ); + + n_AR_Q10 = SKP_RSHIFT( n_AR_Q10, 1 ); /* Q11 -> Q10 */ + n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, psDD->LF_AR_Q12, Tilt_Q14 ); + + n_LF_Q10 = SKP_LSHIFT( SKP_SMULWB( psDD->Shape_Q10[ *smpl_buf_idx ], LF_shp_Q14 ), 2 ); + n_LF_Q10 = SKP_SMLAWT( n_LF_Q10, psDD->LF_AR_Q12, LF_shp_Q14 ); + + /* Input minus prediction plus noise feedback */ + /* r = x[ i ] - LTP_pred - LPC_pred + n_AR + n_Tilt + n_LF + n_LTP */ + tmp1 = SKP_SUB32( LTP_pred_Q14, n_LTP_Q14 ); /* Add Q14 stuff */ + tmp1 = SKP_RSHIFT( tmp1, 4 ); /* convert to Q10 */ + tmp1 = SKP_ADD32( tmp1, LPC_pred_Q10 ); /* add Q10 stuff */ + tmp1 = SKP_SUB32( tmp1, n_AR_Q10 ); /* subtract Q10 stuff */ + tmp1 = SKP_SUB32( tmp1, n_LF_Q10 ); /* subtract Q10 stuff */ + r_Q10 = SKP_SUB32( x_Q10[ i ], tmp1 ); /* residual error Q10 */ + + /* Flip sign depending on dither */ + r_Q10 = ( r_Q10 ^ dither ) - dither; + r_Q10 = SKP_SUB32( r_Q10, offset_Q10 ); + r_Q10 = SKP_LIMIT_32( r_Q10, -64 << 10, 64 << 10 ); + + /* Find two quantization level candidates and measure their rate-distortion */ + if( r_Q10 < -1536 ) { + q1_Q10 = SKP_LSHIFT( SKP_RSHIFT_ROUND( r_Q10, 10 ), 10 ); + r_Q10 = SKP_SUB32( r_Q10, q1_Q10 ); + rd1_Q10 = SKP_RSHIFT( SKP_SMLABB( SKP_MUL( -SKP_ADD32( q1_Q10, offset_Q10 ), Lambda_Q10 ), r_Q10, r_Q10 ), 10 ); + rd2_Q10 = SKP_ADD32( rd1_Q10, 1024 ); + rd2_Q10 = SKP_SUB32( rd2_Q10, SKP_ADD_LSHIFT32( Lambda_Q10, r_Q10, 1 ) ); + q2_Q10 = SKP_ADD32( q1_Q10, 1024 ); + } else if( r_Q10 > 512 ) { + q1_Q10 = SKP_LSHIFT( SKP_RSHIFT_ROUND( r_Q10, 10 ), 10 ); + r_Q10 = SKP_SUB32( r_Q10, q1_Q10 ); + rd1_Q10 = SKP_RSHIFT( SKP_SMLABB( SKP_MUL( SKP_ADD32( q1_Q10, offset_Q10 ), Lambda_Q10 ), r_Q10, r_Q10 ), 10 ); + rd2_Q10 = SKP_ADD32( rd1_Q10, 1024 ); + rd2_Q10 = SKP_SUB32( rd2_Q10, SKP_SUB_LSHIFT32( Lambda_Q10, r_Q10, 1 ) ); + q2_Q10 = SKP_SUB32( q1_Q10, 1024 ); + } else { /* r_Q10 >= -1536 && q1_Q10 <= 512 */ + rr_Q20 = SKP_SMULBB( offset_Q10, Lambda_Q10 ); + rd2_Q10 = SKP_RSHIFT( SKP_SMLABB( rr_Q20, r_Q10, r_Q10 ), 10 ); + rd1_Q10 = SKP_ADD32( rd2_Q10, 1024 ); + rd1_Q10 = SKP_ADD32( rd1_Q10, SKP_SUB_RSHIFT32( SKP_ADD_LSHIFT32( Lambda_Q10, r_Q10, 1 ), rr_Q20, 9 ) ); + q1_Q10 = -1024; + q2_Q10 = 0; + } + + if( rd1_Q10 < rd2_Q10 ) { + psSS[ 0 ].RD_Q10 = SKP_ADD32( psDD->RD_Q10, rd1_Q10 ); + psSS[ 1 ].RD_Q10 = SKP_ADD32( psDD->RD_Q10, rd2_Q10 ); + psSS[ 0 ].Q_Q10 = q1_Q10; + psSS[ 1 ].Q_Q10 = q2_Q10; + } else { + psSS[ 0 ].RD_Q10 = SKP_ADD32( psDD->RD_Q10, rd2_Q10 ); + psSS[ 1 ].RD_Q10 = SKP_ADD32( psDD->RD_Q10, rd1_Q10 ); + psSS[ 0 ].Q_Q10 = q2_Q10; + psSS[ 1 ].Q_Q10 = q1_Q10; + } + + /* Update states for best quantization */ + + /* Quantized excitation */ + exc_Q10 = SKP_ADD32( offset_Q10, psSS[ 0 ].Q_Q10 ); + exc_Q10 = ( exc_Q10 ^ dither ) - dither; + + /* Add predictions */ + LPC_exc_Q10 = exc_Q10 + SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ); + xq_Q10 = SKP_ADD32( LPC_exc_Q10, LPC_pred_Q10 ); + + /* Update states */ + sLF_AR_shp_Q10 = SKP_SUB32( xq_Q10, n_AR_Q10 ); + psSS[ 0 ].sLTP_shp_Q10 = SKP_SUB32( sLF_AR_shp_Q10, n_LF_Q10 ); + psSS[ 0 ].LF_AR_Q12 = SKP_LSHIFT( sLF_AR_shp_Q10, 2 ); + psSS[ 0 ].xq_Q14 = SKP_LSHIFT( xq_Q10, 4 ); + psSS[ 0 ].LPC_exc_Q16 = SKP_LSHIFT( LPC_exc_Q10, 6 ); + + /* Update states for second best quantization */ + + /* Quantized excitation */ + exc_Q10 = SKP_ADD32( offset_Q10, psSS[ 1 ].Q_Q10 ); + exc_Q10 = ( exc_Q10 ^ dither ) - dither; + + /* Add predictions */ + LPC_exc_Q10 = exc_Q10 + SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ); + xq_Q10 = SKP_ADD32( LPC_exc_Q10, LPC_pred_Q10 ); + + /* Update states */ + sLF_AR_shp_Q10 = SKP_SUB32( xq_Q10, n_AR_Q10 ); + psSS[ 1 ].sLTP_shp_Q10 = SKP_SUB32( sLF_AR_shp_Q10, n_LF_Q10 ); + psSS[ 1 ].LF_AR_Q12 = SKP_LSHIFT( sLF_AR_shp_Q10, 2 ); + psSS[ 1 ].xq_Q14 = SKP_LSHIFT( xq_Q10, 4 ); + psSS[ 1 ].LPC_exc_Q16 = SKP_LSHIFT( LPC_exc_Q10, 6 ); + } + + *smpl_buf_idx = ( *smpl_buf_idx - 1 ) & DECISION_DELAY_MASK; /* Index to newest samples */ + last_smple_idx = ( *smpl_buf_idx + decisionDelay ) & DECISION_DELAY_MASK; /* Index to decisionDelay old samples */ + + /* Find winner */ + RDmin_Q10 = psSampleState[ 0 ][ 0 ].RD_Q10; + Winner_ind = 0; + for( k = 1; k < nStatesDelayedDecision; k++ ) { + if( psSampleState[ k ][ 0 ].RD_Q10 < RDmin_Q10 ) { + RDmin_Q10 = psSampleState[ k ][ 0 ].RD_Q10; + Winner_ind = k; + } + } + + /* Increase RD values of expired states */ + Winner_rand_state = psDelDec[ Winner_ind ].RandState[ last_smple_idx ]; + for( k = 0; k < nStatesDelayedDecision; k++ ) { + if( psDelDec[ k ].RandState[ last_smple_idx ] != Winner_rand_state ) { + psSampleState[ k ][ 0 ].RD_Q10 = SKP_ADD32( psSampleState[ k ][ 0 ].RD_Q10, ( SKP_int32_MAX >> 4 ) ); + psSampleState[ k ][ 1 ].RD_Q10 = SKP_ADD32( psSampleState[ k ][ 1 ].RD_Q10, ( SKP_int32_MAX >> 4 ) ); + SKP_assert( psSampleState[ k ][ 0 ].RD_Q10 >= 0 ); + } + } + + /* Find worst in first set and best in second set */ + RDmax_Q10 = psSampleState[ 0 ][ 0 ].RD_Q10; + RDmin_Q10 = psSampleState[ 0 ][ 1 ].RD_Q10; + RDmax_ind = 0; + RDmin_ind = 0; + for( k = 1; k < nStatesDelayedDecision; k++ ) { + /* find worst in first set */ + if( psSampleState[ k ][ 0 ].RD_Q10 > RDmax_Q10 ) { + RDmax_Q10 = psSampleState[ k ][ 0 ].RD_Q10; + RDmax_ind = k; + } + /* find best in second set */ + if( psSampleState[ k ][ 1 ].RD_Q10 < RDmin_Q10 ) { + RDmin_Q10 = psSampleState[ k ][ 1 ].RD_Q10; + RDmin_ind = k; + } + } + + /* Replace a state if best from second set outperforms worst in first set */ + if( RDmin_Q10 < RDmax_Q10 ) { + SKP_Silk_copy_del_dec_state( &psDelDec[ RDmax_ind ], &psDelDec[ RDmin_ind ], i ); + SKP_memcpy( &psSampleState[ RDmax_ind ][ 0 ], &psSampleState[ RDmin_ind ][ 1 ], sizeof( NSQ_sample_struct ) ); + } + + /* Write samples from winner to output and long-term filter states */ + psDD = &psDelDec[ Winner_ind ]; + if( subfr > 0 || i >= decisionDelay ) { + q[ i - decisionDelay ] = ( SKP_int8 )SKP_RSHIFT( psDD->Q_Q10[ last_smple_idx ], 10 ); + xq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( + SKP_SMULWW( psDD->Xq_Q10[ last_smple_idx ], psDD->Gain_Q16[ last_smple_idx ] ), 10 ) ); + NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - decisionDelay ] = psDD->Shape_Q10[ last_smple_idx ]; + sLTP_Q16[ NSQ->sLTP_buf_idx - decisionDelay ] = psDD->Pred_Q16[ last_smple_idx ]; + } + NSQ->sLTP_shp_buf_idx++; + NSQ->sLTP_buf_idx++; + + /* Update states */ + for( k = 0; k < nStatesDelayedDecision; k++ ) { + psDD = &psDelDec[ k ]; + psSS = &psSampleState[ k ][ 0 ]; + psDD->LF_AR_Q12 = psSS->LF_AR_Q12; + psDD->sLPC_Q14[ NSQ_LPC_BUF_LENGTH + i ] = psSS->xq_Q14; + psDD->Xq_Q10[ *smpl_buf_idx ] = SKP_RSHIFT( psSS->xq_Q14, 4 ); + psDD->Q_Q10[ *smpl_buf_idx ] = psSS->Q_Q10; + psDD->Pred_Q16[ *smpl_buf_idx ] = psSS->LPC_exc_Q16; + psDD->Shape_Q10[ *smpl_buf_idx ] = psSS->sLTP_shp_Q10; + psDD->Seed = SKP_ADD_RSHIFT32( psDD->Seed, psSS->Q_Q10, 10 ); + psDD->RandState[ *smpl_buf_idx ] = psDD->Seed; + psDD->RD_Q10 = psSS->RD_Q10; + psDD->Gain_Q16[ *smpl_buf_idx ] = Gain_Q16; + } + } + /* Update LPC states */ + for( k = 0; k < nStatesDelayedDecision; k++ ) { + psDD = &psDelDec[ k ]; + SKP_memcpy( psDD->sLPC_Q14, &psDD->sLPC_Q14[ length ], NSQ_LPC_BUF_LENGTH * sizeof( SKP_int32 ) ); + } +} + +SKP_INLINE void SKP_Silk_nsq_del_dec_scale_states( + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states */ + const SKP_int16 x[], /* I Input in Q0 */ + SKP_int32 x_sc_Q10[], /* O Input scaled with 1/Gain in Q10 */ + SKP_int subfr_length, /* I Length of input */ + const SKP_int16 sLTP[], /* I Re-whitened LTP state in Q0 */ + SKP_int32 sLTP_Q16[], /* O LTP state matching scaled input */ + SKP_int subfr, /* I Subframe number */ + SKP_int nStatesDelayedDecision, /* I Number of del dec states */ + SKP_int smpl_buf_idx, /* I Index to newest samples in buffers */ + const SKP_int LTP_scale_Q14, /* I LTP state scaling */ + const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */ + const SKP_int pitchL[ NB_SUBFR ] /* I Pitch lag */ +) +{ + SKP_int i, k, lag; + SKP_int32 inv_gain_Q16, gain_adj_Q16, inv_gain_Q32; + NSQ_del_dec_struct *psDD; + + inv_gain_Q16 = SKP_INVERSE32_varQ( SKP_max( Gains_Q16[ subfr ], 1 ), 32 ); + inv_gain_Q16 = SKP_min( inv_gain_Q16, SKP_int16_MAX ); + lag = pitchL[ subfr ]; + + /* After rewhitening the LTP state is un-scaled, so scale with inv_gain_Q16 */ + if( NSQ->rewhite_flag ) { + inv_gain_Q32 = SKP_LSHIFT( inv_gain_Q16, 16 ); + if( subfr == 0 ) { + /* Do LTP downscaling */ + inv_gain_Q32 = SKP_LSHIFT( SKP_SMULWB( inv_gain_Q32, LTP_scale_Q14 ), 2 ); + } + for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { + SKP_assert( i < MAX_FRAME_LENGTH ); + sLTP_Q16[ i ] = SKP_SMULWB( inv_gain_Q32, sLTP[ i ] ); + } + } + + /* Adjust for changing gain */ + if( inv_gain_Q16 != NSQ->prev_inv_gain_Q16 ) { + gain_adj_Q16 = SKP_DIV32_varQ( inv_gain_Q16, NSQ->prev_inv_gain_Q16, 16 ); + + /* Scale long-term shaping state */ + for( i = NSQ->sLTP_shp_buf_idx - subfr_length * NB_SUBFR; i < NSQ->sLTP_shp_buf_idx; i++ ) { + NSQ->sLTP_shp_Q10[ i ] = SKP_SMULWW( gain_adj_Q16, NSQ->sLTP_shp_Q10[ i ] ); + } + + /* Scale long-term prediction state */ + if( NSQ->rewhite_flag == 0 ) { + for( i = NSQ->sLTP_buf_idx - lag - LTP_ORDER / 2; i < NSQ->sLTP_buf_idx; i++ ) { + sLTP_Q16[ i ] = SKP_SMULWW( gain_adj_Q16, sLTP_Q16[ i ] ); + } + } + + for( k = 0; k < nStatesDelayedDecision; k++ ) { + psDD = &psDelDec[ k ]; + + /* Scale scalar states */ + psDD->LF_AR_Q12 = SKP_SMULWW( gain_adj_Q16, psDD->LF_AR_Q12 ); + + /* Scale short-term prediction and shaping states */ + for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) { + psDD->sLPC_Q14[ i ] = SKP_SMULWW( gain_adj_Q16, psDD->sLPC_Q14[ i ] ); + } + for( i = 0; i < MAX_SHAPE_LPC_ORDER; i++ ) { + psDD->sAR2_Q14[ i ] = SKP_SMULWW( gain_adj_Q16, psDD->sAR2_Q14[ i ] ); + } + for( i = 0; i < DECISION_DELAY; i++ ) { + psDD->Pred_Q16[ i ] = SKP_SMULWW( gain_adj_Q16, psDD->Pred_Q16[ i ] ); + psDD->Shape_Q10[ i ] = SKP_SMULWW( gain_adj_Q16, psDD->Shape_Q10[ i ] ); + } + } + } + + /* Scale input */ + for( i = 0; i < subfr_length; i++ ) { + x_sc_Q10[ i ] = SKP_RSHIFT( SKP_SMULBB( x[ i ], ( SKP_int16 )inv_gain_Q16 ), 6 ); + } + + /* save inv_gain */ + SKP_assert( inv_gain_Q16 != 0 ); + NSQ->prev_inv_gain_Q16 = inv_gain_Q16; +} + +SKP_INLINE void SKP_Silk_copy_del_dec_state( + NSQ_del_dec_struct *DD_dst, /* I Dst del dec state */ + NSQ_del_dec_struct *DD_src, /* I Src del dec state */ + SKP_int LPC_state_idx /* I Index to LPC buffer */ +) +{ + SKP_memcpy( DD_dst->RandState, DD_src->RandState, sizeof( DD_src->RandState ) ); + SKP_memcpy( DD_dst->Q_Q10, DD_src->Q_Q10, sizeof( DD_src->Q_Q10 ) ); + SKP_memcpy( DD_dst->Pred_Q16, DD_src->Pred_Q16, sizeof( DD_src->Pred_Q16 ) ); + SKP_memcpy( DD_dst->Shape_Q10, DD_src->Shape_Q10, sizeof( DD_src->Shape_Q10 ) ); + SKP_memcpy( DD_dst->Xq_Q10, DD_src->Xq_Q10, sizeof( DD_src->Xq_Q10 ) ); + SKP_memcpy( DD_dst->sAR2_Q14, DD_src->sAR2_Q14, sizeof( DD_src->sAR2_Q14 ) ); + SKP_memcpy( &DD_dst->sLPC_Q14[ LPC_state_idx ], &DD_src->sLPC_Q14[ LPC_state_idx ], NSQ_LPC_BUF_LENGTH * sizeof( SKP_int32 ) ); + DD_dst->LF_AR_Q12 = DD_src->LF_AR_Q12; + DD_dst->Seed = DD_src->Seed; + DD_dst->SeedInit = DD_src->SeedInit; + DD_dst->RD_Q10 = DD_src->RD_Q10; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_PLC.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_PLC.c new file mode 100755 index 0000000..b2ab5af --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_PLC.c @@ -0,0 +1,388 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" +#include "SKP_Silk_PLC.h" + +#define NB_ATT 2 +static const SKP_int16 HARM_ATT_Q15[NB_ATT] = { 32440, 31130 }; /* 0.99, 0.95 */ +static const SKP_int16 PLC_RAND_ATTENUATE_V_Q15[NB_ATT] = { 31130, 26214 }; /* 0.95, 0.8 */ +static const SKP_int16 PLC_RAND_ATTENUATE_UV_Q15[NB_ATT] = { 32440, 29491 }; /* 0.99, 0.9 */ + +void SKP_Silk_PLC_Reset( + SKP_Silk_decoder_state *psDec /* I/O Decoder state */ +) +{ + psDec->sPLC.pitchL_Q8 = SKP_RSHIFT( psDec->frame_length, 1 ); +} + +void SKP_Silk_PLC( + SKP_Silk_decoder_state *psDec, /* I Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I Decoder control */ + SKP_int16 signal[], /* O Concealed signal */ + SKP_int length, /* I length of residual */ + SKP_int lost /* I Loss flag */ +) +{ + /* PLC control function */ + if( psDec->fs_kHz != psDec->sPLC.fs_kHz ) { + SKP_Silk_PLC_Reset( psDec ); + psDec->sPLC.fs_kHz = psDec->fs_kHz; + } + + if( lost ) { + /****************************/ + /* Generate Signal */ + /****************************/ + SKP_Silk_PLC_conceal( psDec, psDecCtrl, signal, length ); + + psDec->lossCnt++; + } else { + /****************************/ + /* Update state */ + /****************************/ + SKP_Silk_PLC_update( psDec, psDecCtrl, signal, length ); + } +} + +/**************************************************/ +/* Update state of PLC */ +/**************************************************/ +void SKP_Silk_PLC_update( + SKP_Silk_decoder_state *psDec, /* (I/O) Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* (I/O) Decoder control */ + SKP_int16 signal[], + SKP_int length +) +{ + SKP_int32 LTP_Gain_Q14, temp_LTP_Gain_Q14; + SKP_int i, j; + SKP_Silk_PLC_struct *psPLC; + + psPLC = &psDec->sPLC; + + /* Update parameters used in case of packet loss */ + psDec->prev_sigtype = psDecCtrl->sigtype; + LTP_Gain_Q14 = 0; + if( psDecCtrl->sigtype == SIG_TYPE_VOICED ) { + /* Find the parameters for the last subframe which contains a pitch pulse */ + for( j = 0; j * psDec->subfr_length < psDecCtrl->pitchL[ NB_SUBFR - 1 ]; j++ ) { + temp_LTP_Gain_Q14 = 0; + for( i = 0; i < LTP_ORDER; i++ ) { + temp_LTP_Gain_Q14 += psDecCtrl->LTPCoef_Q14[ ( NB_SUBFR - 1 - j ) * LTP_ORDER + i ]; + } + if( temp_LTP_Gain_Q14 > LTP_Gain_Q14 ) { + LTP_Gain_Q14 = temp_LTP_Gain_Q14; + SKP_memcpy( psPLC->LTPCoef_Q14, + &psDecCtrl->LTPCoef_Q14[ SKP_SMULBB( NB_SUBFR - 1 - j, LTP_ORDER ) ], + LTP_ORDER * sizeof( SKP_int16 ) ); + + psPLC->pitchL_Q8 = SKP_LSHIFT( psDecCtrl->pitchL[ NB_SUBFR - 1 - j ], 8 ); + } + } + +#if USE_SINGLE_TAP + SKP_memset( psPLC->LTPCoef_Q14, 0, LTP_ORDER * sizeof( SKP_int16 ) ); + psPLC->LTPCoef_Q14[ LTP_ORDER / 2 ] = LTP_Gain_Q14; +#endif + + /* Limit LT coefs */ + if( LTP_Gain_Q14 < V_PITCH_GAIN_START_MIN_Q14 ) { + SKP_int scale_Q10; + SKP_int32 tmp; + + tmp = SKP_LSHIFT( V_PITCH_GAIN_START_MIN_Q14, 10 ); + scale_Q10 = SKP_DIV32( tmp, SKP_max( LTP_Gain_Q14, 1 ) ); + for( i = 0; i < LTP_ORDER; i++ ) { + psPLC->LTPCoef_Q14[ i ] = SKP_RSHIFT( SKP_SMULBB( psPLC->LTPCoef_Q14[ i ], scale_Q10 ), 10 ); + } + } else if( LTP_Gain_Q14 > V_PITCH_GAIN_START_MAX_Q14 ) { + SKP_int scale_Q14; + SKP_int32 tmp; + + tmp = SKP_LSHIFT( V_PITCH_GAIN_START_MAX_Q14, 14 ); + scale_Q14 = SKP_DIV32( tmp, SKP_max( LTP_Gain_Q14, 1 ) ); + for( i = 0; i < LTP_ORDER; i++ ) { + psPLC->LTPCoef_Q14[ i ] = SKP_RSHIFT( SKP_SMULBB( psPLC->LTPCoef_Q14[ i ], scale_Q14 ), 14 ); + } + } + } else { + psPLC->pitchL_Q8 = SKP_LSHIFT( SKP_SMULBB( psDec->fs_kHz, 18 ), 8 ); + SKP_memset( psPLC->LTPCoef_Q14, 0, LTP_ORDER * sizeof( SKP_int16 )); + } + + /* Save LPC coeficients */ + SKP_memcpy( psPLC->prevLPC_Q12, psDecCtrl->PredCoef_Q12[ 1 ], psDec->LPC_order * sizeof( SKP_int16 ) ); + psPLC->prevLTP_scale_Q14 = psDecCtrl->LTP_scale_Q14; + + /* Save Gains */ + SKP_memcpy( psPLC->prevGain_Q16, psDecCtrl->Gains_Q16, NB_SUBFR * sizeof( SKP_int32 ) ); +} + +void SKP_Silk_PLC_conceal( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int16 signal[], /* O concealed signal */ + SKP_int length /* I length of residual */ +) +{ + SKP_int i, j, k; + SKP_int16 *B_Q14, exc_buf[ MAX_FRAME_LENGTH ], *exc_buf_ptr; + SKP_int16 rand_scale_Q14; + union { + SKP_int16 as_int16[ MAX_LPC_ORDER ]; + SKP_int32 as_int32[ MAX_LPC_ORDER / 2 ]; + } A_Q12_tmp; + SKP_int32 rand_seed, harm_Gain_Q15, rand_Gain_Q15; + SKP_int lag, idx, sLTP_buf_idx, shift1, shift2; + SKP_int32 energy1, energy2, *rand_ptr, *pred_lag_ptr; + SKP_int32 sig_Q10[ MAX_FRAME_LENGTH ], *sig_Q10_ptr, LPC_exc_Q10, LPC_pred_Q10, LTP_pred_Q14; + SKP_Silk_PLC_struct *psPLC; + psPLC = &psDec->sPLC; + + /* Update LTP buffer */ + SKP_memcpy( psDec->sLTP_Q16, &psDec->sLTP_Q16[ psDec->frame_length ], psDec->frame_length * sizeof( SKP_int32 ) ); + + /* LPC concealment. Apply BWE to previous LPC */ + SKP_Silk_bwexpander( psPLC->prevLPC_Q12, psDec->LPC_order, BWE_COEF_Q16 ); + + /* Find random noise component */ + /* Scale previous excitation signal */ + exc_buf_ptr = exc_buf; + for( k = ( NB_SUBFR >> 1 ); k < NB_SUBFR; k++ ) { + for( i = 0; i < psDec->subfr_length; i++ ) { + exc_buf_ptr[ i ] = ( SKP_int16 )SKP_RSHIFT( + SKP_SMULWW( psDec->exc_Q10[ i + k * psDec->subfr_length ], psPLC->prevGain_Q16[ k ] ), 10 ); + } + exc_buf_ptr += psDec->subfr_length; + } + /* Find the subframe with lowest energy of the last two and use that as random noise generator */ + SKP_Silk_sum_sqr_shift( &energy1, &shift1, exc_buf, psDec->subfr_length ); + SKP_Silk_sum_sqr_shift( &energy2, &shift2, &exc_buf[ psDec->subfr_length ], psDec->subfr_length ); + + if( SKP_RSHIFT( energy1, shift2 ) < SKP_RSHIFT( energy2, shift1 ) ) { + /* First sub-frame has lowest energy */ + rand_ptr = &psDec->exc_Q10[ SKP_max_int( 0, 3 * psDec->subfr_length - RAND_BUF_SIZE ) ]; + } else { + /* Second sub-frame has lowest energy */ + rand_ptr = &psDec->exc_Q10[ SKP_max_int( 0, psDec->frame_length - RAND_BUF_SIZE ) ]; + } + + /* Setup Gain to random noise component */ + B_Q14 = psPLC->LTPCoef_Q14; + rand_scale_Q14 = psPLC->randScale_Q14; + + /* Setup attenuation gains */ + harm_Gain_Q15 = HARM_ATT_Q15[ SKP_min_int( NB_ATT - 1, psDec->lossCnt ) ]; + if( psDec->prev_sigtype == SIG_TYPE_VOICED ) { + rand_Gain_Q15 = PLC_RAND_ATTENUATE_V_Q15[ SKP_min_int( NB_ATT - 1, psDec->lossCnt ) ]; + } else { + rand_Gain_Q15 = PLC_RAND_ATTENUATE_UV_Q15[ SKP_min_int( NB_ATT - 1, psDec->lossCnt ) ]; + } + + /* First Lost frame */ + if( psDec->lossCnt == 0 ) { + rand_scale_Q14 = (1 << 14 ); + + /* Reduce random noise Gain for voiced frames */ + if( psDec->prev_sigtype == SIG_TYPE_VOICED ) { + for( i = 0; i < LTP_ORDER; i++ ) { + rand_scale_Q14 -= B_Q14[ i ]; + } + rand_scale_Q14 = SKP_max_16( 3277, rand_scale_Q14 ); /* 0.2 */ + rand_scale_Q14 = ( SKP_int16 )SKP_RSHIFT( SKP_SMULBB( rand_scale_Q14, psPLC->prevLTP_scale_Q14 ), 14 ); + } + + /* Reduce random noise for unvoiced frames with high LPC gain */ + if( psDec->prev_sigtype == SIG_TYPE_UNVOICED ) { + SKP_int32 invGain_Q30, down_scale_Q30; + + SKP_Silk_LPC_inverse_pred_gain( &invGain_Q30, psPLC->prevLPC_Q12, psDec->LPC_order ); + + down_scale_Q30 = SKP_min_32( SKP_RSHIFT( ( 1 << 30 ), LOG2_INV_LPC_GAIN_HIGH_THRES ), invGain_Q30 ); + down_scale_Q30 = SKP_max_32( SKP_RSHIFT( ( 1 << 30 ), LOG2_INV_LPC_GAIN_LOW_THRES ), down_scale_Q30 ); + down_scale_Q30 = SKP_LSHIFT( down_scale_Q30, LOG2_INV_LPC_GAIN_HIGH_THRES ); + + rand_Gain_Q15 = SKP_RSHIFT( SKP_SMULWB( down_scale_Q30, rand_Gain_Q15 ), 14 ); + } + } + + rand_seed = psPLC->rand_seed; + lag = SKP_RSHIFT_ROUND( psPLC->pitchL_Q8, 8 ); + sLTP_buf_idx = psDec->frame_length; + + /***************************/ + /* LTP synthesis filtering */ + /***************************/ + sig_Q10_ptr = sig_Q10; + for( k = 0; k < NB_SUBFR; k++ ) { + /* Setup pointer */ + pred_lag_ptr = &psDec->sLTP_Q16[ sLTP_buf_idx - lag + LTP_ORDER / 2 ]; + for( i = 0; i < psDec->subfr_length; i++ ) { + rand_seed = SKP_RAND( rand_seed ); + idx = SKP_RSHIFT( rand_seed, 25 ) & RAND_BUF_MASK; + + /* Unrolled loop */ + LTP_pred_Q14 = SKP_SMULWB( pred_lag_ptr[ 0 ], B_Q14[ 0 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -1 ], B_Q14[ 1 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -2 ], B_Q14[ 2 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], B_Q14[ 3 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], B_Q14[ 4 ] ); + pred_lag_ptr++; + + /* Generate LPC residual */ + LPC_exc_Q10 = SKP_LSHIFT( SKP_SMULWB( rand_ptr[ idx ], rand_scale_Q14 ), 2 ); /* Random noise part */ + LPC_exc_Q10 = SKP_ADD32( LPC_exc_Q10, SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ) ); /* Harmonic part */ + + /* Update states */ + psDec->sLTP_Q16[ sLTP_buf_idx ] = SKP_LSHIFT( LPC_exc_Q10, 6 ); + sLTP_buf_idx++; + + /* Save LPC residual */ + sig_Q10_ptr[ i ] = LPC_exc_Q10; + } + sig_Q10_ptr += psDec->subfr_length; + /* Gradually reduce LTP gain */ + for( j = 0; j < LTP_ORDER; j++ ) { + B_Q14[ j ] = SKP_RSHIFT( SKP_SMULBB( harm_Gain_Q15, B_Q14[ j ] ), 15 ); + } + /* Gradually reduce excitation gain */ + rand_scale_Q14 = SKP_RSHIFT( SKP_SMULBB( rand_scale_Q14, rand_Gain_Q15 ), 15 ); + + /* Slowly increase pitch lag */ + psPLC->pitchL_Q8 += SKP_SMULWB( psPLC->pitchL_Q8, PITCH_DRIFT_FAC_Q16 ); + psPLC->pitchL_Q8 = SKP_min_32( psPLC->pitchL_Q8, SKP_LSHIFT( SKP_SMULBB( MAX_PITCH_LAG_MS, psDec->fs_kHz ), 8 ) ); + lag = SKP_RSHIFT_ROUND( psPLC->pitchL_Q8, 8 ); + } + + /***************************/ + /* LPC synthesis filtering */ + /***************************/ + sig_Q10_ptr = sig_Q10; + /* Preload LPC coeficients to array on stack. Gives small performance gain */ + SKP_memcpy( A_Q12_tmp.as_int16, psPLC->prevLPC_Q12, psDec->LPC_order * sizeof( SKP_int16 ) ); + SKP_assert( psDec->LPC_order >= 10 ); /* check that unrolling works */ + for( k = 0; k < NB_SUBFR; k++ ) { + for( i = 0; i < psDec->subfr_length; i++ ){ + /* partly unrolled */ + LPC_pred_Q10 = SKP_SMULWB( psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 1 ], A_Q12_tmp.as_int16[ 0 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 2 ], A_Q12_tmp.as_int16[ 1 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 3 ], A_Q12_tmp.as_int16[ 2 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 4 ], A_Q12_tmp.as_int16[ 3 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 5 ], A_Q12_tmp.as_int16[ 4 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 6 ], A_Q12_tmp.as_int16[ 5 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 7 ], A_Q12_tmp.as_int16[ 6 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 8 ], A_Q12_tmp.as_int16[ 7 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 9 ], A_Q12_tmp.as_int16[ 8 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 10 ], A_Q12_tmp.as_int16[ 9 ] ); + + for( j = 10; j < psDec->LPC_order; j++ ) { + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - j - 1 ], A_Q12_tmp.as_int16[ j ] ); + } + /* Add prediction to LPC residual */ + sig_Q10_ptr[ i ] = SKP_ADD32( sig_Q10_ptr[ i ], LPC_pred_Q10 ); + + /* Update states */ + psDec->sLPC_Q14[ MAX_LPC_ORDER + i ] = SKP_LSHIFT( sig_Q10_ptr[ i ], 4 ); + } + sig_Q10_ptr += psDec->subfr_length; + /* Update LPC filter state */ + SKP_memcpy( psDec->sLPC_Q14, &psDec->sLPC_Q14[ psDec->subfr_length ], MAX_LPC_ORDER * sizeof( SKP_int32 ) ); + } + + /* Scale with Gain */ + for( i = 0; i < psDec->frame_length; i++ ) { + signal[ i ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( SKP_SMULWW( sig_Q10[ i ], psPLC->prevGain_Q16[ NB_SUBFR - 1 ] ), 10 ) ); + } + + /**************************************/ + /* Update states */ + /**************************************/ + psPLC->rand_seed = rand_seed; + psPLC->randScale_Q14 = rand_scale_Q14; + for( i = 0; i < NB_SUBFR; i++ ) { + psDecCtrl->pitchL[ i ] = lag; + } +} + +/* Glues concealed frames with new good recieved frames */ +void SKP_Silk_PLC_glue_frames( + SKP_Silk_decoder_state *psDec, /* I/O decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int16 signal[], /* I/O signal */ + SKP_int length /* I length of residual */ +) +{ + SKP_int i, energy_shift; + SKP_int32 energy; + SKP_Silk_PLC_struct *psPLC; + psPLC = &psDec->sPLC; + + if( psDec->lossCnt ) { + /* Calculate energy in concealed residual */ + SKP_Silk_sum_sqr_shift( &psPLC->conc_energy, &psPLC->conc_energy_shift, signal, length ); + + psPLC->last_frame_lost = 1; + } else { + if( psDec->sPLC.last_frame_lost ) { + /* Calculate residual in decoded signal if last frame was lost */ + SKP_Silk_sum_sqr_shift( &energy, &energy_shift, signal, length ); + + /* Normalize energies */ + if( energy_shift > psPLC->conc_energy_shift ) { + psPLC->conc_energy = SKP_RSHIFT( psPLC->conc_energy, energy_shift - psPLC->conc_energy_shift ); + } else if( energy_shift < psPLC->conc_energy_shift ) { + energy = SKP_RSHIFT( energy, psPLC->conc_energy_shift - energy_shift ); + } + + /* Fade in the energy difference */ + if( energy > psPLC->conc_energy ) { + SKP_int32 frac_Q24, LZ; + SKP_int32 gain_Q12, slope_Q12; + + LZ = SKP_Silk_CLZ32( psPLC->conc_energy ); + LZ = LZ - 1; + psPLC->conc_energy = SKP_LSHIFT( psPLC->conc_energy, LZ ); + energy = SKP_RSHIFT( energy, SKP_max_32( 24 - LZ, 0 ) ); + + frac_Q24 = SKP_DIV32( psPLC->conc_energy, SKP_max( energy, 1 ) ); + + gain_Q12 = SKP_Silk_SQRT_APPROX( frac_Q24 ); + slope_Q12 = SKP_DIV32_16( ( 1 << 12 ) - gain_Q12, length ); + + for( i = 0; i < length; i++ ) { + signal[ i ] = SKP_RSHIFT( SKP_MUL( gain_Q12, signal[ i ] ), 12 ); + gain_Q12 += slope_Q12; + gain_Q12 = SKP_min( gain_Q12, ( 1 << 12 ) ); + } + } + } + psPLC->last_frame_lost = 0; + + } +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_PLC.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_PLC.h new file mode 100755 index 0000000..027fcda --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_PLC.h @@ -0,0 +1,79 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_PLC_FIX_H +#define SKP_SILK_PLC_FIX_H + +#include "SKP_Silk_main.h" + +#define BWE_COEF_Q16 64880 /* 0.99 in Q16 */ +#define V_PITCH_GAIN_START_MIN_Q14 11469 /* 0.7 in Q14 */ +#define V_PITCH_GAIN_START_MAX_Q14 15565 /* 0.95 in Q14 */ +#define MAX_PITCH_LAG_MS 18 +#define SA_THRES_Q8 50 +#define USE_SINGLE_TAP 1 +#define RAND_BUF_SIZE 128 +#define RAND_BUF_MASK (RAND_BUF_SIZE - 1) +#define LOG2_INV_LPC_GAIN_HIGH_THRES 3 /* 2^3 = 8 dB LPC gain */ +#define LOG2_INV_LPC_GAIN_LOW_THRES 8 /* 2^8 = 24 dB LPC gain */ +#define PITCH_DRIFT_FAC_Q16 655 /* 0.01 in Q16 */ + +void SKP_Silk_PLC_Reset( + SKP_Silk_decoder_state *psDec /* I/O Decoder state */ +); + +void SKP_Silk_PLC( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int16 signal[], /* I/O signal */ + SKP_int length, /* I length of residual */ + SKP_int lost /* I Loss flag */ +); + +void SKP_Silk_PLC_update( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int16 signal[], + SKP_int length +); + +void SKP_Silk_PLC_conceal( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int16 signal[], /* O LPC residual signal */ + SKP_int length /* I length of signal */ +); + +void SKP_Silk_PLC_glue_frames( + SKP_Silk_decoder_state *psDec, /* I/O decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int16 signal[], /* I/O signal */ + SKP_int length /* I length of signal */ +); + +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_SigProc_FIX.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_SigProc_FIX.h new file mode 100755 index 0000000..3f89f82 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_SigProc_FIX.h @@ -0,0 +1,636 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef _SKP_SILK_SIGPROC_FIX_H_ +#define _SKP_SILK_SIGPROC_FIX_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define SKP_Silk_MAX_ORDER_LPC 16 /* max order of the LPC analysis in schur() and k2a() */ +#define SKP_Silk_MAX_CORRELATION_LENGTH 640 /* max input length to the correlation */ +#include "SKP_Silk_typedef.h" +#include +#include /* for abs() */ +#include "SKP_Silk_resampler_structs.h" + +# include "SKP_Silk_macros.h" + + + +/********************************************************************/ +/* SIGNAL PROCESSING FUNCTIONS */ +/********************************************************************/ + +/*! + * Initialize/reset the resampler state for a given pair of input/output sampling rates +*/ +SKP_int SKP_Silk_resampler_init( + SKP_Silk_resampler_state_struct *S, /* I/O: Resampler state */ + SKP_int32 Fs_Hz_in, /* I: Input sampling rate (Hz) */ + SKP_int32 Fs_Hz_out /* I: Output sampling rate (Hz) */ +); + + +/*! + * Clear the states of all resampling filters, without resetting sampling rate ratio + */ +SKP_int SKP_Silk_resampler_clear( + SKP_Silk_resampler_state_struct *S /* I/O: Resampler state */ +); + +/*! + * Resampler: convert from one sampling rate to another + */ +SKP_int SKP_Silk_resampler( + SKP_Silk_resampler_state_struct *S, /* I/O: Resampler state */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + SKP_int32 inLen /* I: Number of input samples */ +); + +/*! + Upsample 2x, low quality + */ +void SKP_Silk_resampler_up2( + SKP_int32 *S, /* I/O: State vector [ 2 ] */ + SKP_int16 *out, /* O: Output signal [ 2 * len ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 len /* I: Number of input samples */ +); + +/*! +* Downsample 2x, mediocre quality +*/ +void SKP_Silk_resampler_down2( + SKP_int32 *S, /* I/O: State vector [ 2 ] */ + SKP_int16 *out, /* O: Output signal [ len ] */ + const SKP_int16 *in, /* I: Input signal [ floor(len/2) ] */ + SKP_int32 inLen /* I: Number of input samples */ +); + + +/*! + * Downsample by a factor 2/3, low quality +*/ +void SKP_Silk_resampler_down2_3( + SKP_int32 *S, /* I/O: State vector [ 6 ] */ + SKP_int16 *out, /* O: Output signal [ floor(2*inLen/3) ] */ + const SKP_int16 *in, /* I: Input signal [ inLen ] */ + SKP_int32 inLen /* I: Number of input samples */ +); + +/*! + * Downsample by a factor 3, low quality +*/ +void SKP_Silk_resampler_down3( + SKP_int32 *S, /* I/O: State vector [ 8 ] */ + SKP_int16 *out, /* O: Output signal [ floor(inLen/3) ] */ + const SKP_int16 *in, /* I: Input signal [ inLen ] */ + SKP_int32 inLen /* I: Number of input samples */ +); + +/*! + * second order ARMA filter + * can handle (slowly) varying coefficients + */ +void SKP_Silk_biquad( + const SKP_int16 *in, /* I: input signal */ + const SKP_int16 *B, /* I: MA coefficients, Q13 [3] */ + const SKP_int16 *A, /* I: AR coefficients, Q13 [2] */ + SKP_int32 *S, /* I/O: state vector [2] */ + SKP_int16 *out, /* O: output signal */ + const SKP_int32 len /* I: signal length */ +); +/*! + * Second order ARMA filter; + * slower than biquad() but uses more precise coefficients + * can handle (slowly) varying coefficients + */ +void SKP_Silk_biquad_alt( + const SKP_int16 *in, /* I: Input signal */ + const SKP_int32 *B_Q28, /* I: MA coefficients [3] */ + const SKP_int32 *A_Q28, /* I: AR coefficients [2] */ + SKP_int32 *S, /* I/O: State vector [2] */ + SKP_int16 *out, /* O: Output signal */ + const SKP_int32 len /* I: Signal length (must be even) */ +); + +/*! + * variable order MA filter. Prediction error filter implementation. Coeficients negated and starting with coef to x[n - 1] + */ +void SKP_Silk_MA_Prediction( + const SKP_int16 *in, /* I: Input signal */ + const SKP_int16 *B, /* I: MA prediction coefficients, Q12 [order] */ + SKP_int32 *S, /* I/O: State vector [order] */ + SKP_int16 *out, /* O: Output signal */ + const SKP_int32 len, /* I: Signal length */ + const SKP_int32 order /* I: Filter order */ +); + +/*! + * 16th order AR filter for LPC synthesis, coefficients are in Q12 + */ +void SKP_Silk_LPC_synthesis_order16( + const SKP_int16 *in, /* I: excitation signal */ + const SKP_int16 *A_Q12, /* I: AR coefficients [16], between -8_Q0 and 8_Q0 */ + const SKP_int32 Gain_Q26, /* I: gain */ + SKP_int32 *S, /* I/O: state vector [16] */ + SKP_int16 *out, /* O: output signal */ + const SKP_int32 len /* I: signal length, must be multiple of 16 */ +); + +/* variable order MA prediction error filter. */ +/* Inverse filter of SKP_Silk_LPC_synthesis_filter */ +void SKP_Silk_LPC_analysis_filter( + const SKP_int16 *in, /* I: Input signal */ + const SKP_int16 *B, /* I: MA prediction coefficients, Q12 [order] */ + SKP_int16 *S, /* I/O: State vector [order] */ + SKP_int16 *out, /* O: Output signal */ + const SKP_int32 len, /* I: Signal length */ + const SKP_int32 Order /* I: Filter order */ +); + +/* even order AR filter */ +void SKP_Silk_LPC_synthesis_filter( + const SKP_int16 *in, /* I: excitation signal */ + const SKP_int16 *A_Q12, /* I: AR coefficients [Order], between -8_Q0 and 8_Q0 */ + const SKP_int32 Gain_Q26, /* I: gain */ + SKP_int32 *S, /* I/O: state vector [Order] */ + SKP_int16 *out, /* O: output signal */ + const SKP_int32 len, /* I: signal length */ + const SKP_int Order /* I: filter order, must be even */ +); + +/* Chirp (bandwidth expand) LP AR filter */ +void SKP_Silk_bwexpander( + SKP_int16 *ar, /* I/O AR filter to be expanded (without leading 1) */ + const SKP_int d, /* I Length of ar */ + SKP_int32 chirp_Q16 /* I Chirp factor (typically in the range 0 to 1) */ +); + +/* Chirp (bandwidth expand) LP AR filter */ +void SKP_Silk_bwexpander_32( + SKP_int32 *ar, /* I/O AR filter to be expanded (without leading 1) */ + const SKP_int d, /* I Length of ar */ + SKP_int32 chirp_Q16 /* I Chirp factor in Q16 */ +); + +/* Compute inverse of LPC prediction gain, and */ +/* test if LPC coefficients are stable (all poles within unit circle) */ +SKP_int SKP_Silk_LPC_inverse_pred_gain( /* O: Returns 1 if unstable, otherwise 0 */ + SKP_int32 *invGain_Q30, /* O: Inverse prediction gain, Q30 energy domain */ + const SKP_int16 *A_Q12, /* I: Prediction coefficients, Q12 [order] */ + const SKP_int order /* I: Prediction order */ +); + +SKP_int SKP_Silk_LPC_inverse_pred_gain_Q24( /* O: Returns 1 if unstable, otherwise 0 */ + SKP_int32 *invGain_Q30, /* O: Inverse prediction gain, Q30 energy domain */ + const SKP_int32 *A_Q24, /* I: Prediction coefficients, Q24 [order] */ + const SKP_int order /* I: Prediction order */ +); + +/* split signal in two decimated bands using first-order allpass filters */ +void SKP_Silk_ana_filt_bank_1( + const SKP_int16 *in, /* I: Input signal [N] */ + SKP_int32 *S, /* I/O: State vector [2] */ + SKP_int16 *outL, /* O: Low band [N/2] */ + SKP_int16 *outH, /* O: High band [N/2] */ + SKP_int32 *scratch, /* I: Scratch memory [3*N/2] */ + const SKP_int32 N /* I: Number of input samples */ +); + +/********************************************************************/ +/* SCALAR FUNCTIONS */ +/********************************************************************/ + +/* Approximation of 128 * log2() (very close inverse of approx 2^() below) */ +/* Convert input to a log scale */ +SKP_int32 SKP_Silk_lin2log(const SKP_int32 inLin); /* I: Input in linear scale */ + +/* Approximation of a sigmoid function */ +SKP_int SKP_Silk_sigm_Q15(SKP_int in_Q5); + +/* approximation of 2^() (exact inverse of approx log2() above) */ +/* convert input to a linear scale */ +SKP_int32 SKP_Silk_log2lin(const SKP_int32 inLog_Q7); /* I: input on log scale */ + +/* Function that returns the maximum absolut value of the input vector */ +SKP_int16 SKP_Silk_int16_array_maxabs( /* O Maximum absolute value, max: 2^15-1 */ + const SKP_int16 *vec, /* I Input vector [len] */ + const SKP_int32 len /* I Length of input vector */ +); + +/* Compute number of bits to right shift the sum of squares of a vector */ +/* of int16s to make it fit in an int32 */ +void SKP_Silk_sum_sqr_shift( + SKP_int32 *energy, /* O Energy of x, after shifting to the right */ + SKP_int *shift, /* O Number of bits right shift applied to energy */ + const SKP_int16 *x, /* I Input vector */ + SKP_int len /* I Length of input vector */ +); + +/* Calculates the reflection coefficients from the correlation sequence */ +/* Faster than schur64(), but much less accurate. */ +/* Uses SMLAWB(), requiring armv5E and higher. */ +SKP_int32 SKP_Silk_schur( /* O: Returns residual energy */ + SKP_int16 *rc_Q15, /* O: reflection coefficients [order] Q15 */ + const SKP_int32 *c, /* I: correlations [order+1] */ + const SKP_int32 order /* I: prediction order */ +); + +/* Calculates the reflection coefficients from the correlation sequence */ +/* Slower than schur(), but more accurate. */ +/* Uses SMULL(), available on armv4 */ +SKP_int32 SKP_Silk_schur64( /* O: returns residual energy */ + SKP_int32 rc_Q16[], /* O: Reflection coefficients [order] Q16 */ + const SKP_int32 c[], /* I: Correlations [order+1] */ + SKP_int32 order /* I: Prediction order */ +); + +/* Step up function, converts reflection coefficients to prediction coefficients */ +void SKP_Silk_k2a( + SKP_int32 *A_Q24, /* O: Prediction coefficients [order] Q24 */ + const SKP_int16 *rc_Q15, /* I: Reflection coefficients [order] Q15 */ + const SKP_int32 order /* I: Prediction order */ +); + +/* Step up function, converts reflection coefficients to prediction coefficients */ +void SKP_Silk_k2a_Q16( + SKP_int32 *A_Q24, /* O: Prediction coefficients [order] Q24 */ + const SKP_int32 *rc_Q16, /* I: Reflection coefficients [order] Q16 */ + const SKP_int32 order /* I: Prediction order */ +); + +/* Apply sine window to signal vector. */ +/* Window types: */ +/* 1 -> sine window from 0 to pi/2 */ +/* 2 -> sine window from pi/2 to pi */ +/* Every other sample is linearly interpolated, for speed. */ +void SKP_Silk_apply_sine_window( + SKP_int16 px_win[], /* O Pointer to windowed signal */ + const SKP_int16 px[], /* I Pointer to input signal */ + const SKP_int win_type, /* I Selects a window type */ + const SKP_int length /* I Window length, multiple of 4 */ +); + +/* Compute autocorrelation */ +void SKP_Silk_autocorr( + SKP_int32 *results, /* O Result (length correlationCount) */ + SKP_int *scale, /* O Scaling of the correlation vector */ + const SKP_int16 *inputData, /* I Input data to correlate */ + const SKP_int inputDataSize, /* I Length of input */ + const SKP_int correlationCount /* I Number of correlation taps to compute */ +); + +/* Pitch estimator */ +#define SKP_Silk_PITCH_EST_MIN_COMPLEX 0 +#define SKP_Silk_PITCH_EST_MID_COMPLEX 1 +#define SKP_Silk_PITCH_EST_MAX_COMPLEX 2 + +void SKP_Silk_decode_pitch( + SKP_int lagIndex, /* I */ + SKP_int contourIndex, /* O */ + SKP_int pitch_lags[], /* O 4 pitch values */ + SKP_int Fs_kHz /* I sampling frequency (kHz) */ +); + +SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unvoiced */ + const SKP_int16 *signal, /* I Signal of length PITCH_EST_FRAME_LENGTH_MS*Fs_kHz */ + SKP_int *pitch_out, /* O 4 pitch lag values */ + SKP_int *lagIndex, /* O Lag Index */ + SKP_int *contourIndex, /* O Pitch contour Index */ + SKP_int *LTPCorr_Q15, /* I/O Normalized correlation; input: value from previous frame */ + SKP_int prevLag, /* I Last lag of previous frame; set to zero is unvoiced */ + const SKP_int32 search_thres1_Q16, /* I First stage threshold for lag candidates 0 - 1 */ + const SKP_int search_thres2_Q15, /* I Final threshold for lag candidates 0 - 1 */ + const SKP_int Fs_kHz, /* I Sample frequency (kHz) */ + const SKP_int complexity, /* I Complexity setting, 0-2, where 2 is highest */ + const SKP_int forLJC /* I 1 if this function is called from LJC code, 0 otherwise. */ +); + +/* parameter defining the size and accuracy of the piecewise linear */ +/* cosine approximatin table. */ + +#define LSF_COS_TAB_SZ_FIX 128 +/* rom table with cosine values */ +extern const SKP_int SKP_Silk_LSFCosTab_FIX_Q12[ LSF_COS_TAB_SZ_FIX + 1 ]; + +/* Compute Normalized Line Spectral Frequencies (NLSFs) from whitening filter coefficients */ +/* If not all roots are found, the a_Q16 coefficients are bandwidth expanded until convergence. */ +void SKP_Silk_A2NLSF( + SKP_int *NLSF, /* O Normalized Line Spectral Frequencies, Q15 (0 - (2^15-1)), [d] */ + SKP_int32 *a_Q16, /* I/O Monic whitening filter coefficients in Q16 [d] */ + const SKP_int d /* I Filter order (must be even) */ +); + +/* compute whitening filter coefficients from normalized line spectral frequencies */ +void SKP_Silk_NLSF2A( + SKP_int16 *a, /* o monic whitening filter coefficients in Q12, [d] */ + const SKP_int *NLSF, /* i normalized line spectral frequencies in Q15, [d] */ + const SKP_int d /* i filter order (should be even) */ +); + +void SKP_Silk_insertion_sort_increasing( + SKP_int32 *a, /* I/O Unsorted / Sorted vector */ + SKP_int *index, /* O: Index vector for the sorted elements */ + const SKP_int L, /* I: Vector length */ + const SKP_int K /* I: Number of correctly sorted positions */ +); + +void SKP_Silk_insertion_sort_decreasing_int16( + SKP_int16 *a, /* I/O: Unsorted / Sorted vector */ + SKP_int *index, /* O: Index vector for the sorted elements */ + const SKP_int L, /* I: Vector length */ + const SKP_int K /* I: Number of correctly sorted positions */ +); + +void SKP_Silk_insertion_sort_increasing_all_values( + SKP_int *a, /* I/O: Unsorted / Sorted vector */ + const SKP_int L /* I: Vector length */ +); + +/* NLSF stabilizer, for a single input data vector */ +void SKP_Silk_NLSF_stabilize( + SKP_int *NLSF_Q15, /* I/O: Unstable/stabilized normalized LSF vector in Q15 [L] */ + const SKP_int *NDeltaMin_Q15, /* I: Normalized delta min vector in Q15, NDeltaMin_Q15[L] must be >= 1 [L+1] */ + const SKP_int L /* I: Number of NLSF parameters in the input vector */ +); + +/* Laroia low complexity NLSF weights */ +void SKP_Silk_NLSF_VQ_weights_laroia( + SKP_int *pNLSFW_Q6, /* O: Pointer to input vector weights [D x 1] */ + const SKP_int *pNLSF_Q15, /* I: Pointer to input vector [D x 1] */ + const SKP_int D /* I: Input vector dimension (even) */ +); + +/* Compute reflection coefficients from input signal */ +void SKP_Silk_burg_modified( + SKP_int32 *res_nrg, /* O residual energy */ + SKP_int *res_nrgQ, /* O residual energy Q value */ + SKP_int32 A_Q16[], /* O prediction coefficients (length order) */ + const SKP_int16 x[], /* I input signal, length: nb_subfr * ( D + subfr_length ) */ + const SKP_int subfr_length, /* I input signal subframe length (including D preceeding samples) */ + const SKP_int nb_subfr, /* I number of subframes stacked in x */ + const SKP_int32 WhiteNoiseFrac_Q32, /* I fraction added to zero-lag autocorrelation */ + const SKP_int D /* I order */ +); + +/* Copy and multiply a vector by a constant */ +void SKP_Silk_scale_copy_vector16( + SKP_int16 *data_out, + const SKP_int16 *data_in, + SKP_int32 gain_Q16, /* I: gain in Q16 */ + const SKP_int dataSize /* I: length */ +); + +/* Some for the LTP related function requires Q26 to work.*/ +void SKP_Silk_scale_vector32_Q26_lshift_18( + SKP_int32 *data1, /* I/O: Q0/Q18 */ + SKP_int32 gain_Q26, /* I: Q26 */ + SKP_int dataSize /* I: length */ +); + +/********************************************************************/ +/* INLINE ARM MATH */ +/********************************************************************/ + +/* return sum(inVec1[i]*inVec2[i]) */ +/* inVec1 and inVec2 should be increasing ordered, and starting address should be 4 byte aligned. (a factor of 4)*/ +SKP_int32 SKP_Silk_inner_prod_aligned( + const SKP_int16* const inVec1, /* I input vector 1 */ + const SKP_int16* const inVec2, /* I input vector 2 */ + const SKP_int len /* I vector lengths */ +); + +SKP_int64 SKP_Silk_inner_prod16_aligned_64( + const SKP_int16 *inVec1, /* I input vector 1 */ + const SKP_int16 *inVec2, /* I input vector 2 */ + const SKP_int len /* I vector lengths */ +); +/********************************************************************/ +/* MACROS */ +/********************************************************************/ + +/* Rotate a32 right by 'rot' bits. Negative rot values result in rotating + left. Output is 32bit int. + Note: contemporary compilers recognize the C expressions below and + compile them into 'ror' instructions if available. No need for inline ASM! */ +#if defined(EMBEDDED_MIPS) +/* For MIPS (and most likely for ARM! and >=i486) we don't have to handle + negative rot's as only 5 bits of rot are encoded into ROR instructions. */ +SKP_INLINE SKP_int32 SKP_ROR32(SKP_int32 a32, SKP_int rot) +{ + SKP_uint32 _x = (SKP_uint32) a32; + SKP_uint32 _r = (SKP_uint32) rot; + return (SKP_int32) ((_x << (32 - _r)) | (_x >> _r)); +} +#else +/* PPC must use this generic implementation. */ +SKP_INLINE SKP_int32 SKP_ROR32( SKP_int32 a32, SKP_int rot ) +{ + SKP_uint32 x = (SKP_uint32) a32; + SKP_uint32 r = (SKP_uint32) rot; + SKP_uint32 m = (SKP_uint32) -rot; + if(rot <= 0) + return (SKP_int32) ((x << m) | (x >> (32 - m))); + else + return (SKP_int32) ((x << (32 - r)) | (x >> r)); +} +#endif + +/* Allocate SKP_int16 alligned to 4-byte memory address */ +#if EMBEDDED_ARM +#if defined(_WIN32) && defined(_M_ARM) +#define SKP_DWORD_ALIGN __declspec(align(4)) +#else +#define SKP_DWORD_ALIGN __attribute__((aligned(4))) +#endif +#else +#define SKP_DWORD_ALIGN +#endif + +/* Useful Macros that can be adjusted to other platforms */ +#define SKP_memcpy(a, b, c) memcpy((a), (b), (c)) /* Dest, Src, ByteCount */ +#define SKP_memset(a, b, c) memset((a), (b), (c)) /* Dest, value, ByteCount */ +#define SKP_memmove(a, b, c) memmove((a), (b), (c)) /* Dest, Src, ByteCount */ +/* fixed point macros */ + +// (a32 * b32) output have to be 32bit int +#define SKP_MUL(a32, b32) ((a32) * (b32)) + +// (a32 * b32) output have to be 32bit uint +#define SKP_MUL_uint(a32, b32) SKP_MUL(a32, b32) + +// a32 + (b32 * c32) output have to be 32bit int +#define SKP_MLA(a32, b32, c32) SKP_ADD32((a32),((b32) * (c32))) + +/* ((a32 >> 16) * (b32 >> 16)) output have to be 32bit int */ +#define SKP_SMULTT(a32, b32) (((a32) >> 16) * ((b32) >> 16)) + +/* a32 + ((a32 >> 16) * (b32 >> 16)) output have to be 32bit int */ +#define SKP_SMLATT(a32, b32, c32) SKP_ADD32((a32),((b32) >> 16) * ((c32) >> 16)) + +#define SKP_SMLALBB(a64, b16, c16) SKP_ADD64((a64),(SKP_int64)((SKP_int32)(b16) * (SKP_int32)(c16))) + +// (a32 * b32) +#define SKP_SMULL(a32, b32) ((SKP_int64)(a32) * /*(SKP_int64)*/(b32)) + +/* Adds two signed 32-bit values in a way that can overflow, while not relying on undefined behaviour + (just standard two's complement implementation-specific behaviour) */ +#define SKP_ADD32_ovflw(a, b) ((SKP_int32)((SKP_uint32)(a) + (SKP_uint32)(b))) +/* Subtractss two signed 32-bit values in a way that can overflow, while not relying on undefined behaviour + (just standard two's complement implementation-specific behaviour) */ +#define SKP_SUB32_ovflw(a, b) ((SKP_int32)((SKP_uint32)(a) - (SKP_uint32)(b))) + +/* Multiply-accumulate macros that allow overflow in the addition (ie, no asserts in debug mode) */ +#define SKP_MLA_ovflw(a32, b32, c32) SKP_ADD32_ovflw((a32), (SKP_uint32)(b32) * (SKP_uint32)(c32)) +#ifndef SKP_SMLABB_ovflw + #define SKP_SMLABB_ovflw(a32, b32, c32) SKP_ADD32_ovflw((a32), SKP_SMULBB((b32),(c32))) +#endif +#define SKP_SMLATT_ovflw(a32, b32, c32) SKP_ADD32_ovflw((a32), SKP_SMULTT((b32),(c32))) +#define SKP_SMLAWB_ovflw(a32, b32, c32) SKP_ADD32_ovflw((a32), SKP_SMULWB((b32),(c32))) +#define SKP_SMLAWT_ovflw(a32, b32, c32) SKP_ADD32_ovflw((a32), SKP_SMULWT((b32),(c32))) +#define SKP_DIV32_16(a32, b16) ((SKP_int32)((a32) / (b16))) +#define SKP_DIV32(a32, b32) ((SKP_int32)((a32) / (b32))) + +#define SKP_ADD32(a, b) ((a) + (b)) +#define SKP_ADD64(a, b) ((a) + (b)) + +#define SKP_SUB32(a, b) ((a) - (b)) + +#define SKP_SAT16(a) ((a) > SKP_int16_MAX ? SKP_int16_MAX : \ + ((a) < SKP_int16_MIN ? SKP_int16_MIN : (a))) +#define SKP_SAT32(a) ((a) > SKP_int32_MAX ? SKP_int32_MAX : \ + ((a) < SKP_int32_MIN ? SKP_int32_MIN : (a))) + +#define SKP_CHECK_FIT16(a) (a) +#define SKP_CHECK_FIT32(a) (a) + +#define SKP_ADD_SAT16(a, b) (SKP_int16)SKP_SAT16( SKP_ADD32( (SKP_int32)(a), (b) ) ) + +/* Add with saturation for positive input values */ +#define SKP_ADD_POS_SAT32(a, b) ((((a)+(b)) & 0x80000000) ? SKP_int32_MAX : ((a)+(b))) + +#define SKP_LSHIFT32(a, shift) ((a)<<(shift)) // shift >= 0, shift < 32 +#define SKP_LSHIFT64(a, shift) ((a)<<(shift)) // shift >= 0, shift < 64 +#define SKP_LSHIFT(a, shift) SKP_LSHIFT32(a, shift) // shift >= 0, shift < 32 + +#define SKP_RSHIFT32(a, shift) ((a)>>(shift)) // shift >= 0, shift < 32 +#define SKP_RSHIFT64(a, shift) ((a)>>(shift)) // shift >= 0, shift < 64 +#define SKP_RSHIFT(a, shift) SKP_RSHIFT32(a, shift) // shift >= 0, shift < 32 + +/* saturates before shifting */ +#define SKP_LSHIFT_SAT32(a, shift) (SKP_LSHIFT32( SKP_LIMIT_32( (a), SKP_RSHIFT32( SKP_int32_MIN, (shift) ), \ + SKP_RSHIFT32( SKP_int32_MAX, (shift) ) ), (shift) )) + +#define SKP_LSHIFT_ovflw(a, shift) ((a)<<(shift)) // shift >= 0, allowed to overflow +#define SKP_LSHIFT_uint(a, shift) ((a)<<(shift)) // shift >= 0 +#define SKP_RSHIFT_uint(a, shift) ((a)>>(shift)) // shift >= 0 + +#define SKP_ADD_LSHIFT(a, b, shift) ((a) + SKP_LSHIFT((b), (shift))) // shift >= 0 +#define SKP_ADD_LSHIFT32(a, b, shift) SKP_ADD32((a), SKP_LSHIFT32((b), (shift))) // shift >= 0 +#define SKP_ADD_RSHIFT(a, b, shift) ((a) + SKP_RSHIFT((b), (shift))) // shift >= 0 +#define SKP_ADD_RSHIFT32(a, b, shift) SKP_ADD32((a), SKP_RSHIFT32((b), (shift))) // shift >= 0 +#define SKP_ADD_RSHIFT_uint(a, b, shift) ((a) + SKP_RSHIFT_uint((b), (shift))) // shift >= 0 +#define SKP_SUB_LSHIFT32(a, b, shift) SKP_SUB32((a), SKP_LSHIFT32((b), (shift))) // shift >= 0 +#define SKP_SUB_RSHIFT32(a, b, shift) SKP_SUB32((a), SKP_RSHIFT32((b), (shift))) // shift >= 0 + +/* Requires that shift > 0 */ +#define SKP_RSHIFT_ROUND(a, shift) ((shift) == 1 ? ((a) >> 1) + ((a) & 1) : (((a) >> ((shift) - 1)) + 1) >> 1) +#define SKP_RSHIFT_ROUND64(a, shift) ((shift) == 1 ? ((a) >> 1) + ((a) & 1) : (((a) >> ((shift) - 1)) + 1) >> 1) + +/* Number of rightshift required to fit the multiplication */ +#define SKP_NSHIFT_MUL_32_32(a, b) ( -(31- (32-SKP_Silk_CLZ32(SKP_abs(a)) + (32-SKP_Silk_CLZ32(SKP_abs(b))))) ) + +#define SKP_min(a, b) (((a) < (b)) ? (a) : (b)) +#define SKP_max(a, b) (((a) > (b)) ? (a) : (b)) + +/* Macro to convert floating-point constants to fixed-point */ +#define SKP_FIX_CONST( C, Q ) ((SKP_int32)((C) * ((SKP_int64)1 << (Q)) + 0.5)) + +/* SKP_min() versions with typecast in the function call */ +SKP_INLINE SKP_int SKP_min_int(SKP_int a, SKP_int b) +{ + return (((a) < (b)) ? (a) : (b)); +} + +SKP_INLINE SKP_int32 SKP_min_32(SKP_int32 a, SKP_int32 b) +{ + return (((a) < (b)) ? (a) : (b)); +} + +/* SKP_min() versions with typecast in the function call */ +SKP_INLINE SKP_int SKP_max_int(SKP_int a, SKP_int b) +{ + return (((a) > (b)) ? (a) : (b)); +} +SKP_INLINE SKP_int16 SKP_max_16(SKP_int16 a, SKP_int16 b) +{ + return (((a) > (b)) ? (a) : (b)); +} +SKP_INLINE SKP_int32 SKP_max_32(SKP_int32 a, SKP_int32 b) +{ + return (((a) > (b)) ? (a) : (b)); +} + +#define SKP_LIMIT( a, limit1, limit2) ((limit1) > (limit2) ? ((a) > (limit1) ? (limit1) : ((a) < (limit2) ? (limit2) : (a))) \ + : ((a) > (limit2) ? (limit2) : ((a) < (limit1) ? (limit1) : (a)))) + +#define SKP_LIMIT_int SKP_LIMIT +#define SKP_LIMIT_32 SKP_LIMIT + +//#define SKP_non_neg(a) ((a) & ((-(a)) >> (8 * sizeof(a) - 1))) /* doesn't seem faster than SKP_max(0, a); + +#define SKP_abs(a) (((a) > 0) ? (a) : -(a)) // Be careful, SKP_abs returns wrong when input equals to SKP_intXX_MIN +#define SKP_abs_int32(a) (((a) ^ ((a) >> 31)) - ((a) >> 31)) + +/* PSEUDO-RANDOM GENERATOR */ +/* Make sure to store the result as the seed for the next call (also in between */ +/* frames), otherwise result won't be random at all. When only using some of the */ +/* bits, take the most significant bits by right-shifting. Do not just mask off */ +/* the lowest bits. */ +#define SKP_RAND(seed) (SKP_MLA_ovflw(907633515, (seed), 196314165)) + +// Add some multiplication functions that can be easily mapped to ARM. + +// SKP_SMMUL: Signed top word multiply. +// ARMv6 2 instruction cycles. +// ARMv3M+ 3 instruction cycles. use SMULL and ignore LSB registers.(except xM) +//#define SKP_SMMUL(a32, b32) (SKP_int32)SKP_RSHIFT(SKP_SMLAL(SKP_SMULWB((a32), (b32)), (a32), SKP_RSHIFT_ROUND((b32), 16)), 16) +// the following seems faster on x86 +//#define SKP_SMMUL(a32, b32) (SKP_int32)SKP_RSHIFT64(SKP_SMULL((a32), (b32)), 32) + +#include "SKP_Silk_Inlines.h" + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_SigProc_FLP.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_SigProc_FLP.h new file mode 100755 index 0000000..b972e5b --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_SigProc_FLP.h @@ -0,0 +1,254 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + + +#ifndef _SKP_SILK_SIGPROC_FLP_H_ +#define _SKP_SILK_SIGPROC_FLP_H_ + +#include "SKP_Silk_SigProc_FIX.h" +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/********************************************************************/ +/* SIGNAL PROCESSING FUNCTIONS */ +/********************************************************************/ + +/* first-order allpass filter */ +void SKP_Silk_allpass_int_FLP( + const SKP_float *in, /* I: input signal [len] */ + SKP_float *S, /* I/O: state [1] */ + SKP_float A, /* I: coefficient (0 <= A < 1) */ + SKP_float *out, /* O: output signal [len] */ + const SKP_int32 len /* I: number of samples */ +); + +/* downsample by a factor 2, coarser */ +void SKP_Silk_decimate2_coarse_FLP( + const SKP_float *in, /* I: signal [2*len] */ + SKP_float *S, /* I/O: state vector [2] */ + SKP_float *out, /* O: decimated signal [len] */ + SKP_float *scratch, /* I: scratch memory [3*len] */ + const SKP_int32 len /* I: number of OUTPUT samples */ +); + +/* downsample by a factor 2, coarsest */ +void SKP_Silk_decimate2_coarsest_FLP( + const SKP_float *in, /* I: signal [2*len] */ + SKP_float *S, /* I/O: state vector [2] */ + SKP_float *out, /* O: decimated signal [len] */ + SKP_float *scratch, /* I: scratch memory [3*len] */ + const SKP_int32 len /* I: number of OUTPUT samples */ +); + +/* Chirp (bw expand) LP AR filter */ +void SKP_Silk_bwexpander_FLP( + SKP_float *ar, /* io AR filter to be expanded (without leading 1) */ + const SKP_int d, /* i length of ar */ + const SKP_float chirp /* i chirp factor (typically in range (0..1) ) */ +); + +/* compute inverse of LPC prediction gain, and */ +/* test if LPC coefficients are stable (all poles within unit circle) */ +/* this code is based on SKP_Silk_FLP_a2k() */ +SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherwise 0 */ + SKP_float *invGain, /* O: inverse prediction gain, energy domain */ + const SKP_float *A, /* I: prediction coefficients [order] */ + SKP_int32 order /* I: prediction order */ +); + +SKP_float SKP_Silk_schur_FLP( /* O returns residual energy */ + SKP_float refl_coef[], /* O reflection coefficients (length order) */ + const SKP_float auto_corr[], /* I autotcorrelation sequence (length order+1) */ + SKP_int order /* I order */ +); + +void SKP_Silk_k2a_FLP( + SKP_float *A, /* O: prediction coefficients [order] */ + const SKP_float *rc, /* I: reflection coefficients [order] */ + SKP_int32 order /* I: prediction order */ +); + +/* Solve the normal equations using the Levinson-Durbin recursion */ +SKP_float SKP_Silk_levinsondurbin_FLP( /* O prediction error energy */ + SKP_float A[], /* O prediction coefficients [order] */ + const SKP_float corr[], /* I input auto-correlations [order + 1] */ + const SKP_int order /* I prediction order */ +); + +/* compute autocorrelation */ +void SKP_Silk_autocorrelation_FLP( + SKP_float *results, /* o result (length correlationCount) */ + const SKP_float *inputData, /* i input data to correlate */ + SKP_int inputDataSize, /* i length of input */ + SKP_int correlationCount /* i number of correlation taps to compute */ +); + +/* Pitch estimator */ +#define SigProc_PITCH_EST_MIN_COMPLEX 0 +#define SigProc_PITCH_EST_MID_COMPLEX 1 +#define SigProc_PITCH_EST_MAX_COMPLEX 2 + +SKP_int SKP_Silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced */ + const SKP_float *signal, /* I signal of length PITCH_EST_FRAME_LENGTH_MS*Fs_kHz */ + SKP_int *pitch_out, /* O 4 pitch lag values */ + SKP_int *lagIndex, /* O lag Index */ + SKP_int *contourIndex, /* O pitch contour Index */ + SKP_float *LTPCorr, /* I/O normalized correlation; input: value from previous frame */ + SKP_int prevLag, /* I last lag of previous frame; set to zero is unvoiced */ + const SKP_float search_thres1, /* I first stage threshold for lag candidates 0 - 1 */ + const SKP_float search_thres2, /* I final threshold for lag candidates 0 - 1 */ + const SKP_int Fs_kHz, /* I sample frequency (kHz) */ + const SKP_int complexity /* I Complexity setting, 0-2, where 2 is highest */ +); + +#define PI (3.1415926536f) + +void SKP_Silk_insertion_sort_decreasing_FLP( + SKP_float *a, /* I/O: Unsorted / Sorted vector */ + SKP_int *index, /* O: Index vector for the sorted elements */ + const SKP_int L, /* I: Vector length */ + const SKP_int K /* I: Number of correctly sorted positions */ +); + +void SKP_Silk_insertion_sort_increasing_FLP( + SKP_float *a, /* I/O: Unsorted / Sorted vector */ + SKP_int *index, /* O: Index vector for the sorted elements */ + const SKP_int L, /* I: Vector length */ + const SKP_int K /* I: Number of correctly sorted positions */ +); + +/* Laroia low complexity NLSF weights */ +void SKP_Silk_NLSF_VQ_weights_laroia_FLP( + SKP_float *pXW, /* 0: Pointer to input vector weights [D x 1] */ + const SKP_float *pX, /* I: Pointer to input vector [D x 1] */ + const SKP_int D /* I: Input vector dimension */ +); + +/* Compute reflection coefficients from input signal */ +SKP_float SKP_Silk_burg_modified_FLP( /* O returns residual energy */ + SKP_float A[], /* O prediction coefficients (length order) */ + const SKP_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */ + const SKP_int subfr_length, /* I input signal subframe length (including D preceeding samples) */ + const SKP_int nb_subfr, /* I number of subframes stacked in x */ + const SKP_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */ + const SKP_int D /* I order */ +); + +/* multiply a vector by a constant */ +void SKP_Silk_scale_vector_FLP( + SKP_float *data1, + SKP_float gain, + SKP_int dataSize +); + +/* copy and multiply a vector by a constant */ +void SKP_Silk_scale_copy_vector_FLP( + SKP_float *data_out, + const SKP_float *data_in, + SKP_float gain, + SKP_int dataSize +); + +/* inner product of two SKP_float arrays, with result as double */ +double SKP_Silk_inner_product_FLP( + const SKP_float *data1, + const SKP_float *data2, + SKP_int dataSize +); + +/* sum of squares of a SKP_float array, with result as double */ +double SKP_Silk_energy_FLP( + const SKP_float *data, + SKP_int dataSize +); + +/********************************************************************/ +/* MACROS */ +/********************************************************************/ + +#define SKP_min_float(a, b) (((a) < (b)) ? (a) : (b)) +#define SKP_max_float(a, b) (((a) > (b)) ? (a) : (b)) +#define SKP_abs_float(a) ((SKP_float)fabs(a)) + +#define SKP_LIMIT_float( a, limit1, limit2) ((limit1) > (limit2) ? ((a) > (limit1) ? (limit1) : ((a) < (limit2) ? (limit2) : (a))) \ + : ((a) > (limit2) ? (limit2) : ((a) < (limit1) ? (limit1) : (a)))) + +/* sigmoid function */ +SKP_INLINE SKP_float SKP_sigmoid(SKP_float x) +{ + return (SKP_float)(1.0 / (1.0 + exp(-x))); +} + +/* floating-point to integer conversion (rounding) */ +SKP_INLINE void SKP_float2short_array( + SKP_int16 *out, + const SKP_float *in, + SKP_int32 length +) +{ + SKP_int32 k; + for (k = length-1; k >= 0; k--) { +#if defined( _WIN32 ) && !defined( _WIN64 ) + double t = in[k] + 6755399441055744.0; + out[k] = (SKP_int16)SKP_SAT16(*(( SKP_int32 * )( &t ))); +#else + double x = in[k]; + out[k] = (SKP_int16)SKP_SAT16( ( x > 0 ) ? x + 0.5 : x - 0.5 ); +#endif + } +} + +/* floating-point to integer conversion (rounding) */ +SKP_INLINE SKP_int32 SKP_float2int(double x) +{ + return (SKP_int32)( ( x > 0 ) ? x + 0.5 : x - 0.5 ); +} + +/* integer to floating-point conversion */ +SKP_INLINE void SKP_short2float_array( + SKP_float *out, + const SKP_int16 *in, + SKP_int32 length +) +{ + SKP_int32 k; + for (k = length-1; k >= 0; k--) { + out[k] = (SKP_float)in[k]; + } +} + +#define SKP_round(x) (SKP_float)((x)>=0 ? (SKP_int64)((x)+0.5) : (SKP_int64)((x)-0.5)) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_VAD.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_VAD.c new file mode 100755 index 0000000..d4ecebb --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_VAD.c @@ -0,0 +1,320 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* + * File Name: SKP_Silk_VAD.c + * Description: Silk VAD. + */ + +#include +#include "SKP_Silk_main.h" + +/**********************************/ +/* Initialization of the Silk VAD */ +/**********************************/ +SKP_int SKP_Silk_VAD_Init( /* O Return value, 0 if success */ + SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ +) +{ + SKP_int b, ret = 0; + + /* reset state memory */ + SKP_memset( psSilk_VAD, 0, sizeof( SKP_Silk_VAD_state ) ); + + /* init noise levels */ + /* Initialize array with approx pink noise levels (psd proportional to inverse of frequency) */ + for( b = 0; b < VAD_N_BANDS; b++ ) { + psSilk_VAD->NoiseLevelBias[ b ] = SKP_max_32( SKP_DIV32_16( VAD_NOISE_LEVELS_BIAS, b + 1 ), 1 ); + } + + /* Initialize state */ + for( b = 0; b < VAD_N_BANDS; b++ ) { + psSilk_VAD->NL[ b ] = SKP_MUL( 100, psSilk_VAD->NoiseLevelBias[ b ] ); + psSilk_VAD->inv_NL[ b ] = SKP_DIV32( SKP_int32_MAX, psSilk_VAD->NL[ b ] ); + } + psSilk_VAD->counter = 15; + + /* init smoothed energy-to-noise ratio*/ + for( b = 0; b < VAD_N_BANDS; b++ ) { + psSilk_VAD->NrgRatioSmth_Q8[ b ] = 100 * 256; /* 100 * 256 --> 20 dB SNR */ + } + + return( ret ); +} + +/* Weighting factors for tilt measure */ +const static SKP_int32 tiltWeights[ VAD_N_BANDS ] = { 30000, 6000, -12000, -12000 }; + +/***************************************/ +/* Get the speech activity level in Q8 */ +/***************************************/ +SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Return value, 0 if success */ + SKP_Silk_VAD_state *psSilk_VAD, /* I/O Silk VAD state */ + SKP_int *pSA_Q8, /* O Speech activity level in Q8 */ + SKP_int *pSNR_dB_Q7, /* O SNR for current frame in Q7 */ + SKP_int pQuality_Q15[ VAD_N_BANDS ], /* O Smoothed SNR for each band */ + SKP_int *pTilt_Q15, /* O current frame's frequency tilt */ + const SKP_int16 pIn[], /* I PCM input [framelength] */ + const SKP_int framelength /* I Input frame length */ +) +{ + SKP_int SA_Q15, input_tilt; + SKP_int32 scratch[ 3 * MAX_FRAME_LENGTH / 2 ]; + SKP_int decimated_framelength, dec_subframe_length, dec_subframe_offset, SNR_Q7, i, b, s; + SKP_int32 sumSquared, smooth_coef_Q16; + SKP_int16 HPstateTmp; + + SKP_int16 X[ VAD_N_BANDS ][ MAX_FRAME_LENGTH / 2 ]; + SKP_int32 Xnrg[ VAD_N_BANDS ]; + SKP_int32 NrgToNoiseRatio_Q8[ VAD_N_BANDS ]; + SKP_int32 speech_nrg, x_tmp; + SKP_int ret = 0; + + /* Safety checks */ + SKP_assert( VAD_N_BANDS == 4 ); + SKP_assert( MAX_FRAME_LENGTH >= framelength ); + SKP_assert( framelength <= 512 ); + + /***********************/ + /* Filter and Decimate */ + /***********************/ + /* 0-8 kHz to 0-4 kHz and 4-8 kHz */ + SKP_Silk_ana_filt_bank_1( pIn, &psSilk_VAD->AnaState[ 0 ], &X[ 0 ][ 0 ], &X[ 3 ][ 0 ], &scratch[ 0 ], framelength ); + + /* 0-4 kHz to 0-2 kHz and 2-4 kHz */ + SKP_Silk_ana_filt_bank_1( &X[ 0 ][ 0 ], &psSilk_VAD->AnaState1[ 0 ], &X[ 0 ][ 0 ], &X[ 2 ][ 0 ], &scratch[ 0 ], SKP_RSHIFT( framelength, 1 ) ); + + /* 0-2 kHz to 0-1 kHz and 1-2 kHz */ + SKP_Silk_ana_filt_bank_1( &X[ 0 ][ 0 ], &psSilk_VAD->AnaState2[ 0 ], &X[ 0 ][ 0 ], &X[ 1 ][ 0 ], &scratch[ 0 ], SKP_RSHIFT( framelength, 2 ) ); + + /*********************************************/ + /* HP filter on lowest band (differentiator) */ + /*********************************************/ + decimated_framelength = SKP_RSHIFT( framelength, 3 ); + X[ 0 ][ decimated_framelength - 1 ] = SKP_RSHIFT( X[ 0 ][ decimated_framelength - 1 ], 1 ); + HPstateTmp = X[ 0 ][ decimated_framelength - 1 ]; + for( i = decimated_framelength - 1; i > 0; i-- ) { + X[ 0 ][ i - 1 ] = SKP_RSHIFT( X[ 0 ][ i - 1 ], 1 ); + X[ 0 ][ i ] -= X[ 0 ][ i - 1 ]; + } + X[ 0 ][ 0 ] -= psSilk_VAD->HPstate; + psSilk_VAD->HPstate = HPstateTmp; + + /*************************************/ + /* Calculate the energy in each band */ + /*************************************/ + for( b = 0; b < VAD_N_BANDS; b++ ) { + /* Find the decimated framelength in the non-uniformly divided bands */ + decimated_framelength = SKP_RSHIFT( framelength, SKP_min_int( VAD_N_BANDS - b, VAD_N_BANDS - 1 ) ); + + /* Split length into subframe lengths */ + dec_subframe_length = SKP_RSHIFT( decimated_framelength, VAD_INTERNAL_SUBFRAMES_LOG2 ); + dec_subframe_offset = 0; + + /* Compute energy per sub-frame */ + /* initialize with summed energy of last subframe */ + Xnrg[ b ] = psSilk_VAD->XnrgSubfr[ b ]; + for( s = 0; s < VAD_INTERNAL_SUBFRAMES; s++ ) { + sumSquared = 0; + for( i = 0; i < dec_subframe_length; i++ ) { + /* The energy will be less than dec_subframe_length * ( SKP_int16_MIN / 8 ) ^ 2. */ + /* Therefore we can accumulate with no risk of overflow (unless dec_subframe_length > 128) */ + x_tmp = SKP_RSHIFT( X[ b ][ i + dec_subframe_offset ], 3 ); + sumSquared = SKP_SMLABB( sumSquared, x_tmp, x_tmp ); + + /* Safety check */ + SKP_assert( sumSquared >= 0 ); + } + + /* Add/saturate summed energy of current subframe */ + if( s < VAD_INTERNAL_SUBFRAMES - 1 ) { + Xnrg[ b ] = SKP_ADD_POS_SAT32( Xnrg[ b ], sumSquared ); + } else { + /* Look-ahead subframe */ + Xnrg[ b ] = SKP_ADD_POS_SAT32( Xnrg[ b ], SKP_RSHIFT( sumSquared, 1 ) ); + } + + dec_subframe_offset += dec_subframe_length; + } + psSilk_VAD->XnrgSubfr[ b ] = sumSquared; + } + + /********************/ + /* Noise estimation */ + /********************/ + SKP_Silk_VAD_GetNoiseLevels( &Xnrg[ 0 ], psSilk_VAD ); + + /***********************************************/ + /* Signal-plus-noise to noise ratio estimation */ + /***********************************************/ + sumSquared = 0; + input_tilt = 0; + for( b = 0; b < VAD_N_BANDS; b++ ) { + speech_nrg = Xnrg[ b ] - psSilk_VAD->NL[ b ]; + if( speech_nrg > 0 ) { + /* Divide, with sufficient resolution */ + if( ( Xnrg[ b ] & 0xFF800000 ) == 0 ) { + NrgToNoiseRatio_Q8[ b ] = SKP_DIV32( SKP_LSHIFT( Xnrg[ b ], 8 ), psSilk_VAD->NL[ b ] + 1 ); + } else { + NrgToNoiseRatio_Q8[ b ] = SKP_DIV32( Xnrg[ b ], SKP_RSHIFT( psSilk_VAD->NL[ b ], 8 ) + 1 ); + } + + /* Convert to log domain */ + SNR_Q7 = SKP_Silk_lin2log( NrgToNoiseRatio_Q8[ b ] ) - 8 * 128; + + /* Sum-of-squares */ + sumSquared = SKP_SMLABB( sumSquared, SNR_Q7, SNR_Q7 ); /* Q14 */ + + /* Tilt measure */ + if( speech_nrg < ( 1 << 20 ) ) { + /* Scale down SNR value for small subband speech energies */ + SNR_Q7 = SKP_SMULWB( SKP_LSHIFT( SKP_Silk_SQRT_APPROX( speech_nrg ), 6 ), SNR_Q7 ); + } + input_tilt = SKP_SMLAWB( input_tilt, tiltWeights[ b ], SNR_Q7 ); + } else { + NrgToNoiseRatio_Q8[ b ] = 256; + } + } + + /* Mean-of-squares */ + sumSquared = SKP_DIV32_16( sumSquared, VAD_N_BANDS ); /* Q14 */ + + /* Root-mean-square approximation, scale to dBs, and write to output pointer */ + *pSNR_dB_Q7 = ( SKP_int16 )( 3 * SKP_Silk_SQRT_APPROX( sumSquared ) ); /* Q7 */ + + /*********************************/ + /* Speech Probability Estimation */ + /*********************************/ + SA_Q15 = SKP_Silk_sigm_Q15( SKP_SMULWB( VAD_SNR_FACTOR_Q16, *pSNR_dB_Q7 ) - VAD_NEGATIVE_OFFSET_Q5 ); + + /**************************/ + /* Frequency Tilt Measure */ + /**************************/ + *pTilt_Q15 = SKP_LSHIFT( SKP_Silk_sigm_Q15( input_tilt ) - 16384, 1 ); + + /**************************************************/ + /* Scale the sigmoid output based on power levels */ + /**************************************************/ + speech_nrg = 0; + for( b = 0; b < VAD_N_BANDS; b++ ) { + /* Accumulate signal-without-noise energies, higher frequency bands have more weight */ + speech_nrg += ( b + 1 ) * SKP_RSHIFT( Xnrg[ b ] - psSilk_VAD->NL[ b ], 4 ); + } + + /* Power scaling */ + if( speech_nrg <= 0 ) { + SA_Q15 = SKP_RSHIFT( SA_Q15, 1 ); + } else if( speech_nrg < 32768 ) { + /* square-root */ + speech_nrg = SKP_Silk_SQRT_APPROX( SKP_LSHIFT( speech_nrg, 15 ) ); + SA_Q15 = SKP_SMULWB( 32768 + speech_nrg, SA_Q15 ); + } + + /* Copy the resulting speech activity in Q8 to *pSA_Q8 */ + *pSA_Q8 = SKP_min_int( SKP_RSHIFT( SA_Q15, 7 ), SKP_uint8_MAX ); + + /***********************************/ + /* Energy Level and SNR estimation */ + /***********************************/ + /* Smoothing coefficient */ + smooth_coef_Q16 = SKP_SMULWB( VAD_SNR_SMOOTH_COEF_Q18, SKP_SMULWB( SA_Q15, SA_Q15 ) ); + for( b = 0; b < VAD_N_BANDS; b++ ) { + /* compute smoothed energy-to-noise ratio per band */ + psSilk_VAD->NrgRatioSmth_Q8[ b ] = SKP_SMLAWB( psSilk_VAD->NrgRatioSmth_Q8[ b ], + NrgToNoiseRatio_Q8[ b ] - psSilk_VAD->NrgRatioSmth_Q8[ b ], smooth_coef_Q16 ); + + /* signal to noise ratio in dB per band */ + SNR_Q7 = 3 * ( SKP_Silk_lin2log( psSilk_VAD->NrgRatioSmth_Q8[b] ) - 8 * 128 ); + /* quality = sigmoid( 0.25 * ( SNR_dB - 16 ) ); */ + pQuality_Q15[ b ] = SKP_Silk_sigm_Q15( SKP_RSHIFT( SNR_Q7 - 16 * 128, 4 ) ); + } + + return( ret ); +} + +/**************************/ +/* Noise level estimation */ +/**************************/ +void SKP_Silk_VAD_GetNoiseLevels( + const SKP_int32 pX[ VAD_N_BANDS ], /* I subband energies */ + SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ +) +{ + SKP_int k; + SKP_int32 nl, nrg, inv_nrg; + SKP_int coef, min_coef; + + /* Initially faster smoothing */ + if( psSilk_VAD->counter < 1000 ) { /* 1000 = 20 sec */ + min_coef = SKP_DIV32_16( SKP_int16_MAX, SKP_RSHIFT( psSilk_VAD->counter, 4 ) + 1 ); + } else { + min_coef = 0; + } + + for( k = 0; k < VAD_N_BANDS; k++ ) { + /* Get old noise level estimate for current band */ + nl = psSilk_VAD->NL[ k ]; + SKP_assert( nl >= 0 ); + + /* Add bias */ + nrg = SKP_ADD_POS_SAT32( pX[ k ], psSilk_VAD->NoiseLevelBias[ k ] ); + SKP_assert( nrg > 0 ); + + /* Invert energies */ + inv_nrg = SKP_DIV32( SKP_int32_MAX, nrg ); + SKP_assert( inv_nrg >= 0 ); + + /* Less update when subband energy is high */ + if( nrg > SKP_LSHIFT( nl, 3 ) ) { + coef = VAD_NOISE_LEVEL_SMOOTH_COEF_Q16 >> 3; + } else if( nrg < nl ) { + coef = VAD_NOISE_LEVEL_SMOOTH_COEF_Q16; + } else { + coef = SKP_SMULWB( SKP_SMULWW( inv_nrg, nl ), VAD_NOISE_LEVEL_SMOOTH_COEF_Q16 << 1 ); + } + + /* Initially faster smoothing */ + coef = SKP_max_int( coef, min_coef ); + + /* Smooth inverse energies */ + psSilk_VAD->inv_NL[ k ] = SKP_SMLAWB( psSilk_VAD->inv_NL[ k ], inv_nrg - psSilk_VAD->inv_NL[ k ], coef ); + SKP_assert( psSilk_VAD->inv_NL[ k ] >= 0 ); + + /* Compute noise level by inverting again */ + nl = SKP_DIV32( SKP_int32_MAX, psSilk_VAD->inv_NL[ k ] ); + SKP_assert( nl >= 0 ); + + /* Limit noise levels (guarantee 7 bits of head room) */ + nl = SKP_min( nl, 0x00FFFFFF ); + + /* Store as part of state */ + psSilk_VAD->NL[ k ] = nl; + } + + /* Increment frame counter */ + psSilk_VAD->counter++; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_VQ_nearest_neighbor_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_VQ_nearest_neighbor_FLP.c new file mode 100755 index 0000000..0eee6d9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_VQ_nearest_neighbor_FLP.c @@ -0,0 +1,102 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +#define Q14_CONVERSION_FAC 6.1035e-005f // 1 / 2^14 + +/* entropy constrained MATRIX-weighted VQ, for a single input data vector */ +void SKP_Silk_VQ_WMat_EC_FLP( + SKP_int *ind, /* O Index of best codebook vector */ + SKP_float *rate_dist, /* O Best weighted quant. error + mu * rate */ + const SKP_float *in, /* I Input vector to be quantized */ + const SKP_float *W, /* I Weighting matrix */ + const SKP_int16 *cb, /* I Codebook */ + const SKP_int16 *cl_Q6, /* I Code length for each codebook vector */ + const SKP_float mu, /* I Tradeoff between WSSE and rate */ + const SKP_int L /* I Number of vectors in codebook */ +) +{ + SKP_int k; + SKP_float sum1; + SKP_float diff[ 5 ]; + const SKP_int16 *cb_row; + + /* Loop over codebook */ + *rate_dist = SKP_float_MAX; + *ind = 0; + cb_row = cb; + for( k = 0; k < L; k++ ) { + /* Calc difference between in vector and cbk vector */ + diff[ 0 ] = in[ 0 ] - ( SKP_float )cb_row[ 0 ] * Q14_CONVERSION_FAC; + diff[ 1 ] = in[ 1 ] - ( SKP_float )cb_row[ 1 ] * Q14_CONVERSION_FAC; + diff[ 2 ] = in[ 2 ] - ( SKP_float )cb_row[ 2 ] * Q14_CONVERSION_FAC; + diff[ 3 ] = in[ 3 ] - ( SKP_float )cb_row[ 3 ] * Q14_CONVERSION_FAC; + diff[ 4 ] = in[ 4 ] - ( SKP_float )cb_row[ 4 ] * Q14_CONVERSION_FAC; + + /* Weighted rate */ + sum1 = mu * cl_Q6[ k ] / 64.0f; + + /* Add weighted quantization error, assuming W is symmetric */ + /* first row of W */ + sum1 += diff[ 0 ] * ( W[ 0 ] * diff[ 0 ] + + 2.0f * ( W[ 1 ] * diff[ 1 ] + + W[ 2 ] * diff[ 2 ] + + W[ 3 ] * diff[ 3 ] + + W[ 4 ] * diff[ 4 ] ) ); + + /* second row of W */ + sum1 += diff[ 1 ] * ( W[ 6 ] * diff[ 1 ] + + 2.0f * ( W[ 7 ] * diff[ 2 ] + + W[ 8 ] * diff[ 3 ] + + W[ 9 ] * diff[ 4 ] ) ); + + /* third row of W */ + sum1 += diff[ 2 ] * ( W[ 12 ] * diff[ 2 ] + + 2.0f * ( W[ 13 ] * diff[ 3 ] + + W[ 14 ] * diff[ 4 ] ) ); + + /* fourth row of W */ + sum1 += diff[ 3 ] * ( W[ 18 ] * diff[ 3 ] + + 2.0f * ( W[ 19 ] * diff[ 4 ] ) ); + + /* last row of W */ + sum1 += diff[ 4 ] * ( W[ 24 ] * diff[ 4 ] ); + + /* find best */ + if( sum1 < *rate_dist ) { + *rate_dist = sum1; + *ind = k; + } + + /* Go to next cbk vector */ + cb_row += LTP_ORDER; + } + + /* If this breaks, we had a floating point wrap-around or similar */ + SKP_assert( ( *rate_dist ) < SKP_float_MAX ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_allpass_int.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_allpass_int.c new file mode 100755 index 0000000..f707635 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_allpass_int.c @@ -0,0 +1,69 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_allpass_int.c * + * * + * First-order allpass filter with * + * transfer function: * + * * + * A + Z^(-1) * + * H(z) = ------------ * + * 1 + A*Z^(-1) * + * * + * Implemented using minimum multiplier filter design. * + * * + * Reference: http://www.univ.trieste.it/~ramponi/teaching/ * + * DSP/materiale/Ch6(2).pdf * + * * + * Copyright 2007 (c), Skype Limited * + * Date: 070525 * + * */ +#include "SKP_Silk_SigProc_FIX.h" + + +/* First-order allpass filter */ +void SKP_Silk_allpass_int( + const SKP_int32 *in, /* I: Q25 input signal [len] */ + SKP_int32 *S, /* I/O: Q25 state [1] */ + SKP_int A, /* I: Q15 coefficient (0 <= A < 32768) */ + SKP_int32 *out, /* O: Q25 output signal [len] */ + const SKP_int32 len /* I: Number of samples */ +) +{ + SKP_int32 Y2, X2, S0; + SKP_int k; + + S0 = S[ 0 ]; + for( k = len - 1; k >= 0; k-- ) { + Y2 = *in - S0; + X2 = ( Y2 >> 15 ) * A + ( ( ( Y2 & 0x00007FFF ) * A ) >> 15 ); + ( *out++ ) = S0 + X2; + S0 = ( *in++ ) + X2; + } + S[ 0 ] = S0; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_allpass_int_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_allpass_int_FLP.c new file mode 100755 index 0000000..aa031d9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_allpass_int_FLP.c @@ -0,0 +1,68 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_allpass_int.c * + * * + * First-order allpass filter with * * + * transfer function: * + * * + * A + Z^(-1) * + * H(z) = ------------ * + * 1 + A*Z^(-1) * + * * + * Implemented using minimum multiplier filter design. * + * * + * Reference: http://www.univ.trieste.it/~ramponi/teaching/ * + * DSP/materiale/Ch6(2).pdf * + * * + * Copyright 2007 (c), Skype Limited * + * Date: 070525 * + * */ +#include "SKP_Silk_SigProc_FLP.h" + +/* first-order allpass filter */ +void SKP_Silk_allpass_int_FLP( + const SKP_float *in, /* I: input signal [len] */ + SKP_float *S, /* I/O: state [1] */ + SKP_float A, /* I: coefficient (0 <= A < 1) */ + SKP_float *out, /* O: output signal [len] */ + const SKP_int32 len /* I: number of samples */ +) +{ + SKP_float Y2, X2, S0; + SKP_int32 k; + + S0 = S[ 0 ]; + for ( k = len-1; k >= 0; k-- ) { + Y2 = *in - S0; + X2 = Y2 * A; + (*out++) = S0 + X2; + S0 = (*in++) + X2; + } + S[ 0 ] = S0; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_ana_filt_bank_1.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_ana_filt_bank_1.c new file mode 100755 index 0000000..bc35a65 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_ana_filt_bank_1.c @@ -0,0 +1,80 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_ana_filt_bank_1.c * + * * + * Split signal into two decimated bands using first-order allpass filters * + * * + * Copyright 2006 (c), Skype Limited * + * Date: 060221 * + * */ +#include "SKP_Silk_SigProc_FIX.h" + +/* Coefficients for 2-band filter bank based on first-order allpass filters */ +// old +static SKP_int16 A_fb1_20[ 1 ] = { 5394 << 1 }; +static SKP_int16 A_fb1_21[ 1 ] = { 20623 << 1 }; /* wrap-around to negative number is intentional */ + +/* Split signal into two decimated bands using first-order allpass filters */ +void SKP_Silk_ana_filt_bank_1( + const SKP_int16 *in, /* I: Input signal [N] */ + SKP_int32 *S, /* I/O: State vector [2] */ + SKP_int16 *outL, /* O: Low band [N/2] */ + SKP_int16 *outH, /* O: High band [N/2] */ + SKP_int32 *scratch, /* I: Scratch memory [3*N/2] */ // todo: remove - no longer used + const SKP_int32 N /* I: Number of input samples */ +) +{ + SKP_int k, N2 = SKP_RSHIFT( N, 1 ); + SKP_int32 in32, X, Y, out_1, out_2; + + /* Internal variables and state are in Q10 format */ + for( k = 0; k < N2; k++ ) { + /* Convert to Q10 */ + in32 = SKP_LSHIFT( (SKP_int32)in[ 2 * k ], 10 ); + + /* All-pass section for even input sample */ + Y = SKP_SUB32( in32, S[ 0 ] ); + X = SKP_SMLAWB( Y, Y, A_fb1_21[ 0 ] ); + out_1 = SKP_ADD32( S[ 0 ], X ); + S[ 0 ] = SKP_ADD32( in32, X ); + + /* Convert to Q10 */ + in32 = SKP_LSHIFT( (SKP_int32)in[ 2 * k + 1 ], 10 ); + + /* All-pass section for odd input sample */ + Y = SKP_SUB32( in32, S[ 1 ] ); + X = SKP_SMULWB( Y, A_fb1_20[ 0 ] ); + out_2 = SKP_ADD32( S[ 1 ], X ); + S[ 1 ] = SKP_ADD32( in32, X ); + + /* Add/subtract, convert back to int16 and store to output */ + outL[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( SKP_ADD32( out_2, out_1 ), 11 ) ); + outH[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( SKP_SUB32( out_2, out_1 ), 11 ) ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_apply_sine_window_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_apply_sine_window_FLP.c new file mode 100755 index 0000000..0d41b76 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_apply_sine_window_FLP.c @@ -0,0 +1,77 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +/* Apply sine window to signal vector. */ +/* Window types: */ +/* 1 -> sine window from 0 to pi/2 */ +/* 2 -> sine window from pi/2 to pi */ +void SKP_Silk_apply_sine_window_FLP( + SKP_float px_win[], /* O Pointer to windowed signal */ + const SKP_float px[], /* I Pointer to input signal */ + const SKP_int win_type, /* I Selects a window type */ + const SKP_int length /* I Window length, multiple of 4 */ +) +{ + SKP_int k; + SKP_float freq, c, S0, S1; + + SKP_assert( win_type == 1 || win_type == 2 ); + + /* Length must be multiple of 4 */ + SKP_assert( ( length & 3 ) == 0 ); + + freq = PI / ( length + 1 ); + + /* Approximation of 2 * cos(f) */ + c = 2.0f - freq * freq; + + /* Initialize state */ + if( win_type < 2 ) { + /* Start from 0 */ + S0 = 0.0f; + /* Approximation of sin(f) */ + S1 = freq; + } else { + /* Start from 1 */ + S0 = 1.0f; + /* Approximation of cos(f) */ + S1 = 0.5f * c; + } + + /* Uses the recursive equation: sin(n*f) = 2 * cos(f) * sin((n-1)*f) - sin((n-2)*f) */ + /* 4 samples at a time */ + for( k = 0; k < length; k += 4 ) { + px_win[ k + 0 ] = px[ k + 0 ] * 0.5f * ( S0 + S1 ); + px_win[ k + 1 ] = px[ k + 1 ] * S1; + S0 = c * S1 - S0; + px_win[ k + 2 ] = px[ k + 2 ] * 0.5f * ( S1 + S0 ); + px_win[ k + 3 ] = px[ k + 3 ] * S0; + S1 = c * S0 - S1; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_autocorrelation_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_autocorrelation_FLP.c new file mode 100755 index 0000000..9e0029e --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_autocorrelation_FLP.c @@ -0,0 +1,48 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_typedef.h" +#include "SKP_Silk_SigProc_FLP.h" + +/* compute autocorrelation */ +void SKP_Silk_autocorrelation_FLP( + SKP_float *results, /* O result (length correlationCount) */ + const SKP_float *inputData, /* I input data to correlate */ + SKP_int inputDataSize, /* I length of input */ + SKP_int correlationCount /* I number of correlation taps to compute */ +) +{ + SKP_int i; + + if ( correlationCount > inputDataSize ) { + correlationCount = inputDataSize; + } + + for( i = 0; i < correlationCount; i++ ) { + results[ i ] = (SKP_float)SKP_Silk_inner_product_FLP( inputData, inputData + i, inputDataSize - i ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_biquad.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_biquad.c new file mode 100755 index 0000000..9485292 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_biquad.c @@ -0,0 +1,72 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_biquad.c * + * * + * Second order ARMA filter * + * Can handle slowly varying filter coefficients * + * * + * Copyright 2006 (c), Skype Limited * + * Date: 060221 * + * */ +#include "SKP_Silk_SigProc_FIX.h" + +/* Second order ARMA filter */ +/* Can handle slowly varying filter coefficients */ +void SKP_Silk_biquad( + const SKP_int16 *in, /* I: input signal */ + const SKP_int16 *B, /* I: MA coefficients, Q13 [3] */ + const SKP_int16 *A, /* I: AR coefficients, Q13 [2] */ + SKP_int32 *S, /* I/O: state vector [2] */ + SKP_int16 *out, /* O: output signal */ + const SKP_int32 len /* I: signal length */ +) +{ + SKP_int k, in16; + SKP_int32 A0_neg, A1_neg, S0, S1, out32, tmp32; + + S0 = S[ 0 ]; + S1 = S[ 1 ]; + A0_neg = -A[ 0 ]; + A1_neg = -A[ 1 ]; + for( k = 0; k < len; k++ ) { + /* S[ 0 ], S[ 1 ]: Q13 */ + in16 = in[ k ]; + out32 = SKP_SMLABB( S0, in16, B[ 0 ] ); + + S0 = SKP_SMLABB( S1, in16, B[ 1 ] ); + S0 += SKP_LSHIFT( SKP_SMULWB( out32, A0_neg ), 3 ); + + S1 = SKP_LSHIFT( SKP_SMULWB( out32, A1_neg ), 3 ); + S1 = SKP_SMLABB( S1, in16, B[ 2 ] ); + tmp32 = SKP_RSHIFT_ROUND( out32, 13 ) + 1; + out[ k ] = (SKP_int16)SKP_SAT16( tmp32 ); + } + S[ 0 ] = S0; + S[ 1 ] = S1; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_biquad_alt.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_biquad_alt.c new file mode 100755 index 0000000..1810046 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_biquad_alt.c @@ -0,0 +1,73 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_biquad_alt.c * + * * + * Second order ARMA filter * + * Can handle slowly varying filter coefficients * + * */ +#include "SKP_Silk_SigProc_FIX.h" + + +/* Second order ARMA filter, alternative implementation */ +void SKP_Silk_biquad_alt( + const SKP_int16 *in, /* I: Input signal */ + const SKP_int32 *B_Q28, /* I: MA coefficients [3] */ + const SKP_int32 *A_Q28, /* I: AR coefficients [2] */ + SKP_int32 *S, /* I/O: State vector [2] */ + SKP_int16 *out, /* O: Output signal */ + const SKP_int32 len /* I: Signal length (must be even) */ +) +{ + /* DIRECT FORM II TRANSPOSED (uses 2 element state vector) */ + SKP_int k; + SKP_int32 inval, A0_U_Q28, A0_L_Q28, A1_U_Q28, A1_L_Q28, out32_Q14; + + /* Negate A_Q28 values and split in two parts */ + A0_L_Q28 = ( -A_Q28[ 0 ] ) & 0x00003FFF; /* lower part */ + A0_U_Q28 = SKP_RSHIFT( -A_Q28[ 0 ], 14 ); /* upper part */ + A1_L_Q28 = ( -A_Q28[ 1 ] ) & 0x00003FFF; /* lower part */ + A1_U_Q28 = SKP_RSHIFT( -A_Q28[ 1 ], 14 ); /* upper part */ + + for( k = 0; k < len; k++ ) { + /* S[ 0 ], S[ 1 ]: Q12 */ + inval = in[ k ]; + out32_Q14 = SKP_LSHIFT( SKP_SMLAWB( S[ 0 ], B_Q28[ 0 ], inval ), 2 ); + + S[ 0 ] = S[1] + SKP_RSHIFT_ROUND( SKP_SMULWB( out32_Q14, A0_L_Q28 ), 14 ); + S[ 0 ] = SKP_SMLAWB( S[ 0 ], out32_Q14, A0_U_Q28 ); + S[ 0 ] = SKP_SMLAWB( S[ 0 ], B_Q28[ 1 ], inval); + + S[ 1 ] = SKP_RSHIFT_ROUND( SKP_SMULWB( out32_Q14, A1_L_Q28 ), 14 ); + S[ 1 ] = SKP_SMLAWB( S[ 1 ], out32_Q14, A1_U_Q28 ); + S[ 1 ] = SKP_SMLAWB( S[ 1 ], B_Q28[ 2 ], inval ); + + /* Scale back to Q0 and saturate */ + out[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT( out32_Q14 + (1<<14) - 1, 14 ) ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_burg_modified_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_burg_modified_FLP.c new file mode 100755 index 0000000..e91364f --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_burg_modified_FLP.c @@ -0,0 +1,156 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_burg_modified.c * + * * + * Calculates the reflection coefficients from the input vector * + * Input vector contains nb_subfr sub vectors of length L_sub + D * + * * + * Copyright 2009 (c), Skype Limited * + * Date: 091130 * + */ + +#include "SKP_Silk_SigProc_FLP.h" + +#define MAX_FRAME_SIZE 544 // subfr_length * nb_subfr = ( 0.005 * 24000 + 16 ) * 4 = 544 +#define MAX_NB_SUBFR 4 + +/* Compute reflection coefficients from input signal */ +SKP_float SKP_Silk_burg_modified_FLP( /* O returns residual energy */ + SKP_float A[], /* O prediction coefficients (length order) */ + const SKP_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */ + const SKP_int subfr_length, /* I input signal subframe length (including D preceeding samples) */ + const SKP_int nb_subfr, /* I number of subframes stacked in x */ + const SKP_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */ + const SKP_int D /* I order */ +) +{ + SKP_int k, n, s; + double C0, num, nrg_f, nrg_b, rc, Atmp, tmp1, tmp2; + const SKP_float *x_ptr; + double C_first_row[ SKP_Silk_MAX_ORDER_LPC ], C_last_row[ SKP_Silk_MAX_ORDER_LPC ]; + double CAf[ SKP_Silk_MAX_ORDER_LPC + 1 ], CAb[ SKP_Silk_MAX_ORDER_LPC + 1 ]; + double Af[ SKP_Silk_MAX_ORDER_LPC ]; + + SKP_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); + SKP_assert( nb_subfr <= MAX_NB_SUBFR ); + + /* Compute autocorrelations, added over subframes */ + C0 = SKP_Silk_energy_FLP( x, nb_subfr * subfr_length ); + SKP_memset( C_first_row, 0, SKP_Silk_MAX_ORDER_LPC * sizeof( double ) ); + for( s = 0; s < nb_subfr; s++ ) { + x_ptr = x + s * subfr_length; + for( n = 1; n < D + 1; n++ ) { + C_first_row[ n - 1 ] += SKP_Silk_inner_product_FLP( x_ptr, x_ptr + n, subfr_length - n ); + } + } + SKP_memcpy( C_last_row, C_first_row, SKP_Silk_MAX_ORDER_LPC * sizeof( double ) ); + + /* Initialize */ + CAb[ 0 ] = CAf[ 0 ] = C0 + WhiteNoiseFrac * C0 + 1e-9f; + + for( n = 0; n < D; n++ ) { + /* Update first row of correlation matrix (without first element) */ + /* Update last row of correlation matrix (without last element, stored in reversed order) */ + /* Update C * Af */ + /* Update C * flipud(Af) (stored in reversed order) */ + for( s = 0; s < nb_subfr; s++ ) { + x_ptr = x + s * subfr_length; + tmp1 = x_ptr[ n ]; + tmp2 = x_ptr[ subfr_length - n - 1 ]; + for( k = 0; k < n; k++ ) { + C_first_row[ k ] -= x_ptr[ n ] * x_ptr[ n - k - 1 ]; + C_last_row[ k ] -= x_ptr[ subfr_length - n - 1 ] * x_ptr[ subfr_length - n + k ]; + Atmp = Af[ k ]; + SKP_assert( subfr_length - n + k + s * subfr_length >= 0 ); + SKP_assert( subfr_length - n + k + s * subfr_length < nb_subfr * subfr_length ); + tmp1 += x_ptr[ n - k - 1 ] * Atmp; + tmp2 += x_ptr[ subfr_length - n + k ] * Atmp; + } + for( k = 0; k <= n; k++ ) { + CAf[ k ] -= tmp1 * x_ptr[ n - k ]; + CAb[ k ] -= tmp2 * x_ptr[ subfr_length - n + k - 1 ]; + } + } + tmp1 = C_first_row[ n ]; + tmp2 = C_last_row[ n ]; + for( k = 0; k < n; k++ ) { + Atmp = Af[ k ]; + tmp1 += C_last_row[ n - k - 1 ] * Atmp; + tmp2 += C_first_row[ n - k - 1 ] * Atmp; + } + CAf[ n + 1 ] = tmp1; + CAb[ n + 1 ] = tmp2; + + /* Calculate nominator and denominator for the next order reflection (parcor) coefficient */ + num = CAb[ n + 1 ]; + nrg_b = CAb[ 0 ]; + nrg_f = CAf[ 0 ]; + for( k = 0; k < n; k++ ) { + Atmp = Af[ k ]; + num += CAb[ n - k ] * Atmp; + nrg_b += CAb[ k + 1 ] * Atmp; + nrg_f += CAf[ k + 1 ] * Atmp; + } + SKP_assert( nrg_f > 0.0 ); + SKP_assert( nrg_b > 0.0 ); + + /* Calculate the next order reflection (parcor) coefficient */ + rc = -2.0 * num / ( nrg_f + nrg_b ); + SKP_assert( rc > -1.0 && rc < 1.0 ); + + /* Update the AR coefficients */ + for( k = 0; k < (n + 1) >> 1; k++ ) { + tmp1 = Af[ k ]; + tmp2 = Af[ n - k - 1 ]; + Af[ k ] = tmp1 + rc * tmp2; + Af[ n - k - 1 ] = tmp2 + rc * tmp1; + } + Af[ n ] = rc; + + /* Update C * Af and C * Ab */ + for( k = 0; k <= n + 1; k++ ) { + tmp1 = CAf[ k ]; + CAf[ k ] += rc * CAb[ n - k + 1 ]; + CAb[ n - k + 1 ] += rc * tmp1; + } + } + + /* Return residual energy */ + nrg_f = CAf[ 0 ]; + tmp1 = 1.0; + for( k = 0; k < D; k++ ) { + Atmp = Af[ k ]; + nrg_f += CAf[ k + 1 ] * Atmp; + tmp1 += Atmp * Atmp; + A[ k ] = (SKP_float)(-Atmp); + } + nrg_f -= WhiteNoiseFrac * C0 * tmp1; + + return (SKP_float)nrg_f; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander.c new file mode 100755 index 0000000..530f271 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander.c @@ -0,0 +1,49 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FIX.h" + +/* Chirp (bandwidth expand) LP AR filter */ +void SKP_Silk_bwexpander( + SKP_int16 *ar, /* I/O AR filter to be expanded (without leading 1) */ + const SKP_int d, /* I Length of ar */ + SKP_int32 chirp_Q16 /* I Chirp factor (typically in the range 0 to 1) */ +) +{ + SKP_int i; + SKP_int32 chirp_minus_one_Q16; + + chirp_minus_one_Q16 = chirp_Q16 - 65536; + + /* NB: Dont use SKP_SMULWB, instead of SKP_RSHIFT_ROUND( SKP_MUL() , 16 ), below. */ + /* Bias in SKP_SMULWB can lead to unstable filters */ + for( i = 0; i < d - 1; i++ ) { + ar[ i ] = (SKP_int16)SKP_RSHIFT_ROUND( SKP_MUL( chirp_Q16, ar[ i ] ), 16 ); + chirp_Q16 += SKP_RSHIFT_ROUND( SKP_MUL( chirp_Q16, chirp_minus_one_Q16 ), 16 ); + } + ar[ d - 1 ] = (SKP_int16)SKP_RSHIFT_ROUND( SKP_MUL( chirp_Q16, ar[ d - 1 ] ), 16 ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander_32.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander_32.c new file mode 100755 index 0000000..8c669bb --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander_32.c @@ -0,0 +1,46 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FIX.h" + +/* Chirp (bandwidth expand) LP AR filter */ +void SKP_Silk_bwexpander_32( + SKP_int32 *ar, /* I/O AR filter to be expanded (without leading 1) */ + const SKP_int d, /* I Length of ar */ + SKP_int32 chirp_Q16 /* I Chirp factor in Q16 */ +) +{ + SKP_int i; + SKP_int32 tmp_chirp_Q16; + + tmp_chirp_Q16 = chirp_Q16; + for( i = 0; i < d - 1; i++ ) { + ar[ i ] = SKP_SMULWW( ar[ i ], tmp_chirp_Q16 ); + tmp_chirp_Q16 = SKP_SMULWW( chirp_Q16, tmp_chirp_Q16 ); + } + ar[ d - 1 ] = SKP_SMULWW( ar[ d - 1 ], tmp_chirp_Q16 ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander_FLP.c new file mode 100755 index 0000000..06d38e1 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_bwexpander_FLP.c @@ -0,0 +1,47 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + + +#include "SKP_Silk_SigProc_FLP.h" + + +/* Chirp (bw expand) LP AR filter */ +void SKP_Silk_bwexpander_FLP( + SKP_float *ar, /* I/O AR filter to be expanded (without leading 1) */ + const SKP_int d, /* I length of ar */ + const SKP_float chirp /* I chirp factor (typically in range (0..1) ) */ +) +{ + SKP_int i; + SKP_float cfac = chirp; + + for( i = 0; i < d - 1; i++ ) { + ar[ i ] *= cfac; + cfac *= chirp; + } + ar[ d - 1 ] *= cfac; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_code_signs.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_code_signs.c new file mode 100755 index 0000000..bb037db --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_code_signs.c @@ -0,0 +1,91 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +//#define SKP_enc_map(a) ((a) > 0 ? 1 : 0) +//#define SKP_dec_map(a) ((a) > 0 ? 1 : -1) +/* shifting avoids if-statement */ +#define SKP_enc_map(a) ( SKP_RSHIFT( (a), 15 ) + 1 ) +#define SKP_dec_map(a) ( SKP_LSHIFT( (a), 1 ) - 1 ) + +/* Encodes signs of excitation */ +void SKP_Silk_encode_signs( + SKP_Silk_range_coder_state *sRC, /* I/O Range coder state */ + const SKP_int8 q[], /* I Pulse signal */ + const SKP_int length, /* I Length of input */ + const SKP_int sigtype, /* I Signal type */ + const SKP_int QuantOffsetType, /* I Quantization offset type */ + const SKP_int RateLevelIndex /* I Rate level index */ +) +{ + SKP_int i; + SKP_int inData; + SKP_uint16 cdf[ 3 ]; + + i = SKP_SMULBB( N_RATE_LEVELS - 1, SKP_LSHIFT( sigtype, 1 ) + QuantOffsetType ) + RateLevelIndex; + cdf[ 0 ] = 0; + cdf[ 1 ] = SKP_Silk_sign_CDF[ i ]; + cdf[ 2 ] = 65535; + + for( i = 0; i < length; i++ ) { + if( q[ i ] != 0 ) { + inData = SKP_enc_map( q[ i ] ); /* - = 0, + = 1 */ + SKP_Silk_range_encoder( sRC, inData, cdf ); + } + } +} + +/* Decodes signs of excitation */ +void SKP_Silk_decode_signs( + SKP_Silk_range_coder_state *sRC, /* I/O Range coder state */ + SKP_int q[], /* I/O pulse signal */ + const SKP_int length, /* I length of output */ + const SKP_int sigtype, /* I Signal type */ + const SKP_int QuantOffsetType, /* I Quantization offset type */ + const SKP_int RateLevelIndex /* I Rate Level Index */ +) +{ + SKP_int i; + SKP_int data; + SKP_uint16 cdf[ 3 ]; + + i = SKP_SMULBB( N_RATE_LEVELS - 1, SKP_LSHIFT( sigtype, 1 ) + QuantOffsetType ) + RateLevelIndex; + cdf[ 0 ] = 0; + cdf[ 1 ] = SKP_Silk_sign_CDF[ i ]; + cdf[ 2 ] = 65535; + + for( i = 0; i < length; i++ ) { + if( q[ i ] > 0 ) { + SKP_Silk_range_decoder( &data, sRC, cdf, 1 ); + /* attach sign */ + /* implementation with shift, subtraction, multiplication */ + q[ i ] *= SKP_dec_map( data ); + } + } +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_common_pitch_est_defines.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_common_pitch_est_defines.h new file mode 100755 index 0000000..cc8c20e --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_common_pitch_est_defines.h @@ -0,0 +1,76 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SIGPROC_COMMON_PITCH_EST_DEFINES_H +#define SIGPROC_COMMON_PITCH_EST_DEFINES_H + +#include "SKP_Silk_SigProc_FIX.h" + +/************************************************************/ +/* Definitions For Fix pitch estimator */ +/************************************************************/ + +#define PITCH_EST_MAX_FS_KHZ 24 /* Maximum sampling frequency used */ + +#define PITCH_EST_FRAME_LENGTH_MS 40 /* 40 ms */ + +#define PITCH_EST_MAX_FRAME_LENGTH (PITCH_EST_FRAME_LENGTH_MS * PITCH_EST_MAX_FS_KHZ) +#define PITCH_EST_MAX_FRAME_LENGTH_ST_1 (PITCH_EST_MAX_FRAME_LENGTH >> 2) +#define PITCH_EST_MAX_FRAME_LENGTH_ST_2 (PITCH_EST_MAX_FRAME_LENGTH >> 1) +#define PITCH_EST_MAX_SF_FRAME_LENGTH (PITCH_EST_SUB_FRAME * PITCH_EST_MAX_FS_KHZ) + +#define PITCH_EST_MAX_LAG_MS 18 /* 18 ms -> 56 Hz */ +#define PITCH_EST_MIN_LAG_MS 2 /* 2 ms -> 500 Hz */ +#define PITCH_EST_MAX_LAG (PITCH_EST_MAX_LAG_MS * PITCH_EST_MAX_FS_KHZ) +#define PITCH_EST_MIN_LAG (PITCH_EST_MIN_LAG_MS * PITCH_EST_MAX_FS_KHZ) + +#define PITCH_EST_NB_SUBFR 4 + +#define PITCH_EST_D_SRCH_LENGTH 24 + +#define PITCH_EST_MAX_DECIMATE_STATE_LENGTH 7 + +#define PITCH_EST_NB_STAGE3_LAGS 5 + +#define PITCH_EST_NB_CBKS_STAGE2 3 +#define PITCH_EST_NB_CBKS_STAGE2_EXT 11 + +#define PITCH_EST_CB_mn2 1 +#define PITCH_EST_CB_mx2 2 + +#define PITCH_EST_NB_CBKS_STAGE3_MAX 34 +#define PITCH_EST_NB_CBKS_STAGE3_MID 24 +#define PITCH_EST_NB_CBKS_STAGE3_MIN 16 + +extern const SKP_int16 SKP_Silk_CB_lags_stage2[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE2_EXT]; +extern const SKP_int16 SKP_Silk_CB_lags_stage3[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE3_MAX]; +extern const SKP_int16 SKP_Silk_Lag_range_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ] [ PITCH_EST_NB_SUBFR ][ 2 ]; +extern const SKP_int16 SKP_Silk_cbk_sizes_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ]; +extern const SKP_int16 SKP_Silk_cbk_offsets_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ]; + +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_control_audio_bandwidth.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_control_audio_bandwidth.c new file mode 100755 index 0000000..c57baa6 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_control_audio_bandwidth.c @@ -0,0 +1,137 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* Control internal sampling rate */ +SKP_int SKP_Silk_control_audio_bandwidth( + SKP_Silk_encoder_state *psEncC, /* I/O Pointer to Silk encoder state */ + const SKP_int32 TargetRate_bps /* I Target max bitrate (bps) */ +) +{ + SKP_int fs_kHz; + + fs_kHz = psEncC->fs_kHz; + if( fs_kHz == 0 ) { + /* Encoder has just been initialized */ + if( TargetRate_bps >= SWB2WB_BITRATE_BPS ) { + fs_kHz = 24; + } else if( TargetRate_bps >= WB2MB_BITRATE_BPS ) { + fs_kHz = 16; + } else if( TargetRate_bps >= MB2NB_BITRATE_BPS ) { + fs_kHz = 12; + } else { + fs_kHz = 8; + } + /* Make sure internal rate is not higher than external rate or maximum allowed, or lower than minimum allowed */ + fs_kHz = SKP_min( fs_kHz, SKP_DIV32_16( psEncC->API_fs_Hz, 1000 ) ); + fs_kHz = SKP_min( fs_kHz, psEncC->maxInternal_fs_kHz ); + } else if( SKP_SMULBB( fs_kHz, 1000 ) > psEncC->API_fs_Hz || fs_kHz > psEncC->maxInternal_fs_kHz ) { + /* Make sure internal rate is not higher than external rate or maximum allowed */ + fs_kHz = SKP_DIV32_16( psEncC->API_fs_Hz, 1000 ); + fs_kHz = SKP_min( fs_kHz, psEncC->maxInternal_fs_kHz ); + } else { + /* State machine for the internal sampling rate switching */ + if( psEncC->API_fs_Hz > 8000 ) { + /* Accumulate the difference between the target rate and limit for switching down */ + psEncC->bitrateDiff += SKP_MUL( psEncC->PacketSize_ms, TargetRate_bps - psEncC->bitrate_threshold_down ); + psEncC->bitrateDiff = SKP_min( psEncC->bitrateDiff, 0 ); + + if( psEncC->vadFlag == NO_VOICE_ACTIVITY ) { /* Low speech activity */ + /* Check if we should switch down */ +#if SWITCH_TRANSITION_FILTERING + if( ( psEncC->sLP.transition_frame_no == 0 ) && /* Transition phase not active */ + ( psEncC->bitrateDiff <= -ACCUM_BITS_DIFF_THRESHOLD || /* Bitrate threshold is met */ + ( psEncC->sSWBdetect.WB_detected * psEncC->fs_kHz == 24 ) ) ) { /* Forced down-switching due to WB input */ + psEncC->sLP.transition_frame_no = 1; /* Begin transition phase */ + psEncC->sLP.mode = 0; /* Switch down */ + } else if( + ( psEncC->sLP.transition_frame_no >= TRANSITION_FRAMES_DOWN ) && /* Transition phase complete */ + ( psEncC->sLP.mode == 0 ) ) { /* Ready to switch down */ + psEncC->sLP.transition_frame_no = 0; /* Ready for new transition phase */ +#else + if( psEncC->bitrateDiff <= -ACCUM_BITS_DIFF_THRESHOLD ) { /* Bitrate threshold is met */ +#endif + psEncC->bitrateDiff = 0; + + /* Switch to a lower sample frequency */ + if( psEncC->fs_kHz == 24 ) { + fs_kHz = 16; + } else if( psEncC->fs_kHz == 16 ) { + fs_kHz = 12; + } else { + SKP_assert( psEncC->fs_kHz == 12 ); + fs_kHz = 8; + } + } + + /* Check if we should switch up */ + if( ( ( psEncC->fs_kHz * 1000 < psEncC->API_fs_Hz ) && + ( TargetRate_bps >= psEncC->bitrate_threshold_up ) && + ( psEncC->sSWBdetect.WB_detected * psEncC->fs_kHz < 16 ) ) && + ( ( ( psEncC->fs_kHz == 16 ) && ( psEncC->maxInternal_fs_kHz >= 24 ) ) || + ( ( psEncC->fs_kHz == 12 ) && ( psEncC->maxInternal_fs_kHz >= 16 ) ) || + ( ( psEncC->fs_kHz == 8 ) && ( psEncC->maxInternal_fs_kHz >= 12 ) ) ) +#if SWITCH_TRANSITION_FILTERING + && ( psEncC->sLP.transition_frame_no == 0 ) ) { /* No transition phase running, ready to switch */ + psEncC->sLP.mode = 1; /* Switch up */ +#else + ) { +#endif + psEncC->bitrateDiff = 0; + + /* Switch to a higher sample frequency */ + if( psEncC->fs_kHz == 8 ) { + fs_kHz = 12; + } else if( psEncC->fs_kHz == 12 ) { + fs_kHz = 16; + } else { + SKP_assert( psEncC->fs_kHz == 16 ); + fs_kHz = 24; + } + } + } + } + +#if SWITCH_TRANSITION_FILTERING + /* After switching up, stop transition filter during speech inactivity */ + if( ( psEncC->sLP.mode == 1 ) && + ( psEncC->sLP.transition_frame_no >= TRANSITION_FRAMES_UP ) && + ( psEncC->vadFlag == NO_VOICE_ACTIVITY ) ) { + + psEncC->sLP.transition_frame_no = 0; + + /* Reset transition filter state */ + SKP_memset( psEncC->sLP.In_LP_State, 0, 2 * sizeof( SKP_int32 ) ); + } +#endif + } + + + + return fs_kHz; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_control_codec_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_control_codec_FLP.c new file mode 100755 index 0000000..2eda36c --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_control_codec_FLP.c @@ -0,0 +1,411 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_setup_complexity.h" + +SKP_INLINE SKP_int SKP_Silk_setup_resamplers( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + SKP_int fs_kHz /* I Internal sampling rate (kHz) */ +); + +SKP_INLINE SKP_int SKP_Silk_setup_packetsize( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + SKP_int PacketSize_ms /* I Packet length (ms) */ +); + +SKP_INLINE SKP_int SKP_Silk_setup_fs( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + SKP_int fs_kHz /* I Internal sampling rate (kHz) */ +); + +SKP_INLINE SKP_int SKP_Silk_setup_rate( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + SKP_int32 TargetRate_bps /* I Target max bitrate */ +); + +SKP_INLINE SKP_int SKP_Silk_setup_LBRR( + SKP_Silk_encoder_state_FLP *psEnc /* I/O Pointer to Silk encoder state FLP */ +); + +/* Control encoder */ +SKP_int SKP_Silk_control_encoder_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + const SKP_int PacketSize_ms, /* I Packet length (ms) */ + const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */ + const SKP_int PacketLoss_perc, /* I Packet loss rate (in percent) */ + const SKP_int DTX_enabled, /* I Enable / disable DTX */ + const SKP_int Complexity /* I Complexity (0->low; 1->medium; 2->high) */ +) +{ + SKP_int fs_kHz, ret = 0; + + if( psEnc->sCmn.controlled_since_last_payload != 0 ) { + if( psEnc->sCmn.API_fs_Hz != psEnc->sCmn.prev_API_fs_Hz && psEnc->sCmn.fs_kHz > 0 ) { + /* Change in API sampling rate in the middle of encoding a packet */ + ret += SKP_Silk_setup_resamplers( psEnc, psEnc->sCmn.fs_kHz ); + } + return ret; + } + + /* Beyond this point we know that there are no previously coded frames in the payload buffer */ + + /********************************************/ + /* Determine internal sampling rate */ + /********************************************/ + fs_kHz = SKP_Silk_control_audio_bandwidth( &psEnc->sCmn, TargetRate_bps ); + + /********************************************/ + /* Prepare resampler and buffered data */ + /********************************************/ + ret += SKP_Silk_setup_resamplers( psEnc, fs_kHz ); + + /********************************************/ + /* Set packet size */ + /********************************************/ + ret += SKP_Silk_setup_packetsize( psEnc, PacketSize_ms ); + + /********************************************/ + /* Set internal sampling frequency */ + /********************************************/ + ret += SKP_Silk_setup_fs( psEnc, fs_kHz ); + + /********************************************/ + /* Set encoding complexity */ + /********************************************/ + ret += SKP_Silk_setup_complexity( &psEnc->sCmn, Complexity ); + + /********************************************/ + /* Set bitrate/coding quality */ + /********************************************/ + ret += SKP_Silk_setup_rate( psEnc, TargetRate_bps ); + + /********************************************/ + /* Set packet loss rate measured by farend */ + /********************************************/ + if( ( PacketLoss_perc < 0 ) || ( PacketLoss_perc > 100 ) ) { + ret = SKP_SILK_ENC_INVALID_LOSS_RATE; + } + psEnc->sCmn.PacketLoss_perc = PacketLoss_perc; + + /********************************************/ + /* Set LBRR usage */ + /********************************************/ + ret += SKP_Silk_setup_LBRR( psEnc ); + + /********************************************/ + /* Set DTX mode */ + /********************************************/ + if( DTX_enabled < 0 || DTX_enabled > 1 ) { + ret = SKP_SILK_ENC_INVALID_DTX_SETTING; + } + psEnc->sCmn.useDTX = DTX_enabled; + psEnc->sCmn.controlled_since_last_payload = 1; + + return ret; +} + +/* Control low bitrate redundancy usage */ +void SKP_Silk_LBRR_ctrl_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I Encoder state FLP */ + SKP_Silk_encoder_control *psEncCtrl /* I/O Encoder control */ +) +{ + SKP_int LBRR_usage; + + if( psEnc->sCmn.LBRR_enabled ) { + /* Control LBRR */ + + /* Usage Control based on sensitivity and packet loss caracteristics */ + /* For now only enable adding to next for active frames. Make more complex later */ + LBRR_usage = SKP_SILK_NO_LBRR; + if( psEnc->speech_activity > LBRR_SPEECH_ACTIVITY_THRES && psEnc->sCmn.PacketLoss_perc > LBRR_LOSS_THRES ) { // nb! maybe multiply loss prob and speech activity + LBRR_usage = SKP_SILK_ADD_LBRR_TO_PLUS1; + } + psEncCtrl->LBRR_usage = LBRR_usage; + } else { + psEncCtrl->LBRR_usage = SKP_SILK_NO_LBRR; + } +} + +SKP_INLINE SKP_int SKP_Silk_setup_resamplers( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + SKP_int fs_kHz /* I Internal sampling rate (kHz) */ +) +{ + SKP_int ret = SKP_SILK_NO_ERROR; + + if( psEnc->sCmn.fs_kHz != fs_kHz || psEnc->sCmn.prev_API_fs_Hz != psEnc->sCmn.API_fs_Hz ) { + + if( psEnc->sCmn.fs_kHz == 0 ) { + /* Initialize the resampler for enc_API.c preparing resampling from API_fs_Hz to fs_kHz */ + ret += SKP_Silk_resampler_init( &psEnc->sCmn.resampler_state, psEnc->sCmn.API_fs_Hz, fs_kHz * 1000 ); + } else { + /* Allocate space for worst case temporary upsampling, 8 to 48 kHz, so a factor 6 */ + SKP_int16 x_buf_API_fs_Hz[ ( 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ) * ( MAX_API_FS_KHZ / 8 ) ]; + SKP_int16 x_bufFIX[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ]; + + SKP_int32 nSamples_temp = 2 * psEnc->sCmn.frame_length + LA_SHAPE_MS * psEnc->sCmn.fs_kHz; + + SKP_float2short_array( x_bufFIX, psEnc->x_buf, nSamples_temp ); + + if( fs_kHz * 1000 < psEnc->sCmn.API_fs_Hz && psEnc->sCmn.fs_kHz != 0 ) { + /* Resample buffered data in x_buf to API_fs_Hz */ + + SKP_Silk_resampler_state_struct temp_resampler_state; + + /* Initialize resampler for temporary resampling of x_buf data to API_fs_Hz */ + ret += SKP_Silk_resampler_init( &temp_resampler_state, psEnc->sCmn.fs_kHz * 1000, psEnc->sCmn.API_fs_Hz ); + + /* Temporary resampling of x_buf data to API_fs_Hz */ + ret += SKP_Silk_resampler( &temp_resampler_state, x_buf_API_fs_Hz, x_bufFIX, nSamples_temp ); + + /* Calculate number of samples that has been temporarily upsampled */ + nSamples_temp = SKP_DIV32_16( nSamples_temp * psEnc->sCmn.API_fs_Hz, psEnc->sCmn.fs_kHz * 1000 ); + + /* Initialize the resampler for enc_API.c preparing resampling from API_fs_Hz to fs_kHz */ + ret += SKP_Silk_resampler_init( &psEnc->sCmn.resampler_state, psEnc->sCmn.API_fs_Hz, fs_kHz * 1000 ); + + } else { + /* Copy data */ + SKP_memcpy( x_buf_API_fs_Hz, x_bufFIX, nSamples_temp * sizeof( SKP_int16 ) ); + } + + if( 1000 * fs_kHz != psEnc->sCmn.API_fs_Hz ) { + /* Correct resampler state (unless resampling by a factor 1) by resampling buffered data from API_fs_Hz to fs_kHz */ + ret += SKP_Silk_resampler( &psEnc->sCmn.resampler_state, x_bufFIX, x_buf_API_fs_Hz, nSamples_temp ); + } + SKP_short2float_array( psEnc->x_buf, x_bufFIX, ( 2 * FRAME_LENGTH_MS + LA_SHAPE_MS ) * fs_kHz ); + } + } + + psEnc->sCmn.prev_API_fs_Hz = psEnc->sCmn.API_fs_Hz; + + return ret; +} + +SKP_INLINE SKP_int SKP_Silk_setup_packetsize( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + SKP_int PacketSize_ms /* I Packet length (ms) */ +) +{ + SKP_int ret = SKP_SILK_NO_ERROR; + + /* Set packet size */ + if( ( PacketSize_ms != 20 ) && + ( PacketSize_ms != 40 ) && + ( PacketSize_ms != 60 ) && + ( PacketSize_ms != 80 ) && + ( PacketSize_ms != 100 ) ) { + ret = SKP_SILK_ENC_PACKET_SIZE_NOT_SUPPORTED; + } else { + if( PacketSize_ms != psEnc->sCmn.PacketSize_ms ) { + psEnc->sCmn.PacketSize_ms = PacketSize_ms; + + /* Packet length changes. Reset LBRR buffer */ + SKP_Silk_LBRR_reset( &psEnc->sCmn ); + } + } + return(ret); +} + +SKP_INLINE SKP_int SKP_Silk_setup_fs( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + SKP_int fs_kHz /* I Internal sampling rate (kHz) */ +) +{ + SKP_int ret = SKP_SILK_NO_ERROR; + + /* Set internal sampling frequency */ + if( psEnc->sCmn.fs_kHz != fs_kHz ) { + /* reset part of the state */ + SKP_memset( &psEnc->sShape, 0, sizeof( SKP_Silk_shape_state_FLP ) ); + SKP_memset( &psEnc->sPrefilt, 0, sizeof( SKP_Silk_prefilter_state_FLP ) ); + SKP_memset( &psEnc->sPred, 0, sizeof( SKP_Silk_predict_state_FLP ) ); + SKP_memset( &psEnc->sCmn.sNSQ, 0, sizeof( SKP_Silk_nsq_state ) ); + SKP_memset( psEnc->sCmn.sNSQ_LBRR.xq, 0, ( 2 * MAX_FRAME_LENGTH ) * sizeof( SKP_int16 ) ); + SKP_memset( psEnc->sCmn.LBRR_buffer, 0, MAX_LBRR_DELAY * sizeof( SKP_SILK_LBRR_struct ) ); +#if SWITCH_TRANSITION_FILTERING + SKP_memset( psEnc->sCmn.sLP.In_LP_State, 0, 2 * sizeof( SKP_int32 ) ); + if( psEnc->sCmn.sLP.mode == 1 ) { + /* Begin transition phase */ + psEnc->sCmn.sLP.transition_frame_no = 1; + } else { + /* End transition phase */ + psEnc->sCmn.sLP.transition_frame_no = 0; + } +#endif + psEnc->sCmn.inputBufIx = 0; + psEnc->sCmn.nFramesInPayloadBuf = 0; + psEnc->sCmn.nBytesInPayloadBuf = 0; + psEnc->sCmn.oldest_LBRR_idx = 0; + psEnc->sCmn.TargetRate_bps = 0; /* Ensures that psEnc->SNR_dB is recomputed */ + + SKP_memset( psEnc->sPred.prev_NLSFq, 0, MAX_LPC_ORDER * sizeof( SKP_float ) ); + + /* Initialize non-zero parameters */ + psEnc->sCmn.prevLag = 100; + psEnc->sCmn.prev_sigtype = SIG_TYPE_UNVOICED; + psEnc->sCmn.first_frame_after_reset = 1; + psEnc->sPrefilt.lagPrev = 100; + psEnc->sShape.LastGainIndex = 1; + psEnc->sCmn.sNSQ.lagPrev = 100; + psEnc->sCmn.sNSQ.prev_inv_gain_Q16 = 65536; + psEnc->sCmn.sNSQ_LBRR.prev_inv_gain_Q16 = 65536; + + psEnc->sCmn.fs_kHz = fs_kHz; + if( psEnc->sCmn.fs_kHz == 8 ) { + psEnc->sCmn.predictLPCOrder = MIN_LPC_ORDER; + psEnc->sCmn.psNLSF_CB[ 0 ] = &SKP_Silk_NLSF_CB0_10; + psEnc->sCmn.psNLSF_CB[ 1 ] = &SKP_Silk_NLSF_CB1_10; + psEnc->psNLSF_CB_FLP[ 0 ] = &SKP_Silk_NLSF_CB0_10_FLP; + psEnc->psNLSF_CB_FLP[ 1 ] = &SKP_Silk_NLSF_CB1_10_FLP; + } else { + psEnc->sCmn.predictLPCOrder = MAX_LPC_ORDER; + psEnc->sCmn.psNLSF_CB[ 0 ] = &SKP_Silk_NLSF_CB0_16; + psEnc->sCmn.psNLSF_CB[ 1 ] = &SKP_Silk_NLSF_CB1_16; + psEnc->psNLSF_CB_FLP[ 0 ] = &SKP_Silk_NLSF_CB0_16_FLP; + psEnc->psNLSF_CB_FLP[ 1 ] = &SKP_Silk_NLSF_CB1_16_FLP; + } + psEnc->sCmn.frame_length = FRAME_LENGTH_MS * fs_kHz; + psEnc->sCmn.subfr_length = psEnc->sCmn.frame_length / NB_SUBFR; + psEnc->sCmn.la_pitch = LA_PITCH_MS * fs_kHz; + psEnc->sPred.min_pitch_lag = 3 * fs_kHz; + psEnc->sPred.max_pitch_lag = 18 * fs_kHz; + psEnc->sPred.pitch_LPC_win_length = FIND_PITCH_LPC_WIN_MS * fs_kHz; + if( psEnc->sCmn.fs_kHz == 24 ) { + psEnc->mu_LTP = MU_LTP_QUANT_SWB; + psEnc->sCmn.bitrate_threshold_up = SKP_int32_MAX; + psEnc->sCmn.bitrate_threshold_down = SWB2WB_BITRATE_BPS; + } else if( psEnc->sCmn.fs_kHz == 16 ) { + psEnc->mu_LTP = MU_LTP_QUANT_WB; + psEnc->sCmn.bitrate_threshold_up = WB2SWB_BITRATE_BPS; + psEnc->sCmn.bitrate_threshold_down = WB2MB_BITRATE_BPS; + } else if( psEnc->sCmn.fs_kHz == 12 ) { + psEnc->mu_LTP = MU_LTP_QUANT_MB; + psEnc->sCmn.bitrate_threshold_up = MB2WB_BITRATE_BPS; + psEnc->sCmn.bitrate_threshold_down = MB2NB_BITRATE_BPS; + } else { + psEnc->mu_LTP = MU_LTP_QUANT_NB; + psEnc->sCmn.bitrate_threshold_up = NB2MB_BITRATE_BPS; + psEnc->sCmn.bitrate_threshold_down = 0; + } + psEnc->sCmn.fs_kHz_changed = 1; + + /* Check that settings are valid */ + SKP_assert( ( psEnc->sCmn.subfr_length * NB_SUBFR ) == psEnc->sCmn.frame_length ); + } + return ret; +} + +SKP_INLINE SKP_int SKP_Silk_setup_rate( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + SKP_int32 TargetRate_bps /* I Target max bitrate */ +) +{ + SKP_int k, ret = SKP_SILK_NO_ERROR; + SKP_float frac; + const SKP_int32 *rateTable; + + /* Set bitrate/coding quality */ + if( TargetRate_bps != psEnc->sCmn.TargetRate_bps ) { + psEnc->sCmn.TargetRate_bps = TargetRate_bps; + + /* If new TargetRate_bps, translate to SNR_dB value */ + if( psEnc->sCmn.fs_kHz == 8 ) { + rateTable = TargetRate_table_NB; + } else if( psEnc->sCmn.fs_kHz == 12 ) { + rateTable = TargetRate_table_MB; + } else if( psEnc->sCmn.fs_kHz == 16 ) { + rateTable = TargetRate_table_WB; + } else { + rateTable = TargetRate_table_SWB; + } + for( k = 1; k < TARGET_RATE_TAB_SZ; k++ ) { + /* Find bitrate interval in table and interpolate */ + if( TargetRate_bps <= rateTable[ k ] ) { + frac = (SKP_float)( TargetRate_bps - rateTable[ k - 1 ] ) / + (SKP_float)( rateTable[ k ] - rateTable[ k - 1 ] ); + psEnc->SNR_dB = 0.5f * ( SNR_table_Q1[ k - 1 ] + frac * ( SNR_table_Q1[ k ] - SNR_table_Q1[ k - 1 ] ) ); + break; + } + } + } + return( ret ); +} + +SKP_INLINE SKP_int SKP_Silk_setup_LBRR( + SKP_Silk_encoder_state_FLP *psEnc /* I/O Pointer to Silk encoder state FLP */ +) +{ + SKP_int ret = SKP_SILK_NO_ERROR; + +#if USE_LBRR + SKP_int32 LBRRRate_thres_bps; + + if( psEnc->sCmn.useInBandFEC < 0 || psEnc->sCmn.useInBandFEC > 1 ) { + ret = SKP_SILK_ENC_INVALID_INBAND_FEC_SETTING; + } + + psEnc->sCmn.LBRR_enabled = psEnc->sCmn.useInBandFEC; + if( psEnc->sCmn.fs_kHz == 8 ) { + LBRRRate_thres_bps = INBAND_FEC_MIN_RATE_BPS - 9000; + } else if( psEnc->sCmn.fs_kHz == 12 ) { + LBRRRate_thres_bps = INBAND_FEC_MIN_RATE_BPS - 6000; + } else if( psEnc->sCmn.fs_kHz == 16 ) { + LBRRRate_thres_bps = INBAND_FEC_MIN_RATE_BPS - 3000; + } else { + LBRRRate_thres_bps = INBAND_FEC_MIN_RATE_BPS; + } + + if( psEnc->sCmn.TargetRate_bps >= LBRRRate_thres_bps ) { + /* Set gain increase / rate reduction for LBRR usage */ + /* Coarsely tuned with PESQ for now. */ + /* Linear regression coefs G = 8 - 0.5 * loss */ + /* Meaning that at 16% loss main rate and redundant rate is the same, -> G = 0 */ + psEnc->sCmn.LBRR_GainIncreases = SKP_max_int( 8 - SKP_RSHIFT( psEnc->sCmn.PacketLoss_perc, 1 ), 0 ); + + /* Set main stream rate compensation */ + if( psEnc->sCmn.LBRR_enabled && psEnc->sCmn.PacketLoss_perc > LBRR_LOSS_THRES ) { + /* Tuned to give approx same mean / weighted bitrate as no inband FEC */ + psEnc->inBandFEC_SNR_comp = 6.0f - 0.5f * psEnc->sCmn.LBRR_GainIncreases; + } else { + psEnc->inBandFEC_SNR_comp = 0.0f; + psEnc->sCmn.LBRR_enabled = 0; + } + } else { + psEnc->inBandFEC_SNR_comp = 0.0f; + psEnc->sCmn.LBRR_enabled = 0; + } +#else + if( INBandFEC_enabled != 0 ) { + ret = SKP_SILK_ENC_INVALID_INBAND_FEC_SETTING; + } + psEnc->sCmn.LBRR_enabled = 0; +#endif + return ret; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_corrMatrix_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_corrMatrix_FLP.c new file mode 100755 index 0000000..64134cf --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_corrMatrix_FLP.c @@ -0,0 +1,89 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/********************************************************************** + * Correlation matrix computations for LS estimate. + **********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +/* Calculates correlation vector X'*t */ +void SKP_Silk_corrVector_FLP( + const SKP_float *x, /* I x vector [L+order-1] used to create X */ + const SKP_float *t, /* I Target vector [L] */ + const SKP_int L, /* I Length of vecors */ + const SKP_int Order, /* I Max lag for correlation */ + SKP_float *Xt /* O X'*t correlation vector [order] */ +) +{ + SKP_int lag; + const SKP_float *ptr1; + + ptr1 = &x[ Order - 1 ]; /* Points to first sample of column 0 of X: X[:,0] */ + for( lag = 0; lag < Order; lag++ ) { + /* Calculate X[:,lag]'*t */ + Xt[ lag ] = (SKP_float)SKP_Silk_inner_product_FLP( ptr1, t, L ); + ptr1--; /* Next column of X */ + } +} + +/* Calculates correlation matrix X'*X */ +void SKP_Silk_corrMatrix_FLP( + const SKP_float *x, /* I x vector [ L+order-1 ] used to create X */ + const SKP_int L, /* I Length of vectors */ + const SKP_int Order, /* I Max lag for correlation */ + SKP_float *XX /* O X'*X correlation matrix [order x order] */ +) +{ + SKP_int j, lag; + double energy; + const SKP_float *ptr1, *ptr2; + + ptr1 = &x[ Order - 1 ]; /* First sample of column 0 of X */ + energy = SKP_Silk_energy_FLP( ptr1, L ); /* X[:,0]'*X[:,0] */ + matrix_ptr( XX, 0, 0, Order ) = ( SKP_float )energy; + for( j = 1; j < Order; j++ ) { + /* Calculate X[:,j]'*X[:,j] */ + energy += ptr1[ -j ] * ptr1[ -j ] - ptr1[ L - j ] * ptr1[ L - j ]; + matrix_ptr( XX, j, j, Order ) = ( SKP_float )energy; + } + + ptr2 = &x[ Order - 2 ]; /* First sample of column 1 of X */ + for( lag = 1; lag < Order; lag++ ) { + /* Calculate X[:,0]'*X[:,lag] */ + energy = SKP_Silk_inner_product_FLP( ptr1, ptr2, L ); + matrix_ptr( XX, lag, 0, Order ) = ( SKP_float )energy; + matrix_ptr( XX, 0, lag, Order ) = ( SKP_float )energy; + /* Calculate X[:,j]'*X[:,j + lag] */ + for( j = 1; j < ( Order - lag ); j++ ) { + energy += ptr1[ -j ] * ptr2[ -j ] - ptr1[ L - j ] * ptr2[ L - j ]; + matrix_ptr( XX, lag + j, j, Order ) = ( SKP_float )energy; + matrix_ptr( XX, j, lag + j, Order ) = ( SKP_float )energy; + } + ptr2--; /* Next column of X */ + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_create_init_destroy.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_create_init_destroy.c new file mode 100755 index 0000000..aa6cea0 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_create_init_destroy.c @@ -0,0 +1,53 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + + +/************************/ +/* Init Decoder State */ +/************************/ +SKP_int SKP_Silk_init_decoder( + SKP_Silk_decoder_state *psDec /* I/O Decoder state pointer */ +) +{ + SKP_memset( psDec, 0, sizeof( SKP_Silk_decoder_state ) ); + /* Set sampling rate to 24 kHz, and init non-zero values */ + SKP_Silk_decoder_set_fs( psDec, 24 ); + + /* Used to deactivate e.g. LSF interpolation and fluctuation reduction */ + psDec->first_frame_after_reset = 1; + psDec->prev_inv_gain_Q16 = 65536; + + /* Reset CNG state */ + SKP_Silk_CNG_Reset( psDec ); + + SKP_Silk_PLC_Reset( psDec ); + + return(0); +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_dec_API.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_dec_API.c new file mode 100755 index 0000000..1de13c6 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_dec_API.c @@ -0,0 +1,279 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SDK_API.h" +#include "SKP_Silk_main.h" + +/*********************/ +/* Decoder functions */ +/*********************/ + +SKP_int SKP_Silk_SDK_Get_Decoder_Size( SKP_int32 *decSizeBytes ) +{ + SKP_int ret = 0; + + *decSizeBytes = sizeof( SKP_Silk_decoder_state ); + + return ret; +} + +/* Reset decoder state */ +SKP_int SKP_Silk_SDK_InitDecoder( + void* decState /* I/O: State */ +) +{ + SKP_int ret = 0; + SKP_Silk_decoder_state *struc; + + struc = (SKP_Silk_decoder_state *)decState; + + ret = SKP_Silk_init_decoder( struc ); + + return ret; +} + +/* Decode a frame */ +SKP_int SKP_Silk_SDK_Decode( + void* decState, /* I/O: State */ + SKP_SILK_SDK_DecControlStruct* decControl, /* I/O: Control structure */ + SKP_int lostFlag, /* I: 0: no loss, 1 loss */ + const SKP_uint8 *inData, /* I: Encoded input vector */ + const SKP_int nBytesIn, /* I: Number of input Bytes */ + SKP_int16 *samplesOut, /* O: Decoded output speech vector */ + SKP_int16 *nSamplesOut /* I/O: Number of samples (vector/decoded) */ +) +{ + SKP_int ret = 0, used_bytes, prev_fs_kHz; + SKP_Silk_decoder_state *psDec; + SKP_int16 samplesOutInternal[ MAX_API_FS_KHZ * FRAME_LENGTH_MS ]; + SKP_int16 *pSamplesOutInternal; + + psDec = (SKP_Silk_decoder_state *)decState; + + /* We need this buffer to have room for an internal frame */ + pSamplesOutInternal = samplesOut; + if( psDec->fs_kHz * 1000 > decControl->API_sampleRate ) { + pSamplesOutInternal = samplesOutInternal; + } + + /**********************************/ + /* Test if first frame in payload */ + /**********************************/ + if( psDec->moreInternalDecoderFrames == 0 ) { + /* First Frame in Payload */ + psDec->nFramesDecoded = 0; /* Used to count frames in packet */ + } + + if( psDec->moreInternalDecoderFrames == 0 && /* First frame in packet */ + lostFlag == 0 && /* Not packet loss */ + nBytesIn > MAX_ARITHM_BYTES ) { /* Too long payload */ + /* Avoid trying to decode a too large packet */ + lostFlag = 1; + ret = SKP_SILK_DEC_PAYLOAD_TOO_LARGE; + } + + /* Save previous sample frequency */ + prev_fs_kHz = psDec->fs_kHz; + + /* Call decoder for one frame */ + ret += SKP_Silk_decode_frame( psDec, pSamplesOutInternal, nSamplesOut, inData, nBytesIn, + lostFlag, &used_bytes ); + + if( used_bytes ) { /* Only Call if not a packet loss */ + if( psDec->nBytesLeft > 0 && psDec->FrameTermination == SKP_SILK_MORE_FRAMES && psDec->nFramesDecoded < 5 ) { + /* We have more frames in the Payload */ + psDec->moreInternalDecoderFrames = 1; + } else { + /* Last frame in Payload */ + psDec->moreInternalDecoderFrames = 0; + psDec->nFramesInPacket = psDec->nFramesDecoded; + + /* Track inband FEC usage */ + if( psDec->vadFlag == VOICE_ACTIVITY ) { + if( psDec->FrameTermination == SKP_SILK_LAST_FRAME ) { + psDec->no_FEC_counter++; + if( psDec->no_FEC_counter > NO_LBRR_THRES ) { + psDec->inband_FEC_offset = 0; + } + } else if( psDec->FrameTermination == SKP_SILK_LBRR_VER1 ) { + psDec->inband_FEC_offset = 1; /* FEC info with 1 packet delay */ + psDec->no_FEC_counter = 0; + } else if( psDec->FrameTermination == SKP_SILK_LBRR_VER2 ) { + psDec->inband_FEC_offset = 2; /* FEC info with 2 packets delay */ + psDec->no_FEC_counter = 0; + } + } + } + } + + if( MAX_API_FS_KHZ * 1000 < decControl->API_sampleRate || + 8000 > decControl->API_sampleRate ) { + ret = SKP_SILK_DEC_INVALID_SAMPLING_FREQUENCY; + return( ret ); + } + + /* Resample if needed */ + if( psDec->fs_kHz * 1000 != decControl->API_sampleRate ) { + SKP_int16 samplesOut_tmp[ MAX_API_FS_KHZ * FRAME_LENGTH_MS ]; + SKP_assert( psDec->fs_kHz <= MAX_API_FS_KHZ ); + + /* Copy to a tmp buffer as the resampling writes to samplesOut */ + SKP_memcpy( samplesOut_tmp, pSamplesOutInternal, *nSamplesOut * sizeof( SKP_int16 ) ); + + /* (Re-)initialize resampler state when switching internal sampling frequency */ + if( prev_fs_kHz != psDec->fs_kHz || psDec->prev_API_sampleRate != decControl->API_sampleRate ) { + ret = SKP_Silk_resampler_init( &psDec->resampler_state, SKP_SMULBB( psDec->fs_kHz, 1000 ), decControl->API_sampleRate ); + } + + /* Resample the output to API_sampleRate */ + ret += SKP_Silk_resampler( &psDec->resampler_state, samplesOut, samplesOut_tmp, *nSamplesOut ); + + /* Update the number of output samples */ + *nSamplesOut = SKP_DIV32( ( SKP_int32 )*nSamplesOut * decControl->API_sampleRate, psDec->fs_kHz * 1000 ); + } else if( prev_fs_kHz * 1000 > decControl->API_sampleRate ) { + SKP_memcpy( samplesOut, pSamplesOutInternal, *nSamplesOut * sizeof( SKP_int16 ) ); + } + + psDec->prev_API_sampleRate = decControl->API_sampleRate; + + /* Copy all parameters that are needed out of internal structure to the control stucture */ + decControl->frameSize = (SKP_uint16)( decControl->API_sampleRate / 50 ) ; + decControl->framesPerPacket = ( SKP_int )psDec->nFramesInPacket; + decControl->inBandFECOffset = ( SKP_int )psDec->inband_FEC_offset; + decControl->moreInternalDecoderFrames = ( SKP_int )psDec->moreInternalDecoderFrames; + + return ret; +} + +/* Function to find LBRR information in a packet */ +void SKP_Silk_SDK_search_for_LBRR( + const SKP_uint8 *inData, /* I: Encoded input vector */ + const SKP_int nBytesIn, /* I: Number of input Bytes */ + SKP_int lost_offset, /* I: Offset from lost packet */ + SKP_uint8 *LBRRData, /* O: LBRR payload */ + SKP_int16 *nLBRRBytes /* O: Number of LBRR Bytes */ +) +{ + SKP_Silk_decoder_state sDec; // Local decoder state to avoid interfering with running decoder */ + SKP_Silk_decoder_control sDecCtrl; + SKP_int TempQ[ MAX_FRAME_LENGTH ]; + + if( lost_offset < 1 || lost_offset > MAX_LBRR_DELAY ) { + /* No useful FEC in this packet */ + *nLBRRBytes = 0; + return; + } + + sDec.nFramesDecoded = 0; + sDec.fs_kHz = 0; /* Force update parameters LPC_order etc */ + sDec.lossCnt = 0; /* Avoid running bw expansion of the LPC parameters when searching for LBRR data */ + SKP_memset( sDec.prevNLSF_Q15, 0, MAX_LPC_ORDER * sizeof( SKP_int ) ); + SKP_Silk_range_dec_init( &sDec.sRC, inData, ( SKP_int32 )nBytesIn ); + + while(1) { + SKP_Silk_decode_parameters( &sDec, &sDecCtrl, TempQ, 0 ); + + if( sDec.sRC.error ) { + /* Corrupt stream */ + *nLBRRBytes = 0; + return; + }; + if( ( sDec.FrameTermination - 1 ) & lost_offset && sDec.FrameTermination > 0 && sDec.nBytesLeft >= 0 ) { + /* The wanted FEC is present in the packet */ + *nLBRRBytes = sDec.nBytesLeft; + SKP_memcpy( LBRRData, &inData[ nBytesIn - sDec.nBytesLeft ], sDec.nBytesLeft * sizeof( SKP_uint8 ) ); + break; + } + if( sDec.nBytesLeft > 0 && sDec.FrameTermination == SKP_SILK_MORE_FRAMES ) { + sDec.nFramesDecoded++; + } else { + LBRRData = NULL; + *nLBRRBytes = 0; + break; + } + } +} + +/* Getting type of content for a packet */ +void SKP_Silk_SDK_get_TOC( + const SKP_uint8 *inData, /* I: Encoded input vector */ + const SKP_int nBytesIn, /* I: Number of input bytes */ + SKP_Silk_TOC_struct *Silk_TOC /* O: Type of content */ +) +{ + SKP_Silk_decoder_state sDec; // Local Decoder state to avoid interfering with running decoder */ + SKP_Silk_decoder_control sDecCtrl; + SKP_int TempQ[ MAX_FRAME_LENGTH ]; + + sDec.nFramesDecoded = 0; + sDec.fs_kHz = 0; /* Force update parameters LPC_order etc */ + SKP_Silk_range_dec_init( &sDec.sRC, inData, ( SKP_int32 )nBytesIn ); + + Silk_TOC->corrupt = 0; + while( 1 ) { + SKP_Silk_decode_parameters( &sDec, &sDecCtrl, TempQ, 0 ); + + Silk_TOC->vadFlags[ sDec.nFramesDecoded ] = sDec.vadFlag; + Silk_TOC->sigtypeFlags[ sDec.nFramesDecoded ] = sDecCtrl.sigtype; + + if( sDec.sRC.error ) { + /* Corrupt stream */ + Silk_TOC->corrupt = 1; + break; + }; + + if( sDec.nBytesLeft > 0 && sDec.FrameTermination == SKP_SILK_MORE_FRAMES ) { + sDec.nFramesDecoded++; + } else { + break; + } + } + if( Silk_TOC->corrupt || sDec.FrameTermination == SKP_SILK_MORE_FRAMES || + sDec.nFramesInPacket > SILK_MAX_FRAMES_PER_PACKET ) { + /* Corrupt packet */ + SKP_memset( Silk_TOC, 0, sizeof( SKP_Silk_TOC_struct ) ); + Silk_TOC->corrupt = 1; + } else { + Silk_TOC->framesInPacket = sDec.nFramesDecoded + 1; + Silk_TOC->fs_kHz = sDec.fs_kHz; + if( sDec.FrameTermination == SKP_SILK_LAST_FRAME ) { + Silk_TOC->inbandLBRR = sDec.FrameTermination; + } else { + Silk_TOC->inbandLBRR = sDec.FrameTermination - 1; + } + } +} + +/**************************/ +/* Get the version number */ +/**************************/ +/* Return a pointer to string specifying the version */ +const char *SKP_Silk_SDK_get_version() +{ + static const char version[] = "1.0.9"; + return version; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decimate2_coarse_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decimate2_coarse_FLP.c new file mode 100755 index 0000000..06c90a9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decimate2_coarse_FLP.c @@ -0,0 +1,69 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_decimate2_coarse.c * + * * + * downsample by a factor 2, coarser * + * */ +#include "SKP_Silk_SigProc_FLP.h" + +/* coefficients for coarser 2-fold resampling */ +static SKP_float A20c_FLP[ 2 ] = {0.064666748046875f, 0.508514404296875f}; +static SKP_float A21c_FLP[ 2 ] = {0.245666503906250f, 0.819732666015625f}; + +/* downsample by a factor 2, coarser */ +void SKP_Silk_decimate2_coarse_FLP( + const SKP_float *in, /* I: 16 kHz signal [2*len] */ + SKP_float *S, /* I/O: state vector [4] */ + SKP_float *out, /* O: 8 kHz signal [len] */ + SKP_float *scratch, /* I: scratch memory [3*len] */ + const SKP_int32 len /* I: number of OUTPUT samples */ +) +{ + SKP_int32 k; + + /* de-interleave allpass inputs */ + for ( k = 0; k < len; k++) { + scratch[ k ] = in[ 2 * k ]; + scratch[ k + len ] = in[ 2 * k + 1 ]; + } + + /* allpass filters */ + SKP_Silk_allpass_int_FLP( scratch, S + 0, A21c_FLP[ 0 ], scratch + 2 * len, len ); + SKP_Silk_allpass_int_FLP( scratch + 2 * len, S + 1, A21c_FLP[ 1 ], scratch, len ); + + SKP_Silk_allpass_int_FLP( scratch + len, S + 2, A20c_FLP[ 0 ], scratch + 2 * len, len ); + SKP_Silk_allpass_int_FLP( scratch + 2 * len, S + 3, A20c_FLP[ 1 ], scratch + len, len ); + + /* add two allpass outputs */ + for ( k = 0; k < len; k++ ) { + out[ k ] = 0.5f * ( scratch[ k ] + scratch[ k + len ] ); + } +} + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decimate2_coarsest_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decimate2_coarsest_FLP.c new file mode 100755 index 0000000..c65a2c7 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decimate2_coarsest_FLP.c @@ -0,0 +1,67 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_decimate2_coarsest.c * + * * + * downsample by a factor 2, coarsest * + * */ +#include "SKP_Silk_SigProc_FLP.h" + +/* coefficients for coarsest 2-fold resampling */ +/* note that these differ from the interpolator with the same filter orders! */ +static float A20cst_FLP[ 1 ] = {0.289001464843750f}; +static float A21cst_FLP[ 1 ] = {0.780487060546875f}; + +/* downsample by a factor 2, coarsest */ +void SKP_Silk_decimate2_coarsest_FLP( + const SKP_float *in, /* I: 16 kHz signal [2*len] */ + SKP_float *S, /* I/O: state vector [2] */ + SKP_float *out, /* O: 8 kHz signal [len] */ + SKP_float *scratch, /* I: scratch memory [3*len] */ + const SKP_int32 len /* I: number of OUTPUT samples */ +) +{ + SKP_int32 k; + + /* de-interleave allpass inputs */ + for ( k = 0; k < len; k++ ) { + scratch[ k ] = in[ 2 * k + 0 ]; + scratch[ k + len ] = in[ 2 * k + 1 ]; + } + + /* allpass filters */ + SKP_Silk_allpass_int_FLP( scratch, S + 0, A21cst_FLP[ 0 ], scratch + 2 * len, len ); + SKP_Silk_allpass_int_FLP( scratch + len, S + 1, A20cst_FLP[ 0 ], scratch, len ); + + /* add two allpass outputs */ + for ( k = 0; k < len; k++ ) { + out[ k ] = 0.5f * ( scratch[ k ] + scratch[ k + 2 * len ] ); + } +} + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_core.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_core.c new file mode 100755 index 0000000..258195c --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_core.c @@ -0,0 +1,242 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + + +void SKP_Silk_decode_short_term_prediction( +SKP_int32 *vec_Q10, +SKP_int32 *pres_Q10, +SKP_int32 *sLPC_Q14, +SKP_int16 *A_Q12_tmp, +SKP_int LPC_order, +SKP_int subfr_length +); + + +/**********************************************************/ +/* Core decoder. Performs inverse NSQ operation LTP + LPC */ +/**********************************************************/ +void SKP_Silk_decode_core( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I Decoder control */ + SKP_int16 xq[], /* O Decoded speech */ + const SKP_int q[ MAX_FRAME_LENGTH ] /* I Pulse signal */ +) +{ + SKP_int i, k, lag = 0, start_idx, sLTP_buf_idx, NLSF_interpolation_flag, sigtype; + SKP_int16 *A_Q12, *B_Q14, *pxq, A_Q12_tmp[ MAX_LPC_ORDER ]; + SKP_int16 sLTP[ MAX_FRAME_LENGTH ]; + SKP_int32 LTP_pred_Q14, Gain_Q16, inv_gain_Q16, inv_gain_Q32, gain_adj_Q16, rand_seed, offset_Q10, dither; + SKP_int32 *pred_lag_ptr, *pexc_Q10, *pres_Q10; + SKP_int32 vec_Q10[ MAX_FRAME_LENGTH / NB_SUBFR ]; + SKP_int32 FiltState[ MAX_LPC_ORDER ]; + + SKP_assert( psDec->prev_inv_gain_Q16 != 0 ); + + offset_Q10 = SKP_Silk_Quantization_Offsets_Q10[ psDecCtrl->sigtype ][ psDecCtrl->QuantOffsetType ]; + + if( psDecCtrl->NLSFInterpCoef_Q2 < ( 1 << 2 ) ) { + NLSF_interpolation_flag = 1; + } else { + NLSF_interpolation_flag = 0; + } + + + /* Decode excitation */ + rand_seed = psDecCtrl->Seed; + for( i = 0; i < psDec->frame_length; i++ ) { + rand_seed = SKP_RAND( rand_seed ); + /* dither = rand_seed < 0 ? 0xFFFFFFFF : 0; */ + dither = SKP_RSHIFT( rand_seed, 31 ); + + psDec->exc_Q10[ i ] = SKP_LSHIFT( ( SKP_int32 )q[ i ], 10 ) + offset_Q10; + psDec->exc_Q10[ i ] = ( psDec->exc_Q10[ i ] ^ dither ) - dither; + + rand_seed += q[ i ]; + } + + + pexc_Q10 = psDec->exc_Q10; + pres_Q10 = psDec->res_Q10; + pxq = &psDec->outBuf[ psDec->frame_length ]; + sLTP_buf_idx = psDec->frame_length; + /* Loop over subframes */ + for( k = 0; k < NB_SUBFR; k++ ) { + A_Q12 = psDecCtrl->PredCoef_Q12[ k >> 1 ]; + + /* Preload LPC coeficients to array on stack. Gives small performance gain */ + SKP_memcpy( A_Q12_tmp, A_Q12, psDec->LPC_order * sizeof( SKP_int16 ) ); + B_Q14 = &psDecCtrl->LTPCoef_Q14[ k * LTP_ORDER ]; + Gain_Q16 = psDecCtrl->Gains_Q16[ k ]; + sigtype = psDecCtrl->sigtype; + + inv_gain_Q16 = SKP_INVERSE32_varQ( SKP_max( Gain_Q16, 1 ), 32 ); + inv_gain_Q16 = SKP_min( inv_gain_Q16, SKP_int16_MAX ); + + /* Calculate Gain adjustment factor */ + gain_adj_Q16 = ( SKP_int32 )1 << 16; + if( inv_gain_Q16 != psDec->prev_inv_gain_Q16 ) { + gain_adj_Q16 = SKP_DIV32_varQ( inv_gain_Q16, psDec->prev_inv_gain_Q16, 16 ); + } + + /* Avoid abrupt transition from voiced PLC to unvoiced normal decoding */ + if( psDec->lossCnt && psDec->prev_sigtype == SIG_TYPE_VOICED && + psDecCtrl->sigtype == SIG_TYPE_UNVOICED && k < ( NB_SUBFR >> 1 ) ) { + + SKP_memset( B_Q14, 0, LTP_ORDER * sizeof( SKP_int16 ) ); + B_Q14[ LTP_ORDER/2 ] = ( SKP_int16 )1 << 12; /* 0.25 */ + + sigtype = SIG_TYPE_VOICED; + psDecCtrl->pitchL[ k ] = psDec->lagPrev; + } + + if( sigtype == SIG_TYPE_VOICED ) { + /* Voiced */ + + lag = psDecCtrl->pitchL[ k ]; + /* Re-whitening */ + if( ( k & ( 3 - SKP_LSHIFT( NLSF_interpolation_flag, 1 ) ) ) == 0 ) { + /* Rewhiten with new A coefs */ + start_idx = psDec->frame_length - lag - psDec->LPC_order - LTP_ORDER / 2; + SKP_assert( start_idx >= 0 ); + SKP_assert( start_idx <= psDec->frame_length - psDec->LPC_order ); + + SKP_memset( FiltState, 0, psDec->LPC_order * sizeof( SKP_int32 ) ); /* Not really necessary, but Valgrind and Coverity will complain otherwise */ + SKP_Silk_MA_Prediction( &psDec->outBuf[ start_idx + k * ( psDec->frame_length >> 2 ) ], + A_Q12, FiltState, sLTP + start_idx, psDec->frame_length - start_idx, psDec->LPC_order ); + + /* After rewhitening the LTP state is unscaled */ + inv_gain_Q32 = SKP_LSHIFT( inv_gain_Q16, 16 ); + if( k == 0 ) { + /* Do LTP downscaling */ + inv_gain_Q32 = SKP_LSHIFT( SKP_SMULWB( inv_gain_Q32, psDecCtrl->LTP_scale_Q14 ), 2 ); + } + for( i = 0; i < (lag + LTP_ORDER/2); i++ ) { + psDec->sLTP_Q16[ sLTP_buf_idx - i - 1 ] = SKP_SMULWB( inv_gain_Q32, sLTP[ psDec->frame_length - i - 1 ] ); + } + } else { + /* Update LTP state when Gain changes */ + if( gain_adj_Q16 != ( SKP_int32 )1 << 16 ) { + for( i = 0; i < ( lag + LTP_ORDER / 2 ); i++ ) { + psDec->sLTP_Q16[ sLTP_buf_idx - i - 1 ] = SKP_SMULWW( gain_adj_Q16, psDec->sLTP_Q16[ sLTP_buf_idx - i - 1 ] ); + } + } + } + } + + /* Scale short term state */ + for( i = 0; i < MAX_LPC_ORDER; i++ ) { + psDec->sLPC_Q14[ i ] = SKP_SMULWW( gain_adj_Q16, psDec->sLPC_Q14[ i ] ); + } + + /* Save inv_gain */ + SKP_assert( inv_gain_Q16 != 0 ); + psDec->prev_inv_gain_Q16 = inv_gain_Q16; + + /* Long-term prediction */ + if( sigtype == SIG_TYPE_VOICED ) { + /* Setup pointer */ + pred_lag_ptr = &psDec->sLTP_Q16[ sLTP_buf_idx - lag + LTP_ORDER / 2 ]; + for( i = 0; i < psDec->subfr_length; i++ ) { + /* Unrolled loop */ + LTP_pred_Q14 = SKP_SMULWB( pred_lag_ptr[ 0 ], B_Q14[ 0 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -1 ], B_Q14[ 1 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -2 ], B_Q14[ 2 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], B_Q14[ 3 ] ); + LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], B_Q14[ 4 ] ); + pred_lag_ptr++; + + /* Generate LPC residual */ + pres_Q10[ i ] = SKP_ADD32( pexc_Q10[ i ], SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ) ); + + /* Update states */ + psDec->sLTP_Q16[ sLTP_buf_idx ] = SKP_LSHIFT( pres_Q10[ i ], 6 ); + sLTP_buf_idx++; + } + } else { + SKP_memcpy( pres_Q10, pexc_Q10, psDec->subfr_length * sizeof( SKP_int32 ) ); + } + + SKP_Silk_decode_short_term_prediction(vec_Q10, pres_Q10, psDec->sLPC_Q14,A_Q12_tmp,psDec->LPC_order,psDec->subfr_length); + + /* Scale with Gain */ + for( i = 0; i < psDec->subfr_length; i++ ) { + pxq[ i ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( SKP_SMULWW( vec_Q10[ i ], Gain_Q16 ), 10 ) ); + } + + /* Update LPC filter state */ + SKP_memcpy( psDec->sLPC_Q14, &psDec->sLPC_Q14[ psDec->subfr_length ], MAX_LPC_ORDER * sizeof( SKP_int32 ) ); + pexc_Q10 += psDec->subfr_length; + pres_Q10 += psDec->subfr_length; + pxq += psDec->subfr_length; + } + + /* Copy to output */ + SKP_memcpy( xq, &psDec->outBuf[ psDec->frame_length ], psDec->frame_length * sizeof( SKP_int16 ) ); + +} + +void SKP_Silk_decode_short_term_prediction( +SKP_int32 *vec_Q10, +SKP_int32 *pres_Q10, +SKP_int32 *sLPC_Q14, +SKP_int16 *A_Q12_tmp, +SKP_int LPC_order, +SKP_int subfr_length +) +{ + SKP_int i; + SKP_int32 LPC_pred_Q10; + SKP_int j; + for( i = 0; i < subfr_length; i++ ) { + /* Partially unrolled */ + LPC_pred_Q10 = SKP_SMULWB( sLPC_Q14[ MAX_LPC_ORDER + i - 1 ], A_Q12_tmp[ 0 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 2 ], A_Q12_tmp[ 1 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 3 ], A_Q12_tmp[ 2 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 4 ], A_Q12_tmp[ 3 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 5 ], A_Q12_tmp[ 4 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 6 ], A_Q12_tmp[ 5 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 7 ], A_Q12_tmp[ 6 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 8 ], A_Q12_tmp[ 7 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 9 ], A_Q12_tmp[ 8 ] ); + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - 10 ], A_Q12_tmp[ 9 ] ); + + for( j = 10; j < LPC_order; j ++ ) { + LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, sLPC_Q14[ MAX_LPC_ORDER + i - j - 1 ], A_Q12_tmp[ j ] ); + } + + /* Add prediction to LPC residual */ + vec_Q10[ i ] = SKP_ADD32( pres_Q10[ i ], LPC_pred_Q10 ); + + /* Update states */ + sLPC_Q14[ MAX_LPC_ORDER + i ] = SKP_LSHIFT_ovflw( vec_Q10[ i ], 4 ); + } +} + + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_frame.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_frame.c new file mode 100755 index 0000000..13f27e0 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_frame.c @@ -0,0 +1,155 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + + +#include "SKP_Silk_main.h" +#include "SKP_Silk_PLC.h" + +/****************/ +/* Decode frame */ +/****************/ +SKP_int SKP_Silk_decode_frame( + SKP_Silk_decoder_state *psDec, /* I/O Pointer to Silk decoder state */ + SKP_int16 pOut[], /* O Pointer to output speech frame */ + SKP_int16 *pN, /* O Pointer to size of output frame */ + const SKP_uint8 pCode[], /* I Pointer to payload */ + const SKP_int nBytes, /* I Payload length */ + SKP_int action, /* I Action from Jitter Buffer */ + SKP_int *decBytes /* O Used bytes to decode this frame */ +) +{ + SKP_Silk_decoder_control sDecCtrl; + SKP_int L, fs_Khz_old, ret = 0; + SKP_int Pulses[ MAX_FRAME_LENGTH ]; + + + L = psDec->frame_length; + sDecCtrl.LTP_scale_Q14 = 0; + + /* Safety checks */ + SKP_assert( L > 0 && L <= MAX_FRAME_LENGTH ); + + /********************************************/ + /* Decode Frame if packet is not lost */ + /********************************************/ + *decBytes = 0; + if( action == 0 ) { + /********************************************/ + /* Initialize arithmetic coder */ + /********************************************/ + fs_Khz_old = psDec->fs_kHz; + if( psDec->nFramesDecoded == 0 ) { + /* Initialize range decoder state */ + SKP_Silk_range_dec_init( &psDec->sRC, pCode, nBytes ); + } + + /********************************************/ + /* Decode parameters and pulse signal */ + /********************************************/ + SKP_Silk_decode_parameters( psDec, &sDecCtrl, Pulses, 1 ); + + + if( psDec->sRC.error ) { + psDec->nBytesLeft = 0; + + action = 1; /* PLC operation */ + /* revert fs if changed in decode_parameters */ + SKP_Silk_decoder_set_fs( psDec, fs_Khz_old ); + + /* Avoid crashing */ + *decBytes = psDec->sRC.bufferLength; + + if( psDec->sRC.error == RANGE_CODER_DEC_PAYLOAD_TOO_LONG ) { + ret = SKP_SILK_DEC_PAYLOAD_TOO_LARGE; + } else { + ret = SKP_SILK_DEC_PAYLOAD_ERROR; + } + } else { + *decBytes = psDec->sRC.bufferLength - psDec->nBytesLeft; + psDec->nFramesDecoded++; + + /* Update lengths. Sampling frequency could have changed */ + L = psDec->frame_length; + + /********************************************************/ + /* Run inverse NSQ */ + /********************************************************/ + SKP_Silk_decode_core( psDec, &sDecCtrl, pOut, Pulses ); + + /********************************************************/ + /* Update PLC state */ + /********************************************************/ + SKP_Silk_PLC( psDec, &sDecCtrl, pOut, L, action ); + + psDec->lossCnt = 0; + psDec->prev_sigtype = sDecCtrl.sigtype; + + /* A frame has been decoded without errors */ + psDec->first_frame_after_reset = 0; + } + } + /*************************************************************/ + /* Generate Concealment frame if packet is lost, or corrupt */ + /*************************************************************/ + if( action == 1 ) { + /* Handle packet loss by extrapolation */ + SKP_Silk_PLC( psDec, &sDecCtrl, pOut, L, action ); + } + + /*************************/ + /* Update output buffer. */ + /*************************/ + SKP_memcpy( psDec->outBuf, pOut, L * sizeof( SKP_int16 ) ); + + /****************************************************************/ + /* Ensure smooth connection of extrapolated and good frames */ + /****************************************************************/ + SKP_Silk_PLC_glue_frames( psDec, &sDecCtrl, pOut, L ); + + /************************************************/ + /* Comfort noise generation / estimation */ + /************************************************/ + SKP_Silk_CNG( psDec, &sDecCtrl, pOut , L ); + + /********************************************/ + /* HP filter output */ + /********************************************/ + SKP_assert( ( ( psDec->fs_kHz == 12 ) && ( L % 3 ) == 0 ) || + ( ( psDec->fs_kHz != 12 ) && ( L % 2 ) == 0 ) ); + SKP_Silk_biquad( pOut, psDec->HP_B, psDec->HP_A, psDec->HPState, pOut, L ); + + /********************************************/ + /* set output frame length */ + /********************************************/ + *pN = ( SKP_int16 )L; + + /* Update some decoder state variables */ + psDec->lagPrev = sDecCtrl.pitchL[ NB_SUBFR - 1 ]; + + + return ret; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_parameters.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_parameters.c new file mode 100755 index 0000000..9dc6935 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_parameters.c @@ -0,0 +1,244 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* Decode parameters from payload */ +void SKP_Silk_decode_parameters( + SKP_Silk_decoder_state *psDec, /* I/O State */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int q[], /* O Excitation signal */ + const SKP_int fullDecoding /* I Flag to tell if only arithmetic decoding */ +) +{ + SKP_int i, k, Ix, fs_kHz_dec, nBytesUsed; + SKP_int Ixs[ NB_SUBFR ]; + SKP_int GainsIndices[ NB_SUBFR ]; + SKP_int NLSFIndices[ NLSF_MSVQ_MAX_CB_STAGES ]; + SKP_int pNLSF_Q15[ MAX_LPC_ORDER ], pNLSF0_Q15[ MAX_LPC_ORDER ]; + const SKP_int16 *cbk_ptr_Q14; + const SKP_Silk_NLSF_CB_struct *psNLSF_CB = NULL; + SKP_Silk_range_coder_state *psRC = &psDec->sRC; + + /************************/ + /* Decode sampling rate */ + /************************/ + /* only done for first frame of packet */ + if( psDec->nFramesDecoded == 0 ) { + SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_SamplingRates_CDF, SKP_Silk_SamplingRates_offset ); + + /* check that sampling rate is supported */ + if( Ix < 0 || Ix > 3 ) { + psRC->error = RANGE_CODER_ILLEGAL_SAMPLING_RATE; + return; + } + fs_kHz_dec = SKP_Silk_SamplingRates_table[ Ix ]; + SKP_Silk_decoder_set_fs( psDec, fs_kHz_dec ); + } + + /*******************************************/ + /* Decode signal type and quantizer offset */ + /*******************************************/ + if( psDec->nFramesDecoded == 0 ) { + /* first frame in packet: independent coding */ + SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_type_offset_CDF, SKP_Silk_type_offset_CDF_offset ); + } else { + /* condidtional coding */ + SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_type_offset_joint_CDF[ psDec->typeOffsetPrev ], + SKP_Silk_type_offset_CDF_offset ); + } + psDecCtrl->sigtype = SKP_RSHIFT( Ix, 1 ); + psDecCtrl->QuantOffsetType = Ix & 1; + psDec->typeOffsetPrev = Ix; + + /****************/ + /* Decode gains */ + /****************/ + /* first subframe */ + if( psDec->nFramesDecoded == 0 ) { + /* first frame in packet: independent coding */ + SKP_Silk_range_decoder( &GainsIndices[ 0 ], psRC, SKP_Silk_gain_CDF[ psDecCtrl->sigtype ], SKP_Silk_gain_CDF_offset ); + } else { + /* condidtional coding */ + SKP_Silk_range_decoder( &GainsIndices[ 0 ], psRC, SKP_Silk_delta_gain_CDF, SKP_Silk_delta_gain_CDF_offset ); + } + + /* remaining subframes */ + for( i = 1; i < NB_SUBFR; i++ ) { + SKP_Silk_range_decoder( &GainsIndices[ i ], psRC, SKP_Silk_delta_gain_CDF, SKP_Silk_delta_gain_CDF_offset ); + } + + /* Dequant Gains */ + SKP_Silk_gains_dequant( psDecCtrl->Gains_Q16, GainsIndices, &psDec->LastGainIndex, psDec->nFramesDecoded ); + /****************/ + /* Decode NLSFs */ + /****************/ + /* Set pointer to NLSF VQ CB for the current signal type */ + psNLSF_CB = psDec->psNLSF_CB[ psDecCtrl->sigtype ]; + + /* Range decode NLSF path */ + SKP_Silk_range_decoder_multi( NLSFIndices, psRC, psNLSF_CB->StartPtr, psNLSF_CB->MiddleIx, psNLSF_CB->nStages ); + + /* From the NLSF path, decode an NLSF vector */ + SKP_Silk_NLSF_MSVQ_decode( pNLSF_Q15, psNLSF_CB, NLSFIndices, psDec->LPC_order ); + + /************************************/ + /* Decode NLSF interpolation factor */ + /************************************/ + SKP_Silk_range_decoder( &psDecCtrl->NLSFInterpCoef_Q2, psRC, SKP_Silk_NLSF_interpolation_factor_CDF, + SKP_Silk_NLSF_interpolation_factor_offset ); + + /* If just reset, e.g., because internal Fs changed, do not allow interpolation */ + /* improves the case of packet loss in the first frame after a switch */ + if( psDec->first_frame_after_reset == 1 ) { + psDecCtrl->NLSFInterpCoef_Q2 = 4; + } + + if( fullDecoding ) { + /* Convert NLSF parameters to AR prediction filter coefficients */ + SKP_Silk_NLSF2A_stable( psDecCtrl->PredCoef_Q12[ 1 ], pNLSF_Q15, psDec->LPC_order ); + + if( psDecCtrl->NLSFInterpCoef_Q2 < 4 ) { + /* Calculation of the interpolated NLSF0 vector from the interpolation factor, */ + /* the previous NLSF1, and the current NLSF1 */ + for( i = 0; i < psDec->LPC_order; i++ ) { + pNLSF0_Q15[ i ] = psDec->prevNLSF_Q15[ i ] + SKP_RSHIFT( SKP_MUL( psDecCtrl->NLSFInterpCoef_Q2, + ( pNLSF_Q15[ i ] - psDec->prevNLSF_Q15[ i ] ) ), 2 ); + } + + /* Convert NLSF parameters to AR prediction filter coefficients */ + SKP_Silk_NLSF2A_stable( psDecCtrl->PredCoef_Q12[ 0 ], pNLSF0_Q15, psDec->LPC_order ); + } else { + /* Copy LPC coefficients for first half from second half */ + SKP_memcpy( psDecCtrl->PredCoef_Q12[ 0 ], psDecCtrl->PredCoef_Q12[ 1 ], + psDec->LPC_order * sizeof( SKP_int16 ) ); + } + } + + SKP_memcpy( psDec->prevNLSF_Q15, pNLSF_Q15, psDec->LPC_order * sizeof( SKP_int ) ); + + /* After a packet loss do BWE of LPC coefs */ + if( psDec->lossCnt ) { + SKP_Silk_bwexpander( psDecCtrl->PredCoef_Q12[ 0 ], psDec->LPC_order, BWE_AFTER_LOSS_Q16 ); + SKP_Silk_bwexpander( psDecCtrl->PredCoef_Q12[ 1 ], psDec->LPC_order, BWE_AFTER_LOSS_Q16 ); + } + + if( psDecCtrl->sigtype == SIG_TYPE_VOICED ) { + /*********************/ + /* Decode pitch lags */ + /*********************/ + /* Get lag index */ + if( psDec->fs_kHz == 8 ) { + SKP_Silk_range_decoder( &Ixs[ 0 ], psRC, SKP_Silk_pitch_lag_NB_CDF, SKP_Silk_pitch_lag_NB_CDF_offset ); + } else if( psDec->fs_kHz == 12 ) { + SKP_Silk_range_decoder( &Ixs[ 0 ], psRC, SKP_Silk_pitch_lag_MB_CDF, SKP_Silk_pitch_lag_MB_CDF_offset ); + } else if( psDec->fs_kHz == 16 ) { + SKP_Silk_range_decoder( &Ixs[ 0 ], psRC, SKP_Silk_pitch_lag_WB_CDF, SKP_Silk_pitch_lag_WB_CDF_offset ); + } else { + SKP_Silk_range_decoder( &Ixs[ 0 ], psRC, SKP_Silk_pitch_lag_SWB_CDF, SKP_Silk_pitch_lag_SWB_CDF_offset ); + } + + /* Get countour index */ + if( psDec->fs_kHz == 8 ) { + /* Less codevectors used in 8 khz mode */ + SKP_Silk_range_decoder( &Ixs[ 1 ], psRC, SKP_Silk_pitch_contour_NB_CDF, SKP_Silk_pitch_contour_NB_CDF_offset ); + } else { + /* Joint for 12, 16, and 24 khz */ + SKP_Silk_range_decoder( &Ixs[ 1 ], psRC, SKP_Silk_pitch_contour_CDF, SKP_Silk_pitch_contour_CDF_offset ); + } + + /* Decode pitch values */ + SKP_Silk_decode_pitch( Ixs[ 0 ], Ixs[ 1 ], psDecCtrl->pitchL, psDec->fs_kHz ); + + /********************/ + /* Decode LTP gains */ + /********************/ + /* Decode PERIndex value */ + SKP_Silk_range_decoder( &psDecCtrl->PERIndex, psRC, SKP_Silk_LTP_per_index_CDF, + SKP_Silk_LTP_per_index_CDF_offset ); + + /* Decode Codebook Index */ + cbk_ptr_Q14 = SKP_Silk_LTP_vq_ptrs_Q14[ psDecCtrl->PERIndex ]; /* set pointer to start of codebook */ + + for( k = 0; k < NB_SUBFR; k++ ) { + SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_LTP_gain_CDF_ptrs[ psDecCtrl->PERIndex ], + SKP_Silk_LTP_gain_CDF_offsets[ psDecCtrl->PERIndex ] ); + + for( i = 0; i < LTP_ORDER; i++ ) { + psDecCtrl->LTPCoef_Q14[ k * LTP_ORDER + i ] = cbk_ptr_Q14[ Ix * LTP_ORDER + i ]; + } + } + + /**********************/ + /* Decode LTP scaling */ + /**********************/ + SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_LTPscale_CDF, SKP_Silk_LTPscale_offset ); + psDecCtrl->LTP_scale_Q14 = SKP_Silk_LTPScales_table_Q14[ Ix ]; + } else { + SKP_assert( psDecCtrl->sigtype == SIG_TYPE_UNVOICED ); + SKP_memset( psDecCtrl->pitchL, 0, NB_SUBFR * sizeof( SKP_int ) ); + SKP_memset( psDecCtrl->LTPCoef_Q14, 0, LTP_ORDER * NB_SUBFR * sizeof( SKP_int16 ) ); + psDecCtrl->PERIndex = 0; + psDecCtrl->LTP_scale_Q14 = 0; + } + + /***************/ + /* Decode seed */ + /***************/ + SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_Seed_CDF, SKP_Silk_Seed_offset ); + psDecCtrl->Seed = ( SKP_int32 )Ix; + /*********************************************/ + /* Decode quantization indices of excitation */ + /*********************************************/ + SKP_Silk_decode_pulses( psRC, psDecCtrl, q, psDec->frame_length ); + + /*********************************************/ + /* Decode VAD flag */ + /*********************************************/ + SKP_Silk_range_decoder( &psDec->vadFlag, psRC, SKP_Silk_vadflag_CDF, SKP_Silk_vadflag_offset ); + + /**************************************/ + /* Decode Frame termination indicator */ + /**************************************/ + SKP_Silk_range_decoder( &psDec->FrameTermination, psRC, SKP_Silk_FrameTermination_CDF, SKP_Silk_FrameTermination_offset ); + + /****************************************/ + /* get number of bytes used so far */ + /****************************************/ + SKP_Silk_range_coder_get_length( psRC, &nBytesUsed ); + psDec->nBytesLeft = psRC->bufferLength - nBytesUsed; + if( psDec->nBytesLeft < 0 ) { + psRC->error = RANGE_CODER_READ_BEYOND_BUFFER; + } + + /****************************************/ + /* check remaining bits in last byte */ + /****************************************/ + if( psDec->nBytesLeft == 0 ) { + SKP_Silk_range_coder_check_after_decoding( psRC ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_pitch.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_pitch.c new file mode 100755 index 0000000..6c18a94 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_pitch.c @@ -0,0 +1,57 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/*********************************************************** +* Pitch analyser function +********************************************************** */ +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_common_pitch_est_defines.h" + +void SKP_Silk_decode_pitch( + SKP_int lagIndex, /* I */ + SKP_int contourIndex, /* O */ + SKP_int pitch_lags[], /* O 4 pitch values */ + SKP_int Fs_kHz /* I sampling frequency (kHz) */ +) +{ + SKP_int lag, i, min_lag; + + min_lag = SKP_SMULBB( PITCH_EST_MIN_LAG_MS, Fs_kHz ); + + /* Only for 24 / 16 kHz version for now */ + lag = min_lag + lagIndex; + if( Fs_kHz == 8 ) { + /* Only a small codebook for 8 khz */ + for( i = 0; i < PITCH_EST_NB_SUBFR; i++ ) { + pitch_lags[ i ] = lag + SKP_Silk_CB_lags_stage2[ i ][ contourIndex ]; + } + } else { + for( i = 0; i < PITCH_EST_NB_SUBFR; i++ ) { + pitch_lags[ i ] = lag + SKP_Silk_CB_lags_stage3[ i ][ contourIndex ]; + } + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_pulses.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_pulses.c new file mode 100755 index 0000000..19ad210 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decode_pulses.c @@ -0,0 +1,105 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/*********************************************/ +/* Decode quantization indices of excitation */ +/*********************************************/ +void SKP_Silk_decode_pulses( + SKP_Silk_range_coder_state *psRC, /* I/O Range coder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int q[], /* O Excitation signal */ + const SKP_int frame_length /* I Frame length (preliminary) */ +) +{ + SKP_int i, j, k, iter, abs_q, nLS, bit; + SKP_int sum_pulses[ MAX_NB_SHELL_BLOCKS ], nLshifts[ MAX_NB_SHELL_BLOCKS ]; + SKP_int *pulses_ptr; + const SKP_uint16 *cdf_ptr; + + /*********************/ + /* Decode rate level */ + /*********************/ + SKP_Silk_range_decoder( &psDecCtrl->RateLevelIndex, psRC, + SKP_Silk_rate_levels_CDF[ psDecCtrl->sigtype ], SKP_Silk_rate_levels_CDF_offset ); + + /* Calculate number of shell blocks */ + iter = frame_length / SHELL_CODEC_FRAME_LENGTH; + + /***************************************************/ + /* Sum-Weighted-Pulses Decoding */ + /***************************************************/ + cdf_ptr = SKP_Silk_pulses_per_block_CDF[ psDecCtrl->RateLevelIndex ]; + for( i = 0; i < iter; i++ ) { + nLshifts[ i ] = 0; + SKP_Silk_range_decoder( &sum_pulses[ i ], psRC, cdf_ptr, SKP_Silk_pulses_per_block_CDF_offset ); + + /* LSB indication */ + while( sum_pulses[ i ] == ( MAX_PULSES + 1 ) ) { + nLshifts[ i ]++; + SKP_Silk_range_decoder( &sum_pulses[ i ], psRC, + SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS - 1 ], SKP_Silk_pulses_per_block_CDF_offset ); + } + } + + /***************************************************/ + /* Shell decoding */ + /***************************************************/ + for( i = 0; i < iter; i++ ) { + if( sum_pulses[ i ] > 0 ) { + SKP_Silk_shell_decoder( &q[ SKP_SMULBB( i, SHELL_CODEC_FRAME_LENGTH ) ], psRC, sum_pulses[ i ] ); + } else { + SKP_memset( &q[ SKP_SMULBB( i, SHELL_CODEC_FRAME_LENGTH ) ], 0, SHELL_CODEC_FRAME_LENGTH * sizeof( SKP_int ) ); + } + } + + /***************************************************/ + /* LSB Decoding */ + /***************************************************/ + for( i = 0; i < iter; i++ ) { + if( nLshifts[ i ] > 0 ) { + nLS = nLshifts[ i ]; + pulses_ptr = &q[ SKP_SMULBB( i, SHELL_CODEC_FRAME_LENGTH ) ]; + for( k = 0; k < SHELL_CODEC_FRAME_LENGTH; k++ ) { + abs_q = pulses_ptr[ k ]; + for( j = 0; j < nLS; j++ ) { + abs_q = SKP_LSHIFT( abs_q, 1 ); + SKP_Silk_range_decoder( &bit, psRC, SKP_Silk_lsb_CDF, 1 ); + abs_q += bit; + } + pulses_ptr[ k ] = abs_q; + } + } + } + + /****************************************/ + /* Decode and add signs to pulse signal */ + /****************************************/ + SKP_Silk_decode_signs( psRC, q, frame_length, psDecCtrl->sigtype, + psDecCtrl->QuantOffsetType, psDecCtrl->RateLevelIndex); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decoder_set_fs.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decoder_set_fs.c new file mode 100755 index 0000000..4b15f27 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_decoder_set_fs.c @@ -0,0 +1,80 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* Set decoder sampling rate */ +void SKP_Silk_decoder_set_fs( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state pointer */ + SKP_int fs_kHz /* I Sampling frequency (kHz) */ +) +{ + if( psDec->fs_kHz != fs_kHz ) { + psDec->fs_kHz = fs_kHz; + psDec->frame_length = SKP_SMULBB( FRAME_LENGTH_MS, fs_kHz ); + psDec->subfr_length = SKP_SMULBB( FRAME_LENGTH_MS / NB_SUBFR, fs_kHz ); + if( psDec->fs_kHz == 8 ) { + psDec->LPC_order = MIN_LPC_ORDER; + psDec->psNLSF_CB[ 0 ] = &SKP_Silk_NLSF_CB0_10; + psDec->psNLSF_CB[ 1 ] = &SKP_Silk_NLSF_CB1_10; + } else { + psDec->LPC_order = MAX_LPC_ORDER; + psDec->psNLSF_CB[ 0 ] = &SKP_Silk_NLSF_CB0_16; + psDec->psNLSF_CB[ 1 ] = &SKP_Silk_NLSF_CB1_16; + } + /* Reset part of the decoder state */ + SKP_memset( psDec->sLPC_Q14, 0, MAX_LPC_ORDER * sizeof( SKP_int32 ) ); + SKP_memset( psDec->outBuf, 0, MAX_FRAME_LENGTH * sizeof( SKP_int16 ) ); + SKP_memset( psDec->prevNLSF_Q15, 0, MAX_LPC_ORDER * sizeof( SKP_int ) ); + + psDec->lagPrev = 100; + psDec->LastGainIndex = 1; + psDec->prev_sigtype = 0; + psDec->first_frame_after_reset = 1; + + if( fs_kHz == 24 ) { + psDec->HP_A = SKP_Silk_Dec_A_HP_24; + psDec->HP_B = SKP_Silk_Dec_B_HP_24; + } else if( fs_kHz == 16 ) { + psDec->HP_A = SKP_Silk_Dec_A_HP_16; + psDec->HP_B = SKP_Silk_Dec_B_HP_16; + } else if( fs_kHz == 12 ) { + psDec->HP_A = SKP_Silk_Dec_A_HP_12; + psDec->HP_B = SKP_Silk_Dec_B_HP_12; + } else if( fs_kHz == 8 ) { + psDec->HP_A = SKP_Silk_Dec_A_HP_8; + psDec->HP_B = SKP_Silk_Dec_B_HP_8; + } else { + /* unsupported sampling rate */ + SKP_assert( 0 ); + } + } + + /* Check that settings are valid */ + SKP_assert( psDec->frame_length > 0 && psDec->frame_length <= MAX_FRAME_LENGTH ); +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_define.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_define.h new file mode 100755 index 0000000..ad6f7d5 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_define.h @@ -0,0 +1,306 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_DEFINE_H +#define SKP_SILK_DEFINE_H + +#include "SKP_Silk_errors.h" +#include "SKP_Silk_typedef.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + +#define MAX_FRAMES_PER_PACKET 5 + + + +/* Limits on bitrate */ +#define MIN_TARGET_RATE_BPS 5000 +#define MAX_TARGET_RATE_BPS 100000 + +/* Transition bitrates between modes */ +#define SWB2WB_BITRATE_BPS 25000 +#define WB2SWB_BITRATE_BPS 30000 +#define WB2MB_BITRATE_BPS 14000 +#define MB2WB_BITRATE_BPS 18000 +#define MB2NB_BITRATE_BPS 10000 +#define NB2MB_BITRATE_BPS 14000 + +/* Integration/hysteresis threshold for lowering internal sample frequency */ +/* 30000000 -> 6 sec if bitrate is 5000 bps below limit; 3 sec if bitrate is 10000 bps below limit */ +#define ACCUM_BITS_DIFF_THRESHOLD 30000000 +#define TARGET_RATE_TAB_SZ 8 + +/* DTX settings */ +#define NO_SPEECH_FRAMES_BEFORE_DTX 5 /* eq 100 ms */ +#define MAX_CONSECUTIVE_DTX 20 /* eq 400 ms */ + +#define USE_LBRR 1 + +/* Amount of concecutive no FEC packets before telling JB */ +#define NO_LBRR_THRES 10 + +/* Maximum delay between real packet and LBRR packet */ +#define MAX_LBRR_DELAY 2 +#define LBRR_IDX_MASK 1 + +#define INBAND_FEC_MIN_RATE_BPS 18000 /* Dont use inband FEC below this total target rate */ +#define LBRR_LOSS_THRES 1 /* Start adding LBRR at this loss rate */ + +/* LBRR usage defines */ +#define SKP_SILK_NO_LBRR 0 /* No LBRR information for this packet */ +#define SKP_SILK_ADD_LBRR_TO_PLUS1 1 /* Add LBRR for this packet to packet n + 1 */ +#define SKP_SILK_ADD_LBRR_TO_PLUS2 2 /* Add LBRR for this packet to packet n + 2 */ + +/* Frame termination indicator defines */ +#define SKP_SILK_LAST_FRAME 0 /* Last frames in packet */ +#define SKP_SILK_MORE_FRAMES 1 /* More frames to follow this one */ +#define SKP_SILK_LBRR_VER1 2 /* LBRR information from packet n - 1 */ +#define SKP_SILK_LBRR_VER2 3 /* LBRR information from packet n - 2 */ +#define SKP_SILK_EXT_LAYER 4 /* Extension layers added */ + +/* Number of Second order Sections for SWB detection HP filter */ +#define NB_SOS 3 +#define HP_8_KHZ_THRES 10 /* average energy per sample, above 8 kHz */ +#define CONCEC_SWB_SMPLS_THRES 480 * 15 /* 300 ms */ +#define WB_DETECT_ACTIVE_SPEECH_MS_THRES 15000 /* ms of active speech needed for WB detection */ + +/* Low complexity setting */ +#define LOW_COMPLEXITY_ONLY 0 + +/* Activate bandwidth transition filtering for mode switching */ +#define SWITCH_TRANSITION_FILTERING 1 + +/* Decoder Parameters */ +#define DEC_HP_ORDER 2 + +/* Maximum sampling frequency, should be 16 for some embedded platforms */ +#define MAX_FS_KHZ 24 +#define MAX_API_FS_KHZ 48 + +/* Signal Types used by silk */ +#define SIG_TYPE_VOICED 0 +#define SIG_TYPE_UNVOICED 1 + +/* VAD Types used by silk */ +#define NO_VOICE_ACTIVITY 0 +#define VOICE_ACTIVITY 1 + +/* Number of samples per frame */ +#define FRAME_LENGTH_MS 20 +#define MAX_FRAME_LENGTH ( FRAME_LENGTH_MS * MAX_FS_KHZ ) + +/* Milliseconds of lookahead for pitch analysis */ +#define LA_PITCH_MS 2 +#define LA_PITCH_MAX ( LA_PITCH_MS * MAX_FS_KHZ ) + +/* Length of LPC window used in find pitch */ +#define FIND_PITCH_LPC_WIN_MS ( 20 + (LA_PITCH_MS << 1) ) +#define FIND_PITCH_LPC_WIN_MAX ( FIND_PITCH_LPC_WIN_MS * MAX_FS_KHZ ) + +/* Order of LPC used in find pitch */ +#define MAX_FIND_PITCH_LPC_ORDER 16 + +#define PITCH_EST_COMPLEXITY_HC_MODE SKP_Silk_PITCH_EST_MAX_COMPLEX +#define PITCH_EST_COMPLEXITY_MC_MODE SKP_Silk_PITCH_EST_MID_COMPLEX +#define PITCH_EST_COMPLEXITY_LC_MODE SKP_Silk_PITCH_EST_MIN_COMPLEX + +/* Milliseconds of lookahead for noise shape analysis */ +#define LA_SHAPE_MS 5 +#define LA_SHAPE_MAX ( LA_SHAPE_MS * MAX_FS_KHZ ) + +/* Max length of LPC window used in noise shape analysis */ +#define SHAPE_LPC_WIN_MAX ( 15 * MAX_FS_KHZ ) + +/* Max number of bytes in payload output buffer (may contain multiple frames) */ +#define MAX_ARITHM_BYTES 1024 + +#define RANGE_CODER_WRITE_BEYOND_BUFFER -1 +#define RANGE_CODER_CDF_OUT_OF_RANGE -2 +#define RANGE_CODER_NORMALIZATION_FAILED -3 +#define RANGE_CODER_ZERO_INTERVAL_WIDTH -4 +#define RANGE_CODER_DECODER_CHECK_FAILED -5 +#define RANGE_CODER_READ_BEYOND_BUFFER -6 +#define RANGE_CODER_ILLEGAL_SAMPLING_RATE -7 +#define RANGE_CODER_DEC_PAYLOAD_TOO_LONG -8 + +/* dB level of lowest gain quantization level */ +#define MIN_QGAIN_DB 6 +/* dB level of highest gain quantization level */ +#define MAX_QGAIN_DB 86 +/* Number of gain quantization levels */ +#define N_LEVELS_QGAIN 64 +/* Max increase in gain quantization index */ +#define MAX_DELTA_GAIN_QUANT 40 +/* Max decrease in gain quantization index */ +#define MIN_DELTA_GAIN_QUANT -4 + +/* Quantization offsets (multiples of 4) */ +#define OFFSET_VL_Q10 32 +#define OFFSET_VH_Q10 100 +#define OFFSET_UVL_Q10 100 +#define OFFSET_UVH_Q10 256 + +/* Maximum numbers of iterations used to stabilize a LPC vector */ +#define MAX_LPC_STABILIZE_ITERATIONS 20 + +#define MAX_LPC_ORDER 16 +#define MIN_LPC_ORDER 10 + +/* Find Pred Coef defines */ +#define LTP_ORDER 5 + +/* LTP quantization settings */ +#define NB_LTP_CBKS 3 + +/* Number of subframes */ +#define NB_SUBFR 4 + +/* Flag to use harmonic noise shaping */ +#define USE_HARM_SHAPING 1 + +/* Max LPC order of noise shaping filters */ +#define MAX_SHAPE_LPC_ORDER 16 + +#define HARM_SHAPE_FIR_TAPS 3 + +/* Maximum number of delayed decision states */ +#define MAX_DEL_DEC_STATES 4 + +#define LTP_BUF_LENGTH 512 +#define LTP_MASK (LTP_BUF_LENGTH - 1) + +#define DECISION_DELAY 32 +#define DECISION_DELAY_MASK (DECISION_DELAY - 1) + +/* number of subframes for excitation entropy coding */ +#define SHELL_CODEC_FRAME_LENGTH 16 +#define MAX_NB_SHELL_BLOCKS (MAX_FRAME_LENGTH / SHELL_CODEC_FRAME_LENGTH) + +/* number of rate levels, for entropy coding of excitation */ +#define N_RATE_LEVELS 10 + +/* maximum sum of pulses per shell coding frame */ +#define MAX_PULSES 18 + +#define MAX_MATRIX_SIZE MAX_LPC_ORDER /* Max of LPC Order and LTP order */ + +#if( MAX_LPC_ORDER > DECISION_DELAY ) +# define NSQ_LPC_BUF_LENGTH MAX_LPC_ORDER +#else +# define NSQ_LPC_BUF_LENGTH DECISION_DELAY +#endif + +/***********************/ +/* High pass filtering */ +/***********************/ +#define HIGH_PASS_INPUT 1 + +/***************************/ +/* Voice activity detector */ +/***************************/ +#define VAD_N_BANDS 4 + +#define VAD_INTERNAL_SUBFRAMES_LOG2 2 +#define VAD_INTERNAL_SUBFRAMES (1 << VAD_INTERNAL_SUBFRAMES_LOG2) + +#define VAD_NOISE_LEVEL_SMOOTH_COEF_Q16 1024 /* Must be < 4096 */ +#define VAD_NOISE_LEVELS_BIAS 50 + +/* Sigmoid settings */ +#define VAD_NEGATIVE_OFFSET_Q5 128 /* sigmoid is 0 at -128 */ +#define VAD_SNR_FACTOR_Q16 45000 + +/* smoothing for SNR measurement */ +#define VAD_SNR_SMOOTH_COEF_Q18 4096 + +/******************/ +/* NLSF quantizer */ +/******************/ +# define NLSF_MSVQ_MAX_CB_STAGES 10 /* Update manually when changing codebooks */ +# define NLSF_MSVQ_MAX_VECTORS_IN_STAGE 128 /* Update manually when changing codebooks */ +# define NLSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END 16 /* Update manually when changing codebooks */ + +#define NLSF_MSVQ_FLUCTUATION_REDUCTION 1 +#define MAX_NLSF_MSVQ_SURVIVORS 16 +#define MAX_NLSF_MSVQ_SURVIVORS_LC_MODE 2 +#define MAX_NLSF_MSVQ_SURVIVORS_MC_MODE 4 + +/* Based on above defines, calculate how much memory is necessary to allocate */ +#if( NLSF_MSVQ_MAX_VECTORS_IN_STAGE > ( MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * NLSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END ) ) +# define NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED_LC_MODE NLSF_MSVQ_MAX_VECTORS_IN_STAGE +#else +# define NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED_LC_MODE MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * NLSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END +#endif + +#if( NLSF_MSVQ_MAX_VECTORS_IN_STAGE > ( MAX_NLSF_MSVQ_SURVIVORS * NLSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END ) ) +# define NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED NLSF_MSVQ_MAX_VECTORS_IN_STAGE +#else +# define NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED MAX_NLSF_MSVQ_SURVIVORS * NLSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END +#endif + +#define NLSF_MSVQ_SURV_MAX_REL_RD 0.1f /* Must be < 0.5 */ + +/* Transition filtering for mode switching */ +#if SWITCH_TRANSITION_FILTERING +# define TRANSITION_TIME_UP_MS 5120 // 5120 = 64 * FRAME_LENGTH_MS * ( TRANSITION_INT_NUM - 1 ) = 64*(20*4) +# define TRANSITION_TIME_DOWN_MS 2560 // 2560 = 32 * FRAME_LENGTH_MS * ( TRANSITION_INT_NUM - 1 ) = 32*(20*4) +# define TRANSITION_NB 3 /* Hardcoded in tables */ +# define TRANSITION_NA 2 /* Hardcoded in tables */ +# define TRANSITION_INT_NUM 5 /* Hardcoded in tables */ +# define TRANSITION_FRAMES_UP ( TRANSITION_TIME_UP_MS / FRAME_LENGTH_MS ) +# define TRANSITION_FRAMES_DOWN ( TRANSITION_TIME_DOWN_MS / FRAME_LENGTH_MS ) +# define TRANSITION_INT_STEPS_UP ( TRANSITION_FRAMES_UP / ( TRANSITION_INT_NUM - 1 ) ) +# define TRANSITION_INT_STEPS_DOWN ( TRANSITION_FRAMES_DOWN / ( TRANSITION_INT_NUM - 1 ) ) +#endif + +/* Row based */ +#define matrix_ptr(Matrix_base_adr, row, column, N) *(Matrix_base_adr + ((row)*(N)+(column))) +#define matrix_adr(Matrix_base_adr, row, column, N) (Matrix_base_adr + ((row)*(N)+(column))) + +/* Column based */ +#ifndef matrix_c_ptr +# define matrix_c_ptr(Matrix_base_adr, row, column, M) *(Matrix_base_adr + ((row)+(M)*(column))) +#endif +#define matrix_c_adr(Matrix_base_adr, row, column, M) (Matrix_base_adr + ((row)+(M)*(column))) + +/* BWE factors to apply after packet loss */ +#define BWE_AFTER_LOSS_Q16 63570 + +/* Defines for CN generation */ +#define CNG_BUF_MASK_MAX 255 /* 2^floor(log2(MAX_FRAME_LENGTH))-1 */ +#define CNG_GAIN_SMTH_Q16 4634 /* 0.25^(1/4) */ +#define CNG_NLSF_SMTH_Q16 16348 /* 0.25 */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_detect_SWB_input.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_detect_SWB_input.c new file mode 100755 index 0000000..87c80c7 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_detect_SWB_input.c @@ -0,0 +1,76 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* + * Detect SWB input by measuring energy above 8 kHz. + */ + +#include "SKP_Silk_main.h" + +void SKP_Silk_detect_SWB_input( + SKP_Silk_detect_SWB_state *psSWBdetect, /* (I/O) encoder state */ + const SKP_int16 samplesIn[], /* (I) input to encoder */ + SKP_int nSamplesIn /* (I) length of input */ +) +{ + SKP_int HP_8_kHz_len, i, shift; + SKP_int16 in_HP_8_kHz[ MAX_FRAME_LENGTH ]; + SKP_int32 energy_32; + + /* High pass filter with cutoff at 8 khz */ + HP_8_kHz_len = SKP_min_int( nSamplesIn, MAX_FRAME_LENGTH ); + HP_8_kHz_len = SKP_max_int( HP_8_kHz_len, 0 ); + + /* Cutoff around 9 khz */ + /* A = conv(conv([8192,14613, 6868], [8192,12883, 7337]), [8192,11586, 7911]); */ + /* B = conv(conv([575, -948, 575], [575, -221, 575]), [575, 104, 575]); */ + SKP_Silk_biquad( samplesIn, SKP_Silk_SWB_detect_B_HP_Q13[ 0 ], SKP_Silk_SWB_detect_A_HP_Q13[ 0 ], + psSWBdetect->S_HP_8_kHz[ 0 ], in_HP_8_kHz, HP_8_kHz_len ); + for( i = 1; i < NB_SOS; i++ ) { + SKP_Silk_biquad( in_HP_8_kHz, SKP_Silk_SWB_detect_B_HP_Q13[ i ], SKP_Silk_SWB_detect_A_HP_Q13[ i ], + psSWBdetect->S_HP_8_kHz[ i ], in_HP_8_kHz, HP_8_kHz_len ); + } + + /* Calculate energy in HP signal */ + SKP_Silk_sum_sqr_shift( &energy_32, &shift, in_HP_8_kHz, HP_8_kHz_len ); + + /* Count concecutive samples above threshold, after adjusting threshold for number of input samples and shift */ + if( energy_32 > SKP_RSHIFT( SKP_SMULBB( HP_8_KHZ_THRES, HP_8_kHz_len ), shift ) ) { + psSWBdetect->ConsecSmplsAboveThres += nSamplesIn; + if( psSWBdetect->ConsecSmplsAboveThres > CONCEC_SWB_SMPLS_THRES ) { + psSWBdetect->SWB_detected = 1; + } + } else { + psSWBdetect->ConsecSmplsAboveThres -= nSamplesIn; + psSWBdetect->ConsecSmplsAboveThres = SKP_max( psSWBdetect->ConsecSmplsAboveThres, 0 ); + } + + /* If sufficient speech activity and no SWB detected, we detect the signal as being WB */ + if( ( psSWBdetect->ActiveSpeech_ms > WB_DETECT_ACTIVE_SPEECH_MS_THRES ) && ( psSWBdetect->SWB_detected == 0 ) ) { + psSWBdetect->WB_detected = 1; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_enc_API.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_enc_API.c new file mode 100755 index 0000000..e558766 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_enc_API.c @@ -0,0 +1,247 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + + +#include "SKP_Silk_define.h" +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_SDK_API.h" +#include "SKP_Silk_control.h" +#include "SKP_Silk_typedef.h" +#include "SKP_Silk_structs.h" +#define SKP_Silk_EncodeControlStruct SKP_SILK_SDK_EncControlStruct + +/****************************************/ +/* Encoder functions */ +/****************************************/ + +SKP_int SKP_Silk_SDK_Get_Encoder_Size( SKP_int32 *encSizeBytes ) +{ + SKP_int ret = 0; + + *encSizeBytes = sizeof( SKP_Silk_encoder_state_FLP ); + + return ret; +} + + +/***************************************/ +/* Read control structure from encoder */ +/***************************************/ +SKP_int SKP_Silk_SDK_QueryEncoder( + const void *encState, /* I: State Vector */ + SKP_Silk_EncodeControlStruct *encStatus /* O: Control Structure */ +) +{ + SKP_Silk_encoder_state_FLP *psEnc; + SKP_int ret = 0; + + psEnc = ( SKP_Silk_encoder_state_FLP* )encState; + + encStatus->API_sampleRate = psEnc->sCmn.API_fs_Hz; + encStatus->maxInternalSampleRate = SKP_SMULBB( psEnc->sCmn.maxInternal_fs_kHz, 1000 ); + encStatus->packetSize = ( SKP_int )SKP_DIV32_16( psEnc->sCmn.API_fs_Hz * psEnc->sCmn.PacketSize_ms, 1000 ); /* convert samples -> ms */ + encStatus->bitRate = psEnc->sCmn.TargetRate_bps; + encStatus->packetLossPercentage = psEnc->sCmn.PacketLoss_perc; + encStatus->complexity = psEnc->sCmn.Complexity; + encStatus->useInBandFEC = psEnc->sCmn.useInBandFEC; + encStatus->useDTX = psEnc->sCmn.useDTX; + return ret; +} + +/*************************/ +/* Init or Reset encoder */ +/*************************/ +SKP_int SKP_Silk_SDK_InitEncoder( + void *encState, /* I/O: State */ + SKP_Silk_EncodeControlStruct *encStatus /* O: Control structure */ +) +{ + SKP_Silk_encoder_state_FLP *psEnc; + SKP_int ret = 0; + + + psEnc = ( SKP_Silk_encoder_state_FLP* )encState; + + /* Reset Encoder */ + if( ret += SKP_Silk_init_encoder_FLP( psEnc ) ) { + SKP_assert( 0 ); + } + + /* Read control structure */ + if( ret += SKP_Silk_SDK_QueryEncoder( encState, encStatus ) ) { + SKP_assert( 0 ); + } + + + return ret; +} + +/**************************/ +/* Encode frame with Silk */ +/**************************/ +SKP_int SKP_Silk_SDK_Encode( + void *encState, /* I/O: State */ + const SKP_Silk_EncodeControlStruct *encControl, /* I: Control structure */ + const SKP_int16 *samplesIn, /* I: Speech sample input vector */ + SKP_int nSamplesIn, /* I: Number of samples in input vector */ + SKP_uint8 *outData, /* O: Encoded output vector */ + SKP_int16 *nBytesOut /* I/O: Number of bytes in outData (input: Max bytes) */ +) +{ + SKP_int max_internal_fs_kHz, PacketSize_ms, PacketLoss_perc, UseInBandFEC, UseDTX, ret = 0; + SKP_int nSamplesToBuffer, Complexity, input_10ms, nSamplesFromInput = 0; + SKP_int32 TargetRate_bps, API_fs_Hz; + SKP_int16 MaxBytesOut; + SKP_Silk_encoder_state_FLP *psEnc = ( SKP_Silk_encoder_state_FLP* )encState; + + SKP_assert( encControl != NULL ); + + /* Check sampling frequency first, to avoid divide by zero later */ + if( ( ( encControl->API_sampleRate != 8000 ) && + ( encControl->API_sampleRate != 12000 ) && + ( encControl->API_sampleRate != 16000 ) && + ( encControl->API_sampleRate != 24000 ) && + ( encControl->API_sampleRate != 32000 ) && + ( encControl->API_sampleRate != 44100 ) && + ( encControl->API_sampleRate != 48000 ) ) || + ( ( encControl->maxInternalSampleRate != 8000 ) && + ( encControl->maxInternalSampleRate != 12000 ) && + ( encControl->maxInternalSampleRate != 16000 ) && + ( encControl->maxInternalSampleRate != 24000 ) ) ) { + ret = SKP_SILK_ENC_FS_NOT_SUPPORTED; + SKP_assert( 0 ); + return( ret ); + } + + /* Set encoder parameters from control structure */ + API_fs_Hz = encControl->API_sampleRate; + max_internal_fs_kHz = (SKP_int)( encControl->maxInternalSampleRate >> 10 ) + 1; /* convert Hz -> kHz */ + PacketSize_ms = SKP_DIV32( 1000 * (SKP_int)encControl->packetSize, API_fs_Hz ); + TargetRate_bps = encControl->bitRate; + PacketLoss_perc = encControl->packetLossPercentage; + UseInBandFEC = encControl->useInBandFEC; + Complexity = encControl->complexity; + UseDTX = encControl->useDTX; + + /* Save values in state */ + psEnc->sCmn.API_fs_Hz = API_fs_Hz; + psEnc->sCmn.maxInternal_fs_kHz = max_internal_fs_kHz; + psEnc->sCmn.useInBandFEC = UseInBandFEC; + + /* Only accept input lengths that are a multiple of 10 ms */ + input_10ms = SKP_DIV32( 100 * nSamplesIn, API_fs_Hz ); + if( input_10ms * API_fs_Hz != 100 * nSamplesIn || nSamplesIn < 0 ) { + ret = SKP_SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES; + SKP_assert( 0 ); + return( ret ); + } + + TargetRate_bps = SKP_LIMIT( TargetRate_bps, MIN_TARGET_RATE_BPS, MAX_TARGET_RATE_BPS ); + if( ( ret = SKP_Silk_control_encoder_FLP( psEnc, PacketSize_ms, TargetRate_bps, + PacketLoss_perc, UseDTX, Complexity) ) != 0 ) { + SKP_assert( 0 ); + return( ret ); + } + + /* Make sure no more than one packet can be produced */ + if( 1000 * (SKP_int32)nSamplesIn > psEnc->sCmn.PacketSize_ms * API_fs_Hz ) { + ret = SKP_SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES; + SKP_assert( 0 ); + return( ret ); + } + +#if MAX_FS_KHZ > 16 + /* Detect energy above 8 kHz */ + if( SKP_min( API_fs_Hz, 1000 * max_internal_fs_kHz ) == 24000 && + psEnc->sCmn.sSWBdetect.SWB_detected == 0 && + psEnc->sCmn.sSWBdetect.WB_detected == 0 ) { + SKP_Silk_detect_SWB_input( &psEnc->sCmn.sSWBdetect, samplesIn, ( SKP_int )nSamplesIn ); + } +#endif + + /* Input buffering/resampling and encoding */ + MaxBytesOut = 0; /* return 0 output bytes if no encoder called */ + while( 1 ) { + nSamplesToBuffer = psEnc->sCmn.frame_length - psEnc->sCmn.inputBufIx; + if( API_fs_Hz == SKP_SMULBB( 1000, psEnc->sCmn.fs_kHz ) ) { + nSamplesToBuffer = SKP_min_int( nSamplesToBuffer, nSamplesIn ); + nSamplesFromInput = nSamplesToBuffer; + /* Copy to buffer */ + SKP_memcpy( &psEnc->sCmn.inputBuf[ psEnc->sCmn.inputBufIx ], samplesIn, nSamplesFromInput * sizeof( SKP_int16 ) ); + } else { + nSamplesToBuffer = SKP_min( nSamplesToBuffer, 10 * input_10ms * psEnc->sCmn.fs_kHz ); + nSamplesFromInput = SKP_DIV32_16( nSamplesToBuffer * API_fs_Hz, psEnc->sCmn.fs_kHz * 1000 ); + /* Resample and write to buffer */ + ret += SKP_Silk_resampler( &psEnc->sCmn.resampler_state, + &psEnc->sCmn.inputBuf[ psEnc->sCmn.inputBufIx ], samplesIn, nSamplesFromInput ); + } + samplesIn += nSamplesFromInput; + nSamplesIn -= nSamplesFromInput; + psEnc->sCmn.inputBufIx += nSamplesToBuffer; + + /* Silk encoder */ + if( psEnc->sCmn.inputBufIx >= psEnc->sCmn.frame_length ) { + SKP_assert( psEnc->sCmn.inputBufIx == psEnc->sCmn.frame_length ); + + /* Enough data in input buffer, so encode */ + if( MaxBytesOut == 0 ) { + /* No payload obtained so far */ + MaxBytesOut = *nBytesOut; + if( ( ret = SKP_Silk_encode_frame_FLP( psEnc, outData, &MaxBytesOut, psEnc->sCmn.inputBuf ) ) != 0 ) { + SKP_assert( 0 ); + } + } else { + /* outData already contains a payload */ + if( ( ret = SKP_Silk_encode_frame_FLP( psEnc, outData, nBytesOut, psEnc->sCmn.inputBuf ) ) != 0 ) { + SKP_assert( 0 ); + } + /* Check that no second payload was created */ + SKP_assert( *nBytesOut == 0 ); + } + psEnc->sCmn.inputBufIx = 0; + psEnc->sCmn.controlled_since_last_payload = 0; + + if( nSamplesIn == 0 ) { + break; + } + } else { + break; + } + } + + *nBytesOut = MaxBytesOut; + if( psEnc->sCmn.useDTX && psEnc->sCmn.inDTX ) { + /* DTX simulation */ + *nBytesOut = 0; + } + + + + return ret; +} + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_frame_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_frame_FLP.c new file mode 100755 index 0000000..04f122c --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_frame_FLP.c @@ -0,0 +1,398 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +/****************/ +/* Encode frame */ +/****************/ +SKP_int SKP_Silk_encode_frame_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_uint8 *pCode, /* O Payload */ + SKP_int16 *pnBytesOut, /* I/O Number of payload bytes; */ + /* input: max length; output: used */ + const SKP_int16 *pIn /* I Input speech frame */ +) +{ + SKP_Silk_encoder_control_FLP sEncCtrl; + SKP_int k, nBytes, ret = 0; + SKP_float *x_frame, *res_pitch_frame; + SKP_int16 pIn_HP[ MAX_FRAME_LENGTH ]; + SKP_int16 pIn_HP_LP[ MAX_FRAME_LENGTH ]; + SKP_float xfw[ MAX_FRAME_LENGTH ]; + SKP_float res_pitch[ 2 * MAX_FRAME_LENGTH + LA_PITCH_MAX ]; + SKP_int LBRR_idx, frame_terminator; + + /* Low bitrate redundancy parameters */ + SKP_uint8 LBRRpayload[ MAX_ARITHM_BYTES ]; + SKP_int16 nBytesLBRR; + + const SKP_uint16 *FrameTermination_CDF; + + + sEncCtrl.sCmn.Seed = psEnc->sCmn.frameCounter++ & 3; + /**************************************************************/ + /* Setup Input Pointers, and insert frame in input buffer */ + /*************************************************************/ + /* pointers aligned with start of frame to encode */ + x_frame = psEnc->x_buf + psEnc->sCmn.frame_length; // start of frame to encode + res_pitch_frame = res_pitch + psEnc->sCmn.frame_length; // start of pitch LPC residual frame + + /****************************/ + /* Voice Activity Detection */ + /****************************/ + SKP_Silk_VAD_FLP( psEnc, &sEncCtrl, pIn ); + + /*******************************************/ + /* High-pass filtering of the input signal */ + /*******************************************/ +#if HIGH_PASS_INPUT + /* Variable high-pass filter */ + SKP_Silk_HP_variable_cutoff_FLP( psEnc, &sEncCtrl, pIn_HP, pIn ); +#else + SKP_memcpy( pIn_HP, pIn, psEnc->sCmn.frame_length * sizeof( SKP_int16 ) ); +#endif + +#if SWITCH_TRANSITION_FILTERING + /* Ensure smooth bandwidth transitions */ + SKP_Silk_LP_variable_cutoff( &psEnc->sCmn.sLP, pIn_HP_LP, pIn_HP, psEnc->sCmn.frame_length ); +#else + SKP_memcpy( pIn_HP_LP, pIn_HP, psEnc->sCmn.frame_length * sizeof( SKP_int16 ) ); +#endif + + /*******************************************/ + /* Copy new frame to front of input buffer */ + /*******************************************/ + SKP_short2float_array( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, pIn_HP_LP, psEnc->sCmn.frame_length ); + + /* Add tiny signal to avoid high CPU load from denormalized floating point numbers */ + for( k = 0; k < 8; k++ ) { + x_frame[ LA_SHAPE_MS * psEnc->sCmn.fs_kHz + k * ( psEnc->sCmn.frame_length >> 3 ) ] += ( 1 - ( k & 2 ) ) * 1e-6f; + } + + /*****************************************/ + /* Find pitch lags, initial LPC analysis */ + /*****************************************/ + SKP_Silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame ); + + /************************/ + /* Noise shape analysis */ + /************************/ + SKP_Silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame ); + + /*****************************************/ + /* Prefiltering for noise shaper */ + /*****************************************/ + SKP_Silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame ); + + /***************************************************/ + /* Find linear prediction coefficients (LPC + LTP) */ + /***************************************************/ + SKP_Silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch ); + + /****************************************/ + /* Process gains */ + /****************************************/ + SKP_Silk_process_gains_FLP( psEnc, &sEncCtrl ); + + /****************************************/ + /* Low Bitrate Redundant Encoding */ + /****************************************/ + nBytesLBRR = MAX_ARITHM_BYTES; + SKP_Silk_LBRR_encode_FLP( psEnc, &sEncCtrl, LBRRpayload, &nBytesLBRR, xfw ); + + /*****************************************/ + /* Noise shaping quantization */ + /*****************************************/ + SKP_Silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, xfw, psEnc->sCmn.q, 0 ); + + /**************************************************/ + /* Convert speech activity into VAD and DTX flags */ + /**************************************************/ + if( psEnc->speech_activity < SPEECH_ACTIVITY_DTX_THRES ) { + psEnc->sCmn.vadFlag = NO_VOICE_ACTIVITY; + psEnc->sCmn.noSpeechCounter++; + if( psEnc->sCmn.noSpeechCounter > NO_SPEECH_FRAMES_BEFORE_DTX ) { + psEnc->sCmn.inDTX = 1; + } + if( psEnc->sCmn.noSpeechCounter > MAX_CONSECUTIVE_DTX + NO_SPEECH_FRAMES_BEFORE_DTX ) { + psEnc->sCmn.noSpeechCounter = NO_SPEECH_FRAMES_BEFORE_DTX; + psEnc->sCmn.inDTX = 0; + } + } else { + psEnc->sCmn.noSpeechCounter = 0; + psEnc->sCmn.inDTX = 0; + psEnc->sCmn.vadFlag = VOICE_ACTIVITY; + } + + /****************************************/ + /* Initialize range coder */ + /****************************************/ + if( psEnc->sCmn.nFramesInPayloadBuf == 0 ) { + SKP_Silk_range_enc_init( &psEnc->sCmn.sRC ); + psEnc->sCmn.nBytesInPayloadBuf = 0; + } + + /****************************************/ + /* Encode Parameters */ + /****************************************/ + SKP_Silk_encode_parameters( &psEnc->sCmn, &sEncCtrl.sCmn, &psEnc->sCmn.sRC, psEnc->sCmn.q ); + FrameTermination_CDF = SKP_Silk_FrameTermination_CDF; + + /****************************************/ + /* Update Buffers and State */ + /****************************************/ + /* Update input buffer */ + SKP_memmove( psEnc->x_buf, &psEnc->x_buf[ psEnc->sCmn.frame_length ], + ( psEnc->sCmn.frame_length + LA_SHAPE_MS * psEnc->sCmn.fs_kHz ) * sizeof( SKP_float ) ); + + /* Parameters needed for next frame */ + psEnc->sCmn.prev_sigtype = sEncCtrl.sCmn.sigtype; + psEnc->sCmn.prevLag = sEncCtrl.sCmn.pitchL[ NB_SUBFR - 1]; + psEnc->sCmn.first_frame_after_reset = 0; + + if( psEnc->sCmn.sRC.error ) { + /* Encoder returned error: Clear payload buffer */ + psEnc->sCmn.nFramesInPayloadBuf = 0; + } else { + psEnc->sCmn.nFramesInPayloadBuf++; + } + + /****************************************/ + /* Finalize payload and copy to output */ + /****************************************/ + if( psEnc->sCmn.nFramesInPayloadBuf * FRAME_LENGTH_MS >= psEnc->sCmn.PacketSize_ms ) { + + LBRR_idx = ( psEnc->sCmn.oldest_LBRR_idx + 1 ) & LBRR_IDX_MASK; + + /* Check if FEC information should be added */ + frame_terminator = SKP_SILK_LAST_FRAME; + if( psEnc->sCmn.LBRR_buffer[ LBRR_idx ].usage == SKP_SILK_ADD_LBRR_TO_PLUS1 ) { + frame_terminator = SKP_SILK_LBRR_VER1; + } + if( psEnc->sCmn.LBRR_buffer[ psEnc->sCmn.oldest_LBRR_idx ].usage == SKP_SILK_ADD_LBRR_TO_PLUS2 ) { + frame_terminator = SKP_SILK_LBRR_VER2; + LBRR_idx = psEnc->sCmn.oldest_LBRR_idx; + } + + /* Add the frame termination info to stream */ + SKP_Silk_range_encoder( &psEnc->sCmn.sRC, frame_terminator, FrameTermination_CDF ); + + /* Payload length so far */ + SKP_Silk_range_coder_get_length( &psEnc->sCmn.sRC, &nBytes ); + + /* Check that there is enough space in external output buffer, and move data */ + if( *pnBytesOut >= nBytes ) { + SKP_Silk_range_enc_wrap_up( &psEnc->sCmn.sRC ); + SKP_memcpy( pCode, psEnc->sCmn.sRC.buffer, nBytes * sizeof( SKP_uint8 ) ); + + if( frame_terminator > SKP_SILK_MORE_FRAMES && + *pnBytesOut >= nBytes + psEnc->sCmn.LBRR_buffer[ LBRR_idx ].nBytes ) { + /* Get old packet and add to payload. */ + SKP_memcpy( &pCode[ nBytes ], + psEnc->sCmn.LBRR_buffer[ LBRR_idx ].payload, + psEnc->sCmn.LBRR_buffer[ LBRR_idx ].nBytes * sizeof( SKP_uint8 ) ); + nBytes += psEnc->sCmn.LBRR_buffer[ LBRR_idx ].nBytes; + } + *pnBytesOut = nBytes; + + /* Update FEC buffer */ + SKP_memcpy( psEnc->sCmn.LBRR_buffer[ psEnc->sCmn.oldest_LBRR_idx ].payload, LBRRpayload, + nBytesLBRR * sizeof( SKP_uint8 ) ); + psEnc->sCmn.LBRR_buffer[ psEnc->sCmn.oldest_LBRR_idx ].nBytes = nBytesLBRR; + /* The line below describes how FEC should be used */ + psEnc->sCmn.LBRR_buffer[ psEnc->sCmn.oldest_LBRR_idx ].usage = sEncCtrl.sCmn.LBRR_usage; + psEnc->sCmn.oldest_LBRR_idx = ( ( psEnc->sCmn.oldest_LBRR_idx + 1 ) & LBRR_IDX_MASK ); + + } else { + /* Not enough space: Payload will be discarded */ + *pnBytesOut = 0; + nBytes = 0; + ret = SKP_SILK_ENC_PAYLOAD_BUF_TOO_SHORT; + } + + /* Reset the number of frames in payload buffer */ + psEnc->sCmn.nFramesInPayloadBuf = 0; + } else { + /* No payload this time */ + *pnBytesOut = 0; + + /* Encode that more frames follows */ + frame_terminator = SKP_SILK_MORE_FRAMES; + SKP_Silk_range_encoder( &psEnc->sCmn.sRC, frame_terminator, FrameTermination_CDF ); + + /* Payload length so far */ + SKP_Silk_range_coder_get_length( &psEnc->sCmn.sRC, &nBytes ); + } + + /* Check for arithmetic coder errors */ + if( psEnc->sCmn.sRC.error ) { + ret = SKP_SILK_ENC_INTERNAL_ERROR; + } + + /* Simulate number of ms buffered in channel because of exceeding TargetRate */ + psEnc->BufferedInChannel_ms += ( 8.0f * 1000.0f * ( nBytes - psEnc->sCmn.nBytesInPayloadBuf ) ) / psEnc->sCmn.TargetRate_bps; + psEnc->BufferedInChannel_ms -= FRAME_LENGTH_MS; + psEnc->BufferedInChannel_ms = SKP_LIMIT_float( psEnc->BufferedInChannel_ms, 0.0f, 100.0f ); + psEnc->sCmn.nBytesInPayloadBuf = nBytes; + + if( psEnc->speech_activity > WB_DETECT_ACTIVE_SPEECH_LEVEL_THRES ) { + psEnc->sCmn.sSWBdetect.ActiveSpeech_ms = SKP_ADD_POS_SAT32( psEnc->sCmn.sSWBdetect.ActiveSpeech_ms, FRAME_LENGTH_MS ); + } + + return( ret ); +} + +/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */ +void SKP_Silk_LBRR_encode_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SKP_uint8 *pCode, /* O Payload */ + SKP_int16 *pnBytesOut, /* I/O Payload bytes; in: max; out: used */ + const SKP_float xfw[] /* I Input signal */ +) +{ + SKP_int32 Gains_Q16[ NB_SUBFR ]; + SKP_int k, TempGainsIndices[ NB_SUBFR ], frame_terminator; + SKP_int nBytes, nFramesInPayloadBuf; + SKP_float TempGains[ NB_SUBFR ]; + SKP_int typeOffset, LTP_scaleIndex, Rate_only_parameters = 0; + + /* Control use of inband LBRR */ + SKP_Silk_LBRR_ctrl_FLP( psEnc, &psEncCtrl->sCmn ); + + if( psEnc->sCmn.LBRR_enabled ) { + /* Save original gains */ + SKP_memcpy( TempGainsIndices, psEncCtrl->sCmn.GainsIndices, NB_SUBFR * sizeof( SKP_int ) ); + SKP_memcpy( TempGains, psEncCtrl->Gains, NB_SUBFR * sizeof( SKP_float ) ); + + typeOffset = psEnc->sCmn.typeOffsetPrev; // Temp save as cannot be overwritten + LTP_scaleIndex = psEncCtrl->sCmn.LTP_scaleIndex; + + /* Set max rate where quant signal is encoded */ + if( psEnc->sCmn.fs_kHz == 8 ) { + Rate_only_parameters = 13500; + } else if( psEnc->sCmn.fs_kHz == 12 ) { + Rate_only_parameters = 15500; + } else if( psEnc->sCmn.fs_kHz == 16 ) { + Rate_only_parameters = 17500; + } else if( psEnc->sCmn.fs_kHz == 24 ) { + Rate_only_parameters = 19500; + } else { + SKP_assert( 0 ); + } + + if( psEnc->sCmn.Complexity > 0 && psEnc->sCmn.TargetRate_bps > Rate_only_parameters ) { + if( psEnc->sCmn.nFramesInPayloadBuf == 0 ) { + /* First frame in packet copy everything */ + SKP_memcpy( &psEnc->sCmn.sNSQ_LBRR, &psEnc->sCmn.sNSQ, sizeof( SKP_Silk_nsq_state ) ); + psEnc->sCmn.LBRRprevLastGainIndex = psEnc->sShape.LastGainIndex; + /* Increase Gains to get target LBRR rate */ + psEncCtrl->sCmn.GainsIndices[ 0 ] += psEnc->sCmn.LBRR_GainIncreases; + psEncCtrl->sCmn.GainsIndices[ 0 ] = SKP_LIMIT_int( psEncCtrl->sCmn.GainsIndices[ 0 ], 0, N_LEVELS_QGAIN - 1 ); + } + /* Decode to get gains in sync with decoder */ + SKP_Silk_gains_dequant( Gains_Q16, psEncCtrl->sCmn.GainsIndices, + &psEnc->sCmn.LBRRprevLastGainIndex, psEnc->sCmn.nFramesInPayloadBuf ); + + /* Overwrite unquantized gains with quantized gains and convert back to Q0 from Q16 */ + for( k = 0; k < NB_SUBFR; k++ ) { + psEncCtrl->Gains[ k ] = Gains_Q16[ k ] / 65536.0f; + } + + /*****************************************/ + /* Noise shaping quantization */ + /*****************************************/ + SKP_Silk_NSQ_wrapper_FLP( psEnc, psEncCtrl, xfw, psEnc->sCmn.q_LBRR, 1 ); + } else { + SKP_memset( psEnc->sCmn.q_LBRR, 0, psEnc->sCmn.frame_length * sizeof( SKP_int8 ) ); + psEncCtrl->sCmn.LTP_scaleIndex = 0; + } + /****************************************/ + /* Initialize arithmetic coder */ + /****************************************/ + if( psEnc->sCmn.nFramesInPayloadBuf == 0 ) { + SKP_Silk_range_enc_init( &psEnc->sCmn.sRC_LBRR ); + psEnc->sCmn.nBytesInPayloadBuf = 0; + } + + /****************************************/ + /* Encode Parameters */ + /****************************************/ + SKP_Silk_encode_parameters( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sCmn.sRC_LBRR, psEnc->sCmn.q_LBRR ); + + if( psEnc->sCmn.sRC_LBRR.error ) { + /* Encoder returned error: Clear payload buffer */ + nFramesInPayloadBuf = 0; + } else { + nFramesInPayloadBuf = psEnc->sCmn.nFramesInPayloadBuf + 1; + } + + /****************************************/ + /* Finalize payload and copy to output */ + /****************************************/ + if( nFramesInPayloadBuf * FRAME_LENGTH_MS >= psEnc->sCmn.PacketSize_ms ) { + + /* Check if FEC information should be added */ + frame_terminator = SKP_SILK_LAST_FRAME; + + /* Add the frame termination info to stream */ + SKP_Silk_range_encoder( &psEnc->sCmn.sRC_LBRR, frame_terminator, SKP_Silk_FrameTermination_CDF ); + + /* Payload length so far */ + SKP_Silk_range_coder_get_length( &psEnc->sCmn.sRC_LBRR, &nBytes ); + + /* Check that there is enough space in external output buffer and move data */ + if( *pnBytesOut >= nBytes ) { + SKP_Silk_range_enc_wrap_up( &psEnc->sCmn.sRC_LBRR ); + SKP_memcpy( pCode, psEnc->sCmn.sRC_LBRR.buffer, nBytes * sizeof( SKP_uint8 ) ); + + *pnBytesOut = nBytes; + } else { + /* Not enough space: Payload will be discarded */ + *pnBytesOut = 0; + SKP_assert( 0 ); + } + } else { + /* No payload this time */ + *pnBytesOut = 0; + + /* Encode that more frames follows */ + frame_terminator = SKP_SILK_MORE_FRAMES; + SKP_Silk_range_encoder( &psEnc->sCmn.sRC_LBRR, frame_terminator, SKP_Silk_FrameTermination_CDF ); + } + + /* Restore original Gains */ + SKP_memcpy( psEncCtrl->sCmn.GainsIndices, TempGainsIndices, NB_SUBFR * sizeof( SKP_int ) ); + SKP_memcpy( psEncCtrl->Gains, TempGains, NB_SUBFR * sizeof( SKP_float ) ); + + /* Restore LTP scale index and typeoffset */ + psEncCtrl->sCmn.LTP_scaleIndex = LTP_scaleIndex; + psEnc->sCmn.typeOffsetPrev = typeOffset; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_parameters.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_parameters.c new file mode 100755 index 0000000..8ed0802 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_parameters.c @@ -0,0 +1,162 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/*******************************************/ +/* Encode parameters to create the payload */ +/*******************************************/ +void SKP_Silk_encode_parameters( + SKP_Silk_encoder_state *psEncC, /* I/O Encoder state */ + SKP_Silk_encoder_control *psEncCtrlC, /* I/O Encoder control */ + SKP_Silk_range_coder_state *psRC, /* I/O Range encoder state */ + const SKP_int8 *q /* I Quantization indices */ +) +{ + SKP_int i, k, typeOffset; + const SKP_Silk_NLSF_CB_struct *psNLSF_CB; + + + /************************/ + /* Encode sampling rate */ + /************************/ + /* only done for first frame in packet */ + if( psEncC->nFramesInPayloadBuf == 0 ) { + /* get sampling rate index */ + for( i = 0; i < 3; i++ ) { + if( SKP_Silk_SamplingRates_table[ i ] == psEncC->fs_kHz ) { + break; + } + } + SKP_Silk_range_encoder( psRC, i, SKP_Silk_SamplingRates_CDF ); + } + + /*******************************************/ + /* Encode signal type and quantizer offset */ + /*******************************************/ + typeOffset = 2 * psEncCtrlC->sigtype + psEncCtrlC->QuantOffsetType; + if( psEncC->nFramesInPayloadBuf == 0 ) { + /* first frame in packet: independent coding */ + SKP_Silk_range_encoder( psRC, typeOffset, SKP_Silk_type_offset_CDF ); + } else { + /* condidtional coding */ + SKP_Silk_range_encoder( psRC, typeOffset, SKP_Silk_type_offset_joint_CDF[ psEncC->typeOffsetPrev ] ); + } + psEncC->typeOffsetPrev = typeOffset; + + /****************/ + /* Encode gains */ + /****************/ + /* first subframe */ + if( psEncC->nFramesInPayloadBuf == 0 ) { + /* first frame in packet: independent coding */ + SKP_Silk_range_encoder( psRC, psEncCtrlC->GainsIndices[ 0 ], SKP_Silk_gain_CDF[ psEncCtrlC->sigtype ] ); + } else { + /* condidtional coding */ + SKP_Silk_range_encoder( psRC, psEncCtrlC->GainsIndices[ 0 ], SKP_Silk_delta_gain_CDF ); + } + + /* remaining subframes */ + for( i = 1; i < NB_SUBFR; i++ ) { + SKP_Silk_range_encoder( psRC, psEncCtrlC->GainsIndices[ i ], SKP_Silk_delta_gain_CDF ); + } + + + /****************/ + /* Encode NLSFs */ + /****************/ + /* Range encoding of the NLSF path */ + psNLSF_CB = psEncC->psNLSF_CB[ psEncCtrlC->sigtype ]; + SKP_Silk_range_encoder_multi( psRC, psEncCtrlC->NLSFIndices, psNLSF_CB->StartPtr, psNLSF_CB->nStages ); + + /* Encode NLSF interpolation factor */ + SKP_assert( psEncC->useInterpolatedNLSFs == 1 || psEncCtrlC->NLSFInterpCoef_Q2 == ( 1 << 2 ) ); + SKP_Silk_range_encoder( psRC, psEncCtrlC->NLSFInterpCoef_Q2, SKP_Silk_NLSF_interpolation_factor_CDF ); + + + if( psEncCtrlC->sigtype == SIG_TYPE_VOICED ) { + /*********************/ + /* Encode pitch lags */ + /*********************/ + + + /* lag index */ + if( psEncC->fs_kHz == 8 ) { + SKP_Silk_range_encoder( psRC, psEncCtrlC->lagIndex, SKP_Silk_pitch_lag_NB_CDF ); + } else if( psEncC->fs_kHz == 12 ) { + SKP_Silk_range_encoder( psRC, psEncCtrlC->lagIndex, SKP_Silk_pitch_lag_MB_CDF ); + } else if( psEncC->fs_kHz == 16 ) { + SKP_Silk_range_encoder( psRC, psEncCtrlC->lagIndex, SKP_Silk_pitch_lag_WB_CDF ); + } else { + SKP_Silk_range_encoder( psRC, psEncCtrlC->lagIndex, SKP_Silk_pitch_lag_SWB_CDF ); + } + + + /* countour index */ + if( psEncC->fs_kHz == 8 ) { + /* Less codevectors used in 8 khz mode */ + SKP_Silk_range_encoder( psRC, psEncCtrlC->contourIndex, SKP_Silk_pitch_contour_NB_CDF ); + } else { + /* Joint for 12, 16, 24 khz */ + SKP_Silk_range_encoder( psRC, psEncCtrlC->contourIndex, SKP_Silk_pitch_contour_CDF ); + } + + /********************/ + /* Encode LTP gains */ + /********************/ + + /* PERIndex value */ + SKP_Silk_range_encoder( psRC, psEncCtrlC->PERIndex, SKP_Silk_LTP_per_index_CDF ); + + /* Codebook Indices */ + for( k = 0; k < NB_SUBFR; k++ ) { + SKP_Silk_range_encoder( psRC, psEncCtrlC->LTPIndex[ k ], SKP_Silk_LTP_gain_CDF_ptrs[ psEncCtrlC->PERIndex ] ); + } + + /**********************/ + /* Encode LTP scaling */ + /**********************/ + SKP_Silk_range_encoder( psRC, psEncCtrlC->LTP_scaleIndex, SKP_Silk_LTPscale_CDF ); + } + + + /***************/ + /* Encode seed */ + /***************/ + SKP_Silk_range_encoder( psRC, psEncCtrlC->Seed, SKP_Silk_Seed_CDF ); + + /*********************************************/ + /* Encode quantization indices of excitation */ + /*********************************************/ + SKP_Silk_encode_pulses( psRC, psEncCtrlC->sigtype, psEncCtrlC->QuantOffsetType, q, psEncC->frame_length ); + + + /*********************************************/ + /* Encode VAD flag */ + /*********************************************/ + SKP_Silk_range_encoder( psRC, psEncC->vadFlag, SKP_Silk_vadflag_CDF ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_pulses.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_pulses.c new file mode 100755 index 0000000..3a711e8 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_encode_pulses.c @@ -0,0 +1,195 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/*********************************************/ +/* Encode quantization indices of excitation */ +/*********************************************/ + +SKP_INLINE SKP_int combine_and_check( /* return ok */ + SKP_int *pulses_comb, /* O */ + const SKP_int *pulses_in, /* I */ + SKP_int max_pulses, /* I max value for sum of pulses */ + SKP_int len /* I number of output values */ +) +{ + SKP_int k, sum; + + for( k = 0; k < len; k++ ) { + sum = pulses_in[ 2 * k ] + pulses_in[ 2 * k + 1 ]; + if( sum > max_pulses ) { + return 1; + } + pulses_comb[ k ] = sum; + } + + return 0; +} + +/* Encode quantization indices of excitation */ +void SKP_Silk_encode_pulses( + SKP_Silk_range_coder_state *psRC, /* I/O Range coder state */ + const SKP_int sigtype, /* I Sigtype */ + const SKP_int QuantOffsetType,/* I QuantOffsetType */ + const SKP_int8 q[], /* I quantization indices */ + const SKP_int frame_length /* I Frame length */ +) +{ + SKP_int i, k, j, iter, bit, nLS, scale_down, RateLevelIndex = 0; + SKP_int32 abs_q, minSumBits_Q6, sumBits_Q6; + SKP_int abs_pulses[ MAX_FRAME_LENGTH ]; + SKP_int sum_pulses[ MAX_NB_SHELL_BLOCKS ]; + SKP_int nRshifts[ MAX_NB_SHELL_BLOCKS ]; + SKP_int pulses_comb[ 8 ]; + SKP_int *abs_pulses_ptr; + const SKP_int8 *pulses_ptr; + const SKP_uint16 *cdf_ptr; + const SKP_int16 *nBits_ptr; + + SKP_memset( pulses_comb, 0, 8 * sizeof( SKP_int ) ); // Fixing Valgrind reported problem + + /****************************/ + /* Prepare for shell coding */ + /****************************/ + /* Calculate number of shell blocks */ + iter = frame_length / SHELL_CODEC_FRAME_LENGTH; + + /* Take the absolute value of the pulses */ + for( i = 0; i < frame_length; i+=4 ) { + abs_pulses[i+0] = ( SKP_int )SKP_abs( q[ i + 0 ] ); + abs_pulses[i+1] = ( SKP_int )SKP_abs( q[ i + 1 ] ); + abs_pulses[i+2] = ( SKP_int )SKP_abs( q[ i + 2 ] ); + abs_pulses[i+3] = ( SKP_int )SKP_abs( q[ i + 3 ] ); + } + + /* Calc sum pulses per shell code frame */ + abs_pulses_ptr = abs_pulses; + for( i = 0; i < iter; i++ ) { + nRshifts[ i ] = 0; + + while( 1 ) { + /* 1+1 -> 2 */ + scale_down = combine_and_check( pulses_comb, abs_pulses_ptr, SKP_Silk_max_pulses_table[ 0 ], 8 ); + + /* 2+2 -> 4 */ + scale_down += combine_and_check( pulses_comb, pulses_comb, SKP_Silk_max_pulses_table[ 1 ], 4 ); + + /* 4+4 -> 8 */ + scale_down += combine_and_check( pulses_comb, pulses_comb, SKP_Silk_max_pulses_table[ 2 ], 2 ); + + /* 8+8 -> 16 */ + sum_pulses[ i ] = pulses_comb[ 0 ] + pulses_comb[ 1 ]; + if( sum_pulses[ i ] > SKP_Silk_max_pulses_table[ 3 ] ) { + scale_down++; + } + + if( scale_down ) { + /* We need to down scale the quantization signal */ + nRshifts[ i ]++; + for( k = 0; k < SHELL_CODEC_FRAME_LENGTH; k++ ) { + abs_pulses_ptr[ k ] = SKP_RSHIFT( abs_pulses_ptr[ k ], 1 ); + } + } else { + /* Jump out of while(1) loop and go to next shell coding frame */ + break; + } + } + abs_pulses_ptr += SHELL_CODEC_FRAME_LENGTH; + } + + /**************/ + /* Rate level */ + /**************/ + /* find rate level that leads to fewest bits for coding of pulses per block info */ + minSumBits_Q6 = SKP_int32_MAX; + for( k = 0; k < N_RATE_LEVELS - 1; k++ ) { + nBits_ptr = SKP_Silk_pulses_per_block_BITS_Q6[ k ]; + sumBits_Q6 = SKP_Silk_rate_levels_BITS_Q6[sigtype][ k ]; + for( i = 0; i < iter; i++ ) { + if( nRshifts[ i ] > 0 ) { + sumBits_Q6 += nBits_ptr[ MAX_PULSES + 1 ]; + } else { + sumBits_Q6 += nBits_ptr[ sum_pulses[ i ] ]; + } + } + if( sumBits_Q6 < minSumBits_Q6 ) { + minSumBits_Q6 = sumBits_Q6; + RateLevelIndex = k; + } + } + SKP_Silk_range_encoder( psRC, RateLevelIndex, SKP_Silk_rate_levels_CDF[ sigtype ] ); + + /***************************************************/ + /* Sum-Weighted-Pulses Encoding */ + /***************************************************/ + cdf_ptr = SKP_Silk_pulses_per_block_CDF[ RateLevelIndex ]; + for( i = 0; i < iter; i++ ) { + if( nRshifts[ i ] == 0 ) { + SKP_Silk_range_encoder( psRC, sum_pulses[ i ], cdf_ptr ); + } else { + SKP_Silk_range_encoder( psRC, MAX_PULSES + 1, cdf_ptr ); + for( k = 0; k < nRshifts[ i ] - 1; k++ ) { + SKP_Silk_range_encoder( psRC, MAX_PULSES + 1, SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS - 1 ] ); + } + SKP_Silk_range_encoder( psRC, sum_pulses[ i ], SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS - 1 ] ); + } + } + + /******************/ + /* Shell Encoding */ + /******************/ + for( i = 0; i < iter; i++ ) { + if( sum_pulses[ i ] > 0 ) { + SKP_Silk_shell_encoder( psRC, &abs_pulses[ i * SHELL_CODEC_FRAME_LENGTH ] ); + } + } + + /****************/ + /* LSB Encoding */ + /****************/ + for( i = 0; i < iter; i++ ) { + if( nRshifts[ i ] > 0 ) { + pulses_ptr = &q[ i * SHELL_CODEC_FRAME_LENGTH ]; + nLS = nRshifts[ i ] - 1; + for( k = 0; k < SHELL_CODEC_FRAME_LENGTH; k++ ) { + abs_q = (SKP_int8)SKP_abs( pulses_ptr[ k ] ); + for( j = nLS; j > 0; j-- ) { + bit = SKP_RSHIFT( abs_q, j ) & 1; + SKP_Silk_range_encoder( psRC, bit, SKP_Silk_lsb_CDF ); + } + bit = abs_q & 1; + SKP_Silk_range_encoder( psRC, bit, SKP_Silk_lsb_CDF ); + } + } + } + + /****************/ + /* Encode signs */ + /****************/ + SKP_Silk_encode_signs( psRC, q, frame_length, sigtype, QuantOffsetType, RateLevelIndex ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_energy_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_energy_FLP.c new file mode 100755 index 0000000..071249a --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_energy_FLP.c @@ -0,0 +1,56 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FLP.h" + +/* sum of squares of a SKP_float array, with result as double */ +double SKP_Silk_energy_FLP( + const SKP_float *data, + SKP_int dataSize +) +{ + SKP_int i, dataSize4; + double result; + + /* 4x unrolled loop */ + result = 0.0f; + dataSize4 = dataSize & 0xFFFC; + for( i = 0; i < dataSize4; i += 4 ) { + result += data[ i + 0 ] * data[ i + 0 ] + + data[ i + 1 ] * data[ i + 1 ] + + data[ i + 2 ] * data[ i + 2 ] + + data[ i + 3 ] * data[ i + 3 ]; + } + + /* add any remaining products */ + for( ; i < dataSize; i++ ) { + result += data[ i ] * data[ i ]; + } + + SKP_assert( result >= 0.0 ); + return result; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_LPC_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_LPC_FLP.c new file mode 100755 index 0000000..4db1957 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_LPC_FLP.c @@ -0,0 +1,102 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +void SKP_Silk_find_LPC_FLP( + SKP_float NLSF[], /* O NLSFs */ + SKP_int *interpIndex, /* O NLSF interp. index for NLSF interp. */ + const SKP_float prev_NLSFq[], /* I Previous NLSFs, for NLSF interpolation */ + const SKP_int useInterpNLSFs, /* I Flag */ + const SKP_int LPC_order, /* I LPC order */ + const SKP_float x[], /* I Input signal */ + const SKP_int subfr_length /* I Subframe length incl preceeding samples */ +) +{ + SKP_int k; + SKP_float a[ MAX_LPC_ORDER ]; + + /* Used only for NLSF interpolation */ + double res_nrg, res_nrg_2nd, res_nrg_interp; + SKP_float a_tmp[ MAX_LPC_ORDER ], NLSF0[ MAX_LPC_ORDER ]; + SKP_float LPC_res[ ( MAX_FRAME_LENGTH + NB_SUBFR * MAX_LPC_ORDER ) / 2 ]; + + /* Default: No interpolation */ + *interpIndex = 4; + + /* Burg AR analysis for the full frame */ + res_nrg = SKP_Silk_burg_modified_FLP( a, x, subfr_length, NB_SUBFR, FIND_LPC_COND_FAC, LPC_order ); + + SKP_Silk_bwexpander_FLP( a, LPC_order, FIND_LPC_CHIRP ); + + if( useInterpNLSFs == 1 ) { + + /* Optimal solution for last 10 ms; subtract residual energy here, as that's easier than */ + /* adding it to the residual energy of the first 10 ms in each iteration of the search below */ + res_nrg -= SKP_Silk_burg_modified_FLP( a_tmp, x + ( NB_SUBFR / 2 ) * subfr_length, + subfr_length, NB_SUBFR / 2, FIND_LPC_COND_FAC, LPC_order ); + + SKP_Silk_bwexpander_FLP( a_tmp, LPC_order, FIND_LPC_CHIRP ); + + /* Convert to NLSFs */ + SKP_Silk_A2NLSF_FLP( NLSF, a_tmp, LPC_order ); + + /* Search over interpolation indices to find the one with lowest residual energy */ + res_nrg_2nd = SKP_float_MAX; + for( k = 3; k >= 0; k-- ) { + /* Interpolate NLSFs for first half */ + SKP_Silk_interpolate_wrapper_FLP( NLSF0, prev_NLSFq, NLSF, 0.25f * k, LPC_order ); + + /* Convert to LPC for residual energy evaluation */ + SKP_Silk_NLSF2A_stable_FLP( a_tmp, NLSF0, LPC_order ); + + /* Calculate residual energy with LSF interpolation */ + SKP_Silk_LPC_analysis_filter_FLP( LPC_res, a_tmp, x, 2 * subfr_length, LPC_order ); + res_nrg_interp = + SKP_Silk_energy_FLP( LPC_res + LPC_order, subfr_length - LPC_order ) + + SKP_Silk_energy_FLP( LPC_res + LPC_order + subfr_length, subfr_length - LPC_order ); + + /* Determine whether current interpolated NLSFs are best so far */ + if( res_nrg_interp < res_nrg ) { + /* Interpolation has lower residual energy */ + res_nrg = res_nrg_interp; + *interpIndex = k; + } else if( res_nrg_interp > res_nrg_2nd ) { + /* No reason to continue iterating - residual energies will continue to climb */ + break; + } + res_nrg_2nd = res_nrg_interp; + } + } + + if( *interpIndex == 4 ) { + /* NLSF interpolation is currently inactive, calculate NLSFs from full frame AR coefficients */ + SKP_Silk_A2NLSF_FLP( NLSF, a, LPC_order ); + } + +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_LTP_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_LTP_FLP.c new file mode 100755 index 0000000..9d88eb4 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_LTP_FLP.c @@ -0,0 +1,131 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +void SKP_Silk_find_LTP_FLP( + SKP_float b[ NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ + SKP_float WLTP[NB_SUBFR*LTP_ORDER*LTP_ORDER], /* O Weight for LTP quantization */ + SKP_float *LTPredCodGain, /* O LTP coding gain */ + const SKP_float r_first[], /* I LPC residual, signal + state for 10 ms */ + const SKP_float r_last[], /* I LPC residual, signal + state for 10 ms */ + const SKP_int lag[ NB_SUBFR ], /* I LTP lags */ + const SKP_float Wght[ NB_SUBFR ], /* I Weights */ + const SKP_int subfr_length, /* I Subframe length */ + const SKP_int mem_offset /* I Number of samples in LTP memory */ +) +{ + SKP_int i, k; + SKP_float *b_ptr, temp, *WLTP_ptr; + SKP_float LPC_res_nrg, LPC_LTP_res_nrg; + SKP_float d[ NB_SUBFR ], m, g, delta_b[ LTP_ORDER ]; + SKP_float w[ NB_SUBFR ], nrg[ NB_SUBFR ], regu; + SKP_float Rr[ LTP_ORDER ], rr[ NB_SUBFR ]; + const SKP_float *r_ptr, *lag_ptr; + + b_ptr = b; + WLTP_ptr = WLTP; + r_ptr = &r_first[ mem_offset ]; + for( k = 0; k < NB_SUBFR; k++ ) { + if( k == ( NB_SUBFR >> 1 ) ) { /* Shift residual for last 10 ms */ + r_ptr = &r_last[ mem_offset ]; + } + lag_ptr = r_ptr - ( lag[ k ] + LTP_ORDER / 2 ); + + SKP_Silk_corrMatrix_FLP( lag_ptr, subfr_length, LTP_ORDER, WLTP_ptr ); + SKP_Silk_corrVector_FLP( lag_ptr, r_ptr, subfr_length, LTP_ORDER, Rr ); + + rr[ k ] = ( SKP_float )SKP_Silk_energy_FLP( r_ptr, subfr_length ); + regu = 1.0f + rr[ k ] + + matrix_ptr( WLTP_ptr, 0, 0, LTP_ORDER ) + + matrix_ptr( WLTP_ptr, LTP_ORDER-1, LTP_ORDER-1, LTP_ORDER ); + regu *= LTP_DAMPING / 3; + SKP_Silk_regularize_correlations_FLP( WLTP_ptr, &rr[ k ], regu, LTP_ORDER ); + SKP_Silk_solve_LDL_FLP( WLTP_ptr, LTP_ORDER, Rr, b_ptr ); + + /* Calculate residual energy */ + nrg[ k ] = SKP_Silk_residual_energy_covar_FLP( b_ptr, WLTP_ptr, Rr, rr[ k ], LTP_ORDER ); + + temp = Wght[ k ] / ( nrg[ k ] * Wght[ k ] + 0.01f * subfr_length ); + SKP_Silk_scale_vector_FLP( WLTP_ptr, temp, LTP_ORDER * LTP_ORDER ); + w[ k ] = matrix_ptr( WLTP_ptr, LTP_ORDER / 2, LTP_ORDER / 2, LTP_ORDER ); + + r_ptr += subfr_length; + b_ptr += LTP_ORDER; + WLTP_ptr += LTP_ORDER * LTP_ORDER; + } + + /* Compute LTP coding gain */ + if( LTPredCodGain != NULL ) { + LPC_LTP_res_nrg = 1e-6f; + LPC_res_nrg = 0.0f; + for( k = 0; k < NB_SUBFR; k++ ) { + LPC_res_nrg += rr[ k ] * Wght[ k ]; + LPC_LTP_res_nrg += nrg[ k ] * Wght[ k ]; + } + + SKP_assert( LPC_LTP_res_nrg > 0 ); + *LTPredCodGain = 3.0f * SKP_Silk_log2( LPC_res_nrg / LPC_LTP_res_nrg ); + } + + /* Smoothing */ + /* d = sum( B, 1 ); */ + b_ptr = b; + for( k = 0; k < NB_SUBFR; k++ ) { + d[ k ] = 0; + for( i = 0; i < LTP_ORDER; i++ ) { + d[ k ] += b_ptr[ i ]; + } + b_ptr += LTP_ORDER; + } + /* m = ( w * d' ) / ( sum( w ) + 1e-3 ); */ + temp = 1e-3f; + for( k = 0; k < NB_SUBFR; k++ ) { + temp += w[ k ]; + } + m = 0; + for( k = 0; k < NB_SUBFR; k++ ) { + m += d[ k ] * w[ k ]; + } + m = m / temp; + + b_ptr = b; + for( k = 0; k < NB_SUBFR; k++ ) { + g = LTP_SMOOTHING / ( LTP_SMOOTHING + w[ k ] ) * ( m - d[ k ] ); + temp = 0; + for( i = 0; i < LTP_ORDER; i++ ) { + delta_b[ i ] = SKP_max_float( b_ptr[ i ], 0.1f ); + temp += delta_b[ i ]; + } + temp = g / temp; + for( i = 0; i < LTP_ORDER; i++ ) { + b_ptr[ i ] = b_ptr[ i ] + delta_b[ i ] * temp; + } + b_ptr += LTP_ORDER; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_pitch_lags_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_pitch_lags_FLP.c new file mode 100755 index 0000000..63447a8 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_pitch_lags_FLP.c @@ -0,0 +1,116 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +void SKP_Silk_find_pitch_lags_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SKP_float res[], /* O Residual */ + const SKP_float x[] /* I Speech signal */ +) +{ + SKP_Silk_predict_state_FLP *psPredSt = &psEnc->sPred; + SKP_int buf_len; + SKP_float thrhld, res_nrg; + const SKP_float *x_buf_ptr, *x_buf; + SKP_float auto_corr[ MAX_FIND_PITCH_LPC_ORDER + 1 ]; + SKP_float A[ MAX_FIND_PITCH_LPC_ORDER ]; + SKP_float refl_coef[ MAX_FIND_PITCH_LPC_ORDER ]; + SKP_float Wsig[ FIND_PITCH_LPC_WIN_MAX ]; + SKP_float *Wsig_ptr; + + /******************************************/ + /* Setup buffer lengths etc based on Fs */ + /******************************************/ + buf_len = 2 * psEnc->sCmn.frame_length + psEnc->sCmn.la_pitch; + + /* Safty check */ + SKP_assert( buf_len >= psPredSt->pitch_LPC_win_length ); + + x_buf = x - psEnc->sCmn.frame_length; + + /******************************************/ + /* Estimate LPC AR coeficients */ + /******************************************/ + + /* Calculate windowed signal */ + + /* First LA_LTP samples */ + x_buf_ptr = x_buf + buf_len - psPredSt->pitch_LPC_win_length; + Wsig_ptr = Wsig; + SKP_Silk_apply_sine_window_FLP( Wsig_ptr, x_buf_ptr, 1, psEnc->sCmn.la_pitch ); + + /* Middle non-windowed samples */ + Wsig_ptr += psEnc->sCmn.la_pitch; + x_buf_ptr += psEnc->sCmn.la_pitch; + SKP_memcpy( Wsig_ptr, x_buf_ptr, ( psPredSt->pitch_LPC_win_length - ( psEnc->sCmn.la_pitch << 1 ) ) * sizeof( SKP_float ) ); + + /* Last LA_LTP samples */ + Wsig_ptr += psPredSt->pitch_LPC_win_length - ( psEnc->sCmn.la_pitch << 1 ); + x_buf_ptr += psPredSt->pitch_LPC_win_length - ( psEnc->sCmn.la_pitch << 1 ); + SKP_Silk_apply_sine_window_FLP( Wsig_ptr, x_buf_ptr, 2, psEnc->sCmn.la_pitch ); + + /* Calculate autocorrelation sequence */ + SKP_Silk_autocorrelation_FLP( auto_corr, Wsig, psPredSt->pitch_LPC_win_length, psEnc->sCmn.pitchEstimationLPCOrder + 1 ); + + /* Add white noise, as a fraction of the energy */ + auto_corr[ 0 ] += auto_corr[ 0 ] * FIND_PITCH_WHITE_NOISE_FRACTION; + + /* Calculate the reflection coefficients using Schur */ + res_nrg = SKP_Silk_schur_FLP( refl_coef, auto_corr, psEnc->sCmn.pitchEstimationLPCOrder ); + + /* Prediction gain */ + psEncCtrl->predGain = auto_corr[ 0 ] / SKP_max_float( res_nrg, 1.0f ); + + /* Convert reflection coefficients to prediction coefficients */ + SKP_Silk_k2a_FLP( A, refl_coef, psEnc->sCmn.pitchEstimationLPCOrder ); + + /* Bandwidth expansion */ + SKP_Silk_bwexpander_FLP( A, psEnc->sCmn.pitchEstimationLPCOrder, FIND_PITCH_BANDWITH_EXPANSION ); + + /*****************************************/ + /* LPC analysis filtering */ + /*****************************************/ + SKP_Silk_LPC_analysis_filter_FLP( res, A, x_buf, buf_len, psEnc->sCmn.pitchEstimationLPCOrder ); + SKP_memset( res, 0, psEnc->sCmn.pitchEstimationLPCOrder * sizeof( SKP_float ) ); + + /* Threshold for pitch estimator */ + thrhld = 0.45f; + thrhld -= 0.004f * psEnc->sCmn.pitchEstimationLPCOrder; + thrhld -= 0.1f * psEnc->speech_activity; + thrhld += 0.15f * psEnc->sCmn.prev_sigtype; + thrhld -= 0.1f * psEncCtrl->input_tilt; + + /*****************************************/ + /* Call Pitch estimator */ + /*****************************************/ + psEncCtrl->sCmn.sigtype = SKP_Silk_pitch_analysis_core_FLP( res, psEncCtrl->sCmn.pitchL, &psEncCtrl->sCmn.lagIndex, + &psEncCtrl->sCmn.contourIndex, &psEnc->LTPCorr, psEnc->sCmn.prevLag, psEnc->sCmn.pitchEstimationThreshold_Q16 / 65536.0f, + thrhld, psEnc->sCmn.fs_kHz, psEnc->sCmn.pitchEstimationComplexity ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_pred_coefs_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_pred_coefs_FLP.c new file mode 100755 index 0000000..22a570c --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_find_pred_coefs_FLP.c @@ -0,0 +1,111 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + + +void SKP_Silk_find_pred_coefs_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const SKP_float res_pitch[] /* I Residual from pitch analysis */ +) +{ + SKP_int i; + SKP_float WLTP[ NB_SUBFR * LTP_ORDER * LTP_ORDER ]; + SKP_float invGains[ NB_SUBFR ], Wght[ NB_SUBFR ]; + SKP_float NLSF[ MAX_LPC_ORDER ]; + const SKP_float *x_ptr; + SKP_float *x_pre_ptr, LPC_in_pre[ NB_SUBFR * MAX_LPC_ORDER + MAX_FRAME_LENGTH ]; + + + /* Weighting for weighted least squares */ + for( i = 0; i < NB_SUBFR; i++ ) { + SKP_assert( psEncCtrl->Gains[ i ] > 0.0f ); + invGains[ i ] = 1.0f / psEncCtrl->Gains[ i ]; + Wght[ i ] = invGains[ i ] * invGains[ i ]; + } + + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + /**********/ + /* VOICED */ + /**********/ + SKP_assert( psEnc->sCmn.frame_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->sCmn.pitchL[ 0 ] + LTP_ORDER / 2 ); + + /* LTP analysis */ + SKP_Silk_find_LTP_FLP( psEncCtrl->LTPCoef, WLTP, &psEncCtrl->LTPredCodGain, res_pitch, + res_pitch + ( psEnc->sCmn.frame_length >> 1 ), psEncCtrl->sCmn.pitchL, Wght, + psEnc->sCmn.subfr_length, psEnc->sCmn.frame_length ); + + + /* Quantize LTP gain parameters */ + SKP_Silk_quant_LTP_gains_FLP( psEncCtrl->LTPCoef, psEncCtrl->sCmn.LTPIndex, &psEncCtrl->sCmn.PERIndex, + WLTP, psEnc->mu_LTP, psEnc->sCmn.LTPQuantLowComplexity ); + + /* Control LTP scaling */ + SKP_Silk_LTP_scale_ctrl_FLP( psEnc, psEncCtrl ); + + /* Create LTP residual */ + SKP_Silk_LTP_analysis_filter_FLP( LPC_in_pre, psEnc->x_buf + psEnc->sCmn.frame_length - psEnc->sCmn.predictLPCOrder, + psEncCtrl->LTPCoef, psEncCtrl->sCmn.pitchL, invGains, psEnc->sCmn.subfr_length, psEnc->sCmn.predictLPCOrder ); + + } else { + /************/ + /* UNVOICED */ + /************/ + /* Create signal with prepended subframes, scaled by inverse gains */ + x_ptr = psEnc->x_buf + psEnc->sCmn.frame_length - psEnc->sCmn.predictLPCOrder; + x_pre_ptr = LPC_in_pre; + for( i = 0; i < NB_SUBFR; i++ ) { + SKP_Silk_scale_copy_vector_FLP( x_pre_ptr, x_ptr, invGains[ i ], + psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder ); + x_pre_ptr += psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder; + x_ptr += psEnc->sCmn.subfr_length; + } + + SKP_memset( psEncCtrl->LTPCoef, 0, NB_SUBFR * LTP_ORDER * sizeof( SKP_float ) ); + psEncCtrl->LTPredCodGain = 0.0f; + } + + /* LPC_in_pre contains the LTP-filtered input for voiced, and the unfiltered input for unvoiced */ + SKP_Silk_find_LPC_FLP( NLSF, &psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEnc->sPred.prev_NLSFq, + psEnc->sCmn.useInterpolatedNLSFs * ( 1 - psEnc->sCmn.first_frame_after_reset ), psEnc->sCmn.predictLPCOrder, + LPC_in_pre, psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder ); + + + /* Quantize LSFs */ + SKP_Silk_process_NLSFs_FLP( psEnc, psEncCtrl, NLSF ); + + /* Calculate residual energy using quantized LPC coefficients */ + SKP_Silk_residual_energy_FLP( psEncCtrl->ResNrg, LPC_in_pre, psEncCtrl->PredCoef, psEncCtrl->Gains, + psEnc->sCmn.subfr_length, psEnc->sCmn.predictLPCOrder ); + + /* Copy to prediction struct for use in next frame for fluctuation reduction */ + SKP_memcpy( psEnc->sPred.prev_NLSFq, NLSF, psEnc->sCmn.predictLPCOrder * sizeof( SKP_float ) ); + + +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_gain_quant.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_gain_quant.c new file mode 100755 index 0000000..d9c1867 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_gain_quant.c @@ -0,0 +1,94 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +#define OFFSET ( ( MIN_QGAIN_DB * 128 ) / 6 + 16 * 128 ) +#define SCALE_Q16 ( ( 65536 * ( N_LEVELS_QGAIN - 1 ) ) / ( ( ( MAX_QGAIN_DB - MIN_QGAIN_DB ) * 128 ) / 6 ) ) +#define INV_SCALE_Q16 ( ( 65536 * ( ( ( MAX_QGAIN_DB - MIN_QGAIN_DB ) * 128 ) / 6 ) ) / ( N_LEVELS_QGAIN - 1 ) ) + +/* Gain scalar quantization with hysteresis, uniform on log scale */ +void SKP_Silk_gains_quant( + SKP_int ind[ NB_SUBFR ], /* O gain indices */ + SKP_int32 gain_Q16[ NB_SUBFR ], /* I/O gains (quantized out) */ + SKP_int *prev_ind, /* I/O last index in previous frame */ + const SKP_int conditional /* I first gain is delta coded if 1 */ +) +{ + SKP_int k; + + for( k = 0; k < NB_SUBFR; k++ ) { + /* Add half of previous quantization error, convert to log scale, scale, floor() */ + ind[ k ] = SKP_SMULWB( SCALE_Q16, SKP_Silk_lin2log( gain_Q16[ k ] ) - OFFSET ); + + /* Round towards previous quantized gain (hysteresis) */ + if( ind[ k ] < *prev_ind ) { + ind[ k ]++; + } + + /* Compute delta indices and limit */ + if( k == 0 && conditional == 0 ) { + /* Full index */ + ind[ k ] = SKP_LIMIT_int( ind[ k ], 0, N_LEVELS_QGAIN - 1 ); + ind[ k ] = SKP_max_int( ind[ k ], *prev_ind + MIN_DELTA_GAIN_QUANT ); + *prev_ind = ind[ k ]; + } else { + /* Delta index */ + ind[ k ] = SKP_LIMIT_int( ind[ k ] - *prev_ind, MIN_DELTA_GAIN_QUANT, MAX_DELTA_GAIN_QUANT ); + /* Accumulate deltas */ + *prev_ind += ind[ k ]; + /* Shift to make non-negative */ + ind[ k ] -= MIN_DELTA_GAIN_QUANT; + } + + /* Convert to linear scale and scale */ + gain_Q16[ k ] = SKP_Silk_log2lin( SKP_min_32( SKP_SMULWB( INV_SCALE_Q16, *prev_ind ) + OFFSET, 3967 ) ); /* 3968 = 31 in Q7 */ + } +} + +/* Gains scalar dequantization, uniform on log scale */ +void SKP_Silk_gains_dequant( + SKP_int32 gain_Q16[ NB_SUBFR ], /* O quantized gains */ + const SKP_int ind[ NB_SUBFR ], /* I gain indices */ + SKP_int *prev_ind, /* I/O last index in previous frame */ + const SKP_int conditional /* I first gain is delta coded if 1 */ +) +{ + SKP_int k; + + for( k = 0; k < NB_SUBFR; k++ ) { + if( k == 0 && conditional == 0 ) { + *prev_ind = ind[ k ]; + } else { + /* Delta index */ + *prev_ind += ind[ k ] + MIN_DELTA_GAIN_QUANT; + } + + /* Convert to linear scale and scale */ + gain_Q16[ k ] = SKP_Silk_log2lin( SKP_min_32( SKP_SMULWB( INV_SCALE_Q16, *prev_ind ) + OFFSET, 3967 ) ); /* 3968 = 31 in Q7 */ + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_init_encoder_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_init_encoder_FLP.c new file mode 100755 index 0000000..ba2fa76 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_init_encoder_FLP.c @@ -0,0 +1,58 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include +#include "SKP_Silk_main_FLP.h" + +/*********************************/ +/* Initialize Silk Encoder state */ +/*********************************/ +SKP_int SKP_Silk_init_encoder_FLP( + SKP_Silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ +) { + SKP_int ret = 0; + + /* Clear the entire encoder state */ + SKP_memset( psEnc, 0, sizeof( SKP_Silk_encoder_state_FLP ) ); + +#if HIGH_PASS_INPUT + psEnc->variable_HP_smth1 = SKP_Silk_log2( 70.0 ); + psEnc->variable_HP_smth2 = SKP_Silk_log2( 70.0 ); +#endif + + /* Used to deactivate e.g. LSF interpolation and fluctuation reduction */ + psEnc->sCmn.first_frame_after_reset = 1; + + /* Initialize Silk VAD */ + ret += SKP_Silk_VAD_Init( &psEnc->sCmn.sVAD ); + + /* Initialize NSQ */ + psEnc->sCmn.sNSQ.prev_inv_gain_Q16 = 65536; + psEnc->sCmn.sNSQ_LBRR.prev_inv_gain_Q16 = 65536; + + return( ret ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_inner_product_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_inner_product_FLP.c new file mode 100755 index 0000000..4741d14 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_inner_product_FLP.c @@ -0,0 +1,56 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FLP.h" + +/* inner product of two SKP_float arrays, with result as double */ +double SKP_Silk_inner_product_FLP( /* O result */ + const SKP_float *data1, /* I vector 1 */ + const SKP_float *data2, /* I vector 2 */ + SKP_int dataSize /* I length of vectors */ +) +{ + SKP_int i, dataSize4; + double result; + + /* 4x unrolled loop */ + result = 0.0f; + dataSize4 = dataSize & 0xFFFC; + for( i = 0; i < dataSize4; i += 4 ) { + result += data1[ i + 0 ] * data2[ i + 0 ] + + data1[ i + 1 ] * data2[ i + 1 ] + + data1[ i + 2 ] * data2[ i + 2 ] + + data1[ i + 3 ] * data2[ i + 3 ]; + } + + /* add any remaining products */ + for( ; i < dataSize; i++ ) { + result += data1[ i ] * data2[ i ]; + } + + return result; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_interpolate.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_interpolate.c new file mode 100755 index 0000000..de8ac51 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_interpolate.c @@ -0,0 +1,47 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* Interpolate two vectors */ +void SKP_Silk_interpolate( + SKP_int xi[ MAX_LPC_ORDER ], /* O interpolated vector */ + const SKP_int x0[ MAX_LPC_ORDER ], /* I first vector */ + const SKP_int x1[ MAX_LPC_ORDER ], /* I second vector */ + const SKP_int ifact_Q2, /* I interp. factor, weight on 2nd vector */ + const SKP_int d /* I number of parameters */ +) +{ + SKP_int i; + + SKP_assert( ifact_Q2 >= 0 ); + SKP_assert( ifact_Q2 <= ( 1 << 2 ) ); + + for( i = 0; i < d; i++ ) { + xi[ i ] = ( SKP_int )( ( SKP_int32 )x0[ i ] + SKP_RSHIFT( SKP_MUL( ( SKP_int32 )x1[ i ] - ( SKP_int32 )x0[ i ], ifact_Q2 ), 2 ) ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_k2a_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_k2a_FLP.c new file mode 100755 index 0000000..72f8725 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_k2a_FLP.c @@ -0,0 +1,58 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_k2a.c * + * * + * step up function, converts reflection coefficients to prediction * + * coefficients * + * * + * Copyright 2008 (c), Skype Limited * + * Date: 080103 * + * */ +#include "SKP_Silk_SigProc_FLP.h" + +/* step up function, converts reflection coefficients to prediction coefficients */ +void SKP_Silk_k2a_FLP( + SKP_float *A, /* O: prediction coefficients [order] */ + const SKP_float *rc, /* I: reflection coefficients [order] */ + SKP_int32 order /* I: prediction order */ +) +{ + SKP_int k, n; + SKP_float Atmp[ SKP_Silk_MAX_ORDER_LPC ]; + + for( k = 0; k < order; k++ ){ + for( n = 0; n < k; n++ ){ + Atmp[ n ] = A[ n ]; + } + for( n = 0; n < k; n++ ) { + A[ n ] += Atmp[ k - n - 1 ] * rc[ k ]; + } + A[ k ] = -rc[ k ]; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_levinsondurbin_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_levinsondurbin_FLP.c new file mode 100755 index 0000000..b9092da --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_levinsondurbin_FLP.c @@ -0,0 +1,77 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FLP.h" + +/* Solve the normal equations using the Levinson-Durbin recursion */ +SKP_float SKP_Silk_levinsondurbin_FLP( /* O prediction error energy */ + SKP_float A[], /* O prediction coefficients [order] */ + const SKP_float corr[], /* I input auto-correlations [order + 1] */ + const SKP_int order /* I prediction order */ +) +{ + SKP_int i, mHalf, m; + SKP_float min_nrg, nrg, t, km, Atmp1, Atmp2; + + min_nrg = 1e-12f * corr[ 0 ] + 1e-9f; + nrg = corr[ 0 ]; + nrg = SKP_max_float(min_nrg, nrg); + A[ 0 ] = corr[ 1 ] / nrg; + nrg -= A[ 0 ] * corr[ 1 ]; + nrg = SKP_max_float(min_nrg, nrg); + + for( m = 1; m < order; m++ ) + { + t = corr[ m + 1 ]; + for( i = 0; i < m; i++ ) { + t -= A[ i ] * corr[ m - i ]; + } + + /* reflection coefficient */ + km = t / nrg; + + /* residual energy */ + nrg -= km * t; + nrg = SKP_max_float(min_nrg, nrg); + + mHalf = m >> 1; + for( i = 0; i < mHalf; i++ ) { + Atmp1 = A[ i ]; + Atmp2 = A[ m - i - 1 ]; + A[ m - i - 1 ] -= km * Atmp1; + A[ i ] -= km * Atmp2; + } + if( m & 1 ) { + A[ mHalf ] -= km * A[ mHalf ]; + } + A[ m ] = km; + } + + /* return the residual energy */ + return nrg; +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lin2log.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lin2log.c new file mode 100755 index 0000000..cf30908 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lin2log.c @@ -0,0 +1,49 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_lin2log.c * + * * + * Convert input to a log scale * + * Approximation of 128 * log2() * + * * + * Copyright 2006 (c), Skype Limited * + * Date: 060221 * + * */ +#include "SKP_Silk_SigProc_FIX.h" +/* Approximation of 128 * log2() (very close inverse of approx 2^() below) */ +/* Convert input to a log scale */ +SKP_int32 SKP_Silk_lin2log( const SKP_int32 inLin ) /* I: Input in linear scale */ +{ + SKP_int32 lz, frac_Q7; + + SKP_Silk_CLZ_FRAC( inLin, &lz, &frac_Q7 ); + + /* Piece-wise parabolic approximation */ + return( SKP_LSHIFT( 31 - lz, 7 ) + SKP_SMLAWB( frac_Q7, SKP_MUL( frac_Q7, 128 - frac_Q7 ), 179 ) ); +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_log2lin.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_log2lin.c new file mode 100755 index 0000000..ee73b2a --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_log2lin.c @@ -0,0 +1,61 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_log2lin.c * + * * + * Convert input to a linear scale * + * * + * Copyright 2006 (c), Skype Limited * + * Date: 060221 * + * */ +#include "SKP_Silk_SigProc_FIX.h" + +/* Approximation of 2^() (very close inverse of SKP_Silk_lin2log()) */ +/* Convert input to a linear scale */ +SKP_int32 SKP_Silk_log2lin( const SKP_int32 inLog_Q7 ) /* I: Input on log scale */ +{ + SKP_int32 out, frac_Q7; + + if( inLog_Q7 < 0 ) { + return( 0 ); + } else if( inLog_Q7 >= ( 31 << 7 ) ) { + /* Saturate, and prevent wrap-around */ + return( SKP_int32_MAX ); + } + + out = SKP_LSHIFT( 1, SKP_RSHIFT( inLog_Q7, 7 ) ); + frac_Q7 = inLog_Q7 & 0x7F; + if( inLog_Q7 < 2048 ) { + /* Piece-wise parabolic approximation */ + out = SKP_ADD_RSHIFT( out, SKP_MUL( out, SKP_SMLAWB( frac_Q7, SKP_MUL( frac_Q7, 128 - frac_Q7 ), -174 ) ), 7 ); + } else { + /* Piece-wise parabolic approximation */ + out = SKP_MLA( out, SKP_RSHIFT( out, 7 ), SKP_SMLAWB( frac_Q7, SKP_MUL( frac_Q7, 128 - frac_Q7 ), -174 ) ); + } + return out; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lowpass_int.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lowpass_int.c new file mode 100755 index 0000000..0f29be9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lowpass_int.c @@ -0,0 +1,61 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_lowpass_int.c * + * * + * First order low-pass filter, with input as SKP_int32, running at * + * 48 kHz * + * * + * Copyright 2006 (c), Skype Limited * + * Date: 060221 * + * */ +#include "SKP_Silk_SigProc_FIX.h" + +/* First order low-pass filter, with input as SKP_int32, running at 48 kHz */ +void SKP_Silk_lowpass_int( + const SKP_int32 *in, /* I: Q25 48 kHz signal; length = len */ + SKP_int32 *S, /* I/O: Q25 state; length = 1 */ + SKP_int32 *out, /* O: Q25 48 kHz signal; length = len */ + const SKP_int32 len /* I: Number of samples */ +) +{ + SKP_int k; + SKP_int32 in_tmp, out_tmp, state; + + state = S[ 0 ]; + for( k = len; k > 0; k-- ) { + in_tmp = *in++; + in_tmp -= SKP_RSHIFT( in_tmp, 2 ); /* multiply by 0.75 */ + out_tmp = state + in_tmp; /* zero at nyquist */ + state = in_tmp - SKP_RSHIFT( out_tmp, 1 ); /* pole */ + *out++ = out_tmp; + } + S[ 0 ] = state; +} + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lowpass_short.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lowpass_short.c new file mode 100755 index 0000000..ed70dfa --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_lowpass_short.c @@ -0,0 +1,61 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_lowpass_short.c * + * * + * First order low-pass filter, with input as SKP_int16, running at * + * 48 kHz * + * * + * Copyright 2006 (c), Skype Limited * + * Date: 060221 * + * */ +#include "SKP_Silk_SigProc_FIX.h" + + +/* First order low-pass filter, with input as SKP_int16, running at 48 kHz */ +void SKP_Silk_lowpass_short( + const SKP_int16 *in, /* I: Q15 48 kHz signal; [len] */ + SKP_int32 *S, /* I/O: Q25 state; length = 1 */ + SKP_int32 *out, /* O: Q25 48 kHz signal; [len] */ + const SKP_int32 len /* O: Signal length */ +) +{ + SKP_int k; + SKP_int32 in_tmp, out_tmp, state; + + state = S[ 0 ]; + for( k = 0; k < len; k++ ) { + in_tmp = SKP_MUL( 768, (SKP_int32)in[k] ); /* multiply by 0.75, going from Q15 to Q25 */ + out_tmp = state + in_tmp; /* zero at nyquist */ + state = in_tmp - SKP_RSHIFT( out_tmp, 1 ); /* pole */ + out[ k ] = out_tmp; + } + S[ 0 ] = state; +} + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_macros.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_macros.h new file mode 100755 index 0000000..c845195 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_macros.h @@ -0,0 +1,125 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef _SKP_SILK_API_C_H_ +#define _SKP_SILK_API_C_H_ + +// This is an inline header file for general platform. + +// (a32 * (SKP_int32)((SKP_int16)(b32))) >> 16 output have to be 32bit int +#define SKP_SMULWB(a32, b32) ((((a32) >> 16) * (SKP_int32)((SKP_int16)(b32))) + ((((a32) & 0x0000FFFF) * (SKP_int32)((SKP_int16)(b32))) >> 16)) + +// a32 + (b32 * (SKP_int32)((SKP_int16)(c32))) >> 16 output have to be 32bit int +#define SKP_SMLAWB(a32, b32, c32) ((a32) + ((((b32) >> 16) * (SKP_int32)((SKP_int16)(c32))) + ((((b32) & 0x0000FFFF) * (SKP_int32)((SKP_int16)(c32))) >> 16))) + +// (a32 * (b32 >> 16)) >> 16 +#define SKP_SMULWT(a32, b32) (((a32) >> 16) * ((b32) >> 16) + ((((a32) & 0x0000FFFF) * ((b32) >> 16)) >> 16)) + +// a32 + (b32 * (c32 >> 16)) >> 16 +#define SKP_SMLAWT(a32, b32, c32) ((a32) + (((b32) >> 16) * ((c32) >> 16)) + ((((b32) & 0x0000FFFF) * ((c32) >> 16)) >> 16)) + +// (SKP_int32)((SKP_int16)(a3))) * (SKP_int32)((SKP_int16)(b32)) output have to be 32bit int +#define SKP_SMULBB(a32, b32) ((SKP_int32)((SKP_int16)(a32)) * (SKP_int32)((SKP_int16)(b32))) + +// a32 + (SKP_int32)((SKP_int16)(b32)) * (SKP_int32)((SKP_int16)(c32)) output have to be 32bit int +#define SKP_SMLABB(a32, b32, c32) ((a32) + ((SKP_int32)((SKP_int16)(b32))) * (SKP_int32)((SKP_int16)(c32))) + +// (SKP_int32)((SKP_int16)(a32)) * (b32 >> 16) +#define SKP_SMULBT(a32, b32) ((SKP_int32)((SKP_int16)(a32)) * ((b32) >> 16)) + +// a32 + (SKP_int32)((SKP_int16)(b32)) * (c32 >> 16) +#define SKP_SMLABT(a32, b32, c32) ((a32) + ((SKP_int32)((SKP_int16)(b32))) * ((c32) >> 16)) + +// a64 + (b32 * c32) +#define SKP_SMLAL(a64, b32, c32) (SKP_ADD64((a64), ((SKP_int64)(b32) * (SKP_int64)(c32)))) + +// (a32 * b32) >> 16 +#define SKP_SMULWW(a32, b32) SKP_MLA(SKP_SMULWB((a32), (b32)), (a32), SKP_RSHIFT_ROUND((b32), 16)) + +// a32 + ((b32 * c32) >> 16) +#define SKP_SMLAWW(a32, b32, c32) SKP_MLA(SKP_SMLAWB((a32), (b32), (c32)), (b32), SKP_RSHIFT_ROUND((c32), 16)) + +// (SKP_int32)(((SKP_int64)a32 * b32) >> 32) +#define SKP_SMMUL(a32, b32) (SKP_int32)SKP_RSHIFT64(SKP_SMULL((a32), (b32)), 32) + +/* add/subtract with output saturated */ +#define SKP_ADD_SAT32(a, b) ((((a) + (b)) & 0x80000000) == 0 ? \ + ((((a) & (b)) & 0x80000000) != 0 ? SKP_int32_MIN : (a)+(b)) : \ + ((((a) | (b)) & 0x80000000) == 0 ? SKP_int32_MAX : (a)+(b)) ) + +#define SKP_SUB_SAT32(a, b) ((((a)-(b)) & 0x80000000) == 0 ? \ + (( (a) & ((b)^0x80000000) & 0x80000000) ? SKP_int32_MIN : (a)-(b)) : \ + ((((a)^0x80000000) & (b) & 0x80000000) ? SKP_int32_MAX : (a)-(b)) ) + +SKP_INLINE SKP_int32 SKP_Silk_CLZ16(SKP_int16 in16) +{ + SKP_int32 out32 = 0; + if( in16 == 0 ) { + return 16; + } + /* test nibbles */ + if( in16 & 0xFF00 ) { + if( in16 & 0xF000 ) { + in16 >>= 12; + } else { + out32 += 4; + in16 >>= 8; + } + } else { + if( in16 & 0xFFF0 ) { + out32 += 8; + in16 >>= 4; + } else { + out32 += 12; + } + } + /* test bits and return */ + if( in16 & 0xC ) { + if( in16 & 0x8 ) + return out32 + 0; + else + return out32 + 1; + } else { + if( in16 & 0xE ) + return out32 + 2; + else + return out32 + 3; + } +} + +SKP_INLINE SKP_int32 SKP_Silk_CLZ32(SKP_int32 in32) +{ + /* test highest 16 bits and convert to SKP_int16 */ + if( in32 & 0xFFFF0000 ) { + return SKP_Silk_CLZ16((SKP_int16)(in32 >> 16)); + } else { + return SKP_Silk_CLZ16((SKP_int16)in32) + 16; + } +} + +#endif //_SKP_SILK_API_C_H_ + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_main.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_main.h new file mode 100755 index 0000000..fa01317 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_main.h @@ -0,0 +1,388 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_MAIN_H +#define SKP_SILK_MAIN_H + +#include "SKP_Silk_SigProc_FIX.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "SKP_Silk_define.h" +#include "SKP_Silk_structs.h" +#include "SKP_Silk_tables.h" +#include "SKP_Silk_PLC.h" + + +/* Encodes signs of excitation */ +void SKP_Silk_encode_signs( + SKP_Silk_range_coder_state *psRC, /* I/O Range coder state */ + const SKP_int8 q[], /* I pulse signal */ + const SKP_int length, /* I length of input */ + const SKP_int sigtype, /* I Signal type */ + const SKP_int QuantOffsetType, /* I Quantization offset type */ + const SKP_int RateLevelIndex /* I Rate Level Index */ +); + +/* Decodes signs of excitation */ +void SKP_Silk_decode_signs( + SKP_Silk_range_coder_state *psRC, /* I/O Range coder state */ + SKP_int q[], /* I/O pulse signal */ + const SKP_int length, /* I length of output */ + const SKP_int sigtype, /* I Signal type */ + const SKP_int QuantOffsetType, /* I Quantization offset type */ + const SKP_int RateLevelIndex /* I Rate Level Index */ +); + +/* Control internal sampling rate */ +SKP_int SKP_Silk_control_audio_bandwidth( + SKP_Silk_encoder_state *psEncC, /* I/O Pointer to Silk encoder state */ + const SKP_int32 TargetRate_bps /* I Target max bitrate (bps) */ +); + +/***************/ +/* Shell coder */ +/***************/ + +/* Encode quantization indices of excitation */ +void SKP_Silk_encode_pulses( + SKP_Silk_range_coder_state *psRC, /* I/O Range coder state */ + const SKP_int sigtype, /* I Sigtype */ + const SKP_int QuantOffsetType, /* I QuantOffsetType */ + const SKP_int8 q[], /* I quantization indices */ + const SKP_int frame_length /* I Frame length */ +); + +/* Shell encoder, operates on one shell code frame of 16 pulses */ +void SKP_Silk_shell_encoder( + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_int *pulses0 /* I data: nonnegative pulse amplitudes */ +); + +/* Shell decoder, operates on one shell code frame of 16 pulses */ +void SKP_Silk_shell_decoder( + SKP_int *pulses0, /* O data: nonnegative pulse amplitudes */ + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_int pulses4 /* I number of pulses per pulse-subframe */ +); + +/***************/ +/* Range coder */ +/***************/ +/* Range encoder for one symbol */ +void SKP_Silk_range_encoder( + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_int data, /* I uncompressed data */ + const SKP_uint16 prob[] /* I cumulative density functions */ +); + +/* Range encoder for multiple symbols */ +void SKP_Silk_range_encoder_multi( + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_int data[], /* I uncompressed data [nSymbols] */ + const SKP_uint16 * const prob[], /* I cumulative density functions */ + const SKP_int nSymbols /* I number of data symbols */ +); + +/* Range decoder for one symbol */ +void SKP_Silk_range_decoder( + SKP_int data[], /* O uncompressed data */ + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_uint16 prob[], /* I cumulative density function */ + SKP_int probIx /* I initial (middle) entry of cdf */ +); + +/* Range decoder for multiple symbols */ +void SKP_Silk_range_decoder_multi( + SKP_int data[], /* O uncompressed data [nSymbols] */ + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_uint16 * const prob[], /* I cumulative density functions */ + const SKP_int probStartIx[], /* I initial (middle) entries of cdfs [nSymbols] */ + const SKP_int nSymbols /* I number of data symbols */ +); + +/* Initialize range coder structure for encoder */ +void SKP_Silk_range_enc_init( + SKP_Silk_range_coder_state *psRC /* O compressor data structure */ +); + +/* Initialize range coder structure for decoder */ +void SKP_Silk_range_dec_init( + SKP_Silk_range_coder_state *psRC, /* O compressor data structure */ + const SKP_uint8 buffer[], /* I buffer for compressed data [bufferLength] */ + const SKP_int32 bufferLength /* I buffer length (in bytes) */ +); + +/* Determine length of bitstream */ +SKP_int SKP_Silk_range_coder_get_length( /* O returns number of BITS in stream */ + const SKP_Silk_range_coder_state *psRC, /* I compressed data structure */ + SKP_int *nBytes /* O number of BYTES in stream */ +); + +/* Write decodable stream to buffer, and determine its length */ +void SKP_Silk_range_enc_wrap_up( + SKP_Silk_range_coder_state *psRC /* I/O compressed data structure */ +); + +/* Check that any remaining bits in the last byte are set to 1 */ +void SKP_Silk_range_coder_check_after_decoding( + SKP_Silk_range_coder_state *psRC /* I/O compressed data structure */ +); + +/* Gain scalar quantization with hysteresis, uniform on log scale */ +void SKP_Silk_gains_quant( + SKP_int ind[ NB_SUBFR ], /* O gain indices */ + SKP_int32 gain_Q16[ NB_SUBFR ], /* I/O gains (quantized out) */ + SKP_int *prev_ind, /* I/O last index in previous frame */ + const SKP_int conditional /* I first gain is delta coded if 1 */ +); + +/* Gains scalar dequantization, uniform on log scale */ +void SKP_Silk_gains_dequant( + SKP_int32 gain_Q16[ NB_SUBFR ], /* O quantized gains */ + const SKP_int ind[ NB_SUBFR ], /* I gain indices */ + SKP_int *prev_ind, /* I/O last index in previous frame */ + const SKP_int conditional /* I first gain is delta coded if 1 */ +); + +/* Convert NLSF parameters to stable AR prediction filter coefficients */ +void SKP_Silk_NLSF2A_stable( + SKP_int16 pAR_Q12[ MAX_LPC_ORDER ], /* O Stabilized AR coefs [LPC_order] */ + const SKP_int pNLSF[ MAX_LPC_ORDER ], /* I NLSF vector [LPC_order] */ + const SKP_int LPC_order /* I LPC/LSF order */ +); + +/* Interpolate two vectors */ +void SKP_Silk_interpolate( + SKP_int xi[ MAX_LPC_ORDER ], /* O interpolated vector */ + const SKP_int x0[ MAX_LPC_ORDER ], /* I first vector */ + const SKP_int x1[ MAX_LPC_ORDER ], /* I second vector */ + const SKP_int ifact_Q2, /* I interp. factor, weight on 2nd vector */ + const SKP_int d /* I number of parameters */ +); + +/***********************************/ +/* Noise shaping quantization (NSQ)*/ +/***********************************/ +void SKP_Silk_NSQ( + SKP_Silk_encoder_state *psEncC, /* I/O Encoder State */ + SKP_Silk_encoder_control *psEncCtrlC, /* I Encoder Control */ + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + const SKP_int16 x[], /* I prefiltered input signal */ + SKP_int8 q[], /* O quantized qulse signal */ + const SKP_int LSFInterpFactor_Q2, /* I LSF interpolation factor in Q2 */ + const SKP_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Short term prediction coefficients */ + const SKP_int16 LTPCoef_Q14[ LTP_ORDER * NB_SUBFR ], /* I Long term prediction coefficients */ + const SKP_int16 AR2_Q13[ NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I */ + const SKP_int HarmShapeGain_Q14[ NB_SUBFR ], /* I */ + const SKP_int Tilt_Q14[ NB_SUBFR ], /* I Spectral tilt */ + const SKP_int32 LF_shp_Q14[ NB_SUBFR ], /* I */ + const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */ + const SKP_int Lambda_Q10, /* I */ + const SKP_int LTP_scale_Q14 /* I LTP state scaling */ +); + +/* Noise shaping using delayed decision */ +void SKP_Silk_NSQ_del_dec( + SKP_Silk_encoder_state *psEncC, /* I/O Encoder State */ + SKP_Silk_encoder_control *psEncCtrlC, /* I Encoder Control */ + SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */ + const SKP_int16 x[], /* I Prefiltered input signal */ + SKP_int8 q[], /* O Quantized pulse signal */ + const SKP_int LSFInterpFactor_Q2, /* I LSF interpolation factor in Q2 */ + const SKP_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Prediction coefs */ + const SKP_int16 LTPCoef_Q14[ LTP_ORDER * NB_SUBFR ], /* I LT prediction coefs */ + const SKP_int16 AR2_Q13[ NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I */ + const SKP_int HarmShapeGain_Q14[ NB_SUBFR ], /* I */ + const SKP_int Tilt_Q14[ NB_SUBFR ], /* I Spectral tilt */ + const SKP_int32 LF_shp_Q14[ NB_SUBFR ], /* I */ + const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */ + const SKP_int Lambda_Q10, /* I */ + const SKP_int LTP_scale_Q14 /* I LTP state scaling */ +); + +/************/ +/* Silk VAD */ +/************/ +/* Initialize the Silk VAD */ +SKP_int SKP_Silk_VAD_Init( /* O Return value, 0 if success */ + SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ +); + +/* Silk VAD noise level estimation */ +void SKP_Silk_VAD_GetNoiseLevels( + const SKP_int32 pX[ VAD_N_BANDS ], /* I subband energies */ + SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ +); + +/* Get speech activity level in Q8 */ +SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Return value, 0 if success */ + SKP_Silk_VAD_state *psSilk_VAD, /* I/O Silk VAD state */ + SKP_int *pSA_Q8, /* O Speech activity level in Q8 */ + SKP_int *pSNR_dB_Q7, /* O SNR for current frame in Q7 */ + SKP_int pQuality_Q15[ VAD_N_BANDS ], /* O Smoothed SNR for each band */ + SKP_int *pTilt_Q15, /* O current frame's frequency tilt */ + const SKP_int16 pIn[], /* I PCM input [framelength] */ + const SKP_int framelength /* I Input frame length */ +); + +/* Detect signal in 8 - 12 khz range */ +void SKP_Silk_detect_SWB_input( + SKP_Silk_detect_SWB_state *psSWBdetect, /* I/O Encoder state */ + const SKP_int16 samplesIn[], /* I Input to encoder */ + SKP_int nSamplesIn /* I Length of input */ +); + +#if SWITCH_TRANSITION_FILTERING +/* Low-pass filter with variable cutoff frequency based on */ +/* piece-wise linear interpolation between elliptic filters */ +/* Start by setting transition_frame_no = 1; */ +void SKP_Silk_LP_variable_cutoff( + SKP_Silk_LP_state *psLP, /* I/O LP filter state */ + SKP_int16 *out, /* O Low-pass filtered output signal */ + const SKP_int16 *in, /* I Input signal */ + const SKP_int frame_length /* I Frame length */ +); +#endif + +/****************************************************/ +/* Decoder Functions */ +/****************************************************/ +SKP_int SKP_Silk_create_decoder( + SKP_Silk_decoder_state **ppsDec /* I/O Decoder state pointer pointer */ +); + +SKP_int SKP_Silk_free_decoder( + SKP_Silk_decoder_state *psDec /* I/O Decoder state pointer */ +); + +SKP_int SKP_Silk_init_decoder( + SKP_Silk_decoder_state *psDec /* I/O Decoder state pointer */ +); + +/* Set decoder sampling rate */ +void SKP_Silk_decoder_set_fs( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state pointer */ + SKP_int fs_kHz /* I Sampling frequency (kHz) */ +); + +/****************/ +/* Decode frame */ +/****************/ +SKP_int SKP_Silk_decode_frame( + SKP_Silk_decoder_state *psDec, /* I/O Pointer to Silk decoder state */ + SKP_int16 pOut[], /* O Pointer to output speech frame */ + SKP_int16 *pN, /* O Pointer to size of output frame */ + const SKP_uint8 pCode[], /* I Pointer to payload */ + const SKP_int nBytes, /* I Payload length */ + SKP_int action, /* I Action from Jitter Buffer */ + SKP_int *decBytes /* O Used bytes to decode this frame */ +); + +/* Decode parameters from payload */ +void SKP_Silk_decode_parameters( + SKP_Silk_decoder_state *psDec, /* I/O State */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int q[], /* O Excitation signal */ + const SKP_int fullDecoding /* I Flag to tell if only arithmetic decoding */ +); + +/* Core decoder. Performs inverse NSQ operation LTP + LPC */ +void SKP_Silk_decode_core( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I Decoder control */ + SKP_int16 xq[], /* O Decoded speech */ + const SKP_int q[ MAX_FRAME_LENGTH ] /* I Pulse signal */ +); + +/* NLSF vector decoder */ +void SKP_Silk_NLSF_MSVQ_decode( + SKP_int *pNLSF_Q15, /* O Pointer to decoded output [LPC_ORDER x 1] */ + const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Pointer to NLSF codebook struct */ + const SKP_int *NLSFIndices, /* I Pointer to NLSF indices [nStages x 1] */ + const SKP_int LPC_order /* I LPC order */ +); + +/**********************/ +/* Arithmetic coding */ +/*********************/ + +/* Decode quantization indices of excitation (Shell coding) */ +void SKP_Silk_decode_pulses( + SKP_Silk_range_coder_state *psRC, /* I/O Range coder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int q[], /* O Excitation signal */ + const SKP_int frame_length /* I Frame length (preliminary) */ +); + +/******************/ +/* CNG */ +/******************/ + +/* Reset CNG */ +void SKP_Silk_CNG_Reset( + SKP_Silk_decoder_state *psDec /* I/O Decoder state */ +); + +/* Updates CNG estimate, and applies the CNG when packet was lost */ +void SKP_Silk_CNG( + SKP_Silk_decoder_state *psDec, /* I/O Decoder state */ + SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + SKP_int16 signal[], /* I/O Signal */ + SKP_int length /* I Length of residual */ +); + +/* Encoding of various parameters */ +void SKP_Silk_encode_parameters( + SKP_Silk_encoder_state *psEncC, /* I/O Encoder state */ + SKP_Silk_encoder_control *psEncCtrlC, /* I/O Encoder control */ + SKP_Silk_range_coder_state *psRC, /* I/O Range coder state */ + const SKP_int8 *q /* I Quantization indices */ +); + +/* Extract lowest layer encoding */ +void SKP_Silk_get_low_layer_internal( + const SKP_uint8 *indata, /* I: Encoded input vector */ + const SKP_int16 nBytesIn, /* I: Number of input Bytes */ + SKP_uint8 *Layer0data, /* O: Layer0 payload */ + SKP_int16 *nLayer0Bytes /* O: Number of FEC Bytes */ +); + +/* Resets LBRR buffer, used if packet size changes */ +void SKP_Silk_LBRR_reset( + SKP_Silk_encoder_state *psEncC /* I/O Pointer to Silk encoder state */ +); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_main_FLP.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_main_FLP.h new file mode 100755 index 0000000..c8bb262 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_main_FLP.h @@ -0,0 +1,433 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_MAIN_FLP_H +#define SKP_SILK_MAIN_FLP_H + +#include "SKP_Silk_SigProc_FLP.h" +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_structs_FLP.h" +#include "SKP_Silk_tables_FLP.h" +#include "SKP_Silk_main.h" + +/* uncomment to compile without SSE optimizations */ +//#undef SKP_USE_SSE + +#ifdef __cplusplus +extern "C" +{ +#endif + +void SKP_Silk_LBRR_ctrl_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I Encoder state FLP */ + SKP_Silk_encoder_control *psEncCtrl /* I/O Encoder control */ +); + +void SKP_Silk_LTP_scale_ctrl_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl /* I/O Encoder control FLP */ +); + +void SKP_Silk_quant_LTP_gains_FLP( + SKP_float B[ NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */ + SKP_int cbk_index[ NB_SUBFR ], /* O Codebook index */ + SKP_int *periodicity_index, /* O Periodicity index */ + const SKP_float W[ NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Error weights */ + const SKP_float mu, /* I Mu value (R/D tradeoff) */ + const SKP_int lowComplexity /* I Flag for low complexity */ +); + +/*********************/ +/* Encoder Functions */ +/*********************/ + +/* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */ +void SKP_Silk_HP_variable_cutoff_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SKP_int16 *out, /* O High-pass filtered output signal */ + const SKP_int16 *in /* I Input signal */ +); + +/* Encoder main function */ +SKP_int SKP_Silk_encode_frame_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_uint8 *pCode, /* O Payload */ + SKP_int16 *pnBytesOut, /* I/O Number of payload bytes; */ + /* input: max length; output: used */ + const SKP_int16 *pIn /* I Input speech frame */ +); + +/* Limit, stabilize, and quantize NLSFs */ +void SKP_Silk_process_NLSFs_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SKP_float *pNLSF /* I/O NLSFs (quantized output) */ +); + +/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */ +void SKP_Silk_LBRR_encode_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SKP_uint8 *pCode, /* O Payload */ + SKP_int16 *pnBytesOut, /* I/O Payload bytes; in: max; out: used */ + const SKP_float xfw[] /* I Input signal */ +); + +/* Initializes the Silk encoder state */ +SKP_int SKP_Silk_init_encoder_FLP( + SKP_Silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ +); + +/* Control the Silk encoder */ +SKP_int SKP_Silk_control_encoder_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + const SKP_int PacketSize_ms, /* I Packet length (ms) */ + const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */ + const SKP_int PacketLoss_perc, /* I Packet loss rate (in percent) */ + const SKP_int DTX_enabled, /* I Enable / disable DTX */ + const SKP_int Complexity /* I Complexity (0->low; 1->medium; 2->high) */ +); + +/****************/ +/* Prefiltering */ +/****************/ +void SKP_Silk_prefilter_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + const SKP_Silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */ + SKP_float xw[], /* O Weighted signal */ + const SKP_float x[] /* I Speech signal */ +); + +/**************************/ +/* Noise shaping analysis */ +/**************************/ +/* Compute noise shaping coefficients and initial gain values */ +void SKP_Silk_noise_shape_analysis_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const SKP_float *pitch_res, /* I LPC residual from pitch analysis */ + const SKP_float *x /* I Input signal [frame_length + la_shape] */ +); + +/* Autocorrelations for a warped frequency axis */ +void SKP_Silk_warped_autocorrelation_FLP( + SKP_float *corr, /* O Result [order + 1] */ + const SKP_float *input, /* I Input data to correlate */ + const SKP_float warping, /* I Warping coefficient */ + const SKP_int length, /* I Length of input */ + const SKP_int order /* I Correlation order (even) */ +); + +/**************/ +/* Find pitch */ +/**************/ +void SKP_Silk_find_pitch_lags_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SKP_float res[], /* O Residual */ + const SKP_float x[] /* I Speech signal */ +); + +/******************/ +/* NLSF Quantizer */ +/******************/ +/* NLSF vector encoder */ +void SKP_Silk_NLSF_MSVQ_encode_FLP( + SKP_int *NLSFIndices, /* O Codebook path vector [ CB_STAGES ] */ + SKP_float *pNLSF, /* I/O Quantized NLSF vector [ LPC_ORDER ] */ + const SKP_Silk_NLSF_CB_FLP *psNLSF_CB_FLP, /* I Codebook object */ + const SKP_float *pNLSF_q_prev, /* I Prev. quantized NLSF vector [LPC_ORDER] */ + const SKP_float *pW, /* I NLSF weight vector [ LPC_ORDER ] */ + const SKP_float NLSF_mu, /* I Rate weight for the RD optimization */ + const SKP_float NLSF_mu_fluc_red, /* I Fluctuation reduction error weight */ + const SKP_int NLSF_MSVQ_Survivors,/* I Max survivors from each stage */ + const SKP_int LPC_order, /* I LPC order */ + const SKP_int deactivate_fluc_red /* I Deactivate fluctuation reduction */ +); + +/* NLSF vector decoder */ +void SKP_Silk_NLSF_MSVQ_decode_FLP( + SKP_float *pNLSF, /* O Decoded output vector [ LPC_ORDER ] */ + const SKP_Silk_NLSF_CB_FLP *psNLSF_CB_FLP, /* I NLSF codebook struct */ + const SKP_int *NLSFIndices, /* I NLSF indices [ nStages ] */ + const SKP_int LPC_order /* I LPC order used */ +); + +/* Rate-Distortion calculations for multiple input data vectors */ +void SKP_Silk_NLSF_VQ_rate_distortion_FLP( + SKP_float *pRD, /* O Rate-distortion values [psNLSF_CBS_FLP->nVectors*N] */ + const SKP_Silk_NLSF_CBS_FLP *psNLSF_CBS_FLP, /* I NLSF codebook stage struct */ + const SKP_float *in, /* I Input vectors to be quantized */ + const SKP_float *w, /* I Weight vector */ + const SKP_float *rate_acc, /* I Accumulated rates from previous stage */ + const SKP_float mu, /* I Weight between weighted error and rate */ + const SKP_int N, /* I Number of input vectors to be quantized */ + const SKP_int LPC_order /* I LPC order */ +); + +/* compute weighted quantization errors for LPC_order element input vectors, over one codebook stage */ +void SKP_Silk_NLSF_VQ_sum_error_FLP( + SKP_float *err, /* O Weighted quantization errors [ N * K ] */ + const SKP_float *in, /* I Input vectors [ N * LPC_order ] */ + const SKP_float *w, /* I Weighting vectors [ N * LPC_order ] */ + const SKP_float *pCB, /* I Codebook vectors [ K * LPC_order ] */ + const SKP_int N, /* I Number of input vectors */ + const SKP_int K, /* I Number of codebook vectors */ + const SKP_int LPC_order /* I LPC order */ +); + +/* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ +SKP_float SKP_Silk_residual_energy_covar_FLP( /* O Weighted residual energy */ + const SKP_float *c, /* I Filter coefficients */ + SKP_float *wXX, /* I/O Weighted correlation matrix, reg. out */ + const SKP_float *wXx, /* I Weighted correlation vector */ + const SKP_float wxx, /* I Weighted correlation value */ + const SKP_int D /* I Dimension */ +); + +/* Entropy constrained MATRIX-weighted VQ, for a single input data vector */ +void SKP_Silk_VQ_WMat_EC_FLP( + SKP_int *ind, /* O Index of best codebook vector */ + SKP_float *rate_dist, /* O Best weighted quant. error + mu * rate */ + const SKP_float *in, /* I Input vector to be quantized */ + const SKP_float *W, /* I Weighting matrix */ + const SKP_int16 *cb, /* I Codebook */ + const SKP_int16 *cl_Q6, /* I Code length for each codebook vector */ + const SKP_float mu, /* I Tradeoff between WSSE and rate */ + const SKP_int L /* I Number of vectors in codebook */ +); + +/* Processing of gains */ +void SKP_Silk_process_gains_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl /* I/O Encoder control FLP */ +); + +void SKP_Silk_find_LTP_FLP( + SKP_float b[ NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ + SKP_float WLTP[NB_SUBFR*LTP_ORDER*LTP_ORDER], /* O Weight for LTP quantization */ + SKP_float *LTPredCodGain, /* O LTP coding gain */ + const SKP_float r_first[], /* I LPC residual, signal + state for 10 ms */ + const SKP_float r_last[], /* I LPC residual, signal + state for 10 ms */ + const SKP_int lag[ NB_SUBFR ], /* I LTP lags */ + const SKP_float Wght[ NB_SUBFR ], /* I Weights */ + const SKP_int subfr_length, /* I Subframe length */ + const SKP_int mem_offset /* I Number of samples in LTP memory */ +); + +void SKP_Silk_find_LPC_FLP( + SKP_float NLSF[], /* O NLSFs */ + SKP_int *interpIndex, /* O NLSF interp. index for NLSF interp. */ + const SKP_float prev_NLSFq[], /* I Previous NLSFs, for NLSF interpolation */ + const SKP_int useInterpNLSFs, /* I Flag */ + const SKP_int LPC_order, /* I LPC order */ + const SKP_float x[], /* I Input signal */ + const SKP_int subfr_length /* I Subframe length incl preceeding samples */ +); + +void SKP_Silk_LTP_analysis_filter_FLP( + SKP_float *LTP_res, /* O LTP res NB_SUBFR*(pre_lgth+subfr_lngth) */ + const SKP_float *x, /* I Input signal, with preceeding samples */ + const SKP_float B[ LTP_ORDER * NB_SUBFR ], /* I LTP coefficients for each subframe */ + const SKP_int pitchL[ NB_SUBFR ], /* I Pitch lags */ + const SKP_float invGains[ NB_SUBFR ], /* I Inverse quantization gains */ + const SKP_int subfr_length, /* I Length of each subframe */ + const SKP_int pre_length /* I Preceeding samples for each subframe */ +); + +void SKP_Silk_residual_energy_FLP( + SKP_float nrgs[ NB_SUBFR ], /* O Residual energy per subframe */ + const SKP_float x[], /* I Input signal */ + SKP_float a[ 2 ][ MAX_LPC_ORDER ],/* I AR coefs for each frame half */ + const SKP_float gains[], /* I Quantization gains */ + const SKP_int subfr_length, /* I Subframe length */ + const SKP_int LPC_order /* I LPC order */ +); + +void SKP_Silk_find_pred_coefs_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const SKP_float res_pitch[] /* I Residual from pitch analysis */ +); + +/* 16th order LPC analysis filter */ +void SKP_Silk_LPC_analysis_filter_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length, /* I Length of input signal */ + const SKP_int Order /* I LPC order */ +); + +/* 16th order LPC analysis filter, does not write first 16 samples */ +void SKP_Silk_LPC_analysis_filter16_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +); + +/* 12th order LPC analysis filter, does not write first 12 samples */ +void SKP_Silk_LPC_analysis_filter12_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +); + +/* 10th order LPC analysis filter, does not write first 10 samples */ +void SKP_Silk_LPC_analysis_filter10_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +); + +/* 8th order LPC analysis filter, does not write first 8 samples */ +void SKP_Silk_LPC_analysis_filter8_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +); + +/* 6th order LPC analysis filter, does not write first 6 samples */ +void SKP_Silk_LPC_analysis_filter6_FLP( + SKP_float r_LPC[], /* O LPC residual signal */ + const SKP_float PredCoef[], /* I LPC coefficients */ + const SKP_float s[], /* I Input signal */ + const SKP_int length /* I Length of input signal */ +); + +/******************/ +/* Linear Algebra */ +/******************/ +/* Calculates correlation matrix X'*X */ +void SKP_Silk_corrMatrix_FLP( + const SKP_float *x, /* I x vector [ L+order-1 ] used to create X */ + const SKP_int L, /* I Length of vectors */ + const SKP_int Order, /* I Max lag for correlation */ + SKP_float *XX /* O X'*X correlation matrix [order x order] */ +); + +/* Calculates correlation vector X'*t */ +void SKP_Silk_corrVector_FLP( + const SKP_float *x, /* I x vector [L+order-1] used to create X */ + const SKP_float *t, /* I Target vector [L] */ + const SKP_int L, /* I Length of vecors */ + const SKP_int Order, /* I Max lag for correlation */ + SKP_float *Xt /* O X'*t correlation vector [order] */ +); + +/* Add noise to matrix diagonal */ +void SKP_Silk_regularize_correlations_FLP( + SKP_float *XX, /* I/O Correlation matrices */ + SKP_float *xx, /* I/O Correlation values */ + const SKP_float noise, /* I Noise energy to add */ + const SKP_int D /* I Dimension of XX */ +); + +/* Function to solve linear equation Ax = b, when A is an MxM symmetric square matrix */ +void SKP_Silk_solve_LDL_FLP( + SKP_float *A, /* I/O Symmetric square matrix, out: reg. */ + const SKP_int M, /* I Size of matrix */ + const SKP_float *b, /* I Pointer to b vector */ + SKP_float *x /* O Pointer to x solution vector */ +); + +/* Apply sine window to signal vector. */ +/* Window types: */ +/* 1 -> sine window from 0 to pi/2 */ +/* 2 -> sine window from pi/2 to pi */ +void SKP_Silk_apply_sine_window_FLP( + SKP_float px_win[], /* O Pointer to windowed signal */ + const SKP_float px[], /* I Pointer to input signal */ + const SKP_int win_type, /* I Selects a window type */ + const SKP_int length /* I Window length, multiple of 4 */ +); + +/* Wrappers. Calls flp / fix code */ + +/* Convert AR filter coefficients to NLSF parameters */ +void SKP_Silk_A2NLSF_FLP( + SKP_float *pNLSF, /* O NLSF vector [ LPC_order ] */ + const SKP_float *pAR, /* I LPC coefficients [ LPC_order ] */ + const SKP_int LPC_order /* I LPC order */ +); + +/* Convert NLSF parameters to AR prediction filter coefficients */ +void SKP_Silk_NLSF2A_stable_FLP( + SKP_float *pAR, /* O LPC coefficients [ LPC_order ] */ + const SKP_float *pNLSF, /* I NLSF vector [ LPC_order ] */ + const SKP_int LPC_order /* I LPC order */ +); + +/* NLSF stabilizer, for a single input data vector */ +void SKP_Silk_NLSF_stabilize_FLP( + SKP_float *pNLSF, /* I/O (Un)stable NLSF vector [ LPC_order ] */ + const SKP_float *pNDelta_min, /* I Normalized delta min vector[LPC_order+1]*/ + const SKP_int LPC_order /* I LPC order */ +); + +/* Interpolation function with fixed point rounding */ +void SKP_Silk_interpolate_wrapper_FLP( + SKP_float xi[], /* O Interpolated vector */ + const SKP_float x0[], /* I First vector */ + const SKP_float x1[], /* I Second vector */ + const SKP_float ifact, /* I Interp. factor, weight on second vector */ + const SKP_int d /* I Number of parameters */ +); + +/****************************************/ +/* Floating-point Silk VAD wrapper */ +/****************************************/ +SKP_int SKP_Silk_VAD_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const SKP_int16 *pIn /* I Input signal */ +); + +/****************************************/ +/* Floating-point Silk NSQ wrapper */ +/****************************************/ +void SKP_Silk_NSQ_wrapper_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const SKP_float x[], /* I Prefiltered input signal */ + SKP_int8 q[], /* O Quantized pulse signal */ + const SKP_int useLBRR /* I LBRR flag */ +); + +/* using log2() helps the fixed-point conversion */ +SKP_INLINE SKP_float SKP_Silk_log2( double x ) { return ( SKP_float )( 3.32192809488736 * log10( x ) ); } + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_noise_shape_analysis_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_noise_shape_analysis_FLP.c new file mode 100755 index 0000000..2208b9e --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_noise_shape_analysis_FLP.c @@ -0,0 +1,382 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +/* Compute gain to make warped filter coefficients have a zero mean log frequency response on a */ +/* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.) */ +SKP_INLINE SKP_float warped_gain( + const SKP_float *coefs, + SKP_float lambda, + SKP_int order +) { + SKP_int i; + SKP_float gain; + + lambda = -lambda; + gain = coefs[ order - 1 ]; + for( i = order - 2; i >= 0; i-- ) { + gain = lambda * gain + coefs[ i ]; + } + return (SKP_float)( 1.0f / ( 1.0f - lambda * gain ) ); +} + +/* Convert warped filter coefficients to monic pseudo-warped coefficients and limit maximum */ +/* amplitude of monic warped coefficients by using bandwidth expansion on the true coefficients */ +SKP_INLINE void warped_true2monic_coefs( + SKP_float *coefs_syn, + SKP_float *coefs_ana, + SKP_float lambda, + SKP_float limit, + SKP_int order +) { + SKP_int i, iter, ind = 0; + SKP_float tmp, maxabs, chirp, gain_syn, gain_ana; + + /* Convert to monic coefficients */ + for( i = order - 1; i > 0; i-- ) { + coefs_syn[ i - 1 ] -= lambda * coefs_syn[ i ]; + coefs_ana[ i - 1 ] -= lambda * coefs_ana[ i ]; + } + gain_syn = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs_syn[ 0 ] ); + gain_ana = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs_ana[ 0 ] ); + for( i = 0; i < order; i++ ) { + coefs_syn[ i ] *= gain_syn; + coefs_ana[ i ] *= gain_ana; + } + + /* Limit */ + for( iter = 0; iter < 10; iter++ ) { + /* Find maximum absolute value */ + maxabs = -1.0f; + for( i = 0; i < order; i++ ) { + tmp = SKP_max( SKP_abs_float( coefs_syn[ i ] ), SKP_abs_float( coefs_ana[ i ] ) ); + if( tmp > maxabs ) { + maxabs = tmp; + ind = i; + } + } + if( maxabs <= limit ) { + /* Coefficients are within range - done */ + return; + } + + /* Convert back to true warped coefficients */ + for( i = 1; i < order; i++ ) { + coefs_syn[ i - 1 ] += lambda * coefs_syn[ i ]; + coefs_ana[ i - 1 ] += lambda * coefs_ana[ i ]; + } + gain_syn = 1.0f / gain_syn; + gain_ana = 1.0f / gain_ana; + for( i = 0; i < order; i++ ) { + coefs_syn[ i ] *= gain_syn; + coefs_ana[ i ] *= gain_ana; + } + + /* Apply bandwidth expansion */ + chirp = 0.99f - ( 0.8f + 0.1f * iter ) * ( maxabs - limit ) / ( maxabs * ( ind + 1 ) ); + SKP_Silk_bwexpander_FLP( coefs_syn, order, chirp ); + SKP_Silk_bwexpander_FLP( coefs_ana, order, chirp ); + + /* Convert to monic warped coefficients */ + for( i = order - 1; i > 0; i-- ) { + coefs_syn[ i - 1 ] -= lambda * coefs_syn[ i ]; + coefs_ana[ i - 1 ] -= lambda * coefs_ana[ i ]; + } + gain_syn = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs_syn[ 0 ] ); + gain_ana = ( 1.0f - lambda * lambda ) / ( 1.0f + lambda * coefs_ana[ 0 ] ); + for( i = 0; i < order; i++ ) { + coefs_syn[ i ] *= gain_syn; + coefs_ana[ i ] *= gain_ana; + } + } + SKP_assert( 0 ); +} + +/* Compute noise shaping coefficients and initial gain values */ +void SKP_Silk_noise_shape_analysis_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const SKP_float *pitch_res, /* I LPC residual from pitch analysis */ + const SKP_float *x /* I Input signal [frame_length + la_shape] */ +) +{ + SKP_Silk_shape_state_FLP *psShapeSt = &psEnc->sShape; + SKP_int k, nSamples; + SKP_float SNR_adj_dB, HarmBoost, HarmShapeGain, Tilt; + SKP_float nrg, pre_nrg, log_energy, log_energy_prev, energy_variation; + SKP_float delta, BWExp1, BWExp2, gain_mult, gain_add, strength, b, warping; + SKP_float x_windowed[ SHAPE_LPC_WIN_MAX ]; + SKP_float auto_corr[ MAX_SHAPE_LPC_ORDER + 1 ]; + const SKP_float *x_ptr, *pitch_res_ptr; + + /* Point to start of first LPC analysis block */ + x_ptr = x - psEnc->sCmn.la_shape; + + /****************/ + /* CONTROL SNR */ + /****************/ + /* Reduce SNR_dB values if recent bitstream has exceeded TargetRate */ + psEncCtrl->current_SNR_dB = psEnc->SNR_dB - 0.05f * psEnc->BufferedInChannel_ms; + + /* Reduce SNR_dB if inband FEC used */ + if( psEnc->speech_activity > LBRR_SPEECH_ACTIVITY_THRES ) { + psEncCtrl->current_SNR_dB -= psEnc->inBandFEC_SNR_comp; + } + + /****************/ + /* GAIN CONTROL */ + /****************/ + /* Input quality is the average of the quality in the lowest two VAD bands */ + psEncCtrl->input_quality = 0.5f * ( psEncCtrl->input_quality_bands[ 0 ] + psEncCtrl->input_quality_bands[ 1 ] ); + + /* Coding quality level, between 0.0 and 1.0 */ + psEncCtrl->coding_quality = SKP_sigmoid( 0.25f * ( psEncCtrl->current_SNR_dB - 18.0f ) ); + + /* Reduce coding SNR during low speech activity */ + b = 1.0f - psEnc->speech_activity; + SNR_adj_dB = psEncCtrl->current_SNR_dB - + BG_SNR_DECR_dB * psEncCtrl->coding_quality * ( 0.5f + 0.5f * psEncCtrl->input_quality ) * b * b; + + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + /* Reduce gains for periodic signals */ + SNR_adj_dB += HARM_SNR_INCR_dB * psEnc->LTPCorr; + } else { + /* For unvoiced signals and low-quality input, adjust the quality slower than SNR_dB setting */ + SNR_adj_dB += ( -0.4f * psEncCtrl->current_SNR_dB + 6.0f ) * ( 1.0f - psEncCtrl->input_quality ); + } + + /*************************/ + /* SPARSENESS PROCESSING */ + /*************************/ + /* Set quantizer offset */ + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + /* Initally set to 0; may be overruled in process_gains(..) */ + psEncCtrl->sCmn.QuantOffsetType = 0; + psEncCtrl->sparseness = 0.0f; + } else { + /* Sparseness measure, based on relative fluctuations of energy per 2 milliseconds */ + nSamples = 2 * psEnc->sCmn.fs_kHz; + energy_variation = 0.0f; + log_energy_prev = 0.0f; + pitch_res_ptr = pitch_res; + for( k = 0; k < FRAME_LENGTH_MS / 2; k++ ) { + nrg = ( SKP_float )nSamples + ( SKP_float )SKP_Silk_energy_FLP( pitch_res_ptr, nSamples ); + log_energy = SKP_Silk_log2( nrg ); + if( k > 0 ) { + energy_variation += SKP_abs_float( log_energy - log_energy_prev ); + } + log_energy_prev = log_energy; + pitch_res_ptr += nSamples; + } + psEncCtrl->sparseness = SKP_sigmoid( 0.4f * ( energy_variation - 5.0f ) ); + + /* Set quantization offset depending on sparseness measure */ + if( psEncCtrl->sparseness > SPARSENESS_THRESHOLD_QNT_OFFSET ) { + psEncCtrl->sCmn.QuantOffsetType = 0; + } else { + psEncCtrl->sCmn.QuantOffsetType = 1; + } + + /* Increase coding SNR for sparse signals */ + SNR_adj_dB += SPARSE_SNR_INCR_dB * ( psEncCtrl->sparseness - 0.5f ); + } + + /*******************************/ + /* Control bandwidth expansion */ + /*******************************/ + /* More BWE for signals with high prediction gain */ + strength = FIND_PITCH_WHITE_NOISE_FRACTION * psEncCtrl->predGain; /* between 0.0 and 1.0 */ + BWExp1 = BWExp2 = BANDWIDTH_EXPANSION / ( 1.0f + strength * strength ); + delta = LOW_RATE_BANDWIDTH_EXPANSION_DELTA * ( 1.0f - 0.75f * psEncCtrl->coding_quality ); + BWExp1 -= delta; + BWExp2 += delta; + /* BWExp1 will be applied after BWExp2, so make it relative */ + BWExp1 /= BWExp2; + + if( psEnc->sCmn.warping_Q16 > 0 ) { + /* Slightly more warping in analysis will move quantization noise up in frequency, where it's better masked */ + warping = (SKP_float)psEnc->sCmn.warping_Q16 / 65536.0f + 0.01f * psEncCtrl->coding_quality; + } else { + warping = 0.0f; + } + + /********************************************/ + /* Compute noise shaping AR coefs and gains */ + /********************************************/ + for( k = 0; k < NB_SUBFR; k++ ) { + /* Apply window: sine slope followed by flat part followed by cosine slope */ + SKP_int shift, slope_part, flat_part; + flat_part = psEnc->sCmn.fs_kHz * 5; + slope_part = ( psEnc->sCmn.shapeWinLength - flat_part ) / 2; + + SKP_Silk_apply_sine_window_FLP( x_windowed, x_ptr, 1, slope_part ); + shift = slope_part; + SKP_memcpy( x_windowed + shift, x_ptr + shift, flat_part * sizeof(SKP_float) ); + shift += flat_part; + SKP_Silk_apply_sine_window_FLP( x_windowed + shift, x_ptr + shift, 2, slope_part ); + + /* Update pointer: next LPC analysis block */ + x_ptr += psEnc->sCmn.subfr_length; + + if( psEnc->sCmn.warping_Q16 > 0 ) { + /* Calculate warped auto correlation */ + SKP_Silk_warped_autocorrelation_FLP( auto_corr, x_windowed, warping, + psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder ); + } else { + /* Calculate regular auto correlation */ + SKP_Silk_autocorrelation_FLP( auto_corr, x_windowed, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder + 1 ); + } + + /* Add white noise, as a fraction of energy */ + auto_corr[ 0 ] += auto_corr[ 0 ] * SHAPE_WHITE_NOISE_FRACTION; + + /* Convert correlations to prediction coefficients, and compute residual energy */ + nrg = SKP_Silk_levinsondurbin_FLP( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], auto_corr, psEnc->sCmn.shapingLPCOrder ); + psEncCtrl->Gains[ k ] = ( SKP_float )sqrt( nrg ); + + if( psEnc->sCmn.warping_Q16 > 0 ) { + /* Adjust gain for warping */ + psEncCtrl->Gains[ k ] *= warped_gain( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], warping, psEnc->sCmn.shapingLPCOrder ); + } + + /* Bandwidth expansion for synthesis filter shaping */ + SKP_Silk_bwexpander_FLP( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder, BWExp2 ); + + /* Compute noise shaping filter coefficients */ + SKP_memcpy( + &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ], + &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], + psEnc->sCmn.shapingLPCOrder * sizeof( SKP_float ) ); + + /* Bandwidth expansion for analysis filter shaping */ + SKP_Silk_bwexpander_FLP( &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder, BWExp1 ); + + /* Ratio of prediction gains, in energy domain */ + SKP_Silk_LPC_inverse_pred_gain_FLP( &pre_nrg, &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder ); + SKP_Silk_LPC_inverse_pred_gain_FLP( &nrg, &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ], psEnc->sCmn.shapingLPCOrder ); + psEncCtrl->GainsPre[ k ] = 1.0f - 0.7f * ( 1.0f - pre_nrg / nrg ); + + /* Convert to monic warped prediction coefficients and limit absolute values */ + warped_true2monic_coefs( &psEncCtrl->AR2[ k * MAX_SHAPE_LPC_ORDER ], &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ], + warping, 3.999f, psEnc->sCmn.shapingLPCOrder ); + } + + /*****************/ + /* Gain tweaking */ + /*****************/ + /* Increase gains during low speech activity and put lower limit on gains */ + gain_mult = ( SKP_float )pow( 2.0f, -0.16f * SNR_adj_dB ); + gain_add = ( SKP_float )pow( 2.0f, 0.16f * NOISE_FLOOR_dB ) + + ( SKP_float )pow( 2.0f, 0.16f * RELATIVE_MIN_GAIN_dB ) * psEnc->avgGain; + for( k = 0; k < NB_SUBFR; k++ ) { + psEncCtrl->Gains[ k ] *= gain_mult; + psEncCtrl->Gains[ k ] += gain_add; + psEnc->avgGain += psEnc->speech_activity * GAIN_SMOOTHING_COEF * ( psEncCtrl->Gains[ k ] - psEnc->avgGain ); + } + + /************************************************/ + /* Decrease level during fricatives (de-essing) */ + /************************************************/ + gain_mult = 1.0f + INPUT_TILT + psEncCtrl->coding_quality * HIGH_RATE_INPUT_TILT; + if( psEncCtrl->input_tilt <= 0.0f && psEncCtrl->sCmn.sigtype == SIG_TYPE_UNVOICED ) { + SKP_float essStrength = -psEncCtrl->input_tilt * psEnc->speech_activity * ( 1.0f - psEncCtrl->sparseness ); + if( psEnc->sCmn.fs_kHz == 24 ) { + gain_mult *= ( SKP_float )pow( 2.0f, -0.16f * DE_ESSER_COEF_SWB_dB * essStrength ); + } else if( psEnc->sCmn.fs_kHz == 16 ) { + gain_mult *= (SKP_float)pow( 2.0f, -0.16f * DE_ESSER_COEF_WB_dB * essStrength ); + } else { + SKP_assert( psEnc->sCmn.fs_kHz == 12 || psEnc->sCmn.fs_kHz == 8 ); + } + } + + for( k = 0; k < NB_SUBFR; k++ ) { + psEncCtrl->GainsPre[ k ] *= gain_mult; + } + + /************************************************/ + /* Control low-frequency shaping and noise tilt */ + /************************************************/ + /* Less low frequency shaping for noisy inputs */ + strength = LOW_FREQ_SHAPING * ( 1.0f + LOW_QUALITY_LOW_FREQ_SHAPING_DECR * ( psEncCtrl->input_quality_bands[ 0 ] - 1.0f ) ); + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + /* Reduce low frequencies quantization noise for periodic signals, depending on pitch lag */ + /*f = 400; freqz([1, -0.98 + 2e-4 * f], [1, -0.97 + 7e-4 * f], 2^12, Fs); axis([0, 1000, -10, 1])*/ + for( k = 0; k < NB_SUBFR; k++ ) { + b = 0.2f / psEnc->sCmn.fs_kHz + 3.0f / psEncCtrl->sCmn.pitchL[ k ]; + psEncCtrl->LF_MA_shp[ k ] = -1.0f + b; + psEncCtrl->LF_AR_shp[ k ] = 1.0f - b - b * strength; + } + Tilt = - HP_NOISE_COEF - + (1 - HP_NOISE_COEF) * HARM_HP_NOISE_COEF * psEnc->speech_activity; + } else { + b = 1.3f / psEnc->sCmn.fs_kHz; + psEncCtrl->LF_MA_shp[ 0 ] = -1.0f + b; + psEncCtrl->LF_AR_shp[ 0 ] = 1.0f - b - b * strength * 0.6f; + for( k = 1; k < NB_SUBFR; k++ ) { + psEncCtrl->LF_MA_shp[ k ] = psEncCtrl->LF_MA_shp[ 0 ]; + psEncCtrl->LF_AR_shp[ k ] = psEncCtrl->LF_AR_shp[ 0 ]; + } + Tilt = -HP_NOISE_COEF; + } + + /****************************/ + /* HARMONIC SHAPING CONTROL */ + /****************************/ + /* Control boosting of harmonic frequencies */ + HarmBoost = LOW_RATE_HARMONIC_BOOST * ( 1.0f - psEncCtrl->coding_quality ) * psEnc->LTPCorr; + + /* More harmonic boost for noisy input signals */ + HarmBoost += LOW_INPUT_QUALITY_HARMONIC_BOOST * ( 1.0f - psEncCtrl->input_quality ); + + if( USE_HARM_SHAPING && psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + /* Harmonic noise shaping */ + HarmShapeGain = HARMONIC_SHAPING; + + /* More harmonic noise shaping for high bitrates or noisy input */ + HarmShapeGain += HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING * + ( 1.0f - ( 1.0f - psEncCtrl->coding_quality ) * psEncCtrl->input_quality ); + + /* Less harmonic noise shaping for less periodic signals */ + HarmShapeGain *= ( SKP_float )sqrt( psEnc->LTPCorr ); + } else { + HarmShapeGain = 0.0f; + } + + /*************************/ + /* Smooth over subframes */ + /*************************/ + for( k = 0; k < NB_SUBFR; k++ ) { + psShapeSt->HarmBoost_smth += SUBFR_SMTH_COEF * ( HarmBoost - psShapeSt->HarmBoost_smth ); + psEncCtrl->HarmBoost[ k ] = psShapeSt->HarmBoost_smth; + psShapeSt->HarmShapeGain_smth += SUBFR_SMTH_COEF * ( HarmShapeGain - psShapeSt->HarmShapeGain_smth ); + psEncCtrl->HarmShapeGain[ k ] = psShapeSt->HarmShapeGain_smth; + psShapeSt->Tilt_smth += SUBFR_SMTH_COEF * ( Tilt - psShapeSt->Tilt_smth ); + psEncCtrl->Tilt[ k ] = psShapeSt->Tilt_smth; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_analysis_core_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_analysis_core_FLP.c new file mode 100755 index 0000000..3362648 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_analysis_core_FLP.c @@ -0,0 +1,625 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/***************************************************************************** +* +* Pitch analyser function +* +******************************************************************************/ +#include "SKP_Silk_SigProc_FLP.h" +#include "SKP_Silk_SigProc_FIX.h" +#include "./SKP_Silk_pitch_est_defines_FLP.h" +#include "SKP_Silk_common_pitch_est_defines.h" + +#define SCRATCH_SIZE 22 + +/************************************************************/ +/* Definitions */ +/************************************************************/ +#define eps 1.192092896e-07f + +/* using log2() helps the fixed-point conversion */ +SKP_INLINE SKP_float SKP_P_log2(double x) { return (SKP_float)(3.32192809488736 * log10(x)); } + +/************************************************************/ +/* Internally used functions */ +/************************************************************/ +static void SKP_P_Ana_calc_corr_st3( + SKP_float cross_corr_st3[ PITCH_EST_NB_SUBFR ][ PITCH_EST_NB_CBKS_STAGE3_MAX ][ PITCH_EST_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */ + const SKP_float signal[], /* I vector to correlate */ + SKP_int start_lag, /* I start lag */ + SKP_int sf_length, /* I sub frame length */ + SKP_int complexity /* I Complexity setting */ +); + +static void SKP_P_Ana_calc_energy_st3( + SKP_float energies_st3[ PITCH_EST_NB_SUBFR ][ PITCH_EST_NB_CBKS_STAGE3_MAX ][ PITCH_EST_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */ + const SKP_float signal[], /* I vector to correlate */ + SKP_int start_lag, /* I start lag */ + SKP_int sf_length, /* I sub frame length */ + SKP_int complexity /* I Complexity setting */ +); + +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +//% CORE PITCH ANALYSIS FUNCTION % +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +SKP_int SKP_Silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced */ + const SKP_float *signal, /* I signal of length PITCH_EST_FRAME_LENGTH_MS*Fs_kHz */ + SKP_int *pitch_out, /* O 4 pitch lag values */ + SKP_int *lagIndex, /* O lag Index */ + SKP_int *contourIndex, /* O pitch contour Index */ + SKP_float *LTPCorr, /* I/O normalized correlation; input: value from previous frame */ + SKP_int prevLag, /* I last lag of previous frame; set to zero is unvoiced */ + const SKP_float search_thres1, /* I first stage threshold for lag candidates 0 - 1 */ + const SKP_float search_thres2, /* I final threshold for lag candidates 0 - 1 */ + const SKP_int Fs_kHz, /* I sample frequency (kHz) */ + const SKP_int complexity /* I Complexity setting, 0-2, where 2 is highest */ +) +{ + SKP_float signal_8kHz[ PITCH_EST_FRAME_LENGTH_MS * 8 ]; + SKP_float signal_4kHz[ PITCH_EST_FRAME_LENGTH_MS * 4 ]; + SKP_float scratch_mem[ PITCH_EST_MAX_FRAME_LENGTH * 3 ]; + SKP_float filt_state[ PITCH_EST_MAX_DECIMATE_STATE_LENGTH ]; + SKP_int i, k, d, j; + SKP_float threshold, contour_bias; + SKP_float C[PITCH_EST_NB_SUBFR][(PITCH_EST_MAX_LAG >> 1) + 5]; /* use to be +2 but then valgrind reported errors for SWB */ + SKP_float CC[PITCH_EST_NB_CBKS_STAGE2_EXT]; + const SKP_float *target_ptr, *basis_ptr; + double cross_corr, normalizer, energy, energy_tmp; + SKP_int d_srch[PITCH_EST_D_SRCH_LENGTH]; + SKP_int16 d_comp[(PITCH_EST_MAX_LAG >> 1) + 5]; + SKP_int length_d_srch, length_d_comp; + SKP_float Cmax, CCmax, CCmax_b, CCmax_new_b, CCmax_new; + SKP_int CBimax, CBimax_new, lag, start_lag, end_lag, lag_new; + SKP_int cbk_offset, cbk_size; + SKP_float lag_log2, prevLag_log2, delta_lag_log2_sqr; + SKP_float energies_st3[ PITCH_EST_NB_SUBFR ][ PITCH_EST_NB_CBKS_STAGE3_MAX ][ PITCH_EST_NB_STAGE3_LAGS ]; + SKP_float cross_corr_st3[ PITCH_EST_NB_SUBFR ][ PITCH_EST_NB_CBKS_STAGE3_MAX ][ PITCH_EST_NB_STAGE3_LAGS ]; + + SKP_int diff, lag_counter; + SKP_int frame_length, frame_length_8kHz, frame_length_4kHz; + SKP_int sf_length, sf_length_8kHz; + SKP_int min_lag, min_lag_8kHz, min_lag_4kHz; + SKP_int max_lag, max_lag_8kHz, max_lag_4kHz; + + SKP_int nb_cbks_stage2; + + /* Check for valid sampling frequency */ + SKP_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 || Fs_kHz == 24 ); + + /* Check for valid complexity setting */ + SKP_assert( complexity >= SKP_Silk_PITCH_EST_MIN_COMPLEX ); + SKP_assert( complexity <= SKP_Silk_PITCH_EST_MAX_COMPLEX ); + + SKP_assert( search_thres1 >= 0.0f && search_thres1 <= 1.0f ); + SKP_assert( search_thres2 >= 0.0f && search_thres2 <= 1.0f ); + + /* Setup frame lengths max / min lag for the sampling frequency */ + frame_length = PITCH_EST_FRAME_LENGTH_MS * Fs_kHz; + frame_length_4kHz = PITCH_EST_FRAME_LENGTH_MS * 4; + frame_length_8kHz = PITCH_EST_FRAME_LENGTH_MS * 8; + sf_length = SKP_RSHIFT( frame_length, 3 ); + sf_length_8kHz = SKP_RSHIFT( frame_length_8kHz, 3 ); + min_lag = PITCH_EST_MIN_LAG_MS * Fs_kHz; + min_lag_4kHz = PITCH_EST_MIN_LAG_MS * 4; + min_lag_8kHz = PITCH_EST_MIN_LAG_MS * 8; + max_lag = PITCH_EST_MAX_LAG_MS * Fs_kHz; + max_lag_4kHz = PITCH_EST_MAX_LAG_MS * 4; + max_lag_8kHz = PITCH_EST_MAX_LAG_MS * 8; + + SKP_memset(C, 0, sizeof(SKP_float) * PITCH_EST_NB_SUBFR * ((PITCH_EST_MAX_LAG >> 1) + 5)); + + /* Resample from input sampled at Fs_kHz to 8 kHz */ + if( Fs_kHz == 12 ) { + SKP_int16 signal_12[ 12 * PITCH_EST_FRAME_LENGTH_MS ]; + SKP_int16 signal_8[ 8 * PITCH_EST_FRAME_LENGTH_MS ]; + SKP_int32 R23[ 6 ]; + + /* Resample to 12 -> 8 khz */ + SKP_memset( R23, 0, 6 * sizeof( SKP_int32 ) ); + SKP_float2short_array( signal_12, signal, PITCH_EST_FRAME_LENGTH_MS * 12); + SKP_Silk_resampler_down2_3( R23, signal_8, signal_12, PITCH_EST_FRAME_LENGTH_MS * 12 ); + SKP_short2float_array( signal_8kHz, signal_8, frame_length_8kHz ); + } else if( Fs_kHz == 16 ) { + if( complexity == SKP_Silk_PITCH_EST_MAX_COMPLEX ) { + SKP_assert( 4 <= PITCH_EST_MAX_DECIMATE_STATE_LENGTH ); + SKP_memset( filt_state, 0, 4 * sizeof(SKP_float) ); + + SKP_Silk_decimate2_coarse_FLP( signal, filt_state, signal_8kHz, + scratch_mem, frame_length_8kHz ); + } else { + SKP_assert( 2 <= PITCH_EST_MAX_DECIMATE_STATE_LENGTH ); + SKP_memset( filt_state, 0, 2 * sizeof(SKP_float) ); + + SKP_Silk_decimate2_coarsest_FLP( signal, filt_state, signal_8kHz, + scratch_mem, frame_length_8kHz ); + } + } else if( Fs_kHz == 24 ) { + SKP_int16 signal_24[ PITCH_EST_MAX_FRAME_LENGTH ]; + SKP_int16 signal_8[ 8 * PITCH_EST_FRAME_LENGTH_MS ]; + SKP_int32 filt_state_fix[ 8 ]; + + /* Resample to 24 -> 8 khz */ + SKP_float2short_array( signal_24, signal, 24 * PITCH_EST_FRAME_LENGTH_MS ); + SKP_memset( filt_state_fix, 0, 8 * sizeof(SKP_int32) ); + SKP_Silk_resampler_down3( filt_state_fix, signal_8, signal_24, 24 * PITCH_EST_FRAME_LENGTH_MS ); + SKP_short2float_array( signal_8kHz, signal_8, frame_length_8kHz ); + } else { + SKP_assert( Fs_kHz == 8 ); + SKP_memcpy( signal_8kHz, signal, frame_length_8kHz * sizeof(SKP_float) ); + } + + /* Decimate again to 4 kHz. Set mem to zero */ + if( complexity == SKP_Silk_PITCH_EST_MAX_COMPLEX ) { + SKP_assert( 4 <= PITCH_EST_MAX_DECIMATE_STATE_LENGTH ); + SKP_memset( filt_state, 0, 4 * sizeof(SKP_float) ); + SKP_Silk_decimate2_coarse_FLP( signal_8kHz, filt_state, + signal_4kHz, scratch_mem, frame_length_4kHz ); + } else { + SKP_assert( 2 <= PITCH_EST_MAX_DECIMATE_STATE_LENGTH ); + SKP_memset( filt_state, 0, 2 * sizeof(SKP_float) ); + SKP_Silk_decimate2_coarsest_FLP( signal_8kHz, filt_state, + signal_4kHz, scratch_mem, frame_length_4kHz ); + } + + /* Low-pass filter */ + for( i = frame_length_4kHz - 1; i > 0; i-- ) { + signal_4kHz[ i ] += signal_4kHz[ i - 1 ]; + } + + /****************************************************************************** + * FIRST STAGE, operating in 4 khz + ******************************************************************************/ + target_ptr = &signal_4kHz[ SKP_RSHIFT( frame_length_4kHz, 1 ) ]; + for( k = 0; k < 2; k++ ) { + /* Check that we are within range of the array */ + SKP_assert( target_ptr >= signal_4kHz ); + SKP_assert( target_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz ); + + basis_ptr = target_ptr - min_lag_4kHz; + + /* Check that we are within range of the array */ + SKP_assert( basis_ptr >= signal_4kHz ); + SKP_assert( basis_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz ); + + /* Calculate first vector products before loop */ + cross_corr = SKP_Silk_inner_product_FLP( target_ptr, basis_ptr, sf_length_8kHz ); + normalizer = SKP_Silk_energy_FLP( basis_ptr, sf_length_8kHz ) + sf_length_8kHz * 4000.0f; + + C[ 0 ][ min_lag_4kHz ] += (SKP_float)(cross_corr / sqrt(normalizer)); + + /* From now on normalizer is computed recursively */ + for(d = min_lag_4kHz + 1; d <= max_lag_4kHz; d++) { + basis_ptr--; + + /* Check that we are within range of the array */ + SKP_assert( basis_ptr >= signal_4kHz ); + SKP_assert( basis_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz ); + + cross_corr = SKP_Silk_inner_product_FLP(target_ptr, basis_ptr, sf_length_8kHz); + + /* Add contribution of new sample and remove contribution from oldest sample */ + normalizer += + basis_ptr[ 0 ] * basis_ptr[ 0 ] - + basis_ptr[ sf_length_8kHz ] * basis_ptr[ sf_length_8kHz ]; + C[ 0 ][ d ] += (SKP_float)(cross_corr / sqrt( normalizer )); + } + /* Update target pointer */ + target_ptr += sf_length_8kHz; + } + + /* Apply short-lag bias */ + for( i = max_lag_4kHz; i >= min_lag_4kHz; i-- ) { + C[ 0 ][ i ] -= C[ 0 ][ i ] * i / 4096.0f; + } + + /* Sort */ + length_d_srch = 4 + 2 * complexity; + SKP_assert( 3 * length_d_srch <= PITCH_EST_D_SRCH_LENGTH ); + SKP_Silk_insertion_sort_decreasing_FLP( &C[ 0 ][ min_lag_4kHz ], d_srch, max_lag_4kHz - min_lag_4kHz + 1, length_d_srch ); + + /* Escape if correlation is very low already here */ + Cmax = C[ 0 ][ min_lag_4kHz ]; + target_ptr = &signal_4kHz[ SKP_RSHIFT( frame_length_4kHz, 1 ) ]; + energy = 1000.0f; + for( i = 0; i < SKP_RSHIFT( frame_length_4kHz, 1 ); i++ ) { + energy += target_ptr[i] * target_ptr[i]; + } + threshold = Cmax * Cmax; + if( energy / 16.0f > threshold ) { + SKP_memset(pitch_out, 0, PITCH_EST_NB_SUBFR * sizeof(SKP_int)); + *LTPCorr = 0.0f; + *lagIndex = 0; + *contourIndex = 0; + return 1; + } + + threshold = search_thres1 * Cmax; + for( i = 0; i < length_d_srch; i++ ) { + /* Convert to 8 kHz indices for the sorted correlation that exceeds the threshold */ + if( C[ 0 ][ min_lag_4kHz + i ] > threshold ) { + d_srch[ i ] = SKP_LSHIFT( d_srch[ i ] + min_lag_4kHz, 1 ); + } else { + length_d_srch = i; + break; + } + } + SKP_assert( length_d_srch > 0 ); + + for( i = min_lag_8kHz - 5; i < max_lag_8kHz + 5; i++ ) { + d_comp[ i ] = 0; + } + for( i = 0; i < length_d_srch; i++ ) { + d_comp[ d_srch[ i ] ] = 1; + } + + /* Convolution */ + for( i = max_lag_8kHz + 3; i >= min_lag_8kHz; i-- ) { + d_comp[ i ] += d_comp[ i - 1 ] + d_comp[ i - 2 ]; + } + + length_d_srch = 0; + for( i = min_lag_8kHz; i < max_lag_8kHz + 1; i++ ) { + if( d_comp[ i + 1 ] > 0 ) { + d_srch[ length_d_srch ] = i; + length_d_srch++; + } + } + + /* Convolution */ + for( i = max_lag_8kHz + 3; i >= min_lag_8kHz; i-- ) { + d_comp[ i ] += d_comp[ i - 1 ] + d_comp[ i - 2 ] + d_comp[ i - 3 ]; + } + + length_d_comp = 0; + for( i = min_lag_8kHz; i < max_lag_8kHz + 4; i++ ) { + if( d_comp[ i ] > 0 ) { + d_comp[ length_d_comp ] = i - 2; + length_d_comp++; + } + } + + /********************************************************************************** + ** SECOND STAGE, operating at 8 kHz, on lag sections with high correlation + *************************************************************************************/ + /********************************************************************************* + * Find energy of each subframe projected onto its history, for a range of delays + *********************************************************************************/ + SKP_memset( C, 0, PITCH_EST_NB_SUBFR*((PITCH_EST_MAX_LAG >> 1) + 5) * sizeof(SKP_float)); // Is this needed? + + target_ptr = &signal_8kHz[ frame_length_4kHz ]; /* point to middle of frame */ + for( k = 0; k < PITCH_EST_NB_SUBFR; k++ ){ + + /* Check that we are within range of the array */ + SKP_assert( target_ptr >= signal_8kHz ); + SKP_assert( target_ptr + sf_length_8kHz <= signal_8kHz + frame_length_8kHz ); + + energy_tmp = SKP_Silk_energy_FLP( target_ptr, sf_length_8kHz ); + for( j = 0; j < length_d_comp; j++ ) { + d = d_comp[ j ]; + basis_ptr = target_ptr - d; + + /* Check that we are within range of the array */ + SKP_assert( basis_ptr >= signal_8kHz ); + SKP_assert( basis_ptr + sf_length_8kHz <= signal_8kHz + frame_length_8kHz ); + + cross_corr = SKP_Silk_inner_product_FLP( basis_ptr, target_ptr, sf_length_8kHz ); + energy = SKP_Silk_energy_FLP( basis_ptr, sf_length_8kHz ); + if (cross_corr > 0.0f) { + C[ k ][ d ] = (SKP_float)(cross_corr * cross_corr / (energy * energy_tmp + eps)); + } else { + C[ k ][ d ] = 0.0f; + } + } + target_ptr += sf_length_8kHz; + } + + /* search over lag range and lags codebook */ + /* scale factor for lag codebook, as a function of center lag */ + + CCmax = 0.0f; /* This value doesn't matter */ + CCmax_b = -1000.0f; + + CBimax = 0; /* To avoid returning undefined lag values */ + lag = -1; /* To check if lag with strong enough correlation has been found */ + + if( prevLag > 0 ) { + if( Fs_kHz == 12 ) { + prevLag = SKP_LSHIFT( prevLag, 1 ) / 3; + } else if( Fs_kHz == 16 ) { + prevLag = SKP_RSHIFT( prevLag, 1 ); + } else if( Fs_kHz == 24 ) { + prevLag = prevLag / 3; + } + prevLag_log2 = SKP_P_log2((double)prevLag); + } else { + prevLag_log2 = 0; + } + + /* If input is 8 khz use a larger codebook here because it is last stage */ + if( Fs_kHz == 8 && complexity > SKP_Silk_PITCH_EST_MIN_COMPLEX ) { + nb_cbks_stage2 = PITCH_EST_NB_CBKS_STAGE2_EXT; + } else { + nb_cbks_stage2 = PITCH_EST_NB_CBKS_STAGE2; + } + + for( k = 0; k < length_d_srch; k++ ) { + d = d_srch[ k ]; + for( j = 0; j < nb_cbks_stage2; j++ ) { + CC[j] = 0.0f; + for( i = 0; i < PITCH_EST_NB_SUBFR; i++ ) { + /* Try all codebooks */ + CC[ j ] += C[ i ][ d + SKP_Silk_CB_lags_stage2[ i ][ j ] ]; + } + } + /* Find best codebook */ + CCmax_new = -1000.0f; + CBimax_new = 0; + for( i = 0; i < nb_cbks_stage2; i++ ) { + if( CC[ i ] > CCmax_new ) { + CCmax_new = CC[ i ]; + CBimax_new = i; + } + } + CCmax_new = SKP_max_float(CCmax_new, 0.0f); /* To avoid taking square root of negative number later */ + CCmax_new_b = CCmax_new; + + /* Bias towards shorter lags */ + lag_log2 = SKP_P_log2((double)d); + CCmax_new_b -= PITCH_EST_FLP_SHORTLAG_BIAS * PITCH_EST_NB_SUBFR * lag_log2; + + /* Bias towards previous lag */ + if ( prevLag > 0 ) { + delta_lag_log2_sqr = lag_log2 - prevLag_log2; + delta_lag_log2_sqr *= delta_lag_log2_sqr; + CCmax_new_b -= PITCH_EST_FLP_PREVLAG_BIAS * PITCH_EST_NB_SUBFR * (*LTPCorr) * delta_lag_log2_sqr / (delta_lag_log2_sqr + 0.5f); + } + + if ( CCmax_new_b > CCmax_b && /* Find maximum biased correlation */ + CCmax_new > PITCH_EST_NB_SUBFR * search_thres2 * search_thres2 && /* Correlation needs to be high enough to be voiced */ + SKP_Silk_CB_lags_stage2[ 0 ][ CBimax_new ] <= min_lag_8kHz /* Lag must be in range */ + ) { + CCmax_b = CCmax_new_b; + CCmax = CCmax_new; + lag = d; + CBimax = CBimax_new; + } + } + + if( lag == -1 ) { + /* No suitable candidate found */ + SKP_memset( pitch_out, 0, PITCH_EST_NB_SUBFR * sizeof(SKP_int) ); + *LTPCorr = 0.0f; + *lagIndex = 0; + *contourIndex = 0; + return 1; + } + + if( Fs_kHz > 8 ) { + /* Search in original signal */ + + /* Compensate for decimation */ + SKP_assert( lag == SKP_SAT16( lag ) ); + if( Fs_kHz == 12 ) { + lag = SKP_RSHIFT_ROUND( SKP_SMULBB( lag, 3 ), 1 ); + } else if( Fs_kHz == 16 ) { + lag = SKP_LSHIFT( lag, 1 ); + } else { + lag = SKP_SMULBB( lag, 3 ); + } + + lag = SKP_LIMIT_int( lag, min_lag, max_lag ); + start_lag = SKP_max_int( lag - 2, min_lag ); + end_lag = SKP_min_int( lag + 2, max_lag ); + lag_new = lag; /* to avoid undefined lag */ + CBimax = 0; /* to avoid undefined lag */ + SKP_assert( CCmax >= 0.0f ); + *LTPCorr = (SKP_float)sqrt( CCmax / PITCH_EST_NB_SUBFR ); // Output normalized correlation + + CCmax = -1000.0f; + + /* Calculate the correlations and energies needed in stage 3 */ + SKP_P_Ana_calc_corr_st3( cross_corr_st3, signal, start_lag, sf_length, complexity ); + SKP_P_Ana_calc_energy_st3( energies_st3, signal, start_lag, sf_length, complexity ); + + lag_counter = 0; + SKP_assert( lag == SKP_SAT16( lag ) ); + contour_bias = PITCH_EST_FLP_FLATCONTOUR_BIAS / lag; + + /* Setup cbk parameters acording to complexity setting */ + cbk_size = (SKP_int)SKP_Silk_cbk_sizes_stage3[ complexity ]; + cbk_offset = (SKP_int)SKP_Silk_cbk_offsets_stage3[ complexity ]; + + for( d = start_lag; d <= end_lag; d++ ) { + for( j = cbk_offset; j < ( cbk_offset + cbk_size ); j++ ) { + cross_corr = 0.0; + energy = eps; + for( k = 0; k < PITCH_EST_NB_SUBFR; k++ ) { + energy += energies_st3[ k ][ j ][ lag_counter ]; + cross_corr += cross_corr_st3[ k ][ j ][ lag_counter ]; + } + if( cross_corr > 0.0 ) { + CCmax_new = (SKP_float)(cross_corr * cross_corr / energy); + /* Reduce depending on flatness of contour */ + diff = j - ( PITCH_EST_NB_CBKS_STAGE3_MAX >> 1 ); + CCmax_new *= ( 1.0f - contour_bias * diff * diff ); + } else { + CCmax_new = 0.0f; + } + + if( CCmax_new > CCmax && + ( d + (SKP_int)SKP_Silk_CB_lags_stage3[ 0 ][ j ] ) <= max_lag + ) { + CCmax = CCmax_new; + lag_new = d; + CBimax = j; + } + } + lag_counter++; + } + + for( k = 0; k < PITCH_EST_NB_SUBFR; k++ ) { + pitch_out[k] = lag_new + (SKP_int)SKP_Silk_CB_lags_stage3[ k ][ CBimax ]; + } + *lagIndex = lag_new - min_lag; + *contourIndex = CBimax; + } else { + /* Save Lags and correlation */ + SKP_assert( CCmax >= 0.0f ); + *LTPCorr = (SKP_float)sqrt(CCmax / PITCH_EST_NB_SUBFR); /* Output normalized correlation */ + for( k = 0; k < PITCH_EST_NB_SUBFR; k++ ) { + pitch_out[ k ] = lag + SKP_Silk_CB_lags_stage2[ k ][ CBimax ]; + } + *lagIndex = lag - min_lag; + *contourIndex = CBimax; + } + SKP_assert( *lagIndex >= 0 ); + /* return as voiced */ + return 0; +} + +static void SKP_P_Ana_calc_corr_st3( + SKP_float cross_corr_st3[ PITCH_EST_NB_SUBFR ][ PITCH_EST_NB_CBKS_STAGE3_MAX ][ PITCH_EST_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */ + const SKP_float signal[], /* I vector to correlate */ + SKP_int start_lag, /* I start lag */ + SKP_int sf_length, /* I sub frame length */ + SKP_int complexity /* I Complexity setting */ +) + /*********************************************************************** + Calculates the correlations used in stage 3 search. In order to cover + the whole lag codebook for all the searched offset lags (lag +- 2), + the following correlations are needed in each sub frame: + + sf1: lag range [-8,...,7] total 16 correlations + sf2: lag range [-4,...,4] total 9 correlations + sf3: lag range [-3,....4] total 8 correltions + sf4: lag range [-6,....8] total 15 correlations + + In total 48 correlations. The direct implementation computed in worst case + 4*12*5 = 240 correlations, but more likely around 120. + **********************************************************************/ +{ + const SKP_float *target_ptr, *basis_ptr; + SKP_int i, j, k, lag_counter; + SKP_int cbk_offset, cbk_size, delta, idx; + SKP_float scratch_mem[ SCRATCH_SIZE ]; + + SKP_assert( complexity >= SKP_Silk_PITCH_EST_MIN_COMPLEX ); + SKP_assert( complexity <= SKP_Silk_PITCH_EST_MAX_COMPLEX ); + + cbk_offset = SKP_Silk_cbk_offsets_stage3[ complexity ]; + cbk_size = SKP_Silk_cbk_sizes_stage3[ complexity ]; + + target_ptr = &signal[ SKP_LSHIFT( sf_length, 2 ) ]; /* Pointer to middle of frame */ + for( k = 0; k < PITCH_EST_NB_SUBFR; k++ ) { + lag_counter = 0; + + /* Calculate the correlations for each subframe */ + for( j = SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 0 ]; j <= SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 1 ]; j++ ) { + basis_ptr = target_ptr - ( start_lag + j ); + SKP_assert( lag_counter < SCRATCH_SIZE ); + scratch_mem[ lag_counter ] = (SKP_float)SKP_Silk_inner_product_FLP( target_ptr, basis_ptr, sf_length ); + lag_counter++; + } + + delta = SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 0 ]; + for( i = cbk_offset; i < ( cbk_offset + cbk_size ); i++ ) { + /* Fill out the 3 dim array that stores the correlations for */ + /* each code_book vector for each start lag */ + idx = SKP_Silk_CB_lags_stage3[ k ][ i ] - delta; + for( j = 0; j < PITCH_EST_NB_STAGE3_LAGS; j++ ) { + SKP_assert( idx + j < SCRATCH_SIZE ); + SKP_assert( idx + j < lag_counter ); + cross_corr_st3[ k ][ i ][ j ] = scratch_mem[ idx + j ]; + } + } + target_ptr += sf_length; + } +} + +static void SKP_P_Ana_calc_energy_st3( + SKP_float energies_st3[ PITCH_EST_NB_SUBFR ][ PITCH_EST_NB_CBKS_STAGE3_MAX ][ PITCH_EST_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */ + const SKP_float signal[], /* I vector to correlate */ + SKP_int start_lag, /* I start lag */ + SKP_int sf_length, /* I sub frame length */ + SKP_int complexity /* I Complexity setting */ +) +/**************************************************************** +Calculate the energies for first two subframes. The energies are +calculated recursively. +****************************************************************/ +{ + const SKP_float *target_ptr, *basis_ptr; + double energy; + SKP_int k, i, j, lag_counter; + SKP_int cbk_offset, cbk_size, delta, idx; + SKP_float scratch_mem[ SCRATCH_SIZE ]; + + SKP_assert( complexity >= SKP_Silk_PITCH_EST_MIN_COMPLEX ); + SKP_assert( complexity <= SKP_Silk_PITCH_EST_MAX_COMPLEX ); + + cbk_offset = SKP_Silk_cbk_offsets_stage3[ complexity ]; + cbk_size = SKP_Silk_cbk_sizes_stage3[ complexity ]; + + target_ptr = &signal[ SKP_LSHIFT( sf_length, 2 ) ]; + for( k = 0; k < PITCH_EST_NB_SUBFR; k++ ) { + lag_counter = 0; + + /* Calculate the energy for first lag */ + basis_ptr = target_ptr - ( start_lag + SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 0 ] ); + energy = SKP_Silk_energy_FLP( basis_ptr, sf_length ) + 1e-3; + SKP_assert( energy >= 0.0 ); + scratch_mem[lag_counter] = (SKP_float)energy; + lag_counter++; + + for( i = 1; i < ( SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 1 ] - SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 0 ] + 1 ); i++ ) { + /* remove part outside new window */ + energy -= basis_ptr[sf_length - i] * basis_ptr[sf_length - i]; + + /* add part that comes into window */ + energy += basis_ptr[ -i ] * basis_ptr[ -i ]; + + SKP_assert( lag_counter < SCRATCH_SIZE ); + scratch_mem[lag_counter] = ( SKP_float )SKP_max_float( energy, 1e-3 ); + lag_counter++; + } + + delta = SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 0 ]; + for( i = cbk_offset; i < ( cbk_offset + cbk_size ); i++ ) { + /* Fill out the 3 dim array that stores the correlations for */ + /* each code_book vector for each start lag */ + idx = SKP_Silk_CB_lags_stage3[ k ][ i ] - delta; + for(j = 0; j < PITCH_EST_NB_STAGE3_LAGS; j++){ + SKP_assert( idx + j < SCRATCH_SIZE ); + SKP_assert( idx + j < lag_counter ); + energies_st3[ k ][ i ][ j ] = scratch_mem[ idx + j ]; + SKP_assert( energies_st3[ k ][ i ][ j ] >= 0.0f ); + } + } + target_ptr += sf_length; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_defines.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_defines.h new file mode 100755 index 0000000..380f220 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_defines.h @@ -0,0 +1,40 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SIGPROCFIX_PITCH_EST_DEFINES_H +#define SIGPROCFIX_PITCH_EST_DEFINES_H + +/************************************************************/ +/* Definitions For Fix pitch estimator */ +/************************************************************/ + +#define PITCH_EST_SHORTLAG_BIAS_Q15 6554 /* 0.2f. for logarithmic weighting */ +#define PITCH_EST_PREVLAG_BIAS_Q15 6554 /* Prev lag bias */ +#define PITCH_EST_FLATCONTOUR_BIAS_Q20 52429 /* 0.05f */ + +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_defines_FLP.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_defines_FLP.h new file mode 100755 index 0000000..5944846 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_defines_FLP.h @@ -0,0 +1,40 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SIGPROCFLP_PITCH_EST_DEFINES_H +#define SIGPROCFLP_PITCH_EST_DEFINES_H + +/************************************************************/ +/* Definitions For FLP pitch estimator */ +/************************************************************/ + +#define PITCH_EST_FLP_SHORTLAG_BIAS 0.2f /* for logarithmic weighting */ +#define PITCH_EST_FLP_PREVLAG_BIAS 0.2f /* for logarithmic weighting */ +#define PITCH_EST_FLP_FLATCONTOUR_BIAS 0.05f + +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_tables.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_tables.c new file mode 100755 index 0000000..6c54795 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_pitch_est_tables.c @@ -0,0 +1,89 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_typedef.h" +#include "SKP_Silk_common_pitch_est_defines.h" + +/********************************************************/ +/* Auto Generated File from generate_pitch_est_tables.m */ +/********************************************************/ + +const SKP_int16 SKP_Silk_CB_lags_stage2[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE2_EXT] = +{ + {0, 2,-1,-1,-1, 0, 0, 1, 1, 0, 1}, + {0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0}, + {0,-1, 2, 1, 0, 1, 1, 0, 0,-1,-1} +}; + +const SKP_int16 SKP_Silk_CB_lags_stage3[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE3_MAX] = +{ + {-9,-7,-6,-5,-5,-4,-4,-3,-3,-2,-2,-2,-1,-1,-1, 0, 0, 0, 1, 1, 0, 1, 2, 2, 2, 3, 3, 4, 4, 5, 6, 5, 6, 8}, + {-3,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0,-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 2, 3}, + { 3, 3, 2, 2, 2, 2, 1, 2, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,-1, 0, 0,-1,-1,-1,-1,-1,-2,-2,-2}, + { 9, 8, 6, 5, 6, 5, 4, 4, 3, 3, 2, 2, 2, 1, 0, 1, 1, 0, 0, 0,-1,-1,-1,-2,-2,-2,-3,-3,-4,-4,-5,-5,-6,-7} + }; + +const SKP_int16 SKP_Silk_Lag_range_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ] [ PITCH_EST_NB_SUBFR ][ 2 ] = +{ + /* Lags to search for low number of stage3 cbks */ + { + {-2,6}, + {-1,5}, + {-1,5}, + {-2,7} + }, + /* Lags to search for middle number of stage3 cbks */ + { + {-4,8}, + {-1,6}, + {-1,6}, + {-4,9} + }, + /* Lags to search for max number of stage3 cbks */ + { + {-9,12}, + {-3,7}, + {-2,7}, + {-7,13} + } +}; + +const SKP_int16 SKP_Silk_cbk_sizes_stage3[SKP_Silk_PITCH_EST_MAX_COMPLEX + 1] = +{ + PITCH_EST_NB_CBKS_STAGE3_MIN, + PITCH_EST_NB_CBKS_STAGE3_MID, + PITCH_EST_NB_CBKS_STAGE3_MAX +}; + +const SKP_int16 SKP_Silk_cbk_offsets_stage3[SKP_Silk_PITCH_EST_MAX_COMPLEX + 1] = +{ + ((PITCH_EST_NB_CBKS_STAGE3_MAX - PITCH_EST_NB_CBKS_STAGE3_MIN) >> 1), + ((PITCH_EST_NB_CBKS_STAGE3_MAX - PITCH_EST_NB_CBKS_STAGE3_MID) >> 1), + 0 +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_prefilter_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_prefilter_FLP.c new file mode 100755 index 0000000..dfcf120 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_prefilter_FLP.c @@ -0,0 +1,202 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +/* +* SKP_Silk_prefilter. Prefilter for finding Quantizer input signal +*/ +SKP_INLINE void SKP_Silk_prefilt_FLP( + SKP_Silk_prefilter_state_FLP *P,/* I/O state */ + SKP_float st_res[], /* I */ + SKP_float xw[], /* O */ + SKP_float *HarmShapeFIR, /* I */ + SKP_float Tilt, /* I */ + SKP_float LF_MA_shp, /* I */ + SKP_float LF_AR_shp, /* I */ + SKP_int lag, /* I */ + SKP_int length /* I */ +); + +void SKP_Silk_warped_LPC_analysis_filter_FLP( + SKP_float state[], /* I/O State [order + 1] */ + SKP_float res[], /* O Residual signal [length] */ + const SKP_float coef[], /* I Coefficients [order] */ + const SKP_float input[], /* I Input signal [length] */ + const SKP_float lambda, /* I Warping factor */ + const SKP_int length, /* I Length of input signal */ + const SKP_int order /* I Filter order (even) */ +) +{ + SKP_int n, i; + SKP_float acc, tmp1, tmp2; + + /* Order must be even */ + SKP_assert( ( order & 1 ) == 0 ); + + for( n = 0; n < length; n++ ) { + /* Output of lowpass section */ + tmp2 = state[ 0 ] + lambda * state[ 1 ]; + state[ 0 ] = input[ n ]; + /* Output of allpass section */ + tmp1 = state[ 1 ] + lambda * ( state[ 2 ] - tmp2 ); + state[ 1 ] = tmp2; + acc = coef[ 0 ] * tmp2; + /* Loop over allpass sections */ + for( i = 2; i < order; i += 2 ) { + /* Output of allpass section */ + tmp2 = state[ i ] + lambda * ( state[ i + 1 ] - tmp1 ); + state[ i ] = tmp1; + acc += coef[ i - 1 ] * tmp1; + /* Output of allpass section */ + tmp1 = state[ i + 1 ] + lambda * ( state[ i + 2 ] - tmp2 ); + state[ i + 1 ] = tmp2; + acc += coef[ i ] * tmp2; + } + state[ order ] = tmp1; + acc += coef[ order - 1 ] * tmp1; + res[ n ] = input[ n ] - acc; + } +} + +/* +* SKP_Silk_prefilter. Main prefilter function +*/ +void SKP_Silk_prefilter_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + const SKP_Silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */ + SKP_float xw[], /* O Weighted signal */ + const SKP_float x[] /* I Speech signal */ +) +{ + SKP_Silk_prefilter_state_FLP *P = &psEnc->sPrefilt; + SKP_int j, k, lag; + SKP_float HarmShapeGain, Tilt, LF_MA_shp, LF_AR_shp; + SKP_float B[ 2 ]; + const SKP_float *AR1_shp; + const SKP_float *px; + SKP_float *pxw; + SKP_float HarmShapeFIR[ 3 ]; + SKP_float st_res[ MAX_FRAME_LENGTH / NB_SUBFR + MAX_SHAPE_LPC_ORDER ]; + + /* Set up pointers */ + px = x; + pxw = xw; + lag = P->lagPrev; + for( k = 0; k < NB_SUBFR; k++ ) { + /* Update Variables that change per sub frame */ + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + lag = psEncCtrl->sCmn.pitchL[ k ]; + } + + /* Noise shape parameters */ + HarmShapeGain = psEncCtrl->HarmShapeGain[ k ] * ( 1.0f - psEncCtrl->HarmBoost[ k ] ); + HarmShapeFIR[ 0 ] = SKP_Silk_HarmShapeFIR_FLP[ 0 ] * HarmShapeGain; + HarmShapeFIR[ 1 ] = SKP_Silk_HarmShapeFIR_FLP[ 1 ] * HarmShapeGain; + HarmShapeFIR[ 2 ] = SKP_Silk_HarmShapeFIR_FLP[ 2 ] * HarmShapeGain; + Tilt = psEncCtrl->Tilt[ k ]; + LF_MA_shp = psEncCtrl->LF_MA_shp[ k ]; + LF_AR_shp = psEncCtrl->LF_AR_shp[ k ]; + AR1_shp = &psEncCtrl->AR1[ k * MAX_SHAPE_LPC_ORDER ]; + + /* Short term FIR filtering */ + SKP_Silk_warped_LPC_analysis_filter_FLP( P->sAR_shp, st_res, AR1_shp, px, + (SKP_float)psEnc->sCmn.warping_Q16 / 65536.0f, psEnc->sCmn.subfr_length, psEnc->sCmn.shapingLPCOrder ); + + /* Reduce (mainly) low frequencies during harmonic emphasis */ + B[ 0 ] = psEncCtrl->GainsPre[ k ]; + B[ 1 ] = -psEncCtrl->GainsPre[ k ] * + ( psEncCtrl->HarmBoost[ k ] * HarmShapeGain + INPUT_TILT + psEncCtrl->coding_quality * HIGH_RATE_INPUT_TILT ); + pxw[ 0 ] = B[ 0 ] * st_res[ 0 ] + B[ 1 ] * P->sHarmHP; + for( j = 1; j < psEnc->sCmn.subfr_length; j++ ) { + pxw[ j ] = B[ 0 ] * st_res[ j ] + B[ 1 ] * st_res[ j - 1 ]; + } + P->sHarmHP = st_res[ psEnc->sCmn.subfr_length - 1 ]; + + SKP_Silk_prefilt_FLP( P, pxw, pxw, HarmShapeFIR, Tilt, LF_MA_shp, LF_AR_shp, lag, psEnc->sCmn.subfr_length ); + + px += psEnc->sCmn.subfr_length; + pxw += psEnc->sCmn.subfr_length; + } + P->lagPrev = psEncCtrl->sCmn.pitchL[ NB_SUBFR - 1 ]; +} + +/* +* Prefilter for finding Quantizer input signal +*/ +SKP_INLINE void SKP_Silk_prefilt_FLP( + SKP_Silk_prefilter_state_FLP *P,/* I/O state */ + SKP_float st_res[], /* I */ + SKP_float xw[], /* O */ + SKP_float *HarmShapeFIR, /* I */ + SKP_float Tilt, /* I */ + SKP_float LF_MA_shp, /* I */ + SKP_float LF_AR_shp, /* I */ + SKP_int lag, /* I */ + SKP_int length /* I */ +) +{ + SKP_int i; + SKP_int idx, LTP_shp_buf_idx; + SKP_float n_Tilt, n_LF, n_LTP; + SKP_float sLF_AR_shp, sLF_MA_shp; + SKP_float *LTP_shp_buf; + + /* To speed up use temp variables instead of using the struct */ + LTP_shp_buf = P->sLTP_shp; + LTP_shp_buf_idx = P->sLTP_shp_buf_idx; + sLF_AR_shp = P->sLF_AR_shp; + sLF_MA_shp = P->sLF_MA_shp; + + for( i = 0; i < length; i++ ) { + if( lag > 0 ) { + SKP_assert( HARM_SHAPE_FIR_TAPS == 3 ); + idx = lag + LTP_shp_buf_idx; + n_LTP = LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 - 1) & LTP_MASK ] * HarmShapeFIR[ 0 ]; + n_LTP += LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 ) & LTP_MASK ] * HarmShapeFIR[ 1 ]; + n_LTP += LTP_shp_buf[ ( idx - HARM_SHAPE_FIR_TAPS / 2 + 1) & LTP_MASK ] * HarmShapeFIR[ 2 ]; + } else { + n_LTP = 0; + } + + n_Tilt = sLF_AR_shp * Tilt; + n_LF = sLF_AR_shp * LF_AR_shp + sLF_MA_shp * LF_MA_shp; + + sLF_AR_shp = st_res[ i ] - n_Tilt; + sLF_MA_shp = sLF_AR_shp - n_LF; + + LTP_shp_buf_idx = ( LTP_shp_buf_idx - 1 ) & LTP_MASK; + LTP_shp_buf[ LTP_shp_buf_idx ] = sLF_MA_shp; + + xw[ i ] = sLF_MA_shp - n_LTP; + } + /* Copy temp variable back to state */ + P->sLF_AR_shp = sLF_AR_shp; + P->sLF_MA_shp = sLF_MA_shp; + P->sLTP_shp_buf_idx = LTP_shp_buf_idx; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_process_NLSFs_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_process_NLSFs_FLP.c new file mode 100755 index 0000000..bf67df9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_process_NLSFs_FLP.c @@ -0,0 +1,106 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include +#include "SKP_Silk_main_FLP.h" + +/* Limit, stabilize, convert and quantize NLSFs */ +void SKP_Silk_process_NLSFs_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SKP_float *pNLSF /* I/O NLSFs (quantized output) */ +) +{ + SKP_int doInterpolate; + SKP_float pNLSFW[ MAX_LPC_ORDER ]; + SKP_float NLSF_mu, NLSF_mu_fluc_red, i_sqr, NLSF_interpolation_factor = 0.0f; + const SKP_Silk_NLSF_CB_FLP *psNLSF_CB_FLP; + + /* Used only for NLSF interpolation */ + SKP_float pNLSF0_temp[ MAX_LPC_ORDER ]; + SKP_float pNLSFW0_temp[ MAX_LPC_ORDER ]; + SKP_int i; + + SKP_assert( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED || psEncCtrl->sCmn.sigtype == SIG_TYPE_UNVOICED ); + + /***********************/ + /* Calculate mu values */ + /***********************/ + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + NLSF_mu = 0.002f - 0.001f * psEnc->speech_activity; + NLSF_mu_fluc_red = 0.1f - 0.05f * psEnc->speech_activity; + } else { + NLSF_mu = 0.005f - 0.004f * psEnc->speech_activity; + NLSF_mu_fluc_red = 0.2f - 0.1f * ( psEnc->speech_activity + psEncCtrl->sparseness ); + } + + /* Calculate NLSF weights */ + SKP_Silk_NLSF_VQ_weights_laroia_FLP( pNLSFW, pNLSF, psEnc->sCmn.predictLPCOrder ); + + /* Update NLSF weights for interpolated NLSFs */ + doInterpolate = ( psEnc->sCmn.useInterpolatedNLSFs == 1 ) && ( psEncCtrl->sCmn.NLSFInterpCoef_Q2 < ( 1 << 2 ) ); + if( doInterpolate ) { + + /* Calculate the interpolated NLSF vector for the first half */ + NLSF_interpolation_factor = 0.25f * psEncCtrl->sCmn.NLSFInterpCoef_Q2; + SKP_Silk_interpolate_wrapper_FLP( pNLSF0_temp, psEnc->sPred.prev_NLSFq, pNLSF, + NLSF_interpolation_factor, psEnc->sCmn.predictLPCOrder ); + + /* Calculate first half NLSF weights for the interpolated NLSFs */ + SKP_Silk_NLSF_VQ_weights_laroia_FLP( pNLSFW0_temp, pNLSF0_temp, psEnc->sCmn.predictLPCOrder ); + + /* Update NLSF weights with contribution from first half */ + i_sqr = NLSF_interpolation_factor * NLSF_interpolation_factor; + for( i = 0; i < psEnc->sCmn.predictLPCOrder; i++ ) { + pNLSFW[ i ] = 0.5f * ( pNLSFW[ i ] + i_sqr * pNLSFW0_temp[ i ] ); + } + } + + /* Set pointer to the NLSF codebook for the current signal type and LPC order */ + psNLSF_CB_FLP = psEnc->psNLSF_CB_FLP[ psEncCtrl->sCmn.sigtype ]; + + /* Quantize NLSF parameters given the trained NLSF codebooks */ + SKP_Silk_NLSF_MSVQ_encode_FLP( psEncCtrl->sCmn.NLSFIndices, pNLSF, psNLSF_CB_FLP, psEnc->sPred.prev_NLSFq, pNLSFW, NLSF_mu, + NLSF_mu_fluc_red, psEnc->sCmn.NLSF_MSVQ_Survivors, psEnc->sCmn.predictLPCOrder, psEnc->sCmn.first_frame_after_reset ); + + /* Convert quantized NLSFs back to LPC coefficients */ + SKP_Silk_NLSF2A_stable_FLP( psEncCtrl->PredCoef[ 1 ], pNLSF, psEnc->sCmn.predictLPCOrder ); + + if( doInterpolate ) { + /* Calculate the interpolated, quantized NLSF vector for the first half */ + SKP_Silk_interpolate_wrapper_FLP( pNLSF0_temp, psEnc->sPred.prev_NLSFq, pNLSF, + NLSF_interpolation_factor, psEnc->sCmn.predictLPCOrder ); + + /* Convert back to LPC coefficients */ + SKP_Silk_NLSF2A_stable_FLP( psEncCtrl->PredCoef[ 0 ], pNLSF0_temp, psEnc->sCmn.predictLPCOrder ); + + } else { + /* Copy LPC coefficients for first half from second half */ + SKP_memcpy( psEncCtrl->PredCoef[ 0 ], psEncCtrl->PredCoef[ 1 ], psEnc->sCmn.predictLPCOrder * sizeof( SKP_float ) ); + } +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_process_gains_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_process_gains_FLP.c new file mode 100755 index 0000000..1e7cc16 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_process_gains_FLP.c @@ -0,0 +1,93 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +/* Processing of gains */ +void SKP_Silk_process_gains_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl /* I/O Encoder control FLP */ +) +{ + SKP_Silk_shape_state_FLP *psShapeSt = &psEnc->sShape; + SKP_int k; + SKP_int32 pGains_Q16[ NB_SUBFR ]; + SKP_float s, InvMaxSqrVal, gain, quant_offset; + + /* Gain reduction when LTP coding gain is high */ + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + s = 1.0f - 0.5f * SKP_sigmoid( 0.25f * ( psEncCtrl->LTPredCodGain - 12.0f ) ); + for( k = 0; k < NB_SUBFR; k++ ) { + psEncCtrl->Gains[ k ] *= s; + } + } + + /* Limit the quantized signal */ + InvMaxSqrVal = ( SKP_float )( pow( 2.0f, 0.33f * ( 21.0f - psEncCtrl->current_SNR_dB ) ) / psEnc->sCmn.subfr_length ); + + for( k = 0; k < NB_SUBFR; k++ ) { + /* Soft limit on ratio residual energy and squared gains */ + gain = psEncCtrl->Gains[ k ]; + gain = ( SKP_float )sqrt( gain * gain + psEncCtrl->ResNrg[ k ] * InvMaxSqrVal ); + psEncCtrl->Gains[ k ] = SKP_min_float( gain, 32767.0f ); + } + + /* Prepare gains for noise shaping quantization */ + for( k = 0; k < NB_SUBFR; k++ ) { + pGains_Q16[ k ] = ( SKP_int32 ) ( psEncCtrl->Gains[ k ] * 65536.0f ); + } + + /* Noise shaping quantization */ + SKP_Silk_gains_quant( psEncCtrl->sCmn.GainsIndices, pGains_Q16, + &psShapeSt->LastGainIndex, psEnc->sCmn.nFramesInPayloadBuf ); + /* Overwrite unquantized gains with quantized gains and convert back to Q0 from Q16 */ + for( k = 0; k < NB_SUBFR; k++ ) { + psEncCtrl->Gains[ k ] = pGains_Q16[ k ] / 65536.0f; + } + + /* Set quantizer offset for voiced signals. Larger offset when LTP coding gain is low or tilt is high (ie low-pass) */ + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + if( psEncCtrl->LTPredCodGain + psEncCtrl->input_tilt > 1.0f ) { + psEncCtrl->sCmn.QuantOffsetType = 0; + } else { + psEncCtrl->sCmn.QuantOffsetType = 1; + } + } + + /* Quantizer boundary adjustment */ + quant_offset = SKP_Silk_Quantization_Offsets_Q10[ psEncCtrl->sCmn.sigtype ][ psEncCtrl->sCmn.QuantOffsetType ] / 1024.0f; + psEncCtrl->Lambda = LAMBDA_OFFSET + + LAMBDA_DELAYED_DECISIONS * psEnc->sCmn.nStatesDelayedDecision + + LAMBDA_SPEECH_ACT * psEnc->speech_activity + + LAMBDA_INPUT_QUALITY * psEncCtrl->input_quality + + LAMBDA_CODING_QUALITY * psEncCtrl->coding_quality + + LAMBDA_QUANT_OFFSET * quant_offset; + + SKP_assert( psEncCtrl->Lambda > 0.0f ); + SKP_assert( psEncCtrl->Lambda < 2.0f ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_quant_LTP_gains_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_quant_LTP_gains_FLP.c new file mode 100755 index 0000000..8bd7201 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_quant_LTP_gains_FLP.c @@ -0,0 +1,107 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +#define Q14_CONVERSION_FAC 6.1035e-005f // 1 / 2^14 + +void SKP_Silk_quant_LTP_gains_FLP( + SKP_float B[ NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */ + SKP_int cbk_index[ NB_SUBFR ], /* O Codebook index */ + SKP_int *periodicity_index, /* O Periodicity index */ + const SKP_float W[ NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Error weights */ + const SKP_float mu, /* I Mu value (R/D tradeoff) */ + const SKP_int lowComplexity /* I Flag for low complexity */ +) +{ + SKP_int j, k, temp_idx[ NB_SUBFR ], cbk_size; + const SKP_int16 *cl_ptr; + const SKP_int16 *cbk_ptr_Q14; + const SKP_float *b_ptr, *W_ptr; + SKP_float rate_dist_subfr, rate_dist, min_rate_dist; + + + + /***************************************************/ + /* Iterate over different codebooks with different */ + /* rates/distortions, and choose best */ + /***************************************************/ + min_rate_dist = SKP_float_MAX; + for( k = 0; k < 3; k++ ) { + cl_ptr = SKP_Silk_LTP_gain_BITS_Q6_ptrs[ k ]; + cbk_ptr_Q14 = SKP_Silk_LTP_vq_ptrs_Q14[ k ]; + cbk_size = SKP_Silk_LTP_vq_sizes[ k ]; + + /* Setup pointer to first subframe */ + W_ptr = W; + b_ptr = B; + + rate_dist = 0.0f; + for( j = 0; j < NB_SUBFR; j++ ) { + + SKP_Silk_VQ_WMat_EC_FLP( + &temp_idx[ j ], /* O index of best codebook vector */ + &rate_dist_subfr, /* O best weighted quantization error + mu * rate */ + b_ptr, /* I input vector to be quantized */ + W_ptr, /* I weighting matrix */ + cbk_ptr_Q14, /* I codebook */ + cl_ptr, /* I code length for each codebook vector */ + mu, /* I tradeoff between weighted error and rate */ + cbk_size /* I number of vectors in codebook */ + ); + + rate_dist += rate_dist_subfr; + + b_ptr += LTP_ORDER; + W_ptr += LTP_ORDER * LTP_ORDER; + } + + if( rate_dist < min_rate_dist ) { + min_rate_dist = rate_dist; + SKP_memcpy( cbk_index, temp_idx, NB_SUBFR * sizeof( SKP_int ) ); + *periodicity_index = k; + } + + /* Break early in low-complexity mode if rate distortion is below threshold */ + if( lowComplexity && ( rate_dist * 16384.0f < ( SKP_float )SKP_Silk_LTP_gain_middle_avg_RD_Q14 ) ) { + break; + } + } + + cbk_ptr_Q14 = SKP_Silk_LTP_vq_ptrs_Q14[ *periodicity_index ]; + for( j = 0; j < NB_SUBFR; j++ ) { + SKP_short2float_array( &B[ j * LTP_ORDER ], + &cbk_ptr_Q14[ cbk_index[ j ] * LTP_ORDER ], + LTP_ORDER ); + } + + for( j = 0; j < NB_SUBFR * LTP_ORDER; j++ ) { + B[ j ] *= Q14_CONVERSION_FAC; + } + +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_range_coder.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_range_coder.c new file mode 100755 index 0000000..20e633f --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_range_coder.c @@ -0,0 +1,372 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* Range encoder for one symbol */ +void SKP_Silk_range_encoder( + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_int data, /* I uncompressed data */ + const SKP_uint16 prob[] /* I cumulative density functions */ +) +{ + SKP_uint32 low_Q16, high_Q16; + SKP_uint32 base_tmp, range_Q32; + + /* Copy structure data */ + SKP_uint32 base_Q32 = psRC->base_Q32; + SKP_uint32 range_Q16 = psRC->range_Q16; + SKP_int32 bufferIx = psRC->bufferIx; + SKP_uint8 *buffer = psRC->buffer; + + if( psRC->error ) { + return; + } + + /* Update interval */ + low_Q16 = prob[ data ]; + high_Q16 = prob[ data + 1 ]; + base_tmp = base_Q32; /* save current base, to test for carry */ + base_Q32 += SKP_MUL_uint( range_Q16, low_Q16 ); + range_Q32 = SKP_MUL_uint( range_Q16, high_Q16 - low_Q16 ); + + /* Check for carry */ + if( base_Q32 < base_tmp ) { + /* Propagate carry in buffer */ + SKP_int bufferIx_tmp = bufferIx; + while( ( ++buffer[ --bufferIx_tmp ] ) == 0 ); + } + + /* Check normalization */ + if( range_Q32 & 0xFF000000 ) { + /* No normalization */ + range_Q16 = SKP_RSHIFT_uint( range_Q32, 16 ); + } else { + if( range_Q32 & 0xFFFF0000 ) { + /* Normalization of 8 bits shift */ + range_Q16 = SKP_RSHIFT_uint( range_Q32, 8 ); + } else { + /* Normalization of 16 bits shift */ + range_Q16 = range_Q32; + /* Make sure not to write beyond buffer */ + if( bufferIx >= psRC->bufferLength ) { + psRC->error = RANGE_CODER_WRITE_BEYOND_BUFFER; + return; + } + /* Write one byte to buffer */ + buffer[ bufferIx++ ] = (SKP_uint8)( SKP_RSHIFT_uint( base_Q32, 24 ) ); + base_Q32 = SKP_LSHIFT_ovflw( base_Q32, 8 ); + } + /* Make sure not to write beyond buffer */ + if( bufferIx >= psRC->bufferLength ) { + psRC->error = RANGE_CODER_WRITE_BEYOND_BUFFER; + return; + } + /* Write one byte to buffer */ + buffer[ bufferIx++ ] = (SKP_uint8)( SKP_RSHIFT_uint( base_Q32, 24 ) ); + base_Q32 = SKP_LSHIFT_ovflw( base_Q32, 8 ); + } + + /* Copy structure data back */ + psRC->base_Q32 = base_Q32; + psRC->range_Q16 = range_Q16; + psRC->bufferIx = bufferIx; +} + +/* Range encoder for multiple symbols */ +void SKP_Silk_range_encoder_multi( + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_int data[], /* I uncompressed data [nSymbols] */ + const SKP_uint16 * const prob[], /* I cumulative density functions */ + const SKP_int nSymbols /* I number of data symbols */ +) +{ + SKP_int k; + for( k = 0; k < nSymbols; k++ ) { + SKP_Silk_range_encoder( psRC, data[ k ], prob[ k ] ); + } +} + +/* Range decoder for one symbol */ +void SKP_Silk_range_decoder( + SKP_int data[], /* O uncompressed data */ + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_uint16 prob[], /* I cumulative density function */ + SKP_int probIx /* I initial (middle) entry of cdf */ +) +{ + SKP_uint32 low_Q16, high_Q16; + SKP_uint32 base_tmp, range_Q32; + + /* Copy structure data */ + SKP_uint32 base_Q32 = psRC->base_Q32; + SKP_uint32 range_Q16 = psRC->range_Q16; + SKP_int32 bufferIx = psRC->bufferIx; + SKP_uint8 *buffer = &psRC->buffer[ 4 ]; + + if( psRC->error ) { + /* Set output to zero */ + *data = 0; + return; + } + + high_Q16 = prob[ probIx ]; + base_tmp = SKP_MUL_uint( range_Q16, high_Q16 ); + if( base_tmp > base_Q32 ) { + while( 1 ) { + low_Q16 = prob[ --probIx ]; + base_tmp = SKP_MUL_uint( range_Q16, low_Q16 ); + if( base_tmp <= base_Q32 ) { + break; + } + high_Q16 = low_Q16; + /* Test for out of range */ + if( high_Q16 == 0 ) { + psRC->error = RANGE_CODER_CDF_OUT_OF_RANGE; + /* Set output to zero */ + *data = 0; + return; + } + } + } else { + while( 1 ) { + low_Q16 = high_Q16; + high_Q16 = prob[ ++probIx ]; + base_tmp = SKP_MUL_uint( range_Q16, high_Q16 ); + if( base_tmp > base_Q32 ) { + probIx--; + break; + } + /* Test for out of range */ + if( high_Q16 == 0xFFFF ) { + psRC->error = RANGE_CODER_CDF_OUT_OF_RANGE; + /* Set output to zero */ + *data = 0; + return; + } + } + } + *data = probIx; + base_Q32 -= SKP_MUL_uint( range_Q16, low_Q16 ); + range_Q32 = SKP_MUL_uint( range_Q16, high_Q16 - low_Q16 ); + + /* Check normalization */ + if( range_Q32 & 0xFF000000 ) { + /* No normalization */ + range_Q16 = SKP_RSHIFT_uint( range_Q32, 16 ); + } else { + if( range_Q32 & 0xFFFF0000 ) { + /* Normalization of 8 bits shift */ + range_Q16 = SKP_RSHIFT_uint( range_Q32, 8 ); + /* Check for errors */ + if( SKP_RSHIFT_uint( base_Q32, 24 ) ) { + psRC->error = RANGE_CODER_NORMALIZATION_FAILED; + /* Set output to zero */ + *data = 0; + return; + } + } else { + /* Normalization of 16 bits shift */ + range_Q16 = range_Q32; + /* Check for errors */ + if( SKP_RSHIFT( base_Q32, 16 ) ) { + psRC->error = RANGE_CODER_NORMALIZATION_FAILED; + /* Set output to zero */ + *data = 0; + return; + } + /* Update base */ + base_Q32 = SKP_LSHIFT_uint( base_Q32, 8 ); + /* Make sure not to read beyond buffer */ + if( bufferIx < psRC->bufferLength ) { + /* Read one byte from buffer */ + base_Q32 |= (SKP_uint32)buffer[ bufferIx++ ]; + } + } + /* Update base */ + base_Q32 = SKP_LSHIFT_uint( base_Q32, 8 ); + /* Make sure not to read beyond buffer */ + if( bufferIx < psRC->bufferLength ) { + /* Read one byte from buffer */ + base_Q32 |= (SKP_uint32)buffer[ bufferIx++ ]; + } + } + + /* Check for zero interval length */ + if( range_Q16 == 0 ) { + psRC->error = RANGE_CODER_ZERO_INTERVAL_WIDTH; + /* Set output to zero */ + *data = 0; + return; + } + + /* Copy structure data back */ + psRC->base_Q32 = base_Q32; + psRC->range_Q16 = range_Q16; + psRC->bufferIx = bufferIx; +} + +/* Range decoder for multiple symbols */ +void SKP_Silk_range_decoder_multi( + SKP_int data[], /* O uncompressed data [nSymbols] */ + SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */ + const SKP_uint16 * const prob[], /* I cumulative density functions */ + const SKP_int probStartIx[], /* I initial (middle) entries of cdfs [nSymbols] */ + const SKP_int nSymbols /* I number of data symbols */ +) +{ + SKP_int k; + for( k = 0; k < nSymbols; k++ ) { + SKP_Silk_range_decoder( &data[ k ], psRC, prob[ k ], probStartIx[ k ] ); + } +} + +/* Initialize range encoder */ +void SKP_Silk_range_enc_init( + SKP_Silk_range_coder_state *psRC /* O compressor data structure */ +) +{ + /* Initialize structure */ + psRC->bufferLength = MAX_ARITHM_BYTES; + psRC->range_Q16 = 0x0000FFFF; + psRC->bufferIx = 0; + psRC->base_Q32 = 0; + psRC->error = 0; +} + +/* Initialize range decoder */ +void SKP_Silk_range_dec_init( + SKP_Silk_range_coder_state *psRC, /* O compressor data structure */ + const SKP_uint8 buffer[], /* I buffer for compressed data [bufferLength] */ + const SKP_int32 bufferLength /* I buffer length (in bytes) */ +) +{ + /* check input */ + if( ( bufferLength > MAX_ARITHM_BYTES ) || ( bufferLength < 0 ) ) { + psRC->error = RANGE_CODER_DEC_PAYLOAD_TOO_LONG; + return; + } + /* Initialize structure */ + /* Copy to internal buffer */ + SKP_memcpy( psRC->buffer, buffer, bufferLength * sizeof( SKP_uint8 ) ); + psRC->bufferLength = bufferLength; + psRC->bufferIx = 0; + psRC->base_Q32 = + SKP_LSHIFT_uint( (SKP_uint32)buffer[ 0 ], 24 ) | + SKP_LSHIFT_uint( (SKP_uint32)buffer[ 1 ], 16 ) | + SKP_LSHIFT_uint( (SKP_uint32)buffer[ 2 ], 8 ) | + (SKP_uint32)buffer[ 3 ]; + psRC->range_Q16 = 0x0000FFFF; + psRC->error = 0; +} + +/* Determine length of bitstream */ +SKP_int SKP_Silk_range_coder_get_length( /* O returns number of BITS in stream */ + const SKP_Silk_range_coder_state *psRC, /* I compressed data structure */ + SKP_int *nBytes /* O number of BYTES in stream */ +) +{ + SKP_int nBits; + + /* Number of bits in stream */ + nBits = SKP_LSHIFT( psRC->bufferIx, 3 ) + SKP_Silk_CLZ32( psRC->range_Q16 - 1 ) - 14; + + *nBytes = SKP_RSHIFT( nBits + 7, 3 ); + + /* Return number of bits in bitstream */ + return nBits; +} + +/* Write shortest uniquely decodable stream to buffer, and determine its length */ +void SKP_Silk_range_enc_wrap_up( + SKP_Silk_range_coder_state *psRC /* I/O compressed data structure */ +) +{ + SKP_int bufferIx_tmp, bits_to_store, bits_in_stream, nBytes, mask; + SKP_uint32 base_Q24; + + /* Lower limit of interval, shifted 8 bits to the right */ + base_Q24 = SKP_RSHIFT_uint( psRC->base_Q32, 8 ); + + bits_in_stream = SKP_Silk_range_coder_get_length( psRC, &nBytes ); + + /* Number of additional bits (1..9) required to be stored to stream */ + bits_to_store = bits_in_stream - SKP_LSHIFT( psRC->bufferIx, 3 ); + /* Round up to required resolution */ + base_Q24 += SKP_RSHIFT_uint( 0x00800000, bits_to_store - 1 ); + base_Q24 &= SKP_LSHIFT_ovflw( 0xFFFFFFFF, 24 - bits_to_store ); + + /* Check for carry */ + if( base_Q24 & 0x01000000 ) { + /* Propagate carry in buffer */ + bufferIx_tmp = psRC->bufferIx; + while( ( ++( psRC->buffer[ --bufferIx_tmp ] ) ) == 0 ); + } + + /* Store to stream, making sure not to write beyond buffer */ + if( psRC->bufferIx < psRC->bufferLength ) { + psRC->buffer[ psRC->bufferIx++ ] = (SKP_uint8)SKP_RSHIFT_uint( base_Q24, 16 ); + if( bits_to_store > 8 ) { + if( psRC->bufferIx < psRC->bufferLength ) { + psRC->buffer[ psRC->bufferIx++ ] = (SKP_uint8)SKP_RSHIFT_uint( base_Q24, 8 ); + } + } + } + + /* Fill up any remaining bits in the last byte with 1s */ + if( bits_in_stream & 7 ) { + mask = SKP_RSHIFT( 0xFF, bits_in_stream & 7 ); + if( nBytes - 1 < psRC->bufferLength ) { + psRC->buffer[ nBytes - 1 ] |= mask; + } + } +} + +/* Check that any remaining bits in the last byte are set to 1 */ +void SKP_Silk_range_coder_check_after_decoding( + SKP_Silk_range_coder_state *psRC /* I/O compressed data structure */ +) +{ + SKP_int bits_in_stream, nBytes, mask; + + bits_in_stream = SKP_Silk_range_coder_get_length( psRC, &nBytes ); + + /* Make sure not to read beyond buffer */ + if( nBytes - 1 >= psRC->bufferLength ) { + psRC->error = RANGE_CODER_DECODER_CHECK_FAILED; + return; + } + + /* Test any remaining bits in last byte */ + if( bits_in_stream & 7 ) { + mask = SKP_RSHIFT( 0xFF, bits_in_stream & 7 ); + if( ( psRC->buffer[ nBytes - 1 ] & mask ) != mask ) { + psRC->error = RANGE_CODER_DECODER_CHECK_FAILED; + return; + } + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_regularize_correlations_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_regularize_correlations_FLP.c new file mode 100755 index 0000000..46cf9c1 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_regularize_correlations_FLP.c @@ -0,0 +1,43 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +void SKP_Silk_regularize_correlations_FLP( + SKP_float *XX, /* I/O Correlation matrices */ + SKP_float *xx, /* I/O Correlation values */ + const SKP_float noise, /* I Noise energy to add */ + const SKP_int D /* I Dimension of XX */ +) +{ + SKP_int i; + + for( i = 0; i < D; i++ ) { + matrix_ptr( &XX[ 0 ], i, i, D ) += noise; + } + xx[ 0 ] += noise; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler.c new file mode 100755 index 0000000..b7b7860 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler.c @@ -0,0 +1,323 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * File Name: SKP_Silk_resampler.c * + * * + * Description: Interface to collection of resamplers * + * * + * Copyright 2010 (c), Skype Limited * + * All rights reserved. * + * */ + +/* Matrix of resampling methods used: + * Fs_out (kHz) + * 8 12 16 24 32 44.1 48 + * + * 8 C UF U UF UF UF UF + * 12 AF C UF U UF UF UF + * 16 D AF C UF U UF UF + * Fs_in (kHz) 24 AIF D AF C UF UF U + * 32 UF AF D AF C UF UF + * 44.1 AMI AMI AMI AMI AMI C UF + * 48 DAF DAF AF D AF UF C + * + * default method: UF + * + * C -> Copy (no resampling) + * D -> Allpass-based 2x downsampling + * U -> Allpass-based 2x upsampling + * DAF -> Allpass-based 2x downsampling followed by AR2 filter followed by FIR interpolation + * UF -> Allpass-based 2x upsampling followed by FIR interpolation + * AMI -> ARMA4 filter followed by FIR interpolation + * AF -> AR2 filter followed by FIR interpolation + * + * Input signals sampled above 48 kHz are first downsampled to at most 48 kHz. + * Output signals sampled above 48 kHz are upsampled from at most 48 kHz. + */ + +#include "SKP_Silk_resampler_private.h" + +/* Greatest common divisor */ +static SKP_int32 gcd( + SKP_int32 a, + SKP_int32 b +) +{ + SKP_int32 tmp; + while( b > 0 ) { + tmp = a - b * SKP_DIV32( a, b ); + a = b; + b = tmp; + } + return a; +} + +/* Initialize/reset the resampler state for a given pair of input/output sampling rates */ +SKP_int SKP_Silk_resampler_init( + SKP_Silk_resampler_state_struct *S, /* I/O: Resampler state */ + SKP_int32 Fs_Hz_in, /* I: Input sampling rate (Hz) */ + SKP_int32 Fs_Hz_out /* I: Output sampling rate (Hz) */ +) +{ + SKP_int32 cycleLen, cyclesPerBatch, up2 = 0, down2 = 0; + + /* Clear state */ + SKP_memset( S, 0, sizeof( SKP_Silk_resampler_state_struct ) ); + + /* Input checking */ +#if RESAMPLER_SUPPORT_ABOVE_48KHZ + if( Fs_Hz_in < 8000 || Fs_Hz_in > 192000 || Fs_Hz_out < 8000 || Fs_Hz_out > 192000 ) { +#else + if( Fs_Hz_in < 8000 || Fs_Hz_in > 48000 || Fs_Hz_out < 8000 || Fs_Hz_out > 48000 ) { +#endif + SKP_assert( 0 ); + return -1; + } + +#if RESAMPLER_SUPPORT_ABOVE_48KHZ + /* Determine pre downsampling and post upsampling */ + if( Fs_Hz_in > 96000 ) { + S->nPreDownsamplers = 2; + S->down_pre_function = SKP_Silk_resampler_private_down4; + } else if( Fs_Hz_in > 48000 ) { + S->nPreDownsamplers = 1; + S->down_pre_function = SKP_Silk_resampler_down2; + } else { + S->nPreDownsamplers = 0; + S->down_pre_function = NULL; + } + + if( Fs_Hz_out > 96000 ) { + S->nPostUpsamplers = 2; + S->up_post_function = SKP_Silk_resampler_private_up4; + } else if( Fs_Hz_out > 48000 ) { + S->nPostUpsamplers = 1; + S->up_post_function = SKP_Silk_resampler_up2; + } else { + S->nPostUpsamplers = 0; + S->up_post_function = NULL; + } + + if( S->nPreDownsamplers + S->nPostUpsamplers > 0 ) { + /* Ratio of output/input samples */ + S->ratio_Q16 = SKP_LSHIFT32( SKP_DIV32( SKP_LSHIFT32( Fs_Hz_out, 13 ), Fs_Hz_in ), 3 ); + /* Make sure the ratio is rounded up */ + while( SKP_SMULWW( S->ratio_Q16, Fs_Hz_in ) < Fs_Hz_out ) S->ratio_Q16++; + + /* Batch size is 10 ms */ + S->batchSizePrePost = SKP_DIV32_16( Fs_Hz_in, 100 ); + + /* Convert sampling rate to those after pre-downsampling and before post-upsampling */ + Fs_Hz_in = SKP_RSHIFT( Fs_Hz_in, S->nPreDownsamplers ); + Fs_Hz_out = SKP_RSHIFT( Fs_Hz_out, S->nPostUpsamplers ); + } +#endif + + /* Number of samples processed per batch */ + /* First, try 10 ms frames */ + S->batchSize = SKP_DIV32_16( Fs_Hz_in, 100 ); + if( ( SKP_MUL( S->batchSize, 100 ) != Fs_Hz_in ) || ( Fs_Hz_in % 100 != 0 ) ) { + /* No integer number of input or output samples with 10 ms frames, use greatest common divisor */ + cycleLen = SKP_DIV32( Fs_Hz_in, gcd( Fs_Hz_in, Fs_Hz_out ) ); + cyclesPerBatch = SKP_DIV32( RESAMPLER_MAX_BATCH_SIZE_IN, cycleLen ); + if( cyclesPerBatch == 0 ) { + /* cycleLen too big, let's just use the maximum batch size. Some distortion will result. */ + S->batchSize = RESAMPLER_MAX_BATCH_SIZE_IN; + SKP_assert( 0 ); + } else { + S->batchSize = SKP_MUL( cyclesPerBatch, cycleLen ); + } + } + + + /* Find resampler with the right sampling ratio */ + if( Fs_Hz_out > Fs_Hz_in ) { + /* Upsample */ + if( Fs_Hz_out == SKP_MUL( Fs_Hz_in, 2 ) ) { /* Fs_out : Fs_in = 2 : 1 */ + /* Special case: directly use 2x upsampler */ + S->resampler_function = SKP_Silk_resampler_private_up2_HQ_wrapper; + } else { + /* Default resampler */ + S->resampler_function = SKP_Silk_resampler_private_IIR_FIR; + up2 = 1; + if( Fs_Hz_in > 24000 ) { + /* Low-quality all-pass upsampler */ + S->up2_function = SKP_Silk_resampler_up2; + } else { + /* High-quality all-pass upsampler */ + S->up2_function = SKP_Silk_resampler_private_up2_HQ; + } + } + } else if ( Fs_Hz_out < Fs_Hz_in ) { + /* Downsample */ + if( SKP_MUL( Fs_Hz_out, 4 ) == SKP_MUL( Fs_Hz_in, 3 ) ) { /* Fs_out : Fs_in = 3 : 4 */ + S->FIR_Fracs = 3; + S->Coefs = SKP_Silk_Resampler_3_4_COEFS; + S->resampler_function = SKP_Silk_resampler_private_down_FIR; + } else if( SKP_MUL( Fs_Hz_out, 3 ) == SKP_MUL( Fs_Hz_in, 2 ) ) { /* Fs_out : Fs_in = 2 : 3 */ + S->FIR_Fracs = 2; + S->Coefs = SKP_Silk_Resampler_2_3_COEFS; + S->resampler_function = SKP_Silk_resampler_private_down_FIR; + } else if( SKP_MUL( Fs_Hz_out, 2 ) == Fs_Hz_in ) { /* Fs_out : Fs_in = 1 : 2 */ + S->FIR_Fracs = 1; + S->Coefs = SKP_Silk_Resampler_1_2_COEFS; + S->resampler_function = SKP_Silk_resampler_private_down_FIR; + } else if( SKP_MUL( Fs_Hz_out, 8 ) == SKP_MUL( Fs_Hz_in, 3 ) ) { /* Fs_out : Fs_in = 3 : 8 */ + S->FIR_Fracs = 3; + S->Coefs = SKP_Silk_Resampler_3_8_COEFS; + S->resampler_function = SKP_Silk_resampler_private_down_FIR; + } else if( SKP_MUL( Fs_Hz_out, 3 ) == Fs_Hz_in ) { /* Fs_out : Fs_in = 1 : 3 */ + S->FIR_Fracs = 1; + S->Coefs = SKP_Silk_Resampler_1_3_COEFS; + S->resampler_function = SKP_Silk_resampler_private_down_FIR; + } else if( SKP_MUL( Fs_Hz_out, 4 ) == Fs_Hz_in ) { /* Fs_out : Fs_in = 1 : 4 */ + S->FIR_Fracs = 1; + down2 = 1; + S->Coefs = SKP_Silk_Resampler_1_2_COEFS; + S->resampler_function = SKP_Silk_resampler_private_down_FIR; + } else if( SKP_MUL( Fs_Hz_out, 6 ) == Fs_Hz_in ) { /* Fs_out : Fs_in = 1 : 6 */ + S->FIR_Fracs = 1; + down2 = 1; + S->Coefs = SKP_Silk_Resampler_1_3_COEFS; + S->resampler_function = SKP_Silk_resampler_private_down_FIR; + } else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 80 ) ) { /* Fs_out : Fs_in = 80 : 441 */ + S->Coefs = SKP_Silk_Resampler_80_441_ARMA4_COEFS; + S->resampler_function = SKP_Silk_resampler_private_IIR_FIR; + } else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 120 ) ) { /* Fs_out : Fs_in = 120 : 441 */ + S->Coefs = SKP_Silk_Resampler_120_441_ARMA4_COEFS; + S->resampler_function = SKP_Silk_resampler_private_IIR_FIR; + } else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 160 ) ) { /* Fs_out : Fs_in = 160 : 441 */ + S->Coefs = SKP_Silk_Resampler_160_441_ARMA4_COEFS; + S->resampler_function = SKP_Silk_resampler_private_IIR_FIR; + } else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 240 ) ) { /* Fs_out : Fs_in = 240 : 441 */ + S->Coefs = SKP_Silk_Resampler_240_441_ARMA4_COEFS; + S->resampler_function = SKP_Silk_resampler_private_IIR_FIR; + } else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 320 ) ) { /* Fs_out : Fs_in = 320 : 441 */ + S->Coefs = SKP_Silk_Resampler_320_441_ARMA4_COEFS; + S->resampler_function = SKP_Silk_resampler_private_IIR_FIR; + } else { + /* Default resampler */ + S->resampler_function = SKP_Silk_resampler_private_IIR_FIR; + up2 = 1; + if( Fs_Hz_in > 24000 ) { + /* Low-quality all-pass upsampler */ + S->up2_function = SKP_Silk_resampler_up2; + } else { + /* High-quality all-pass upsampler */ + S->up2_function = SKP_Silk_resampler_private_up2_HQ; + } + } + } else { + /* Input and output sampling rates are equal: copy */ + S->resampler_function = SKP_Silk_resampler_private_copy; + } + + S->input2x = up2 | down2; + + /* Ratio of input/output samples */ + S->invRatio_Q16 = SKP_LSHIFT32( SKP_DIV32( SKP_LSHIFT32( Fs_Hz_in, 14 + up2 - down2 ), Fs_Hz_out ), 2 ); + /* Make sure the ratio is rounded up */ + while( SKP_SMULWW( S->invRatio_Q16, SKP_LSHIFT32( Fs_Hz_out, down2 ) ) < SKP_LSHIFT32( Fs_Hz_in, up2 ) ) { + S->invRatio_Q16++; + } + + S->magic_number = 123456789; + + return 0; +} + +/* Clear the states of all resampling filters, without resetting sampling rate ratio */ +SKP_int SKP_Silk_resampler_clear( + SKP_Silk_resampler_state_struct *S /* I/O: Resampler state */ +) +{ + /* Clear state */ + SKP_memset( S->sDown2, 0, sizeof( S->sDown2 ) ); + SKP_memset( S->sIIR, 0, sizeof( S->sIIR ) ); + SKP_memset( S->sFIR, 0, sizeof( S->sFIR ) ); +#if RESAMPLER_SUPPORT_ABOVE_48KHZ + SKP_memset( S->sDownPre, 0, sizeof( S->sDownPre ) ); + SKP_memset( S->sUpPost, 0, sizeof( S->sUpPost ) ); +#endif + return 0; +} + +/* Resampler: convert from one sampling rate to another */ +SKP_int SKP_Silk_resampler( + SKP_Silk_resampler_state_struct *S, /* I/O: Resampler state */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + SKP_int32 inLen /* I: Number of input samples */ +) +{ + /* Verify that state was initialized and has not been corrupted */ + if( S->magic_number != 123456789 ) { + SKP_assert( 0 ); + return -1; + } + +#if RESAMPLER_SUPPORT_ABOVE_48KHZ + if( S->nPreDownsamplers + S->nPostUpsamplers > 0 ) { + /* The input and/or output sampling rate is above 48000 Hz */ + SKP_int32 nSamplesIn, nSamplesOut; + SKP_int16 in_buf[ 480 ], out_buf[ 480 ]; + + while( inLen > 0 ) { + /* Number of input and output samples to process */ + nSamplesIn = SKP_min( inLen, S->batchSizePrePost ); + nSamplesOut = SKP_SMULWB( S->ratio_Q16, nSamplesIn ); + + SKP_assert( SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) <= 480 ); + SKP_assert( SKP_RSHIFT32( nSamplesOut, S->nPostUpsamplers ) <= 480 ); + + if( S->nPreDownsamplers > 0 ) { + S->down_pre_function( S->sDownPre, in_buf, in, nSamplesIn ); + if( S->nPostUpsamplers > 0 ) { + S->resampler_function( S, out_buf, in_buf, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) ); + S->up_post_function( S->sUpPost, out, out_buf, SKP_RSHIFT32( nSamplesOut, S->nPostUpsamplers ) ); + } else { + S->resampler_function( S, out, in_buf, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) ); + } + } else { + S->resampler_function( S, out_buf, in, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) ); + S->up_post_function( S->sUpPost, out, out_buf, SKP_RSHIFT32( nSamplesOut, S->nPostUpsamplers ) ); + } + + in += nSamplesIn; + out += nSamplesOut; + inLen -= nSamplesIn; + } + } else +#endif + { + /* Input and output sampling rate are at most 48000 Hz */ + S->resampler_function( S, out, in, inLen ); + } + + return 0; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down2.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down2.c new file mode 100755 index 0000000..5d863c7 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down2.c @@ -0,0 +1,77 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_down2.c * + * * + * Downsample by a factor 2, mediocre quality * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_rom.h" + +/* Downsample by a factor 2, mediocre quality */ +void SKP_Silk_resampler_down2( + SKP_int32 *S, /* I/O: State vector [ 2 ] */ + SKP_int16 *out, /* O: Output signal [ len ] */ + const SKP_int16 *in, /* I: Input signal [ floor(len/2) ] */ + SKP_int32 inLen /* I: Number of input samples */ +) +{ + SKP_int32 k, len2 = SKP_RSHIFT32( inLen, 1 ); + SKP_int32 in32, out32, Y, X; + + SKP_assert( SKP_Silk_resampler_down2_0 > 0 ); + SKP_assert( SKP_Silk_resampler_down2_1 < 0 ); + + /* Internal variables and state are in Q10 format */ + for( k = 0; k < len2; k++ ) { + /* Convert to Q10 */ + in32 = SKP_LSHIFT( (SKP_int32)in[ 2 * k ], 10 ); + + /* All-pass section for even input sample */ + Y = SKP_SUB32( in32, S[ 0 ] ); + X = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_down2_1 ); + out32 = SKP_ADD32( S[ 0 ], X ); + S[ 0 ] = SKP_ADD32( in32, X ); + + /* Convert to Q10 */ + in32 = SKP_LSHIFT( (SKP_int32)in[ 2 * k + 1 ], 10 ); + + /* All-pass section for odd input sample, and add to output of previous section */ + Y = SKP_SUB32( in32, S[ 1 ] ); + X = SKP_SMULWB( Y, SKP_Silk_resampler_down2_0 ); + out32 = SKP_ADD32( out32, S[ 1 ] ); + out32 = SKP_ADD32( out32, X ); + S[ 1 ] = SKP_ADD32( in32, X ); + + /* Add, convert back to int16 and store to output */ + out[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 11 ) ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down2_3.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down2_3.c new file mode 100755 index 0000000..fb91eb9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down2_3.c @@ -0,0 +1,102 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_down2_3.c * + * * + * Downsample by a factor 2/3, low quality * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" + +#define ORDER_FIR 4 + +/* Downsample by a factor 2/3, low quality */ +void SKP_Silk_resampler_down2_3( + SKP_int32 *S, /* I/O: State vector [ 6 ] */ + SKP_int16 *out, /* O: Output signal [ floor(2*inLen/3) ] */ + const SKP_int16 *in, /* I: Input signal [ inLen ] */ + SKP_int32 inLen /* I: Number of input samples */ +) +{ + SKP_int32 nSamplesIn, counter, res_Q6; + SKP_int32 buf[ RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR ]; + SKP_int32 *buf_ptr; + + /* Copy buffered samples to start of buffer */ + SKP_memcpy( buf, S, ORDER_FIR * sizeof( SKP_int32 ) ); + + /* Iterate over blocks of frameSizeIn input samples */ + while( 1 ) { + nSamplesIn = SKP_min( inLen, RESAMPLER_MAX_BATCH_SIZE_IN ); + + /* Second-order AR filter (output in Q8) */ + SKP_Silk_resampler_private_AR2( &S[ ORDER_FIR ], &buf[ ORDER_FIR ], in, + SKP_Silk_Resampler_2_3_COEFS_LQ, nSamplesIn ); + + /* Interpolate filtered signal */ + buf_ptr = buf; + counter = nSamplesIn; + while( counter > 2 ) { + /* Inner product */ + res_Q6 = SKP_SMULWB( buf_ptr[ 0 ], SKP_Silk_Resampler_2_3_COEFS_LQ[ 2 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 1 ], SKP_Silk_Resampler_2_3_COEFS_LQ[ 3 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 2 ], SKP_Silk_Resampler_2_3_COEFS_LQ[ 5 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 3 ], SKP_Silk_Resampler_2_3_COEFS_LQ[ 4 ] ); + + /* Scale down, saturate and store in output array */ + *out++ = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( res_Q6, 6 ) ); + + res_Q6 = SKP_SMULWB( buf_ptr[ 1 ], SKP_Silk_Resampler_2_3_COEFS_LQ[ 4 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 2 ], SKP_Silk_Resampler_2_3_COEFS_LQ[ 5 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 3 ], SKP_Silk_Resampler_2_3_COEFS_LQ[ 3 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 4 ], SKP_Silk_Resampler_2_3_COEFS_LQ[ 2 ] ); + + /* Scale down, saturate and store in output array */ + *out++ = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( res_Q6, 6 ) ); + + buf_ptr += 3; + counter -= 3; + } + + in += nSamplesIn; + inLen -= nSamplesIn; + + if( inLen > 0 ) { + /* More iterations to do; copy last part of filtered signal to beginning of buffer */ + SKP_memcpy( buf, &buf[ nSamplesIn ], ORDER_FIR * sizeof( SKP_int32 ) ); + } else { + break; + } + } + + /* Copy last part of filtered signal to the state for the next call */ + SKP_memcpy( S, &buf[ nSamplesIn ], ORDER_FIR * sizeof( SKP_int32 ) ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down3.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down3.c new file mode 100755 index 0000000..a716d5c --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_down3.c @@ -0,0 +1,93 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_down3.c * + * * + * Downsample by a factor 3, low quality * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" + +#define ORDER_FIR 6 + +/* Downsample by a factor 3, low quality */ +void SKP_Silk_resampler_down3( + SKP_int32 *S, /* I/O: State vector [ 8 ] */ + SKP_int16 *out, /* O: Output signal [ floor(inLen/3) ] */ + const SKP_int16 *in, /* I: Input signal [ inLen ] */ + SKP_int32 inLen /* I: Number of input samples */ +) +{ + SKP_int32 nSamplesIn, counter, res_Q6; + SKP_int32 buf[ RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR ]; + SKP_int32 *buf_ptr; + + /* Copy buffered samples to start of buffer */ + SKP_memcpy( buf, S, ORDER_FIR * sizeof( SKP_int32 ) ); + + /* Iterate over blocks of frameSizeIn input samples */ + while( 1 ) { + nSamplesIn = SKP_min( inLen, RESAMPLER_MAX_BATCH_SIZE_IN ); + + /* Second-order AR filter (output in Q8) */ + SKP_Silk_resampler_private_AR2( &S[ ORDER_FIR ], &buf[ ORDER_FIR ], in, + SKP_Silk_Resampler_1_3_COEFS_LQ, nSamplesIn ); + + /* Interpolate filtered signal */ + buf_ptr = buf; + counter = nSamplesIn; + while( counter > 2 ) { + /* Inner product */ + res_Q6 = SKP_SMULWB( SKP_ADD32( buf_ptr[ 0 ], buf_ptr[ 5 ] ), SKP_Silk_Resampler_1_3_COEFS_LQ[ 2 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, SKP_ADD32( buf_ptr[ 1 ], buf_ptr[ 4 ] ), SKP_Silk_Resampler_1_3_COEFS_LQ[ 3 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, SKP_ADD32( buf_ptr[ 2 ], buf_ptr[ 3 ] ), SKP_Silk_Resampler_1_3_COEFS_LQ[ 4 ] ); + + /* Scale down, saturate and store in output array */ + *out++ = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( res_Q6, 6 ) ); + + buf_ptr += 3; + counter -= 3; + } + + in += nSamplesIn; + inLen -= nSamplesIn; + + if( inLen > 0 ) { + /* More iterations to do; copy last part of filtered signal to beginning of buffer */ + SKP_memcpy( buf, &buf[ nSamplesIn ], ORDER_FIR * sizeof( SKP_int32 ) ); + } else { + break; + } + } + + /* Copy last part of filtered signal to the state for the next call */ + SKP_memcpy( S, &buf[ nSamplesIn ], ORDER_FIR * sizeof( SKP_int32 ) ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private.h new file mode 100755 index 0000000..e7159e1 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private.h @@ -0,0 +1,131 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * File Name: SKP_Silk_resampler_structs.h * + * * + * Description: Structs for IIR/FIR resamplers * + * * + * Copyright 2010 (c), Skype Limited * + * All rights reserved. * + * * + * */ + +#ifndef SKP_Silk_RESAMPLER_H +#define SKP_Silk_RESAMPLER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_structs.h" +#include "SKP_Silk_resampler_rom.h" + +/* Number of input samples to process in the inner loop */ +#define RESAMPLER_MAX_BATCH_SIZE_IN 480 + +/* Description: Hybrid IIR/FIR polyphase implementation of resampling */ +void SKP_Silk_resampler_private_IIR_FIR( + void *SS, /* I/O: Resampler state */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + SKP_int32 inLen /* I: Number of input samples */ +); + +/* Description: Hybrid IIR/FIR polyphase implementation of resampling */ +void SKP_Silk_resampler_private_down_FIR( + void *SS, /* I/O: Resampler state */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + SKP_int32 inLen /* I: Number of input samples */ +); + +/* Copy */ +void SKP_Silk_resampler_private_copy( + void *SS, /* I/O: Resampler state (unused) */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + SKP_int32 inLen /* I: Number of input samples */ +); + +/* Upsample by a factor 2, high quality */ +void SKP_Silk_resampler_private_up2_HQ_wrapper( + void *SS, /* I/O: Resampler state (unused) */ + SKP_int16 *out, /* O: Output signal [ 2 * len ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 len /* I: Number of input samples */ +); + +/* Upsample by a factor 2, high quality */ +void SKP_Silk_resampler_private_up2_HQ( + SKP_int32 *S, /* I/O: Resampler state [ 6 ] */ + SKP_int16 *out, /* O: Output signal [ 2 * len ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 len /* I: Number of input samples */ +); + +/* Upsample 4x, low quality */ +void SKP_Silk_resampler_private_up4( + SKP_int32 *S, /* I/O: State vector [ 2 ] */ + SKP_int16 *out, /* O: Output signal [ 4 * len ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 len /* I: Number of input samples */ +); + +/* Downsample 4x, low quality */ +void SKP_Silk_resampler_private_down4( + SKP_int32 *S, /* I/O: State vector [ 2 ] */ + SKP_int16 *out, /* O: Output signal [ floor(len/2) ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 inLen /* I: Number of input samples */ +); + +/* Second order AR filter */ +void SKP_Silk_resampler_private_AR2( + SKP_int32 S[], /* I/O: State vector [ 2 ] */ + SKP_int32 out_Q8[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + const SKP_int16 A_Q14[], /* I: AR coefficients, Q14 */ + SKP_int32 len /* I: Signal length */ +); + +/* Fourth order ARMA filter */ +void SKP_Silk_resampler_private_ARMA4( + SKP_int32 S[], /* I/O: State vector [ 4 ] */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + const SKP_int16 Coef[], /* I: ARMA coefficients [ 7 ] */ + SKP_int32 len /* I: Signal length */ +); + + +#ifdef __cplusplus +} +#endif +#endif // SKP_Silk_RESAMPLER_H + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_AR2.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_AR2.c new file mode 100755 index 0000000..02b0f5d --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_AR2.c @@ -0,0 +1,58 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_private_AR2. c * + * * + * Second order AR filter with single delay elements * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" + +/* Second order AR filter with single delay elements */ +void SKP_Silk_resampler_private_AR2( + SKP_int32 S[], /* I/O: State vector [ 2 ] */ + SKP_int32 out_Q8[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + const SKP_int16 A_Q14[], /* I: AR coefficients, Q14 */ + SKP_int32 len /* I: Signal length */ +) +{ + SKP_int32 k; + SKP_int32 out32; + + for( k = 0; k < len; k++ ) { + out32 = SKP_ADD_LSHIFT32( S[ 0 ], (SKP_int32)in[ k ], 8 ); + out_Q8[ k ] = out32; + out32 = SKP_LSHIFT( out32, 2 ); + S[ 0 ] = SKP_SMLAWB( S[ 1 ], out32, A_Q14[ 0 ] ); + S[ 1 ] = SKP_SMULWB( out32, A_Q14[ 1 ] ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_ARMA4.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_ARMA4.c new file mode 100755 index 0000000..22259cf --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_ARMA4.c @@ -0,0 +1,77 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_private_ARMA4.c * + * * + * Fourth order ARMA filter, applies 64x gain * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" + +/* Fourth order ARMA filter */ +/* Internally operates as two biquad filters in sequence. */ + +/* Coeffients are stored in a packed format: */ +/* { B1_Q14[1], B2_Q14[1], -A1_Q14[1], -A1_Q14[2], -A2_Q14[1], -A2_Q14[2], gain_Q16 } */ +/* where it is assumed that B*_Q14[0], B*_Q14[2], A*_Q14[0] are all 16384 */ +void SKP_Silk_resampler_private_ARMA4( + SKP_int32 S[], /* I/O: State vector [ 4 ] */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + const SKP_int16 Coef[], /* I: ARMA coefficients [ 7 ] */ + SKP_int32 len /* I: Signal length */ +) +{ + SKP_int32 k; + SKP_int32 in_Q8, out1_Q8, out2_Q8, X; + + for( k = 0; k < len; k++ ) { + in_Q8 = SKP_LSHIFT32( (SKP_int32)in[ k ], 8 ); + + /* Outputs of first and second biquad */ + out1_Q8 = SKP_ADD_LSHIFT32( in_Q8, S[ 0 ], 2 ); + out2_Q8 = SKP_ADD_LSHIFT32( out1_Q8, S[ 2 ], 2 ); + + /* Update states, which are stored in Q6. Coefficients are in Q14 here */ + X = SKP_SMLAWB( S[ 1 ], in_Q8, Coef[ 0 ] ); + S[ 0 ] = SKP_SMLAWB( X, out1_Q8, Coef[ 2 ] ); + + X = SKP_SMLAWB( S[ 3 ], out1_Q8, Coef[ 1 ] ); + S[ 2 ] = SKP_SMLAWB( X, out2_Q8, Coef[ 4 ] ); + + S[ 1 ] = SKP_SMLAWB( SKP_RSHIFT32( in_Q8, 2 ), out1_Q8, Coef[ 3 ] ); + S[ 3 ] = SKP_SMLAWB( SKP_RSHIFT32( out1_Q8, 2 ), out2_Q8, Coef[ 5 ] ); + + /* Apply gain and store to output. The coefficient is in Q16 */ + out[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT32( SKP_SMLAWB( 128, out2_Q8, Coef[ 6 ] ), 8 ) ); + } +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_IIR_FIR.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_IIR_FIR.c new file mode 100755 index 0000000..1b46b11 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_IIR_FIR.c @@ -0,0 +1,105 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * File Name: SKP_Silk_resampler_private_IIR_FIR.c * + * * + * Description: Hybrid IIR/FIR polyphase implementation of resampling * + * * + * Copyright 2010 (c), Skype Limited * + * All rights reserved. * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" +SKP_INLINE SKP_int16 *SKP_Silk_resampler_private_IIR_FIR_INTERPOL( + SKP_int16 * out, SKP_int16 * buf, SKP_int32 max_index_Q16 , SKP_int32 index_increment_Q16 ){ + SKP_int32 index_Q16, res_Q15; + SKP_int16 *buf_ptr; + SKP_int32 table_index; + /* Interpolate upsampled signal and store in output array */ + for( index_Q16 = 0; index_Q16 < max_index_Q16; index_Q16 += index_increment_Q16 ) { + table_index = SKP_SMULWB( index_Q16 & 0xFFFF, 144 ); + buf_ptr = &buf[ index_Q16 >> 16 ]; + + res_Q15 = SKP_SMULBB( buf_ptr[ 0 ], SKP_Silk_resampler_frac_FIR_144[ table_index ][ 0 ] ); + res_Q15 = SKP_SMLABB( res_Q15, buf_ptr[ 1 ], SKP_Silk_resampler_frac_FIR_144[ table_index ][ 1 ] ); + res_Q15 = SKP_SMLABB( res_Q15, buf_ptr[ 2 ], SKP_Silk_resampler_frac_FIR_144[ table_index ][ 2 ] ); + res_Q15 = SKP_SMLABB( res_Q15, buf_ptr[ 3 ], SKP_Silk_resampler_frac_FIR_144[ 143 - table_index ][ 2 ] ); + res_Q15 = SKP_SMLABB( res_Q15, buf_ptr[ 4 ], SKP_Silk_resampler_frac_FIR_144[ 143 - table_index ][ 1 ] ); + res_Q15 = SKP_SMLABB( res_Q15, buf_ptr[ 5 ], SKP_Silk_resampler_frac_FIR_144[ 143 - table_index ][ 0 ] ); + *out++ = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( res_Q15, 15 ) ); + } + return out; +} +/* Upsample using a combination of allpass-based 2x upsampling and FIR interpolation */ +void SKP_Silk_resampler_private_IIR_FIR( + void *SS, /* I/O: Resampler state */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + SKP_int32 inLen /* I: Number of input samples */ +) +{ + SKP_Silk_resampler_state_struct *S = (SKP_Silk_resampler_state_struct *)SS; + SKP_int32 nSamplesIn; + SKP_int32 max_index_Q16, index_increment_Q16; + SKP_int16 buf[ 2 * RESAMPLER_MAX_BATCH_SIZE_IN + RESAMPLER_ORDER_FIR_144 ]; + + + /* Copy buffered samples to start of buffer */ + SKP_memcpy( buf, S->sFIR, RESAMPLER_ORDER_FIR_144 * sizeof( SKP_int32 ) ); + + /* Iterate over blocks of frameSizeIn input samples */ + index_increment_Q16 = S->invRatio_Q16; + while( 1 ) { + nSamplesIn = SKP_min( inLen, S->batchSize ); + + if( S->input2x == 1 ) { + /* Upsample 2x */ + S->up2_function( S->sIIR, &buf[ RESAMPLER_ORDER_FIR_144 ], in, nSamplesIn ); + } else { + /* Fourth-order ARMA filter */ + SKP_Silk_resampler_private_ARMA4( S->sIIR, &buf[ RESAMPLER_ORDER_FIR_144 ], in, S->Coefs, nSamplesIn ); + } + + max_index_Q16 = SKP_LSHIFT32( nSamplesIn, 16 + S->input2x ); /* +1 if 2x upsampling */ + out = SKP_Silk_resampler_private_IIR_FIR_INTERPOL(out, buf, max_index_Q16, index_increment_Q16); + in += nSamplesIn; + inLen -= nSamplesIn; + + if( inLen > 0 ) { + /* More iterations to do; copy last part of filtered signal to beginning of buffer */ + SKP_memcpy( buf, &buf[ nSamplesIn << S->input2x ], RESAMPLER_ORDER_FIR_144 * sizeof( SKP_int32 ) ); + } else { + break; + } + } + + /* Copy last part of filtered signal to the state for the next call */ + SKP_memcpy( S->sFIR, &buf[nSamplesIn << S->input2x ], RESAMPLER_ORDER_FIR_144 * sizeof( SKP_int32 ) ); +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_copy.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_copy.c new file mode 100755 index 0000000..093fb0b --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_copy.c @@ -0,0 +1,49 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * File Name: SKP_Silk_resampler_private_copy.c * + * * + * Description: Copy. * + * * + * Copyright 2010 (c), Skype Limited * + * All rights reserved. * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" + +/* Copy */ +void SKP_Silk_resampler_private_copy( + void *SS, /* I/O: Resampler state (unused) */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + SKP_int32 inLen /* I: Number of input samples */ +) +{ + SKP_memcpy( out, in, inLen * sizeof( SKP_int16 ) ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_down4.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_down4.c new file mode 100755 index 0000000..5cce504 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_down4.c @@ -0,0 +1,77 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_private_down4.c * + * * + * Downsample by a factor 4 * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" + +/* Downsample by a factor 4. Note: very low quality, only use with input sampling rates above 96 kHz. */ +void SKP_Silk_resampler_private_down4( + SKP_int32 *S, /* I/O: State vector [ 2 ] */ + SKP_int16 *out, /* O: Output signal [ floor(len/2) ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 inLen /* I: Number of input samples */ +) +{ + SKP_int32 k, len4 = SKP_RSHIFT32( inLen, 2 ); + SKP_int32 in32, out32, Y, X; + + SKP_assert( SKP_Silk_resampler_down2_0 > 0 ); + SKP_assert( SKP_Silk_resampler_down2_1 < 0 ); + + /* Internal variables and state are in Q10 format */ + for( k = 0; k < len4; k++ ) { + /* Add two input samples and convert to Q10 */ + in32 = SKP_LSHIFT( SKP_ADD32( (SKP_int32)in[ 4 * k ], (SKP_int32)in[ 4 * k + 1 ] ), 9 ); + + /* All-pass section for even input sample */ + Y = SKP_SUB32( in32, S[ 0 ] ); + X = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_down2_1 ); + out32 = SKP_ADD32( S[ 0 ], X ); + S[ 0 ] = SKP_ADD32( in32, X ); + + /* Add two input samples and convert to Q10 */ + in32 = SKP_LSHIFT( SKP_ADD32( (SKP_int32)in[ 4 * k + 2 ], (SKP_int32)in[ 4 * k + 3 ] ), 9 ); + + /* All-pass section for odd input sample */ + Y = SKP_SUB32( in32, S[ 1 ] ); + X = SKP_SMULWB( Y, SKP_Silk_resampler_down2_0 ); + out32 = SKP_ADD32( out32, S[ 1 ] ); + out32 = SKP_ADD32( out32, X ); + S[ 1 ] = SKP_ADD32( in32, X ); + + /* Add, convert back to int16 and store to output */ + out[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 11 ) ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_down_FIR.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_down_FIR.c new file mode 100755 index 0000000..5bb5475 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_down_FIR.c @@ -0,0 +1,160 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * File Name: SKP_Silk_resampler_private_down_FIR.c * + * * + * Description: Hybrid IIR/FIR polyphase implementation of resampling * + * * + * Copyright 2010 (c), Skype Limited * + * All rights reserved. * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" +SKP_INLINE SKP_int16 *SKP_Silk_resampler_private_down_FIR_INTERPOL0( + SKP_int16 *out, SKP_int32 *buf2, const SKP_int16 *FIR_Coefs, SKP_int32 max_index_Q16, SKP_int32 index_increment_Q16){ + + SKP_int32 index_Q16, res_Q6; + SKP_int32 *buf_ptr; + for( index_Q16 = 0; index_Q16 < max_index_Q16; index_Q16 += index_increment_Q16 ) { + /* Integer part gives pointer to buffered input */ + buf_ptr = buf2 + SKP_RSHIFT( index_Q16, 16 ); + + /* Inner product */ + res_Q6 = SKP_SMULWB( SKP_ADD32( buf_ptr[ 0 ], buf_ptr[ 11 ] ), FIR_Coefs[ 0 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, SKP_ADD32( buf_ptr[ 1 ], buf_ptr[ 10 ] ), FIR_Coefs[ 1 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, SKP_ADD32( buf_ptr[ 2 ], buf_ptr[ 9 ] ), FIR_Coefs[ 2 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, SKP_ADD32( buf_ptr[ 3 ], buf_ptr[ 8 ] ), FIR_Coefs[ 3 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, SKP_ADD32( buf_ptr[ 4 ], buf_ptr[ 7 ] ), FIR_Coefs[ 4 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, SKP_ADD32( buf_ptr[ 5 ], buf_ptr[ 6 ] ), FIR_Coefs[ 5 ] ); + + /* Scale down, saturate and store in output array */ + *out++ = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( res_Q6, 6 ) ); + } + return out; +} + +SKP_INLINE SKP_int16 *SKP_Silk_resampler_private_down_FIR_INTERPOL1( + SKP_int16 *out, SKP_int32 *buf2, const SKP_int16 *FIR_Coefs, SKP_int32 max_index_Q16, SKP_int32 index_increment_Q16, SKP_int32 FIR_Fracs){ + + SKP_int32 index_Q16, res_Q6; + SKP_int32 *buf_ptr; + SKP_int32 interpol_ind; + const SKP_int16 *interpol_ptr; + for( index_Q16 = 0; index_Q16 < max_index_Q16; index_Q16 += index_increment_Q16 ) { + /* Integer part gives pointer to buffered input */ + buf_ptr = buf2 + SKP_RSHIFT( index_Q16, 16 ); + + /* Fractional part gives interpolation coefficients */ + interpol_ind = SKP_SMULWB( index_Q16 & 0xFFFF, FIR_Fracs ); + + /* Inner product */ + interpol_ptr = &FIR_Coefs[ RESAMPLER_DOWN_ORDER_FIR / 2 * interpol_ind ]; + res_Q6 = SKP_SMULWB( buf_ptr[ 0 ], interpol_ptr[ 0 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 1 ], interpol_ptr[ 1 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 2 ], interpol_ptr[ 2 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 3 ], interpol_ptr[ 3 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 4 ], interpol_ptr[ 4 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 5 ], interpol_ptr[ 5 ] ); + interpol_ptr = &FIR_Coefs[ RESAMPLER_DOWN_ORDER_FIR / 2 * ( FIR_Fracs - 1 - interpol_ind ) ]; + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 11 ], interpol_ptr[ 0 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 10 ], interpol_ptr[ 1 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 9 ], interpol_ptr[ 2 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 8 ], interpol_ptr[ 3 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 7 ], interpol_ptr[ 4 ] ); + res_Q6 = SKP_SMLAWB( res_Q6, buf_ptr[ 6 ], interpol_ptr[ 5 ] ); + + /* Scale down, saturate and store in output array */ + *out++ = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( res_Q6, 6 ) ); + } + return out; +} + + +/* Resample with a 2x downsampler (optional), a 2nd order AR filter followed by FIR interpolation */ +void SKP_Silk_resampler_private_down_FIR( + void *SS, /* I/O: Resampler state */ + SKP_int16 out[], /* O: Output signal */ + const SKP_int16 in[], /* I: Input signal */ + SKP_int32 inLen /* I: Number of input samples */ +) +{ + SKP_Silk_resampler_state_struct *S = (SKP_Silk_resampler_state_struct *)SS; + SKP_int32 nSamplesIn; + SKP_int32 max_index_Q16, index_increment_Q16; + SKP_int16 buf1[ RESAMPLER_MAX_BATCH_SIZE_IN / 2 ]; + SKP_int32 buf2[ RESAMPLER_MAX_BATCH_SIZE_IN + RESAMPLER_DOWN_ORDER_FIR ]; + const SKP_int16 *FIR_Coefs; + + /* Copy buffered samples to start of buffer */ + SKP_memcpy( buf2, S->sFIR, RESAMPLER_DOWN_ORDER_FIR * sizeof( SKP_int32 ) ); + + FIR_Coefs = &S->Coefs[ 2 ]; + + /* Iterate over blocks of frameSizeIn input samples */ + index_increment_Q16 = S->invRatio_Q16; + while( 1 ) { + nSamplesIn = SKP_min( inLen, S->batchSize ); + + if( S->input2x == 1 ) { + /* Downsample 2x */ + SKP_Silk_resampler_down2( S->sDown2, buf1, in, nSamplesIn ); + + nSamplesIn = SKP_RSHIFT32( nSamplesIn, 1 ); + + /* Second-order AR filter (output in Q8) */ + SKP_Silk_resampler_private_AR2( S->sIIR, &buf2[ RESAMPLER_DOWN_ORDER_FIR ], buf1, S->Coefs, nSamplesIn ); + } else { + /* Second-order AR filter (output in Q8) */ + SKP_Silk_resampler_private_AR2( S->sIIR, &buf2[ RESAMPLER_DOWN_ORDER_FIR ], in, S->Coefs, nSamplesIn ); + } + + max_index_Q16 = SKP_LSHIFT32( nSamplesIn, 16 ); + + /* Interpolate filtered signal */ + if( S->FIR_Fracs == 1 ) { + out = SKP_Silk_resampler_private_down_FIR_INTERPOL0(out, buf2, FIR_Coefs, max_index_Q16, index_increment_Q16); + } else { + out = SKP_Silk_resampler_private_down_FIR_INTERPOL1(out, buf2, FIR_Coefs, max_index_Q16, index_increment_Q16, S->FIR_Fracs); + } + + in += nSamplesIn << S->input2x; + inLen -= nSamplesIn << S->input2x; + + if( inLen > S->input2x ) { + /* More iterations to do; copy last part of filtered signal to beginning of buffer */ + SKP_memcpy( buf2, &buf2[ nSamplesIn ], RESAMPLER_DOWN_ORDER_FIR * sizeof( SKP_int32 ) ); + } else { + break; + } + } + + /* Copy last part of filtered signal to the state for the next call */ + SKP_memcpy( S->sFIR, &buf2[ nSamplesIn ], RESAMPLER_DOWN_ORDER_FIR * sizeof( SKP_int32 ) ); +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_up2_HQ.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_up2_HQ.c new file mode 100755 index 0000000..8015c91 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_up2_HQ.c @@ -0,0 +1,118 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_private_up2_HQ.c * + * * + * Upsample by a factor 2, high quality * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" + +/* Upsample by a factor 2, high quality */ +/* Uses 2nd order allpass filters for the 2x upsampling, followed by a */ +/* notch filter just above Nyquist. */ +void SKP_Silk_resampler_private_up2_HQ( + SKP_int32 *S, /* I/O: Resampler state [ 6 ] */ + SKP_int16 *out, /* O: Output signal [ 2 * len ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 len /* I: Number of INPUT samples */ +) +{ + SKP_int32 k; + SKP_int32 in32, out32_1, out32_2, Y, X; + + SKP_assert( SKP_Silk_resampler_up2_hq_0[ 0 ] > 0 ); + SKP_assert( SKP_Silk_resampler_up2_hq_0[ 1 ] < 0 ); + SKP_assert( SKP_Silk_resampler_up2_hq_1[ 0 ] > 0 ); + SKP_assert( SKP_Silk_resampler_up2_hq_1[ 1 ] < 0 ); + + /* Internal variables and state are in Q10 format */ + for( k = 0; k < len; k++ ) { + /* Convert to Q10 */ + in32 = SKP_LSHIFT( (SKP_int32)in[ k ], 10 ); + + /* First all-pass section for even output sample */ + Y = SKP_SUB32( in32, S[ 0 ] ); + X = SKP_SMULWB( Y, SKP_Silk_resampler_up2_hq_0[ 0 ] ); + out32_1 = SKP_ADD32( S[ 0 ], X ); + S[ 0 ] = SKP_ADD32( in32, X ); + + /* Second all-pass section for even output sample */ + Y = SKP_SUB32( out32_1, S[ 1 ] ); + X = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_up2_hq_0[ 1 ] ); + out32_2 = SKP_ADD32( S[ 1 ], X ); + S[ 1 ] = SKP_ADD32( out32_1, X ); + + /* Biquad notch filter */ + out32_2 = SKP_SMLAWB( out32_2, S[ 5 ], SKP_Silk_resampler_up2_hq_notch[ 2 ] ); + out32_2 = SKP_SMLAWB( out32_2, S[ 4 ], SKP_Silk_resampler_up2_hq_notch[ 1 ] ); + out32_1 = SKP_SMLAWB( out32_2, S[ 4 ], SKP_Silk_resampler_up2_hq_notch[ 0 ] ); + S[ 5 ] = SKP_SUB32( out32_2, S[ 5 ] ); + + /* Apply gain in Q15, convert back to int16 and store to output */ + out[ 2 * k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT32( + SKP_SMLAWB( 256, out32_1, SKP_Silk_resampler_up2_hq_notch[ 3 ] ), 9 ) ); + + /* First all-pass section for odd output sample */ + Y = SKP_SUB32( in32, S[ 2 ] ); + X = SKP_SMULWB( Y, SKP_Silk_resampler_up2_hq_1[ 0 ] ); + out32_1 = SKP_ADD32( S[ 2 ], X ); + S[ 2 ] = SKP_ADD32( in32, X ); + + /* Second all-pass section for odd output sample */ + Y = SKP_SUB32( out32_1, S[ 3 ] ); + X = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_up2_hq_1[ 1 ] ); + out32_2 = SKP_ADD32( S[ 3 ], X ); + S[ 3 ] = SKP_ADD32( out32_1, X ); + + /* Biquad notch filter */ + out32_2 = SKP_SMLAWB( out32_2, S[ 4 ], SKP_Silk_resampler_up2_hq_notch[ 2 ] ); + out32_2 = SKP_SMLAWB( out32_2, S[ 5 ], SKP_Silk_resampler_up2_hq_notch[ 1 ] ); + out32_1 = SKP_SMLAWB( out32_2, S[ 5 ], SKP_Silk_resampler_up2_hq_notch[ 0 ] ); + S[ 4 ] = SKP_SUB32( out32_2, S[ 4 ] ); + + /* Apply gain in Q15, convert back to int16 and store to output */ + out[ 2 * k + 1 ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT32( + SKP_SMLAWB( 256, out32_1, SKP_Silk_resampler_up2_hq_notch[ 3 ] ), 9 ) ); + } +} + + +void SKP_Silk_resampler_private_up2_HQ_wrapper( + void *SS, /* I/O: Resampler state (unused) */ + SKP_int16 *out, /* O: Output signal [ 2 * len ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 len /* I: Number of input samples */ +) +{ + SKP_Silk_resampler_state_struct *S = (SKP_Silk_resampler_state_struct *)SS; + SKP_Silk_resampler_private_up2_HQ( S->sIIR, out, in, len ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_up4.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_up4.c new file mode 100755 index 0000000..f13347f --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_private_up4.c @@ -0,0 +1,81 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_private_up4.c * + * * + * Upsample by a factor 4, low quality * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_private.h" + +/* Upsample by a factor 4, Note: very low quality, only use with output sampling rates above 96 kHz. */ +void SKP_Silk_resampler_private_up4( + SKP_int32 *S, /* I/O: State vector [ 2 ] */ + SKP_int16 *out, /* O: Output signal [ 4 * len ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 len /* I: Number of INPUT samples */ +) +{ + SKP_int32 k; + SKP_int32 in32, out32, Y, X; + SKP_int16 out16; + + SKP_assert( SKP_Silk_resampler_up2_lq_0 > 0 ); + SKP_assert( SKP_Silk_resampler_up2_lq_1 < 0 ); + + /* Internal variables and state are in Q10 format */ + for( k = 0; k < len; k++ ) { + /* Convert to Q10 */ + in32 = SKP_LSHIFT( (SKP_int32)in[ k ], 10 ); + + /* All-pass section for even output sample */ + Y = SKP_SUB32( in32, S[ 0 ] ); + X = SKP_SMULWB( Y, SKP_Silk_resampler_up2_lq_0 ); + out32 = SKP_ADD32( S[ 0 ], X ); + S[ 0 ] = SKP_ADD32( in32, X ); + + /* Convert back to int16 and store to output */ + out16 = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 10 ) ); + out[ 4 * k ] = out16; + out[ 4 * k + 1 ] = out16; + + /* All-pass section for odd output sample */ + Y = SKP_SUB32( in32, S[ 1 ] ); + X = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_up2_lq_1 ); + out32 = SKP_ADD32( S[ 1 ], X ); + S[ 1 ] = SKP_ADD32( in32, X ); + + /* Convert back to int16 and store to output */ + out16 = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 10 ) ); + out[ 4 * k + 2 ] = out16; + out[ 4 * k + 3 ] = out16; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_rom.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_rom.c new file mode 100755 index 0000000..5315ce5 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_rom.c @@ -0,0 +1,269 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * File Name: SKP_Silk_resampler_rom.c * + * * + * Description: Filter coefficients for IIR/FIR polyphase resampling * + * Total size: 550 Words (1.1 kB) * + * * + * Copyright 2010 (c), Skype Limited * + * All rights reserved. * + * */ + +#include "SKP_Silk_resampler_private.h" + +/* Tables for 2x downsampler */ +const SKP_int16 SKP_Silk_resampler_down2_0 = 9872; +const SKP_int16 SKP_Silk_resampler_down2_1 = 39809 - 65536; + +/* Tables for 2x upsampler, low quality */ +const SKP_int16 SKP_Silk_resampler_up2_lq_0 = 8102; +const SKP_int16 SKP_Silk_resampler_up2_lq_1 = 36783 - 65536; + +/* Tables for 2x upsampler, high quality */ +const SKP_int16 SKP_Silk_resampler_up2_hq_0[ 2 ] = { 4280, 33727 - 65536 }; +const SKP_int16 SKP_Silk_resampler_up2_hq_1[ 2 ] = { 16295, 54015 - 65536 }; +/* Matlab code for the notch filter coefficients: */ +/* B = [1, 0.12, 1]; A = [1, 0.055, 0.8]; G = 0.87; freqz(G * B, A, 2^14, 16e3); axis([0, 8000, -10, 1]); */ +/* fprintf('\t%6d, %6d, %6d, %6d\n', round(B(2)*2^16), round(-A(2)*2^16), round((1-A(3))*2^16), round(G*2^15)) */ +const SKP_int16 SKP_Silk_resampler_up2_hq_notch[ 4 ] = { 7864, -3604, 13107, 28508 }; + + +/* Tables with IIR and FIR coefficients for fractional downsamplers (70 Words) */ +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_3_4_COEFS[ 2 + 3 * RESAMPLER_DOWN_ORDER_FIR / 2 ] = { + -18249, -12532, + -97, 284, -495, 309, 10268, 20317, + -94, 156, -48, -720, 5984, 18278, + -45, -4, 237, -847, 2540, 14662, +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_2_3_COEFS[ 2 + 2 * RESAMPLER_DOWN_ORDER_FIR / 2 ] = { + -11891, -12486, + 20, 211, -657, 688, 8423, 15911, + -44, 197, -152, -653, 3855, 13015, +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_1_2_COEFS[ 2 + RESAMPLER_DOWN_ORDER_FIR / 2 ] = { + 2415, -13101, + 158, -295, -400, 1265, 4832, 7968, +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_3_8_COEFS[ 2 + 3 * RESAMPLER_DOWN_ORDER_FIR / 2 ] = { + 13270, -13738, + -294, -123, 747, 2043, 3339, 3995, + -151, -311, 414, 1583, 2947, 3877, + -33, -389, 143, 1141, 2503, 3653, +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_1_3_COEFS[ 2 + RESAMPLER_DOWN_ORDER_FIR / 2 ] = { + 16643, -14000, + -331, 19, 581, 1421, 2290, 2845, +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_2_3_COEFS_LQ[ 2 + 2 * 2 ] = { + -2797, -6507, + 4697, 10739, + 1567, 8276, +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_1_3_COEFS_LQ[ 2 + 3 ] = { + 16777, -9792, + 890, 1614, 2148, +}; + + +/* Tables with coefficients for 4th order ARMA filter (35 Words), in a packed format: */ +/* { B1_Q14[1], B2_Q14[1], -A1_Q14[1], -A1_Q14[2], -A2_Q14[1], -A2_Q14[2], gain_Q16 } */ +/* where it is assumed that B*_Q14[0], B*_Q14[2], A*_Q14[0] are all 16384 */ +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_320_441_ARMA4_COEFS[ 7 ] = { + 31454, 24746, -9706, -3386, -17911, -13243, 24797 +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_240_441_ARMA4_COEFS[ 7 ] = { + 28721, 11254, 3189, -2546, -1495, -12618, 11562 +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_160_441_ARMA4_COEFS[ 7 ] = { + 23492, -6457, 14358, -4856, 14654, -13008, 4456 +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_120_441_ARMA4_COEFS[ 7 ] = { + 19311, -15569, 19489, -6950, 21441, -13559, 2370 +}; + +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_Resampler_80_441_ARMA4_COEFS[ 7 ] = { + 13248, -23849, 24126, -9486, 26806, -14286, 1065 +}; + +/* Table with interplation fractions of 1/288 : 2/288 : 287/288 (432 Words) */ +SKP_DWORD_ALIGN const SKP_int16 SKP_Silk_resampler_frac_FIR_144[ 144 ][ RESAMPLER_ORDER_FIR_144 / 2 ] = { + { -647, 1884, 30078}, + { -625, 1736, 30044}, + { -603, 1591, 30005}, + { -581, 1448, 29963}, + { -559, 1308, 29917}, + { -537, 1169, 29867}, + { -515, 1032, 29813}, + { -494, 898, 29755}, + { -473, 766, 29693}, + { -452, 636, 29627}, + { -431, 508, 29558}, + { -410, 383, 29484}, + { -390, 260, 29407}, + { -369, 139, 29327}, + { -349, 20, 29242}, + { -330, -97, 29154}, + { -310, -211, 29062}, + { -291, -324, 28967}, + { -271, -434, 28868}, + { -253, -542, 28765}, + { -234, -647, 28659}, + { -215, -751, 28550}, + { -197, -852, 28436}, + { -179, -951, 28320}, + { -162, -1048, 28200}, + { -144, -1143, 28077}, + { -127, -1235, 27950}, + { -110, -1326, 27820}, + { -94, -1414, 27687}, + { -77, -1500, 27550}, + { -61, -1584, 27410}, + { -45, -1665, 27268}, + { -30, -1745, 27122}, + { -15, -1822, 26972}, + { 0, -1897, 26820}, + { 15, -1970, 26665}, + { 29, -2041, 26507}, + { 44, -2110, 26346}, + { 57, -2177, 26182}, + { 71, -2242, 26015}, + { 84, -2305, 25845}, + { 97, -2365, 25673}, + { 110, -2424, 25498}, + { 122, -2480, 25320}, + { 134, -2534, 25140}, + { 146, -2587, 24956}, + { 157, -2637, 24771}, + { 168, -2685, 24583}, + { 179, -2732, 24392}, + { 190, -2776, 24199}, + { 200, -2819, 24003}, + { 210, -2859, 23805}, + { 220, -2898, 23605}, + { 229, -2934, 23403}, + { 238, -2969, 23198}, + { 247, -3002, 22992}, + { 255, -3033, 22783}, + { 263, -3062, 22572}, + { 271, -3089, 22359}, + { 279, -3114, 22144}, + { 286, -3138, 21927}, + { 293, -3160, 21709}, + { 300, -3180, 21488}, + { 306, -3198, 21266}, + { 312, -3215, 21042}, + { 318, -3229, 20816}, + { 323, -3242, 20589}, + { 328, -3254, 20360}, + { 333, -3263, 20130}, + { 338, -3272, 19898}, + { 342, -3278, 19665}, + { 346, -3283, 19430}, + { 350, -3286, 19194}, + { 353, -3288, 18957}, + { 356, -3288, 18718}, + { 359, -3286, 18478}, + { 362, -3283, 18238}, + { 364, -3279, 17996}, + { 366, -3273, 17753}, + { 368, -3266, 17509}, + { 369, -3257, 17264}, + { 371, -3247, 17018}, + { 372, -3235, 16772}, + { 372, -3222, 16525}, + { 373, -3208, 16277}, + { 373, -3192, 16028}, + { 373, -3175, 15779}, + { 373, -3157, 15529}, + { 372, -3138, 15279}, + { 371, -3117, 15028}, + { 370, -3095, 14777}, + { 369, -3072, 14526}, + { 368, -3048, 14274}, + { 366, -3022, 14022}, + { 364, -2996, 13770}, + { 362, -2968, 13517}, + { 359, -2940, 13265}, + { 357, -2910, 13012}, + { 354, -2880, 12760}, + { 351, -2848, 12508}, + { 348, -2815, 12255}, + { 344, -2782, 12003}, + { 341, -2747, 11751}, + { 337, -2712, 11500}, + { 333, -2676, 11248}, + { 328, -2639, 10997}, + { 324, -2601, 10747}, + { 320, -2562, 10497}, + { 315, -2523, 10247}, + { 310, -2482, 9998}, + { 305, -2442, 9750}, + { 300, -2400, 9502}, + { 294, -2358, 9255}, + { 289, -2315, 9009}, + { 283, -2271, 8763}, + { 277, -2227, 8519}, + { 271, -2182, 8275}, + { 265, -2137, 8032}, + { 259, -2091, 7791}, + { 252, -2045, 7550}, + { 246, -1998, 7311}, + { 239, -1951, 7072}, + { 232, -1904, 6835}, + { 226, -1856, 6599}, + { 219, -1807, 6364}, + { 212, -1758, 6131}, + { 204, -1709, 5899}, + { 197, -1660, 5668}, + { 190, -1611, 5439}, + { 183, -1561, 5212}, + { 175, -1511, 4986}, + { 168, -1460, 4761}, + { 160, -1410, 4538}, + { 152, -1359, 4317}, + { 145, -1309, 4098}, + { 137, -1258, 3880}, + { 129, -1207, 3664}, + { 121, -1156, 3450}, + { 113, -1105, 3238}, + { 105, -1054, 3028}, + { 97, -1003, 2820}, + { 89, -952, 2614}, + { 81, -901, 2409}, + { 73, -851, 2207}, +}; diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_rom.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_rom.h new file mode 100755 index 0000000..4792721 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_rom.h @@ -0,0 +1,91 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * File Name: SKP_Silk_resample_rom.h * + * * + * Description: Header file for FIR resampling of * + * 32 and 44 kHz input * + * * + * Copyright 2007 (c), Skype Limited * + * All rights reserved. * + * * + * Date: 070807 * + * */ + +#ifndef _SKP_SILK_FIX_RESAMPLER_ROM_H_ +#define _SKP_SILK_FIX_RESAMPLER_ROM_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "SKP_Silk_typedef.h" +#include "SKP_Silk_resampler_structs.h" + +#define RESAMPLER_DOWN_ORDER_FIR 12 +#define RESAMPLER_ORDER_FIR_144 6 + + +/* Tables for 2x downsampler. Values above 32767 intentionally wrap to a negative value. */ +extern const SKP_int16 SKP_Silk_resampler_down2_0; +extern const SKP_int16 SKP_Silk_resampler_down2_1; + +/* Tables for 2x upsampler, low quality. Values above 32767 intentionally wrap to a negative value. */ +extern const SKP_int16 SKP_Silk_resampler_up2_lq_0; +extern const SKP_int16 SKP_Silk_resampler_up2_lq_1; + +/* Tables for 2x upsampler, high quality. Values above 32767 intentionally wrap to a negative value. */ +extern const SKP_int16 SKP_Silk_resampler_up2_hq_0[ 2 ]; +extern const SKP_int16 SKP_Silk_resampler_up2_hq_1[ 2 ]; +extern const SKP_int16 SKP_Silk_resampler_up2_hq_notch[ 4 ]; + +/* Tables with IIR and FIR coefficients for fractional downsamplers */ +extern const SKP_int16 SKP_Silk_Resampler_3_4_COEFS[ 2 + 3 * RESAMPLER_DOWN_ORDER_FIR / 2 ]; +extern const SKP_int16 SKP_Silk_Resampler_2_3_COEFS[ 2 + 2 * RESAMPLER_DOWN_ORDER_FIR / 2 ]; +extern const SKP_int16 SKP_Silk_Resampler_1_2_COEFS[ 2 + RESAMPLER_DOWN_ORDER_FIR / 2 ]; +extern const SKP_int16 SKP_Silk_Resampler_3_8_COEFS[ 2 + 3 * RESAMPLER_DOWN_ORDER_FIR / 2 ]; +extern const SKP_int16 SKP_Silk_Resampler_1_3_COEFS[ 2 + RESAMPLER_DOWN_ORDER_FIR / 2 ]; +extern const SKP_int16 SKP_Silk_Resampler_2_3_COEFS_LQ[ 2 + 2 * 2 ]; +extern const SKP_int16 SKP_Silk_Resampler_1_3_COEFS_LQ[ 2 + 3 ]; + +/* Tables with coefficients for 4th order ARMA filter */ +extern const SKP_int16 SKP_Silk_Resampler_320_441_ARMA4_COEFS[ 7 ]; +extern const SKP_int16 SKP_Silk_Resampler_240_441_ARMA4_COEFS[ 7 ]; +extern const SKP_int16 SKP_Silk_Resampler_160_441_ARMA4_COEFS[ 7 ]; +extern const SKP_int16 SKP_Silk_Resampler_120_441_ARMA4_COEFS[ 7 ]; +extern const SKP_int16 SKP_Silk_Resampler_80_441_ARMA4_COEFS[ 7 ]; + +/* Table with interplation fractions of 1/288 : 2/288 : 287/288 (432 Words) */ +extern const SKP_int16 SKP_Silk_resampler_frac_FIR_144[ 144 ][ RESAMPLER_ORDER_FIR_144 / 2 ]; + +#ifdef __cplusplus +} +#endif + +#endif // _SKP_SILK_FIX_RESAMPLER_ROM_H_ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_structs.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_structs.h new file mode 100755 index 0000000..c44bbc9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_structs.h @@ -0,0 +1,80 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * File Name: SKP_Silk_resampler_structs.h * + * * + * Description: Structs for IIR/FIR resamplers * + * * + * Copyright 2010 (c), Skype Limited * + * All rights reserved. * + * * + * */ + +#ifndef SKP_Silk_RESAMPLER_STRUCTS_H +#define SKP_Silk_RESAMPLER_STRUCTS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Flag to enable support for input/output sampling rates above 48 kHz. Turn off for embedded devices */ +#define RESAMPLER_SUPPORT_ABOVE_48KHZ 1 + +#define SKP_Silk_RESAMPLER_MAX_FIR_ORDER 16 +#define SKP_Silk_RESAMPLER_MAX_IIR_ORDER 6 + + +typedef struct _SKP_Silk_resampler_state_struct{ + SKP_int32 sIIR[ SKP_Silk_RESAMPLER_MAX_IIR_ORDER ]; /* this must be the first element of this struct */ + SKP_int32 sFIR[ SKP_Silk_RESAMPLER_MAX_FIR_ORDER ]; + SKP_int32 sDown2[ 2 ]; + void (*resampler_function)( void *, SKP_int16 *, const SKP_int16 *, SKP_int32 ); + void (*up2_function)( SKP_int32 *, SKP_int16 *, const SKP_int16 *, SKP_int32 ); + SKP_int32 batchSize; + SKP_int32 invRatio_Q16; + SKP_int32 FIR_Fracs; + SKP_int32 input2x; + const SKP_int16 *Coefs; +#if RESAMPLER_SUPPORT_ABOVE_48KHZ + SKP_int32 sDownPre[ 2 ]; + SKP_int32 sUpPost[ 2 ]; + void (*down_pre_function)( SKP_int32 *, SKP_int16 *, const SKP_int16 *, SKP_int32 ); + void (*up_post_function)( SKP_int32 *, SKP_int16 *, const SKP_int16 *, SKP_int32 ); + SKP_int32 batchSizePrePost; + SKP_int32 ratio_Q16; + SKP_int32 nPreDownsamplers; + SKP_int32 nPostUpsamplers; +#endif + SKP_int32 magic_number; +} SKP_Silk_resampler_state_struct; + +#ifdef __cplusplus +} +#endif +#endif /* SKP_Silk_RESAMPLER_STRUCTS_H */ + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_up2.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_up2.c new file mode 100755 index 0000000..c452cc6 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_resampler_up2.c @@ -0,0 +1,75 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_resampler_up2.c * + * * + * Upsample by a factor 2, low quality * + * * + * Copyright 2010 (c), Skype Limited * + * */ + +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_resampler_rom.h" + +/* Upsample by a factor 2, low quality */ +void SKP_Silk_resampler_up2( + SKP_int32 *S, /* I/O: State vector [ 2 ] */ + SKP_int16 *out, /* O: Output signal [ 2 * len ] */ + const SKP_int16 *in, /* I: Input signal [ len ] */ + SKP_int32 len /* I: Number of input samples */ +) +{ + SKP_int32 k; + SKP_int32 in32, out32, Y, X; + + SKP_assert( SKP_Silk_resampler_up2_lq_0 > 0 ); + SKP_assert( SKP_Silk_resampler_up2_lq_1 < 0 ); + /* Internal variables and state are in Q10 format */ + for( k = 0; k < len; k++ ) { + /* Convert to Q10 */ + in32 = SKP_LSHIFT( (SKP_int32)in[ k ], 10 ); + + /* All-pass section for even output sample */ + Y = SKP_SUB32( in32, S[ 0 ] ); + X = SKP_SMULWB( Y, SKP_Silk_resampler_up2_lq_0 ); + out32 = SKP_ADD32( S[ 0 ], X ); + S[ 0 ] = SKP_ADD32( in32, X ); + + /* Convert back to int16 and store to output */ + out[ 2 * k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 10 ) ); + + /* All-pass section for odd output sample */ + Y = SKP_SUB32( in32, S[ 1 ] ); + X = SKP_SMLAWB( Y, Y, SKP_Silk_resampler_up2_lq_1 ); + out32 = SKP_ADD32( S[ 1 ], X ); + S[ 1 ] = SKP_ADD32( in32, X ); + + /* Convert back to int16 and store to output */ + out[ 2 * k + 1 ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out32, 10 ) ); + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_residual_energy_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_residual_energy_FLP.c new file mode 100755 index 0000000..2fd63f0 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_residual_energy_FLP.c @@ -0,0 +1,110 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +#define MAX_ITERATIONS_RESIDUAL_NRG 10 +#define REGULARIZATION_FACTOR 1e-8f + +/* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ +SKP_float SKP_Silk_residual_energy_covar_FLP( /* O Weighted residual energy */ + const SKP_float *c, /* I Filter coefficients */ + SKP_float *wXX, /* I/O Weighted correlation matrix, reg. out */ + const SKP_float *wXx, /* I Weighted correlation vector */ + const SKP_float wxx, /* I Weighted correlation value */ + const SKP_int D /* I Dimension */ +) +{ + SKP_int i, j, k; + SKP_float tmp, nrg, regularization; + + /* Safety checks */ + SKP_assert( D >= 0 ); + + regularization = REGULARIZATION_FACTOR * ( wXX[ 0 ] + wXX[ D * D - 1 ] ); + for( k = 0; k < MAX_ITERATIONS_RESIDUAL_NRG; k++ ) { + nrg = wxx; + + tmp = 0.0f; + for( i = 0; i < D; i++ ) { + tmp += wXx[ i ] * c[ i ]; + } + nrg -= 2.0f * tmp; + + /* compute c' * wXX * c, assuming wXX is symmetric */ + for( i = 0; i < D; i++ ) { + tmp = 0.0f; + for( j = i + 1; j < D; j++ ) { + tmp += matrix_c_ptr( wXX, i, j, D ) * c[ j ]; + } + nrg += c[ i ] * ( 2.0f * tmp + matrix_c_ptr( wXX, i, i, D ) * c[ i ] ); + } + if( nrg > 0 ) { + break; + } else { + /* Add white noise */ + for( i = 0; i < D; i++ ) { + matrix_c_ptr( wXX, i, i, D ) += regularization; + } + /* Increase noise for next run */ + regularization *= 2.0f; + } + } + if( k == MAX_ITERATIONS_RESIDUAL_NRG ) { + SKP_assert( nrg == 0 ); + nrg = 1.0f; + } + + return nrg; +} + +/* Calculates residual energies of input subframes where all subframes have LPC_order */ +/* of preceeding samples */ +void SKP_Silk_residual_energy_FLP( + SKP_float nrgs[], /* O Residual energy per subframe */ + const SKP_float x[], /* I Input signal */ + SKP_float a[ 2 ][ MAX_LPC_ORDER ], /* I AR coefs for each frame half */ + const SKP_float gains[], /* I Quantization gains */ + const SKP_int subfr_length, /* I Subframe length */ + const SKP_int LPC_order /* I LPC order */ +) +{ + SKP_int shift; + SKP_float *LPC_res_ptr, LPC_res[ ( MAX_FRAME_LENGTH + NB_SUBFR * MAX_LPC_ORDER ) / 2 ]; + + LPC_res_ptr = LPC_res + LPC_order; + shift = LPC_order + subfr_length; + + /* Filter input to create the LPC residual for each frame half, and measure subframe energies */ + SKP_Silk_LPC_analysis_filter_FLP( LPC_res, a[ 0 ], x + 0 * shift, 2 * shift, LPC_order ); + nrgs[ 0 ] = ( SKP_float )( gains[ 0 ] * gains[ 0 ] * SKP_Silk_energy_FLP( LPC_res_ptr + 0 * shift, subfr_length ) ); + nrgs[ 1 ] = ( SKP_float )( gains[ 1 ] * gains[ 1 ] * SKP_Silk_energy_FLP( LPC_res_ptr + 1 * shift, subfr_length ) ); + + SKP_Silk_LPC_analysis_filter_FLP( LPC_res, a[ 1 ], x + 2 * shift, 2 * shift, LPC_order ); + nrgs[ 2 ] = ( SKP_float )( gains[ 2 ] * gains[ 2 ] * SKP_Silk_energy_FLP( LPC_res_ptr + 0 * shift, subfr_length ) ); + nrgs[ 3 ] = ( SKP_float )( gains[ 3 ] * gains[ 3 ] * SKP_Silk_energy_FLP( LPC_res_ptr + 1 * shift, subfr_length ) ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_scale_copy_vector_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_scale_copy_vector_FLP.c new file mode 100755 index 0000000..c02492e --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_scale_copy_vector_FLP.c @@ -0,0 +1,53 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FLP.h" + +/* copy and multiply a vector by a constant */ +void SKP_Silk_scale_copy_vector_FLP( + SKP_float *data_out, + const SKP_float *data_in, + SKP_float gain, + SKP_int dataSize +) +{ + SKP_int i, dataSize4; + + /* 4x unrolled loop */ + dataSize4 = dataSize & 0xFFFC; + for( i = 0; i < dataSize4; i += 4 ) { + data_out[ i + 0 ] = gain * data_in[ i + 0 ]; + data_out[ i + 1 ] = gain * data_in[ i + 1 ]; + data_out[ i + 2 ] = gain * data_in[ i + 2 ]; + data_out[ i + 3 ] = gain * data_in[ i + 3 ]; + } + + /* any remaining elements */ + for( ; i < dataSize; i++ ) { + data_out[ i ] = gain * data_in[ i ]; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_scale_vector_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_scale_vector_FLP.c new file mode 100755 index 0000000..84551a0 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_scale_vector_FLP.c @@ -0,0 +1,52 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_SigProc_FLP.h" + +/* multiply a vector by a constant */ +void SKP_Silk_scale_vector_FLP( + SKP_float *data1, + SKP_float gain, + SKP_int dataSize +) +{ + SKP_int i, dataSize4; + + /* 4x unrolled loop */ + dataSize4 = dataSize & 0xFFFC; + for( i = 0; i < dataSize4; i += 4 ) { + data1[ i + 0 ] *= gain; + data1[ i + 1 ] *= gain; + data1[ i + 2 ] *= gain; + data1[ i + 3 ] *= gain; + } + + /* any remaining elements */ + for( ; i < dataSize; i++ ) { + data1[ i ] *= gain; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_schur_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_schur_FLP.c new file mode 100755 index 0000000..7ca2afc --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_schur_FLP.c @@ -0,0 +1,73 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_schur.c * + * * + * Calculates the reflection coefficients from the correlation sequence * + * * + * Copyright 2008 (c), Skype Limited * + * Date: 080103 * + */ + +#include "SKP_Silk_SigProc_FLP.h" + +SKP_float SKP_Silk_schur_FLP( /* O returns residual energy */ + SKP_float refl_coef[], /* O reflection coefficients (length order) */ + const SKP_float auto_corr[], /* I autotcorrelation sequence (length order+1) */ + SKP_int order /* I order */ +) +{ + SKP_int k, n; + SKP_float C[SKP_Silk_MAX_ORDER_LPC + 1][2]; + SKP_float Ctmp1, Ctmp2, rc_tmp; + + /* copy correlations */ + for( k = 0; k < order+1; k++ ){ + C[k][0] = C[k][1] = auto_corr[k]; + } + + for( k = 0; k < order; k++ ) { + /* get reflection coefficient */ + rc_tmp = -C[k + 1][0] / SKP_max_float( C[0][1], 1e-9f ); + + /* save the output */ + refl_coef[k] = rc_tmp; + + /* update correlations */ + for( n = 0; n < order - k; n++ ){ + Ctmp1 = C[n + k + 1][0]; + Ctmp2 = C[n][1]; + C[n + k + 1][0] = Ctmp1 + Ctmp2 * rc_tmp; + C[n][1] = Ctmp2 + Ctmp1 * rc_tmp; + } + } + + /* return residual energy */ + return C[0][1]; +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_setup_complexity.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_setup_complexity.h new file mode 100755 index 0000000..25bcefd --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_setup_complexity.h @@ -0,0 +1,99 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" +#include "SKP_Silk_tuning_parameters.h" + +SKP_INLINE SKP_int SKP_Silk_setup_complexity( + SKP_Silk_encoder_state *psEncC, /* I/O Pointer to Silk encoder state */ + SKP_int Complexity /* I Complexity (0->low; 1->medium; 2->high) */ +) +{ + SKP_int ret = SKP_SILK_NO_ERROR; + + /* Check that settings are valid */ + if( LOW_COMPLEXITY_ONLY && Complexity != 0 ) { + ret = SKP_SILK_ENC_INVALID_COMPLEXITY_SETTING; + } + + /* Set encoding complexity */ + if( Complexity == 0 || LOW_COMPLEXITY_ONLY ) { + /* Low complexity */ + psEncC->Complexity = 0; + psEncC->pitchEstimationComplexity = PITCH_EST_COMPLEXITY_LC_MODE; + psEncC->pitchEstimationThreshold_Q16 = SKP_FIX_CONST( FIND_PITCH_CORRELATION_THRESHOLD_LC_MODE, 16 ); + psEncC->pitchEstimationLPCOrder = 6; + psEncC->shapingLPCOrder = 8; + psEncC->la_shape = 3 * psEncC->fs_kHz; + psEncC->nStatesDelayedDecision = 1; + psEncC->useInterpolatedNLSFs = 0; + psEncC->LTPQuantLowComplexity = 1; + psEncC->NLSF_MSVQ_Survivors = MAX_NLSF_MSVQ_SURVIVORS_LC_MODE; + psEncC->warping_Q16 = 0; + } else if( Complexity == 1 ) { + /* Medium complexity */ + psEncC->Complexity = 1; + psEncC->pitchEstimationComplexity = PITCH_EST_COMPLEXITY_MC_MODE; + psEncC->pitchEstimationThreshold_Q16 = SKP_FIX_CONST( FIND_PITCH_CORRELATION_THRESHOLD_MC_MODE, 16 ); + psEncC->pitchEstimationLPCOrder = 12; + psEncC->shapingLPCOrder = 12; + psEncC->la_shape = 5 * psEncC->fs_kHz; + psEncC->nStatesDelayedDecision = 2; + psEncC->useInterpolatedNLSFs = 0; + psEncC->LTPQuantLowComplexity = 0; + psEncC->NLSF_MSVQ_Survivors = MAX_NLSF_MSVQ_SURVIVORS_MC_MODE; + psEncC->warping_Q16 = psEncC->fs_kHz * SKP_FIX_CONST( WARPING_MULTIPLIER, 16 ); + } else if( Complexity == 2 ) { + /* High complexity */ + psEncC->Complexity = 2; + psEncC->pitchEstimationComplexity = PITCH_EST_COMPLEXITY_HC_MODE; + psEncC->pitchEstimationThreshold_Q16 = SKP_FIX_CONST( FIND_PITCH_CORRELATION_THRESHOLD_HC_MODE, 16 ); + psEncC->pitchEstimationLPCOrder = 16; + psEncC->shapingLPCOrder = 16; + psEncC->la_shape = 5 * psEncC->fs_kHz; + psEncC->nStatesDelayedDecision = MAX_DEL_DEC_STATES; + psEncC->useInterpolatedNLSFs = 1; + psEncC->LTPQuantLowComplexity = 0; + psEncC->NLSF_MSVQ_Survivors = MAX_NLSF_MSVQ_SURVIVORS; + psEncC->warping_Q16 = psEncC->fs_kHz * SKP_FIX_CONST( WARPING_MULTIPLIER, 16 ); + } else { + ret = SKP_SILK_ENC_INVALID_COMPLEXITY_SETTING; + } + + /* Do not allow higher pitch estimation LPC order than predict LPC order */ + psEncC->pitchEstimationLPCOrder = SKP_min_int( psEncC->pitchEstimationLPCOrder, psEncC->predictLPCOrder ); + psEncC->shapeWinLength = 5 * psEncC->fs_kHz + 2 * psEncC->la_shape; + + SKP_assert( psEncC->pitchEstimationLPCOrder <= MAX_FIND_PITCH_LPC_ORDER ); + SKP_assert( psEncC->shapingLPCOrder <= MAX_SHAPE_LPC_ORDER ); + SKP_assert( psEncC->nStatesDelayedDecision <= MAX_DEL_DEC_STATES ); + SKP_assert( psEncC->warping_Q16 <= 32767 ); + SKP_assert( psEncC->la_shape <= LA_SHAPE_MAX ); + SKP_assert( psEncC->shapeWinLength <= SHAPE_LPC_WIN_MAX ); + + return( ret ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_shell_coder.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_shell_coder.c new file mode 100755 index 0000000..9d0f546 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_shell_coder.c @@ -0,0 +1,155 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main.h" + +/* shell coder; pulse-subframe length is hardcoded */ + +SKP_INLINE void combine_pulses( + SKP_int *out, /* O: combined pulses vector [len] */ + const SKP_int *in, /* I: input vector [2 * len] */ + const SKP_int len /* I: number of OUTPUT samples */ +) +{ + SKP_int k; + for( k = 0; k < len; k++ ) { + out[ k ] = in[ 2 * k ] + in[ 2 * k + 1 ]; + } +} + +SKP_INLINE void encode_split( + SKP_Silk_range_coder_state *sRC, /* I/O: compressor data structure */ + const SKP_int p_child1, /* I: pulse amplitude of first child subframe */ + const SKP_int p, /* I: pulse amplitude of current subframe */ + const SKP_uint16 *shell_table /* I: table of shell cdfs */ +) +{ + const SKP_uint16 *cdf; + + if( p > 0 ) { + cdf = &shell_table[ SKP_Silk_shell_code_table_offsets[ p ] ]; + SKP_Silk_range_encoder( sRC, p_child1, cdf ); + } +} + +SKP_INLINE void decode_split( + SKP_int *p_child1, /* O: pulse amplitude of first child subframe */ + SKP_int *p_child2, /* O: pulse amplitude of second child subframe */ + SKP_Silk_range_coder_state *sRC, /* I/O: compressor data structure */ + const SKP_int p, /* I: pulse amplitude of current subframe */ + const SKP_uint16 *shell_table /* I: table of shell cdfs */ +) +{ + SKP_int cdf_middle; + const SKP_uint16 *cdf; + + if( p > 0 ) { + cdf_middle = SKP_RSHIFT( p, 1 ); + cdf = &shell_table[ SKP_Silk_shell_code_table_offsets[ p ] ]; + SKP_Silk_range_decoder( p_child1, sRC, cdf, cdf_middle ); + p_child2[ 0 ] = p - p_child1[ 0 ]; + } else { + p_child1[ 0 ] = 0; + p_child2[ 0 ] = 0; + } +} + +/* Shell encoder, operates on one shell code frame of 16 pulses */ +void SKP_Silk_shell_encoder( + SKP_Silk_range_coder_state *sRC, /* I/O compressor data structure */ + const SKP_int *pulses0 /* I data: nonnegative pulse amplitudes */ +) +{ + SKP_int pulses1[ 8 ], pulses2[ 4 ], pulses3[ 2 ], pulses4[ 1 ]; + + /* this function operates on one shell code frame of 16 pulses */ + SKP_assert( SHELL_CODEC_FRAME_LENGTH == 16 ); + + /* tree representation per pulse-subframe */ + combine_pulses( pulses1, pulses0, 8 ); + combine_pulses( pulses2, pulses1, 4 ); + combine_pulses( pulses3, pulses2, 2 ); + combine_pulses( pulses4, pulses3, 1 ); + + encode_split( sRC, pulses3[ 0 ], pulses4[ 0 ], SKP_Silk_shell_code_table3 ); + + encode_split( sRC, pulses2[ 0 ], pulses3[ 0 ], SKP_Silk_shell_code_table2 ); + + encode_split( sRC, pulses1[ 0 ], pulses2[ 0 ], SKP_Silk_shell_code_table1 ); + encode_split( sRC, pulses0[ 0 ], pulses1[ 0 ], SKP_Silk_shell_code_table0 ); + encode_split( sRC, pulses0[ 2 ], pulses1[ 1 ], SKP_Silk_shell_code_table0 ); + + encode_split( sRC, pulses1[ 2 ], pulses2[ 1 ], SKP_Silk_shell_code_table1 ); + encode_split( sRC, pulses0[ 4 ], pulses1[ 2 ], SKP_Silk_shell_code_table0 ); + encode_split( sRC, pulses0[ 6 ], pulses1[ 3 ], SKP_Silk_shell_code_table0 ); + + encode_split( sRC, pulses2[ 2 ], pulses3[ 1 ], SKP_Silk_shell_code_table2 ); + + encode_split( sRC, pulses1[ 4 ], pulses2[ 2 ], SKP_Silk_shell_code_table1 ); + encode_split( sRC, pulses0[ 8 ], pulses1[ 4 ], SKP_Silk_shell_code_table0 ); + encode_split( sRC, pulses0[ 10 ], pulses1[ 5 ], SKP_Silk_shell_code_table0 ); + + encode_split( sRC, pulses1[ 6 ], pulses2[ 3 ], SKP_Silk_shell_code_table1 ); + encode_split( sRC, pulses0[ 12 ], pulses1[ 6 ], SKP_Silk_shell_code_table0 ); + encode_split( sRC, pulses0[ 14 ], pulses1[ 7 ], SKP_Silk_shell_code_table0 ); +} + + +/* Shell decoder, operates on one shell code frame of 16 pulses */ +void SKP_Silk_shell_decoder( + SKP_int *pulses0, /* O data: nonnegative pulse amplitudes */ + SKP_Silk_range_coder_state *sRC, /* I/O compressor data structure */ + const SKP_int pulses4 /* I number of pulses per pulse-subframe */ +) +{ + SKP_int pulses3[ 2 ], pulses2[ 4 ], pulses1[ 8 ]; + + /* this function operates on one shell code frame of 16 pulses */ + SKP_assert( SHELL_CODEC_FRAME_LENGTH == 16 ); + + decode_split( &pulses3[ 0 ], &pulses3[ 1 ], sRC, pulses4, SKP_Silk_shell_code_table3 ); + + decode_split( &pulses2[ 0 ], &pulses2[ 1 ], sRC, pulses3[ 0 ], SKP_Silk_shell_code_table2 ); + + decode_split( &pulses1[ 0 ], &pulses1[ 1 ], sRC, pulses2[ 0 ], SKP_Silk_shell_code_table1 ); + decode_split( &pulses0[ 0 ], &pulses0[ 1 ], sRC, pulses1[ 0 ], SKP_Silk_shell_code_table0 ); + decode_split( &pulses0[ 2 ], &pulses0[ 3 ], sRC, pulses1[ 1 ], SKP_Silk_shell_code_table0 ); + + decode_split( &pulses1[ 2 ], &pulses1[ 3 ], sRC, pulses2[ 1 ], SKP_Silk_shell_code_table1 ); + decode_split( &pulses0[ 4 ], &pulses0[ 5 ], sRC, pulses1[ 2 ], SKP_Silk_shell_code_table0 ); + decode_split( &pulses0[ 6 ], &pulses0[ 7 ], sRC, pulses1[ 3 ], SKP_Silk_shell_code_table0 ); + + decode_split( &pulses2[ 2 ], &pulses2[ 3 ], sRC, pulses3[ 1 ], SKP_Silk_shell_code_table2 ); + + decode_split( &pulses1[ 4 ], &pulses1[ 5 ], sRC, pulses2[ 2 ], SKP_Silk_shell_code_table1 ); + decode_split( &pulses0[ 8 ], &pulses0[ 9 ], sRC, pulses1[ 4 ], SKP_Silk_shell_code_table0 ); + decode_split( &pulses0[ 10 ], &pulses0[ 11 ], sRC, pulses1[ 5 ], SKP_Silk_shell_code_table0 ); + + decode_split( &pulses1[ 6 ], &pulses1[ 7 ], sRC, pulses2[ 3 ], SKP_Silk_shell_code_table1 ); + decode_split( &pulses0[ 12 ], &pulses0[ 13 ], sRC, pulses1[ 6 ], SKP_Silk_shell_code_table0 ); + decode_split( &pulses0[ 14 ], &pulses0[ 15 ], sRC, pulses1[ 7 ], SKP_Silk_shell_code_table0 ); +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sigm_Q15.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sigm_Q15.c new file mode 100755 index 0000000..586c157 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sigm_Q15.c @@ -0,0 +1,78 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_sigm_Q15.c * + * * + * Approximate sigmoid function * + * * + * Copyright 2006 (c), Skype Limited * + * Date: 060221 * + * */ +#include "SKP_Silk_SigProc_FIX.h" +/********************************/ +/* approximate sigmoid function */ +/********************************/ +/* fprintf(1, '%d, ', round(1024 * ([1 ./ (1 + exp(-(1:5))), 1] - 1 ./ (1 + exp(-(0:5)))))); */ +static const SKP_int32 sigm_LUT_slope_Q10[ 6 ] = { + 237, 153, 73, 30, 12, 7 +}; +/* fprintf(1, '%d, ', round(32767 * 1 ./ (1 + exp(-(0:5))))); */ +static const SKP_int32 sigm_LUT_pos_Q15[ 6 ] = { + 16384, 23955, 28861, 31213, 32178, 32548 +}; +/* fprintf(1, '%d, ', round(32767 * 1 ./ (1 + exp((0:5))))); */ +static const SKP_int32 sigm_LUT_neg_Q15[ 6 ] = { + 16384, 8812, 3906, 1554, 589, 219 +}; + +SKP_int SKP_Silk_sigm_Q15( SKP_int in_Q5 ) +{ + SKP_int ind; + + if( in_Q5 < 0 ) { + /* Negative input */ + in_Q5 = -in_Q5; + if( in_Q5 >= 6 * 32 ) { + return 0; /* Clip */ + } else { + /* Linear interpolation of look up table */ + ind = SKP_RSHIFT( in_Q5, 5 ); + return( sigm_LUT_neg_Q15[ ind ] - SKP_SMULBB( sigm_LUT_slope_Q10[ ind ], in_Q5 & 0x1F ) ); + } + } else { + /* Positive input */ + if( in_Q5 >= 6 * 32 ) { + return 32767; /* clip */ + } else { + /* Linear interpolation of look up table */ + ind = SKP_RSHIFT( in_Q5, 5 ); + return( sigm_LUT_pos_Q15[ ind ] + SKP_SMULBB( sigm_LUT_slope_Q10[ ind ], in_Q5 & 0x1F ) ); + } + } +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_solve_LS_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_solve_LS_FLP.c new file mode 100755 index 0000000..91fa609 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_solve_LS_FLP.c @@ -0,0 +1,203 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" +#include "SKP_Silk_tuning_parameters.h" + +/********************************************************************** + * LDL Factorisation. Finds the upper triangular matrix L and the diagonal + * Matrix D (only the diagonal elements returned in a vector)such that + * the symmetric matric A is given by A = L*D*L'. + **********************************************************************/ +void SKP_Silk_LDL_FLP( + SKP_float *A, /* (I/O) Pointer to Symetric Square Matrix */ + SKP_int M, /* (I) Size of Matrix */ + SKP_float *L, /* (I/O) Pointer to Square Upper triangular Matrix */ + SKP_float *Dinv /* (I/O) Pointer to vector holding the inverse diagonal elements of D */ +); + +/********************************************************************** + * Function to solve linear equation Ax = b, when A is a MxM lower + * triangular matrix, with ones on the diagonal. + **********************************************************************/ +void SKP_Silk_SolveWithLowerTriangularWdiagOnes_FLP( + const SKP_float *L, /* (I) Pointer to Lower Triangular Matrix */ + SKP_int M, /* (I) Dim of Matrix equation */ + const SKP_float *b, /* (I) b Vector */ + SKP_float *x /* (O) x Vector */ +); + +/********************************************************************** + * Function to solve linear equation (A^T)x = b, when A is a MxM lower + * triangular, with ones on the diagonal. (ie then A^T is upper triangular) + **********************************************************************/ +void SKP_Silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( + const SKP_float *L, /* (I) Pointer to Lower Triangular Matrix */ + SKP_int M, /* (I) Dim of Matrix equation */ + const SKP_float *b, /* (I) b Vector */ + SKP_float *x /* (O) x Vector */ +); + +/********************************************************************** + * Function to solve linear equation Ax = b, when A is a MxM + * symmetric square matrix - using LDL factorisation + **********************************************************************/ +void SKP_Silk_solve_LDL_FLP( + SKP_float *A, /* I/O Symmetric square matrix, out: reg. */ + const SKP_int M, /* I Size of matrix */ + const SKP_float *b, /* I Pointer to b vector */ + SKP_float *x /* O Pointer to x solution vector */ +) +{ + SKP_int i; + SKP_float L[ MAX_MATRIX_SIZE ][ MAX_MATRIX_SIZE ]; + SKP_float T[ MAX_MATRIX_SIZE ]; + SKP_float Dinv[ MAX_MATRIX_SIZE ]; // inverse diagonal elements of D + + SKP_assert( M <= MAX_MATRIX_SIZE ); + + /*************************************************** + Factorize A by LDL such that A = L*D*(L^T), + where L is lower triangular with ones on diagonal + ****************************************************/ + SKP_Silk_LDL_FLP( A, M, &L[ 0 ][ 0 ], Dinv ); + + /**************************************************** + * substitute D*(L^T) = T. ie: + L*D*(L^T)*x = b => L*T = b <=> T = inv(L)*b + ******************************************************/ + SKP_Silk_SolveWithLowerTriangularWdiagOnes_FLP( &L[ 0 ][ 0 ], M, b, T ); + + /**************************************************** + D*(L^T)*x = T <=> (L^T)*x = inv(D)*T, because D is + diagonal just multiply with 1/d_i + ****************************************************/ + for( i = 0; i < M; i++ ) { + T[ i ] = T[ i ] * Dinv[ i ]; + } + /**************************************************** + x = inv(L') * inv(D) * T + *****************************************************/ + SKP_Silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( &L[ 0 ][ 0 ], M, T, x ); +} + +void SKP_Silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( + const SKP_float *L, /* (I) Pointer to Lower Triangular Matrix */ + SKP_int M, /* (I) Dim of Matrix equation */ + const SKP_float *b, /* (I) b Vector */ + SKP_float *x /* (O) x Vector */ +) +{ + SKP_int i, j; + SKP_float temp; + const SKP_float *ptr1; + + for( i = M - 1; i >= 0; i-- ) { + ptr1 = matrix_adr( L, 0, i, M ); + temp = 0; + for( j = M - 1; j > i ; j-- ) { + temp += ptr1[ j * M ] * x[ j ]; + } + temp = b[ i ] - temp; + x[ i ] = temp; + } +} + +void SKP_Silk_SolveWithLowerTriangularWdiagOnes_FLP( + const SKP_float *L, /* (I) Pointer to Lower Triangular Matrix */ + SKP_int M, /* (I) Dim of Matrix equation */ + const SKP_float *b, /* (I) b Vector */ + SKP_float *x /* (O) x Vector */ +) +{ + SKP_int i, j; + SKP_float temp; + const SKP_float *ptr1; + + for( i = 0; i < M; i++ ) { + ptr1 = matrix_adr( L, i, 0, M ); + temp = 0; + for( j = 0; j < i; j++ ) { + temp += ptr1[ j ] * x[ j ]; + } + temp = b[ i ] - temp; + x[ i ] = temp; + } +} + +void SKP_Silk_LDL_FLP( + SKP_float *A, /* (I/O) Pointer to Symetric Square Matrix */ + SKP_int M, /* (I) Size of Matrix */ + SKP_float *L, /* (I/O) Pointer to Square Upper triangular Matrix */ + SKP_float *Dinv /* (I/O) Pointer to vector holding the inverse diagonal elements of D */ +) +{ + SKP_int i, j, k, loop_count, err = 1; + SKP_float *ptr1, *ptr2; + double temp, diag_min_value; + SKP_float v[ MAX_MATRIX_SIZE ], D[ MAX_MATRIX_SIZE ]; // temp arrays + + SKP_assert( M <= MAX_MATRIX_SIZE ); + + diag_min_value = FIND_LTP_COND_FAC * 0.5f * ( A[ 0 ] + A[ M * M - 1 ] ); + for( loop_count = 0; loop_count < M && err == 1; loop_count++ ) { + err = 0; + for( j = 0; j < M; j++ ) { + ptr1 = matrix_adr( L, j, 0, M ); + temp = matrix_ptr( A, j, j, M ); // element in row j column j + for( i = 0; i < j; i++ ) { + v[ i ] = ptr1[ i ] * D[ i ]; + temp -= ptr1[ i ] * v[ i ]; + } + if( temp < diag_min_value ) { + /* Badly conditioned matrix: add white noise and run again */ + temp = ( loop_count + 1 ) * diag_min_value - temp; + for( i = 0; i < M; i++ ) { + matrix_ptr( A, i, i, M ) += ( SKP_float )temp; + } + err = 1; + break; + } + D[ j ] = ( SKP_float )temp; + Dinv[ j ] = ( SKP_float )( 1.0f / temp ); + matrix_ptr( L, j, j, M ) = 1.0f; + + ptr1 = matrix_adr( A, j, 0, M ); + ptr2 = matrix_adr( L, j + 1, 0, M); + for( i = j + 1; i < M; i++ ) { + temp = 0.0; + for( k = 0; k < j; k++ ) { + temp += ptr2[ k ] * v[ k ]; + } + matrix_ptr( L, i, j, M ) = ( SKP_float )( ( ptr1[ i ] - temp ) * Dinv[ j ] ); + ptr2 += M; // go to next column + } + } + } + SKP_assert( err == 0 ); +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sort.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sort.c new file mode 100755 index 0000000..934373f --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sort.c @@ -0,0 +1,147 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* Insertion sort (fast for already almost sorted arrays): */ +/* Best case: O(n) for an already sorted array */ +/* Worst case: O(n^2) for an inversely sorted array */ + +#include "SKP_Silk_SigProc_FIX.h" + +void SKP_Silk_insertion_sort_increasing( + SKP_int32 *a, /* I/O: Unsorted / Sorted vector */ + SKP_int *index, /* O: Index vector for the sorted elements */ + const SKP_int L, /* I: Vector length */ + const SKP_int K /* I: Number of correctly sorted output positions */ +) +{ + SKP_int32 value; + SKP_int i, j; + + /* Safety checks */ + SKP_assert( K > 0 ); + SKP_assert( L > 0 ); + SKP_assert( L >= K ); + + /* Write start indices in index vector */ + for( i = 0; i < K; i++ ) { + index[ i ] = i; + } + + /* Sort vector elements by value, increasing order */ + for( i = 1; i < K; i++ ) { + value = a[ i ]; + for( j = i - 1; ( j >= 0 ) && ( value < a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + index[ j + 1 ] = index[ j ]; /* Shift index */ + } + a[ j + 1 ] = value; /* Write value */ + index[ j + 1 ] = i; /* Write index */ + } + + /* If less than L values are asked for, check the remaining values, */ + /* but only spend CPU to ensure that the K first values are correct */ + for( i = K; i < L; i++ ) { + value = a[ i ]; + if( value < a[ K - 1 ] ) { + for( j = K - 2; ( j >= 0 ) && ( value < a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + index[ j + 1 ] = index[ j ]; /* Shift index */ + } + a[ j + 1 ] = value; /* Write value */ + index[ j + 1 ] = i; /* Write index */ + } + } +} + +void SKP_Silk_insertion_sort_decreasing_int16( + SKP_int16 *a, /* I/O: Unsorted / Sorted vector */ + SKP_int *index, /* O: Index vector for the sorted elements */ + const SKP_int L, /* I: Vector length */ + const SKP_int K /* I: Number of correctly sorted output positions */ +) +{ + SKP_int i, j; + SKP_int value; + + /* Safety checks */ + SKP_assert( K > 0 ); + SKP_assert( L > 0 ); + SKP_assert( L >= K ); + + /* Write start indices in index vector */ + for( i = 0; i < K; i++ ) { + index[ i ] = i; + } + + /* Sort vector elements by value, decreasing order */ + for( i = 1; i < K; i++ ) { + value = a[ i ]; + for( j = i - 1; ( j >= 0 ) && ( value > a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + index[ j + 1 ] = index[ j ]; /* Shift index */ + } + a[ j + 1 ] = value; /* Write value */ + index[ j + 1 ] = i; /* Write index */ + } + + /* If less than L values are asked for, check the remaining values, */ + /* but only spend CPU to ensure that the K first values are correct */ + for( i = K; i < L; i++ ) { + value = a[ i ]; + if( value > a[ K - 1 ] ) { + for( j = K - 2; ( j >= 0 ) && ( value > a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + index[ j + 1 ] = index[ j ]; /* Shift index */ + } + a[ j + 1 ] = value; /* Write value */ + index[ j + 1 ] = i; /* Write index */ + } + } +} + +void SKP_Silk_insertion_sort_increasing_all_values( + SKP_int *a, /* I/O: Unsorted / Sorted vector */ + const SKP_int L /* I: Vector length */ +) +{ + SKP_int value; + SKP_int i, j; + + /* Safety checks */ + SKP_assert( L > 0 ); + + /* Sort vector elements by value, increasing order */ + for( i = 1; i < L; i++ ) { + value = a[ i ]; + for( j = i - 1; ( j >= 0 ) && ( value < a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + } + a[ j + 1 ] = value; /* Write value */ + } +} + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sort_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sort_FLP.c new file mode 100755 index 0000000..9bcc877 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sort_FLP.c @@ -0,0 +1,128 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* Insertion sort (fast for already almost sorted arrays): */ +/* Best case: O(n) for an already sorted array */ +/* Worst case: O(n^2) for an inversely sorted array */ +/* */ +/* To be implemented: */ + +#include "SKP_Silk_typedef.h" +#include "SKP_Silk_SigProc_FLP.h" + +void SKP_Silk_insertion_sort_increasing_FLP( + SKP_float *a, /* I/O: Unsorted / Sorted vector */ + SKP_int *index, /* O: Index vector for the sorted elements */ + const SKP_int L, /* I: Vector length */ + const SKP_int K /* I: Number of correctly sorted positions */ +) +{ + SKP_float value; + SKP_int i, j; + + /* Safety checks */ + SKP_assert( K > 0 ); + SKP_assert( L > 0 ); + SKP_assert( L >= K ); + + /* Write start indices in index vector */ + for( i = 0; i < K; i++ ) { + index[ i ] = i; + } + + /* Sort vector elements by value, increasing order */ + for( i = 1; i < K; i++ ) { + value = a[ i ]; + for( j = i - 1; ( j >= 0 ) && ( value < a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + index[ j + 1 ] = index[ j ]; /* Shift index */ + } + a[ j + 1 ] = value; /* Write value */ + index[ j + 1 ] = i; /* Write index */ + } + + /* If less than L values are asked check the remaining values, */ + /* but only spend CPU to ensure that the K first values are correct */ + for( i = K; i < L; i++ ) { + value = a[ i ]; + if( value < a[ K - 1 ] ) { + for( j = K - 2; ( j >= 0 ) && ( value < a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + index[ j + 1 ] = index[ j ]; /* Shift index */ + } + a[ j + 1 ] = value; /* Write value */ + index[ j + 1 ] = i; /* Write index */ + } + } +} + +void SKP_Silk_insertion_sort_decreasing_FLP( + SKP_float *a, /* I/O: Unsorted / Sorted vector */ + SKP_int *index, /* O: Index vector for the sorted elements */ + const SKP_int L, /* I: Vector length */ + const SKP_int K /* I: Number of correctly sorted positions */ +) +{ + SKP_float value; + SKP_int i, j; + + /* Safety checks */ + SKP_assert( K > 0 ); + SKP_assert( L > 0 ); + SKP_assert( L >= K ); + + /* Write start indices in index vector */ + for( i = 0; i < K; i++ ) { + index[ i ] = i; + } + + /* Sort vector elements by value, decreasing order */ + for( i = 1; i < K; i++ ) { + value = a[ i ]; + for( j = i - 1; ( j >= 0 ) && ( value > a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + index[ j + 1 ] = index[ j ]; /* Shift index */ + } + a[ j + 1 ] = value; /* Write value */ + index[ j + 1 ] = i; /* Write index */ + } + + /* If less than L values are asked check the remaining values, */ + /* but only spend CPU to ensure that the K first values are correct */ + for( i = K; i < L; i++ ) { + value = a[ i ]; + if( value > a[ K - 1 ] ) { + for( j = K - 2; ( j >= 0 ) && ( value > a[ j ] ); j-- ) { + a[ j + 1 ] = a[ j ]; /* Shift value */ + index[ j + 1 ] = index[ j ]; /* Shift index */ + } + a[ j + 1 ] = value; /* Write value */ + index[ j + 1 ] = i; /* Write index */ + } + } +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_structs.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_structs.h new file mode 100755 index 0000000..10c4117 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_structs.h @@ -0,0 +1,353 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_STRUCTS_H +#define SKP_SILK_STRUCTS_H + +#include "SKP_Silk_typedef.h" +#include "SKP_Silk_SigProc_FIX.h" +#include "SKP_Silk_define.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/************************************/ +/* Noise shaping quantization state */ +/************************************/ +typedef struct { + SKP_int16 xq[ 2 * MAX_FRAME_LENGTH ]; /* Buffer for quantized output signal */ + SKP_int32 sLTP_shp_Q10[ 2 * MAX_FRAME_LENGTH ]; + SKP_int32 sLPC_Q14[ MAX_FRAME_LENGTH / NB_SUBFR + NSQ_LPC_BUF_LENGTH ]; + SKP_int32 sAR2_Q14[ MAX_SHAPE_LPC_ORDER ]; + SKP_int32 sLF_AR_shp_Q12; + SKP_int lagPrev; + SKP_int sLTP_buf_idx; + SKP_int sLTP_shp_buf_idx; + SKP_int32 rand_seed; + SKP_int32 prev_inv_gain_Q16; + SKP_int rewhite_flag; +} SKP_Silk_nsq_state; /* FIX*/ + +/* Struct for Low BitRate Redundant (LBRR) information */ +typedef struct { + SKP_uint8 payload[ MAX_ARITHM_BYTES ]; + SKP_int nBytes; /* Number of bytes in payload */ + SKP_int usage; /* Tells how the payload should be used as FEC */ +} SKP_SILK_LBRR_struct; + +/********************************/ +/* VAD state */ +/********************************/ +typedef struct { + SKP_int32 AnaState[ 2 ]; /* Analysis filterbank state: 0-8 kHz */ + SKP_int32 AnaState1[ 2 ]; /* Analysis filterbank state: 0-4 kHz */ + SKP_int32 AnaState2[ 2 ]; /* Analysis filterbank state: 0-2 kHz */ + SKP_int32 XnrgSubfr[ VAD_N_BANDS ]; /* Subframe energies */ + SKP_int32 NrgRatioSmth_Q8[ VAD_N_BANDS ]; /* Smoothed energy level in each band */ + SKP_int16 HPstate; /* State of differentiator in the lowest band */ + SKP_int32 NL[ VAD_N_BANDS ]; /* Noise energy level in each band */ + SKP_int32 inv_NL[ VAD_N_BANDS ]; /* Inverse noise energy level in each band */ + SKP_int32 NoiseLevelBias[ VAD_N_BANDS ]; /* Noise level estimator bias/offset */ + SKP_int32 counter; /* Frame counter used in the initial phase */ +} SKP_Silk_VAD_state; + +/*******************************/ +/* Range encoder/decoder state */ +/*******************************/ +typedef struct { + SKP_int32 bufferLength; + SKP_int32 bufferIx; + SKP_uint32 base_Q32; + SKP_uint32 range_Q16; + SKP_int32 error; + SKP_uint8 buffer[ MAX_ARITHM_BYTES ]; /* Buffer containing payload */ +} SKP_Silk_range_coder_state; + +/* Input frequency range detection struct */ +typedef struct { + SKP_int32 S_HP_8_kHz[ NB_SOS ][ 2 ]; /* HP filter State */ + SKP_int32 ConsecSmplsAboveThres; + SKP_int32 ActiveSpeech_ms; /* Accumulated time with active speech */ + SKP_int SWB_detected; /* Flag to indicate SWB input */ + SKP_int WB_detected; /* Flag to indicate WB input */ +} SKP_Silk_detect_SWB_state; + +#if SWITCH_TRANSITION_FILTERING +/* Variable cut-off low-pass filter state */ +typedef struct { + SKP_int32 In_LP_State[ 2 ]; /* Low pass filter state */ + SKP_int32 transition_frame_no; /* Counter which is mapped to a cut-off frequency */ + SKP_int mode; /* Operating mode, 0: switch down, 1: switch up */ +} SKP_Silk_LP_state; +#endif + +/* Structure for one stage of MSVQ */ +typedef struct { + const SKP_int32 nVectors; + const SKP_int16 *CB_NLSF_Q15; + const SKP_int16 *Rates_Q5; +} SKP_Silk_NLSF_CBS; + +/* Structure containing NLSF MSVQ codebook */ +typedef struct { + const SKP_int32 nStages; + + /* Fields for (de)quantizing */ + const SKP_Silk_NLSF_CBS *CBStages; + const SKP_int *NDeltaMin_Q15; + + /* Fields for arithmetic (de)coding */ + const SKP_uint16 *CDF; + const SKP_uint16 * const *StartPtr; + const SKP_int *MiddleIx; +} SKP_Silk_NLSF_CB_struct; + +/********************************/ +/* Encoder state */ +/********************************/ +typedef struct { + SKP_Silk_range_coder_state sRC; /* Range coder state */ + SKP_Silk_range_coder_state sRC_LBRR; /* Range coder state (for low bitrate redundancy) */ + SKP_Silk_nsq_state sNSQ; /* Noise Shape Quantizer State */ + SKP_Silk_nsq_state sNSQ_LBRR; /* Noise Shape Quantizer State ( for low bitrate redundancy ) */ + +#if HIGH_PASS_INPUT + SKP_int32 In_HP_State[ 2 ]; /* High pass filter state */ +#endif +#if SWITCH_TRANSITION_FILTERING + SKP_Silk_LP_state sLP; /* Low pass filter state */ +#endif + SKP_Silk_VAD_state sVAD; /* Voice activity detector state */ + + SKP_int LBRRprevLastGainIndex; + SKP_int prev_sigtype; + SKP_int typeOffsetPrev; /* Previous signal type and quantization offset */ + SKP_int prevLag; + SKP_int prev_lagIndex; + SKP_int32 API_fs_Hz; /* API sampling frequency (Hz) */ + SKP_int32 prev_API_fs_Hz; /* Previous API sampling frequency (Hz) */ + SKP_int maxInternal_fs_kHz; /* Maximum internal sampling frequency (kHz) */ + SKP_int fs_kHz; /* Internal sampling frequency (kHz) */ + SKP_int fs_kHz_changed; /* Did we switch yet? */ + SKP_int frame_length; /* Frame length (samples) */ + SKP_int subfr_length; /* Subframe length (samples) */ + SKP_int la_pitch; /* Look-ahead for pitch analysis (samples) */ + SKP_int la_shape; /* Look-ahead for noise shape analysis (samples) */ + SKP_int shapeWinLength; /* Window length for noise shape analysis (samples) */ + SKP_int32 TargetRate_bps; /* Target bitrate (bps) */ + SKP_int PacketSize_ms; /* Number of milliseconds to put in each packet */ + SKP_int PacketLoss_perc; /* Packet loss rate measured by farend */ + SKP_int32 frameCounter; + SKP_int Complexity; /* Complexity setting: 0-> low; 1-> medium; 2->high */ + SKP_int nStatesDelayedDecision; /* Number of states in delayed decision quantization */ + SKP_int useInterpolatedNLSFs; /* Flag for using NLSF interpolation */ + SKP_int shapingLPCOrder; /* Filter order for noise shaping filters */ + SKP_int predictLPCOrder; /* Filter order for prediction filters */ + SKP_int pitchEstimationComplexity; /* Complexity level for pitch estimator */ + SKP_int pitchEstimationLPCOrder; /* Whitening filter order for pitch estimator */ + SKP_int32 pitchEstimationThreshold_Q16; /* Threshold for pitch estimator */ + SKP_int LTPQuantLowComplexity; /* Flag for low complexity LTP quantization */ + SKP_int NLSF_MSVQ_Survivors; /* Number of survivors in NLSF MSVQ */ + SKP_int first_frame_after_reset; /* Flag for deactivating NLSF interp. and fluc. reduction after resets */ + SKP_int controlled_since_last_payload; /* Flag for ensuring codec_control only runs once per packet */ + SKP_int warping_Q16; /* Warping parameter for warped noise shaping */ + + /* Input/output buffering */ + SKP_int16 inputBuf[ MAX_FRAME_LENGTH ]; /* buffer containin input signal */ + SKP_int inputBufIx; + SKP_int nFramesInPayloadBuf; /* number of frames sitting in outputBuf */ + SKP_int nBytesInPayloadBuf; /* number of bytes sitting in outputBuf */ + + /* Parameters For LTP scaling Control */ + SKP_int frames_since_onset; + + const SKP_Silk_NLSF_CB_struct *psNLSF_CB[ 2 ]; /* Pointers to voiced/unvoiced NLSF codebooks */ + + /* Struct for Inband LBRR */ + SKP_SILK_LBRR_struct LBRR_buffer[ MAX_LBRR_DELAY ]; + SKP_int oldest_LBRR_idx; + SKP_int useInBandFEC; /* Saves the API setting for query */ + SKP_int LBRR_enabled; + SKP_int LBRR_GainIncreases; /* Number of shifts to Gains to get LBRR rate Voiced frames */ + + /* Bitrate control */ + SKP_int32 bitrateDiff; /* Accumulated diff. between the target bitrate and the switch bitrates */ + SKP_int32 bitrate_threshold_up; /* Threshold for switching to a higher internal sample frequency */ + SKP_int32 bitrate_threshold_down; /* Threshold for switching to a lower internal sample frequency */ + + SKP_Silk_resampler_state_struct resampler_state; + + /* DTX */ + SKP_int noSpeechCounter; /* Counts concecutive nonactive frames, used by DTX */ + SKP_int useDTX; /* Flag to enable DTX */ + SKP_int inDTX; /* Flag to signal DTX period */ + SKP_int vadFlag; /* Flag to indicate Voice Activity */ + + /* Struct for detecting SWB input */ + SKP_Silk_detect_SWB_state sSWBdetect; + + + /* Buffers */ + SKP_int8 q[ MAX_FRAME_LENGTH ]; /* pulse signal buffer */ + SKP_int8 q_LBRR[ MAX_FRAME_LENGTH ]; /* pulse signal buffer */ + +} SKP_Silk_encoder_state; + + +/************************/ +/* Encoder control */ +/************************/ +typedef struct { + /* Quantization indices */ + SKP_int lagIndex; + SKP_int contourIndex; + SKP_int PERIndex; + SKP_int LTPIndex[ NB_SUBFR ]; + SKP_int NLSFIndices[ NLSF_MSVQ_MAX_CB_STAGES ]; /* NLSF path of quantized LSF vector */ + SKP_int NLSFInterpCoef_Q2; + SKP_int GainsIndices[ NB_SUBFR ]; + SKP_int32 Seed; + SKP_int LTP_scaleIndex; + SKP_int RateLevelIndex; + SKP_int QuantOffsetType; + SKP_int sigtype; + + /* Prediction and coding parameters */ + SKP_int pitchL[ NB_SUBFR ]; + + SKP_int LBRR_usage; /* Low bitrate redundancy usage */ +} SKP_Silk_encoder_control; + +/* Struct for Packet Loss Concealment */ +typedef struct { + SKP_int32 pitchL_Q8; /* Pitch lag to use for voiced concealment */ + SKP_int16 LTPCoef_Q14[ LTP_ORDER ]; /* LTP coeficients to use for voiced concealment */ + SKP_int16 prevLPC_Q12[ MAX_LPC_ORDER ]; + SKP_int last_frame_lost; /* Was previous frame lost */ + SKP_int32 rand_seed; /* Seed for unvoiced signal generation */ + SKP_int16 randScale_Q14; /* Scaling of unvoiced random signal */ + SKP_int32 conc_energy; + SKP_int conc_energy_shift; + SKP_int16 prevLTP_scale_Q14; + SKP_int32 prevGain_Q16[ NB_SUBFR ]; + SKP_int fs_kHz; +} SKP_Silk_PLC_struct; + +/* Struct for CNG */ +typedef struct { + SKP_int32 CNG_exc_buf_Q10[ MAX_FRAME_LENGTH ]; + SKP_int CNG_smth_NLSF_Q15[ MAX_LPC_ORDER ]; + SKP_int32 CNG_synth_state[ MAX_LPC_ORDER ]; + SKP_int32 CNG_smth_Gain_Q16; + SKP_int32 rand_seed; + SKP_int fs_kHz; +} SKP_Silk_CNG_struct; + +/********************************/ +/* Decoder state */ +/********************************/ +typedef struct { + SKP_Silk_range_coder_state sRC; /* Range coder state */ + SKP_int32 prev_inv_gain_Q16; + SKP_int32 sLTP_Q16[ 2 * MAX_FRAME_LENGTH ]; + SKP_int32 sLPC_Q14[ MAX_FRAME_LENGTH / NB_SUBFR + MAX_LPC_ORDER ]; + SKP_int32 exc_Q10[ MAX_FRAME_LENGTH ]; + SKP_int32 res_Q10[ MAX_FRAME_LENGTH ]; + SKP_int16 outBuf[ 2 * MAX_FRAME_LENGTH ]; /* Buffer for output signal */ + SKP_int lagPrev; /* Previous Lag */ + SKP_int LastGainIndex; /* Previous gain index */ + SKP_int LastGainIndex_EnhLayer; /* Previous gain index */ + SKP_int typeOffsetPrev; /* Previous signal type and quantization offset */ + SKP_int32 HPState[ DEC_HP_ORDER ]; /* HP filter state */ + const SKP_int16 *HP_A; /* HP filter AR coefficients */ + const SKP_int16 *HP_B; /* HP filter MA coefficients */ + SKP_int fs_kHz; /* Sampling frequency in kHz */ + SKP_int32 prev_API_sampleRate; /* Previous API sample frequency (Hz) */ + SKP_int frame_length; /* Frame length (samples) */ + SKP_int subfr_length; /* Subframe length (samples) */ + SKP_int LPC_order; /* LPC order */ + SKP_int prevNLSF_Q15[ MAX_LPC_ORDER ]; /* Used to interpolate LSFs */ + SKP_int first_frame_after_reset; /* Flag for deactivating NLSF interp. and fluc. reduction after resets */ + + /* For buffering payload in case of more frames per packet */ + SKP_int nBytesLeft; + SKP_int nFramesDecoded; + SKP_int nFramesInPacket; + SKP_int moreInternalDecoderFrames; + SKP_int FrameTermination; + + SKP_Silk_resampler_state_struct resampler_state; + + const SKP_Silk_NLSF_CB_struct *psNLSF_CB[ 2 ]; /* Pointers to voiced/unvoiced NLSF codebooks */ + + /* Parameters used to investigate if inband FEC is used */ + SKP_int vadFlag; + SKP_int no_FEC_counter; /* Counts number of frames wo inband FEC */ + SKP_int inband_FEC_offset; /* 0: no FEC, 1: FEC with 1 packet offset, 2: FEC w 2 packets offset */ + + /* CNG state */ + SKP_Silk_CNG_struct sCNG; + + /* Stuff used for PLC */ + SKP_int lossCnt; + SKP_int prev_sigtype; /* Previous sigtype */ + + SKP_Silk_PLC_struct sPLC; + + + +} SKP_Silk_decoder_state; + +/************************/ +/* Decoder control */ +/************************/ +typedef struct { + /* prediction and coding parameters */ + SKP_int pitchL[ NB_SUBFR ]; + SKP_int32 Gains_Q16[ NB_SUBFR ]; + SKP_int32 Seed; + /* holds interpolated and final coefficients, 4-byte aligned */ + SKP_DWORD_ALIGN SKP_int16 PredCoef_Q12[ 2 ][ MAX_LPC_ORDER ]; + SKP_int16 LTPCoef_Q14[ LTP_ORDER * NB_SUBFR ]; + SKP_int LTP_scale_Q14; + + /* quantization indices */ + SKP_int PERIndex; + SKP_int RateLevelIndex; + SKP_int QuantOffsetType; + SKP_int sigtype; + SKP_int NLSFInterpCoef_Q2; +} SKP_Silk_decoder_control; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_structs_FLP.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_structs_FLP.h new file mode 100755 index 0000000..7189c8d --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_structs_FLP.h @@ -0,0 +1,168 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_STRUCTS_FLP_H +#define SKP_SILK_STRUCTS_FLP_H + +#include "SKP_Silk_typedef.h" +#include "SKP_Silk_main.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/********************************/ +/* Noise shaping analysis state */ +/********************************/ +typedef struct { + SKP_int LastGainIndex; + SKP_float HarmBoost_smth; + SKP_float HarmShapeGain_smth; + SKP_float Tilt_smth; +} SKP_Silk_shape_state_FLP; + +/********************************/ +/* Prefilter state */ +/********************************/ +typedef struct { + SKP_float sLTP_shp[ LTP_BUF_LENGTH ]; + SKP_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; + SKP_int sLTP_shp_buf_idx; + SKP_float sLF_AR_shp; + SKP_float sLF_MA_shp; + SKP_float sHarmHP; + SKP_int32 rand_seed; + SKP_int lagPrev; +} SKP_Silk_prefilter_state_FLP; + +/*****************************/ +/* Prediction analysis state */ +/*****************************/ +typedef struct { + SKP_int pitch_LPC_win_length; + SKP_int min_pitch_lag; /* Lowest possible pitch lag (samples) */ + SKP_int max_pitch_lag; /* Highest possible pitch lag (samples) */ + SKP_float prev_NLSFq[ MAX_LPC_ORDER ]; /* Previously quantized NLSF vector */ +} SKP_Silk_predict_state_FLP; + +/*******************************************/ +/* Structure containing NLSF MSVQ codebook */ +/*******************************************/ +/* structure for one stage of MSVQ */ +typedef struct { + const SKP_int32 nVectors; + const SKP_float *CB; + const SKP_float *Rates; +} SKP_Silk_NLSF_CBS_FLP; + +typedef struct { + const SKP_int32 nStages; + + /* fields for (de)quantizing */ + const SKP_Silk_NLSF_CBS_FLP *CBStages; + const SKP_float *NDeltaMin; + + /* fields for arithmetic (de)coding */ + const SKP_uint16 *CDF; + const SKP_uint16 * const *StartPtr; + const SKP_int *MiddleIx; +} SKP_Silk_NLSF_CB_FLP; + +/********************************/ +/* Encoder state FLP */ +/********************************/ +typedef struct { + SKP_Silk_encoder_state sCmn; /* Common struct, shared with fixed-point code */ + + SKP_float variable_HP_smth1; /* State of first smoother */ + SKP_float variable_HP_smth2; /* State of second smoother */ + + SKP_Silk_shape_state_FLP sShape; /* Noise shaping state */ + SKP_Silk_prefilter_state_FLP sPrefilt; /* Prefilter State */ + SKP_Silk_predict_state_FLP sPred; /* Prediction State */ + + /* Buffer for find pitch and noise shape analysis */ + SKP_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */ + SKP_float LTPCorr; /* Normalized correlation from pitch lag estimator */ + SKP_float mu_LTP; /* Rate-distortion tradeoff in LTP quantization */ + SKP_float SNR_dB; /* Quality setting */ + SKP_float avgGain; /* average gain during active speech */ + SKP_float BufferedInChannel_ms; /* Simulated number of ms buffer in channel because of exceeded TargetRate_bps */ + SKP_float speech_activity; /* Speech activity */ + + /* Parameters for LTP scaling control */ + SKP_float prevLTPredCodGain; + SKP_float HPLTPredCodGain; + + SKP_float inBandFEC_SNR_comp; /* Compensation to SNR_DB when using inband FEC Voiced */ + + const SKP_Silk_NLSF_CB_FLP *psNLSF_CB_FLP[ 2 ]; /* Pointers to voiced/unvoiced NLSF codebooks */ +} SKP_Silk_encoder_state_FLP; + + +/************************/ +/* Encoder control FLP */ +/************************/ +typedef struct { + SKP_Silk_encoder_control sCmn; /* Common struct, shared with fixed-point code */ + + /* Prediction and coding parameters */ + SKP_float Gains[NB_SUBFR]; + SKP_float PredCoef[ 2 ][ MAX_LPC_ORDER ]; /* holds interpolated and final coefficients */ + SKP_float LTPCoef[LTP_ORDER * NB_SUBFR]; + SKP_float LTP_scale; + + /* Noise shaping parameters */ + SKP_float AR1[ NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; + SKP_float AR2[ NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; + SKP_float LF_MA_shp[ NB_SUBFR ]; + SKP_float LF_AR_shp[ NB_SUBFR ]; + SKP_float GainsPre[ NB_SUBFR ]; + SKP_float HarmBoost[ NB_SUBFR ]; + SKP_float Tilt[ NB_SUBFR ]; + SKP_float HarmShapeGain[ NB_SUBFR ]; + SKP_float Lambda; + SKP_float input_quality; + SKP_float coding_quality; + SKP_float pitch_freq_low_Hz; + SKP_float current_SNR_dB; + + /* Measures */ + SKP_float sparseness; + SKP_float predGain; + SKP_float LTPredCodGain; + SKP_float input_quality_bands[ VAD_N_BANDS ]; + SKP_float input_tilt; + SKP_float ResNrg[ NB_SUBFR ]; /* Residual energy per subframe */ +} SKP_Silk_encoder_control_FLP; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sum_sqr_shift.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sum_sqr_shift.c new file mode 100755 index 0000000..271c300 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_sum_sqr_shift.c @@ -0,0 +1,100 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* * + * SKP_Silk_sum_sqr_shift.c * + * * + * compute number of bits to right shift the sum of squares of a vector * + * of int16s to make it fit in an int32 * + * * + * Copyright 2006-2008 (c), Skype Limited * + * */ +#include "SKP_Silk_SigProc_FIX.h" +/* Compute number of bits to right shift the sum of squares of a vector */ +/* of int16s to make it fit in an int32 */ +void SKP_Silk_sum_sqr_shift( + SKP_int32 *energy, /* O Energy of x, after shifting to the right */ + SKP_int *shift, /* O Number of bits right shift applied to energy */ + const SKP_int16 *x, /* I Input vector */ + SKP_int len /* I Length of input vector */ +) +{ + SKP_int i, shft; + SKP_int32 in32, nrg_tmp, nrg; + + if( (SKP_int32)( (SKP_int_ptr_size)x & 2 ) != 0 ) { + /* Input is not 4-byte aligned */ + nrg = SKP_SMULBB( x[ 0 ], x[ 0 ] ); + i = 1; + } else { + nrg = 0; + i = 0; + } + shft = 0; + len--; + while( i < len ) { + /* Load two values at once */ + in32 = *( (SKP_int32 *)&x[ i ] ); + nrg = SKP_SMLABB_ovflw( nrg, in32, in32 ); + nrg = SKP_SMLATT_ovflw( nrg, in32, in32 ); + i += 2; + if( nrg < 0 ) { + /* Scale down */ + nrg = (SKP_int32)SKP_RSHIFT_uint( (SKP_uint32)nrg, 2 ); + shft = 2; + break; + } + } + for( ; i < len; i += 2 ) { + /* Load two values at once */ + in32 = *( (SKP_int32 *)&x[ i ] ); + nrg_tmp = SKP_SMULBB( in32, in32 ); + nrg_tmp = SKP_SMLATT_ovflw( nrg_tmp, in32, in32 ); + nrg = (SKP_int32)SKP_ADD_RSHIFT_uint( nrg, (SKP_uint32)nrg_tmp, shft ); + if( nrg < 0 ) { + /* Scale down */ + nrg = (SKP_int32)SKP_RSHIFT_uint( (SKP_uint32)nrg, 2 ); + shft += 2; + } + } + if( i == len ) { + /* One sample left to process */ + nrg_tmp = SKP_SMULBB( x[ i ], x[ i ] ); + nrg = (SKP_int32)SKP_ADD_RSHIFT_uint( nrg, nrg_tmp, shft ); + } + + /* Make sure to have at least one extra leading zero (two leading zeros in total) */ + if( nrg & 0xC0000000 ) { + nrg = SKP_RSHIFT_uint( (SKP_uint32)nrg, 2 ); + shft += 2; + } + + /* Output arguments */ + *shift = shft; + *energy = nrg; +} + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables.h new file mode 100755 index 0000000..fb6d27c --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables.h @@ -0,0 +1,168 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_TABLES_H +#define SKP_SILK_TABLES_H + +#include "SKP_Silk_define.h" +#include "SKP_Silk_structs.h" + +#define PITCH_EST_MAX_LAG_MS 18 /* 18 ms -> 56 Hz */ +#define PITCH_EST_MIN_LAG_MS 2 /* 2 ms -> 500 Hz */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* entropy coding tables */ +extern const SKP_uint16 SKP_Silk_type_offset_CDF[ 5 ]; /* 5 */ +extern const SKP_uint16 SKP_Silk_type_offset_joint_CDF[ 4 ][ 5 ]; /* 20 */ +extern const SKP_int SKP_Silk_type_offset_CDF_offset; + +extern const SKP_uint16 SKP_Silk_gain_CDF[ 2 ][ N_LEVELS_QGAIN + 1 ]; /* 130 */ +extern const SKP_int SKP_Silk_gain_CDF_offset; +extern const SKP_uint16 SKP_Silk_delta_gain_CDF[ MAX_DELTA_GAIN_QUANT - MIN_DELTA_GAIN_QUANT + 2 ]; /* 46 */ +extern const SKP_int SKP_Silk_delta_gain_CDF_offset; + +extern const SKP_uint16 SKP_Silk_pitch_lag_NB_CDF[ 8 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) + 2 ]; /* 130 */ +extern const SKP_int SKP_Silk_pitch_lag_NB_CDF_offset; +extern const SKP_uint16 SKP_Silk_pitch_lag_MB_CDF[ 12 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) + 2 ]; /* 194 */ +extern const SKP_int SKP_Silk_pitch_lag_MB_CDF_offset; +extern const SKP_uint16 SKP_Silk_pitch_lag_WB_CDF[ 16 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) + 2 ]; /* 258 */ +extern const SKP_int SKP_Silk_pitch_lag_WB_CDF_offset; +extern const SKP_uint16 SKP_Silk_pitch_lag_SWB_CDF[ 24 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) + 2 ]; /* 386 */ +extern const SKP_int SKP_Silk_pitch_lag_SWB_CDF_offset; + +extern const SKP_uint16 SKP_Silk_pitch_contour_CDF[ 35 ]; /* 35 */ +extern const SKP_int SKP_Silk_pitch_contour_CDF_offset; +extern const SKP_uint16 SKP_Silk_pitch_contour_NB_CDF[ 12 ]; /* 12 */ +extern const SKP_int SKP_Silk_pitch_contour_NB_CDF_offset; +extern const SKP_uint16 SKP_Silk_pitch_delta_CDF[23]; /* 23 */ +extern const SKP_int SKP_Silk_pitch_delta_CDF_offset; + +extern const SKP_uint16 SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS ][ MAX_PULSES + 3 ]; /* 210 */ +extern const SKP_int SKP_Silk_pulses_per_block_CDF_offset; +extern const SKP_int16 SKP_Silk_pulses_per_block_BITS_Q6[ N_RATE_LEVELS - 1 ][ MAX_PULSES + 2 ]; /* 180 */ + +extern const SKP_uint16 SKP_Silk_rate_levels_CDF[ 2 ][ N_RATE_LEVELS ]; /* 20 */ +extern const SKP_int SKP_Silk_rate_levels_CDF_offset; +extern const SKP_int16 SKP_Silk_rate_levels_BITS_Q6[ 2 ][ N_RATE_LEVELS - 1 ]; /* 18 */ + +extern const SKP_int SKP_Silk_max_pulses_table[ 4 ]; /* 4 */ + +extern const SKP_uint16 SKP_Silk_shell_code_table0[ 33 ]; /* 33 */ +extern const SKP_uint16 SKP_Silk_shell_code_table1[ 52 ]; /* 52 */ +extern const SKP_uint16 SKP_Silk_shell_code_table2[ 102 ]; /* 102 */ +extern const SKP_uint16 SKP_Silk_shell_code_table3[ 207 ]; /* 207 */ +extern const SKP_uint16 SKP_Silk_shell_code_table_offsets[ 19 ]; /* 19 */ + +extern const SKP_uint16 SKP_Silk_lsb_CDF[ 3 ]; /* 3 */ + +extern const SKP_uint16 SKP_Silk_sign_CDF[ 36 ]; /* 36 */ + +extern const SKP_uint16 SKP_Silk_LTP_per_index_CDF[ 4 ]; /* 4 */ +extern const SKP_int SKP_Silk_LTP_per_index_CDF_offset; +extern const SKP_int16 * const SKP_Silk_LTP_gain_BITS_Q6_ptrs[ NB_LTP_CBKS ]; /* 3 */ +extern const SKP_uint16 * const SKP_Silk_LTP_gain_CDF_ptrs[ NB_LTP_CBKS ]; /* 3 */ +extern const SKP_int SKP_Silk_LTP_gain_CDF_offsets[ NB_LTP_CBKS ]; /* 3 */ +extern const SKP_int32 SKP_Silk_LTP_gain_middle_avg_RD_Q14; +extern const SKP_uint16 SKP_Silk_LTPscale_CDF[ 4 ]; /* 4 */ +extern const SKP_int SKP_Silk_LTPscale_offset; + +/* Tables for LTPScale */ +extern const SKP_int16 SKP_Silk_LTPScales_table_Q14[ 3 ]; + +extern const SKP_uint16 SKP_Silk_vadflag_CDF[ 3 ]; /* 3 */ +extern const SKP_int SKP_Silk_vadflag_offset; + +extern const SKP_int SKP_Silk_SamplingRates_table[ 4 ]; /* 4 */ +extern const SKP_uint16 SKP_Silk_SamplingRates_CDF[ 5 ]; /* 5 */ +extern const SKP_int SKP_Silk_SamplingRates_offset; + +extern const SKP_uint16 SKP_Silk_NLSF_interpolation_factor_CDF[ 6 ]; +extern const SKP_int SKP_Silk_NLSF_interpolation_factor_offset; + +/* NLSF codebooks */ +extern const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB0_16, SKP_Silk_NLSF_CB1_16; +extern const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB0_10, SKP_Silk_NLSF_CB1_10; + +/* quantization tables */ +extern const SKP_int16 * const SKP_Silk_LTP_vq_ptrs_Q14[ NB_LTP_CBKS ]; /* 168 */ +extern const SKP_int SKP_Silk_LTP_vq_sizes[ NB_LTP_CBKS ]; /* 3 */ + +/* Piece-wise linear mapping from bitrate in kbps to coding quality in dB SNR */ +extern const SKP_int32 TargetRate_table_NB[ TARGET_RATE_TAB_SZ ]; +extern const SKP_int32 TargetRate_table_MB[ TARGET_RATE_TAB_SZ ]; +extern const SKP_int32 TargetRate_table_WB[ TARGET_RATE_TAB_SZ ]; +extern const SKP_int32 TargetRate_table_SWB[ TARGET_RATE_TAB_SZ ]; +extern const SKP_int32 SNR_table_Q1[ TARGET_RATE_TAB_SZ ]; + +extern const SKP_int32 SNR_table_one_bit_per_sample_Q7[ 4 ]; + +/* Filter coeficicnts for HP filter: 4. Order filter implementad as two biquad filters */ +extern const SKP_int16 SKP_Silk_SWB_detect_B_HP_Q13[ NB_SOS ][ 3 ]; +extern const SKP_int16 SKP_Silk_SWB_detect_A_HP_Q13[ NB_SOS ][ 2 ]; + +/* Decoder high-pass filter coefficients for 24 kHz sampling */ +extern const SKP_int16 SKP_Silk_Dec_A_HP_24[ DEC_HP_ORDER ]; /* 2 */ +extern const SKP_int16 SKP_Silk_Dec_B_HP_24[ DEC_HP_ORDER + 1 ]; /* 3 */ + +/* Decoder high-pass filter coefficients for 16 kHz sampling */ +extern const SKP_int16 SKP_Silk_Dec_A_HP_16[ DEC_HP_ORDER ]; /* 2 */ +extern const SKP_int16 SKP_Silk_Dec_B_HP_16[ DEC_HP_ORDER + 1 ]; /* 3 */ + +/* Decoder high-pass filter coefficients for 12 kHz sampling */ +extern const SKP_int16 SKP_Silk_Dec_A_HP_12[ DEC_HP_ORDER ]; /* 2 */ +extern const SKP_int16 SKP_Silk_Dec_B_HP_12[ DEC_HP_ORDER + 1 ]; /* 3 */ + +/* Decoder high-pass filter coefficients for 8 kHz sampling */ +extern const SKP_int16 SKP_Silk_Dec_A_HP_8[ DEC_HP_ORDER ]; /* 2 */ +extern const SKP_int16 SKP_Silk_Dec_B_HP_8[ DEC_HP_ORDER + 1 ]; /* 3 */ + +/* Table for frame termination indication */ +extern const SKP_uint16 SKP_Silk_FrameTermination_CDF[ 5 ]; +extern const SKP_int SKP_Silk_FrameTermination_offset; + +/* Table for random seed */ +extern const SKP_uint16 SKP_Silk_Seed_CDF[ 5 ]; +extern const SKP_int SKP_Silk_Seed_offset; + +/* Quantization offsets */ +extern const SKP_int16 SKP_Silk_Quantization_Offsets_Q10[ 2 ][ 2 ]; + +#if SWITCH_TRANSITION_FILTERING +/* Interpolation points for filter coefficients used in the bandwidth transition smoother */ +extern const SKP_int32 SKP_Silk_Transition_LP_B_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NB ]; +extern const SKP_int32 SKP_Silk_Transition_LP_A_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NA ]; +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_FLP.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_FLP.h new file mode 100755 index 0000000..554122b --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_FLP.h @@ -0,0 +1,52 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_TABLES_FLP_H +#define SKP_SILK_TABLES_FLP_H + +#include "SKP_Silk_structs_FLP.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* filters */ +extern const SKP_float SKP_Silk_HarmShapeFIR_FLP[ HARM_SHAPE_FIR_TAPS ]; + +/* Table of quantization offset values */ +extern const SKP_float SKP_Silk_Quantization_Offsets[ 2 ][ 2 ]; + +/* NLSF codebooks */ +extern const SKP_Silk_NLSF_CB_FLP SKP_Silk_NLSF_CB0_16_FLP, SKP_Silk_NLSF_CB1_16_FLP; +extern const SKP_Silk_NLSF_CB_FLP SKP_Silk_NLSF_CB0_10_FLP, SKP_Silk_NLSF_CB1_10_FLP; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_LTP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_LTP.c new file mode 100755 index 0000000..075e7d4 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_LTP.c @@ -0,0 +1,324 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_tables.h" + +const SKP_uint16 SKP_Silk_LTP_per_index_CDF[ 4 ] = { + 0, 20992, 40788, 65535 +}; + +const SKP_int SKP_Silk_LTP_per_index_CDF_offset = 1; + + +const SKP_uint16 SKP_Silk_LTP_gain_CDF_0[ 11 ] = { + 0, 49380, 54463, 56494, 58437, 60101, 61683, 62985, + 64066, 64823, 65535 +}; + +const SKP_uint16 SKP_Silk_LTP_gain_CDF_1[ 21 ] = { + 0, 25290, 30654, 35710, 40386, 42937, 45250, 47459, + 49411, 51348, 52974, 54517, 55976, 57423, 58865, 60285, + 61667, 62895, 63827, 64724, 65535 +}; + +const SKP_uint16 SKP_Silk_LTP_gain_CDF_2[ 41 ] = { + 0, 4958, 9439, 13581, 17638, 21651, 25015, 28025, + 30287, 32406, 34330, 36240, 38130, 39790, 41281, 42764, + 44229, 45676, 47081, 48431, 49675, 50849, 51932, 52966, + 53957, 54936, 55869, 56789, 57708, 58504, 59285, 60043, + 60796, 61542, 62218, 62871, 63483, 64076, 64583, 65062, + 65535 +}; + +const SKP_int SKP_Silk_LTP_gain_CDF_offsets[ 3 ] = { + 1, 3, 10 +}; + +const SKP_int32 SKP_Silk_LTP_gain_middle_avg_RD_Q14 = 11010; + +const SKP_int16 SKP_Silk_LTP_gain_BITS_Q6_0[ 10 ] = { + 26, 236, 321, 325, 339, 344, 362, 379, + 412, 418 +}; + +const SKP_int16 SKP_Silk_LTP_gain_BITS_Q6_1[ 20 ] = { + 88, 231, 237, 244, 300, 309, 313, 324, + 325, 341, 346, 351, 352, 352, 354, 356, + 367, 393, 396, 406 +}; + +const SKP_int16 SKP_Silk_LTP_gain_BITS_Q6_2[ 40 ] = { + 238, 248, 255, 257, 258, 274, 284, 311, + 317, 326, 326, 327, 339, 349, 350, 351, + 352, 355, 358, 366, 371, 379, 383, 387, + 388, 393, 394, 394, 407, 409, 412, 412, + 413, 422, 426, 432, 434, 449, 454, 455 +}; + +const SKP_uint16 * const SKP_Silk_LTP_gain_CDF_ptrs[ NB_LTP_CBKS ] = { + SKP_Silk_LTP_gain_CDF_0, + SKP_Silk_LTP_gain_CDF_1, + SKP_Silk_LTP_gain_CDF_2 +}; + +const SKP_int16 * const SKP_Silk_LTP_gain_BITS_Q6_ptrs[ NB_LTP_CBKS ] = { + SKP_Silk_LTP_gain_BITS_Q6_0, + SKP_Silk_LTP_gain_BITS_Q6_1, + SKP_Silk_LTP_gain_BITS_Q6_2 +}; + +const SKP_int16 SKP_Silk_LTP_gain_vq_0_Q14[ 10 ][ 5 ] = +{ +{ + 594, 984, 2840, 1021, 669 +}, +{ + 10, 35, 304, -1, 23 +}, +{ + -694, 1923, 4603, 2975, 2335 +}, +{ + 2437, 3176, 3778, 1940, 481 +}, +{ + 214, -46, 7870, 4406, -521 +}, +{ + -896, 4818, 8501, 1623, -887 +}, +{ + -696, 3178, 6480, -302, 1081 +}, +{ + 517, 599, 1002, 567, 560 +}, +{ + -2075, -834, 4712, -340, 896 +}, +{ + 1435, -644, 3993, -612, -2063 +} +}; + +const SKP_int16 SKP_Silk_LTP_gain_vq_1_Q14[ 20 ][ 5 ] = +{ +{ + 1655, 2918, 5001, 3010, 1775 +}, +{ + 113, 198, 856, 176, 178 +}, +{ + -843, 2479, 7858, 5371, 574 +}, +{ + 59, 5356, 7648, 2850, -315 +}, +{ + 3840, 4851, 6527, 1583, -1233 +}, +{ + 1620, 1760, 2330, 1876, 2045 +}, +{ + -545, 1854, 11792, 1547, -307 +}, +{ + -604, 689, 5369, 5074, 4265 +}, +{ + 521, -1331, 9829, 6209, -1211 +}, +{ + -1315, 6747, 9929, -1410, 546 +}, +{ + 117, -144, 2810, 1649, 5240 +}, +{ + 5392, 3476, 2425, -38, 633 +}, +{ + 14, -449, 5274, 3547, -171 +}, +{ + -98, 395, 9114, 1676, 844 +}, +{ + -908, 3843, 8861, -957, 1474 +}, +{ + 396, 6747, 5379, -329, 1269 +}, +{ + -335, 2830, 4281, 270, -54 +}, +{ + 1502, 5609, 8958, 6045, 2059 +}, +{ + -370, 479, 5267, 5726, 1174 +}, +{ + 5237, -1144, 6510, 455, 512 +} +}; + +const SKP_int16 SKP_Silk_LTP_gain_vq_2_Q14[ 40 ][ 5 ] = +{ +{ + -278, 415, 9345, 7106, -431 +}, +{ + -1006, 3863, 9524, 4724, -871 +}, +{ + -954, 4624, 11722, 973, -300 +}, +{ + -117, 7066, 8331, 1959, -901 +}, +{ + 593, 3412, 6070, 4914, 1567 +}, +{ + 54, -51, 12618, 4228, -844 +}, +{ + 3157, 4822, 5229, 2313, 717 +}, +{ + -244, 1161, 14198, 779, 69 +}, +{ + -1218, 5603, 12894, -2301, 1001 +}, +{ + -132, 3960, 9526, 577, 1806 +}, +{ + -1633, 8815, 10484, -2452, 895 +}, +{ + 235, 450, 1243, 667, 437 +}, +{ + 959, -2630, 10897, 8772, -1852 +}, +{ + 2420, 2046, 8893, 4427, -1569 +}, +{ + 23, 7091, 8356, -1285, 1508 +}, +{ + -1133, 835, 7662, 6043, 2800 +}, +{ + 439, 391, 11016, 2253, 1362 +}, +{ + -1020, 2876, 13436, 4015, -3020 +}, +{ + 1060, -2690, 13512, 5565, -1394 +}, +{ + -1420, 8007, 11421, -152, -1672 +}, +{ + -893, 2895, 15434, -1490, 159 +}, +{ + -1054, 428, 12208, 8538, -3344 +}, +{ + 1772, -1304, 7593, 6185, 561 +}, +{ + 525, -1207, 6659, 11151, -1170 +}, +{ + 439, 2667, 4743, 2359, 5515 +}, +{ + 2951, 7432, 7909, -230, -1564 +}, +{ + -72, 2140, 5477, 1391, 1580 +}, +{ + 476, -1312, 15912, 2174, -1027 +}, +{ + 5737, 441, 2493, 2043, 2757 +}, +{ + 228, -43, 1803, 6663, 7064 +}, +{ + 4596, 9182, 1917, -200, 203 +}, +{ + -704, 12039, 5451, -1188, 542 +}, +{ + 1782, -1040, 10078, 7513, -2767 +}, +{ + -2626, 7747, 9019, 62, 1710 +}, +{ + 235, -233, 2954, 10921, 1947 +}, +{ + 10854, 2814, 1232, -111, 222 +}, +{ + 2267, 2778, 12325, 156, -1658 +}, +{ + -2950, 8095, 16330, 268, -3626 +}, +{ + 67, 2083, 7950, -80, -2432 +}, +{ + 518, -66, 1718, 415, 11435 +} +}; + +const SKP_int16 * const SKP_Silk_LTP_vq_ptrs_Q14[ NB_LTP_CBKS ] = { + &SKP_Silk_LTP_gain_vq_0_Q14[ 0 ][ 0 ], + &SKP_Silk_LTP_gain_vq_1_Q14[ 0 ][ 0 ], + &SKP_Silk_LTP_gain_vq_2_Q14[ 0 ][ 0 ] +}; + +const SKP_int SKP_Silk_LTP_vq_sizes[ NB_LTP_CBKS ] = { + 10, 20, 40 +}; diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10.c new file mode 100755 index 0000000..49b27d2 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10.c @@ -0,0 +1,890 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/**********************************************/ +/* This file has been automatically generated */ +/* */ +/* ROM usage: 0.29 + 2.66 kB */ +/**********************************************/ + +#include "SKP_Silk_structs.h" +#include "SKP_Silk_tables_NLSF_CB0_10.h" +#include "SKP_Silk_tables.h" + +const SKP_uint16 SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ NLSF_MSVQ_CB0_10_VECTORS + NLSF_MSVQ_CB0_10_STAGES ] = +{ + 0, + 2658, + 4420, + 6107, + 7757, + 9408, + 10955, + 12502, + 13983, + 15432, + 16882, + 18331, + 19750, + 21108, + 22409, + 23709, + 25010, + 26256, + 27501, + 28747, + 29965, + 31158, + 32351, + 33544, + 34736, + 35904, + 36997, + 38091, + 39185, + 40232, + 41280, + 42327, + 43308, + 44290, + 45271, + 46232, + 47192, + 48132, + 49032, + 49913, + 50775, + 51618, + 52462, + 53287, + 54095, + 54885, + 55675, + 56449, + 57222, + 57979, + 58688, + 59382, + 60076, + 60726, + 61363, + 61946, + 62505, + 63052, + 63543, + 63983, + 64396, + 64766, + 65023, + 65279, + 65535, + 0, + 4977, + 9542, + 14106, + 18671, + 23041, + 27319, + 31596, + 35873, + 39969, + 43891, + 47813, + 51652, + 55490, + 59009, + 62307, + 65535, + 0, + 8571, + 17142, + 25529, + 33917, + 42124, + 49984, + 57844, + 65535, + 0, + 8732, + 17463, + 25825, + 34007, + 42189, + 50196, + 58032, + 65535, + 0, + 8948, + 17704, + 25733, + 33762, + 41791, + 49821, + 57678, + 65535, + 0, + 4374, + 8655, + 12936, + 17125, + 21313, + 25413, + 29512, + 33611, + 37710, + 41809, + 45820, + 49832, + 53843, + 57768, + 61694, + 65535 +}; + +const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB0_10_CDF_start_ptr[ NLSF_MSVQ_CB0_10_STAGES ] = +{ + &SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ 0 ], + &SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ 65 ], + &SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ 82 ], + &SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ 91 ], + &SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ 100 ], + &SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ 109 ] +}; + +const SKP_int SKP_Silk_NLSF_MSVQ_CB0_10_CDF_middle_idx[ NLSF_MSVQ_CB0_10_STAGES ] = +{ + 23, + 8, + 5, + 5, + 5, + 9 +}; + +const SKP_int16 SKP_Silk_NLSF_MSVQ_CB0_10_rates_Q5[ NLSF_MSVQ_CB0_10_VECTORS ] = +{ + 148, 167, + 169, 170, + 170, 173, + 173, 175, + 176, 176, + 176, 177, + 179, 181, + 181, 181, + 183, 183, + 183, 184, + 185, 185, + 185, 185, + 186, 189, + 189, 189, + 191, 191, + 191, 194, + 194, 194, + 195, 195, + 196, 198, + 199, 200, + 201, 201, + 202, 203, + 204, 204, + 205, 205, + 206, 209, + 210, 210, + 213, 214, + 218, 220, + 221, 226, + 231, 234, + 239, 256, + 256, 256, + 119, 123, + 123, 123, + 125, 126, + 126, 126, + 128, 130, + 130, 131, + 131, 135, + 138, 139, + 94, 94, + 95, 95, + 96, 98, + 98, 99, + 93, 93, + 95, 96, + 96, 97, + 98, 100, + 92, 93, + 97, 97, + 97, 97, + 98, 98, + 125, 126, + 126, 127, + 127, 128, + 128, 128, + 128, 128, + 129, 129, + 129, 130, + 130, 131 +}; + +const SKP_int SKP_Silk_NLSF_MSVQ_CB0_10_ndelta_min_Q15[ 10 + 1 ] = +{ + 563, + 3, + 22, + 20, + 3, + 3, + 132, + 119, + 358, + 86, + 964 +}; + +const SKP_int16 SKP_Silk_NLSF_MSVQ_CB0_10_Q15[ 10 * NLSF_MSVQ_CB0_10_VECTORS ] = +{ + 2210, 4023, + 6981, 9260, + 12573, 15687, + 19207, 22383, + 25981, 29142, + 3285, 4172, + 6116, 10856, + 15289, 16826, + 19701, 22010, + 24721, 29313, + 1554, 2511, + 6577, 10337, + 13837, 16511, + 20086, 23214, + 26480, 29464, + 3062, 4017, + 5771, 10037, + 13365, 14952, + 20140, 22891, + 25229, 29603, + 2085, 3457, + 5934, 8718, + 11501, 13670, + 17997, 21817, + 24935, 28745, + 2776, 4093, + 6421, 10413, + 15111, 16806, + 20825, 23826, + 26308, 29411, + 2717, 4034, + 5697, 8463, + 14301, 16354, + 19007, 23413, + 25812, 28506, + 2872, 3702, + 5881, 11034, + 17141, 18879, + 21146, 23451, + 25817, 29600, + 2999, 4015, + 7357, 11219, + 12866, 17307, + 20081, 22644, + 26774, 29107, + 2942, 3866, + 5918, 11915, + 13909, 16072, + 20453, 22279, + 27310, 29826, + 2271, 3527, + 6606, 9729, + 12943, 17382, + 20224, 22345, + 24602, 28290, + 2207, 3310, + 5844, 9339, + 11141, 15651, + 18576, 21177, + 25551, 28228, + 3963, 4975, + 6901, 11588, + 13466, 15577, + 19231, 21368, + 25510, 27759, + 2749, 3549, + 6966, 13808, + 15653, 17645, + 20090, 22599, + 26467, 28537, + 2126, 3504, + 5109, 9954, + 12550, 14620, + 19703, 21687, + 26457, 29106, + 3966, 5745, + 7442, 9757, + 14468, 16404, + 19135, 23048, + 25375, 28391, + 3197, 4751, + 6451, 9298, + 13038, 14874, + 17962, 20627, + 23835, 28464, + 3195, 4081, + 6499, 12252, + 14289, 16040, + 18357, 20730, + 26980, 29309, + 1533, 2471, + 4486, 7796, + 12332, 15758, + 19567, 22298, + 25673, 29051, + 2002, 2971, + 4985, 8083, + 13181, 15435, + 18237, 21517, + 24595, 28351, + 3808, 4925, + 6710, 10201, + 12011, 14300, + 18457, 20391, + 26525, 28956, + 2281, 3418, + 4979, 8726, + 15964, 18104, + 20250, 22771, + 25286, 28954, + 3051, 5479, + 7290, 9848, + 12744, 14503, + 18665, 23684, + 26065, 28947, + 2364, 3565, + 5502, 9621, + 14922, 16621, + 19005, 20996, + 26310, 29302, + 4093, 5212, + 6833, 9880, + 16303, 18286, + 20571, 23614, + 26067, 29128, + 2941, 3996, + 6038, 10638, + 12668, 14451, + 16798, 19392, + 26051, 28517, + 3863, 5212, + 7019, 9468, + 11039, 13214, + 19942, 22344, + 25126, 29539, + 4615, 6172, + 7853, 10252, + 12611, 14445, + 19719, 22441, + 24922, 29341, + 3566, 4512, + 6985, 8684, + 10544, 16097, + 18058, 22475, + 26066, 28167, + 4481, 5489, + 7432, 11414, + 13191, 15225, + 20161, 22258, + 26484, 29716, + 3320, 4320, + 6621, 9867, + 11581, 14034, + 21168, 23210, + 26588, 29903, + 3794, 4689, + 6916, 8655, + 10143, 16144, + 19568, 21588, + 27557, 29593, + 2446, 3276, + 5918, 12643, + 16601, 18013, + 21126, 23175, + 27300, 29634, + 2450, 3522, + 5437, 8560, + 15285, 19911, + 21826, 24097, + 26567, 29078, + 2580, 3796, + 5580, 8338, + 9969, 12675, + 18907, 22753, + 25450, 29292, + 3325, 4312, + 6241, 7709, + 9164, 14452, + 21665, 23797, + 27096, 29857, + 3338, 4163, + 7738, 11114, + 12668, 14753, + 16931, 22736, + 25671, 28093, + 3840, 4755, + 7755, 13471, + 15338, 17180, + 20077, 22353, + 27181, 29743, + 2504, 4079, + 8351, 12118, + 15046, 18595, + 21684, 24704, + 27519, 29937, + 5234, 6342, + 8267, 11821, + 15155, 16760, + 20667, 23488, + 25949, 29307, + 2681, 3562, + 6028, 10827, + 18458, 20458, + 22303, 24701, + 26912, 29956, + 3374, 4528, + 6230, 8256, + 9513, 12730, + 18666, 20720, + 26007, 28425, + 2731, 3629, + 8320, 12450, + 14112, 16431, + 18548, 22098, + 25329, 27718, + 3481, 4401, + 7321, 9319, + 11062, 13093, + 15121, 22315, + 26331, 28740, + 3577, 4945, + 6669, 8792, + 10299, 12645, + 19505, 24766, + 26996, 29634, + 4058, 5060, + 7288, 10190, + 11724, 13936, + 15849, 18539, + 26701, 29845, + 4262, 5390, + 7057, 8982, + 10187, 15264, + 20480, 22340, + 25958, 28072, + 3404, 4329, + 6629, 7946, + 10121, 17165, + 19640, 22244, + 25062, 27472, + 3157, 4168, + 6195, 9319, + 10771, 13325, + 15416, 19816, + 24672, 27634, + 2503, 3473, + 5130, 6767, + 8571, 14902, + 19033, 21926, + 26065, 28728, + 4133, 5102, + 7553, 10054, + 11757, 14924, + 17435, 20186, + 23987, 26272, + 4972, 6139, + 7894, 9633, + 11320, 14295, + 21737, 24306, + 26919, 29907, + 2958, 3816, + 6851, 9204, + 10895, 18052, + 20791, 23338, + 27556, 29609, + 5234, 6028, + 8034, 10154, + 11242, 14789, + 18948, 20966, + 26585, 29127, + 5241, 6838, + 10526, 12819, + 14681, 17328, + 19928, 22336, + 26193, 28697, + 3412, 4251, + 5988, 7094, + 9907, 18243, + 21669, 23777, + 26969, 29087, + 2470, 3217, + 7797, 15296, + 17365, 19135, + 21979, 24256, + 27322, 29442, + 4939, 5804, + 8145, 11809, + 13873, 15598, + 17234, 19423, + 26476, 29645, + 5051, 6167, + 8223, 9655, + 12159, 17995, + 20464, 22832, + 26616, 28462, + 4987, 5907, + 9319, 11245, + 13132, 15024, + 17485, 22687, + 26011, 28273, + 5137, 6884, + 11025, 14950, + 17191, 19425, + 21807, 24393, + 26938, 29288, + 7057, 7884, + 9528, 10483, + 10960, 14811, + 19070, 21675, + 25645, 28019, + 6759, 7160, + 8546, 11779, + 12295, 13023, + 16627, 21099, + 24697, 28287, + 3863, 9762, + 11068, 11445, + 12049, 13960, + 18085, 21507, + 25224, 28997, + 397, 335, + 651, 1168, + 640, 765, + 465, 331, + 214, -194, + -578, -647, + -657, 750, + 564, 613, + 549, 630, + 304, -52, + 828, 922, + 443, 111, + 138, 124, + 169, 14, + 144, 83, + 132, 58, + -413, -752, + 869, 336, + 385, 69, + 56, 830, + -227, -266, + -368, -440, + -1195, 163, + 126, -228, + 802, 156, + 188, 120, + 376, 59, + -358, -558, + -1326, -254, + -202, -789, + 296, 92, + -70, -129, + -718, -1135, + 292, -29, + -631, 487, + -157, -153, + -279, 2, + -419, -342, + -34, -514, + -799, -1571, + -687, -609, + -546, -130, + -215, -252, + -446, -574, + -1337, 207, + -72, 32, + 103, -642, + 942, 733, + 187, 29, + -211, -814, + 143, 225, + 20, 24, + -268, -377, + 1623, 1133, + 667, 164, + 307, 366, + 187, 34, + 62, -313, + -832, -1482, + -1181, 483, + -42, -39, + -450, -1406, + -587, -52, + -760, 334, + 98, -60, + -500, -488, + -1058, 299, + 131, -250, + -251, -703, + 1037, 568, + -413, -265, + 1687, 573, + 345, 323, + 98, 61, + -102, 31, + 135, 149, + 617, 365, + -39, 34, + -611, 1201, + 1421, 736, + -414, -393, + -492, -343, + -316, -532, + 528, 172, + 90, 322, + -294, -319, + -541, 503, + 639, 401, + 1, -149, + -73, -167, + 150, 118, + 308, 218, + 121, 195, + -143, -261, + -1013, -802, + 387, 436, + 130, -427, + -448, -681, + 123, -87, + -251, -113, + 274, 310, + 445, 501, + 354, 272, + 141, -285, + 569, 656, + 37, -49, + 251, -386, + -263, 1122, + 604, 606, + 336, 95, + 34, 0, + 85, 180, + 207, -367, + -622, 1070, + -6, -79, + -160, -92, + -137, -276, + -323, -371, + -696, -1036, + 407, 102, + -86, -214, + -482, -647, + -28, -291, + -97, -180, + -250, -435, + -18, -76, + -332, 410, + 407, 168, + 539, 411, + 254, 111, + 58, -145, + 200, 30, + 187, 116, + 131, -367, + -475, 781, + -559, 561, + 195, -115, + 8, -168, + 30, 55, + -122, 131, + 82, -5, + -273, -50, + -632, 668, + 4, 32, + -26, -279, + 315, 165, + 197, 377, + 155, -41, + -138, -324, + -109, -617, + 360, 98, + -53, -319, + -114, -245, + -82, 507, + 468, 263, + -137, -389, + 652, 354, + -18, -227, + -462, -135, + 317, 53, + -16, 66, + -72, -126, + -356, -347, + -328, -72, + -337, 324, + 152, 349, + 169, -196, + 179, 254, + 260, 325, + -74, -80, + 75, -31, + 270, 275, + 87, 278, + -446, -301, + 309, 71, + -25, -242, + 516, 161, + -162, -83, + 329, 230, + -311, -259, + 177, -26, + -462, 89, + 257, 6, + -130, -93, + -456, -317, + -221, -206, + -417, -182, + -74, 234, + 48, 261, + 359, 231, + 258, 85, + -282, 252, + -147, -222, + 251, -207, + 443, 123, + -417, -36, + 273, -241, + 240, -112, + 44, -167, + 126, -124, + -77, 58, + -401, 333, + -118, 82, + 126, 151, + -433, 359, + -130, -102, + 131, -244, + 86, 85, + -462, 414, + -240, 16, + 145, 28, + -205, -481, + 373, 293, + -72, -174, + 62, 259, + -8, -18, + 362, 233, + 185, 43, + 278, 27, + 193, 570, + -248, 189, + 92, 31, + -275, -3, + 243, 176, + 438, 209, + 206, -51, + 79, 109, + 168, -185, + -308, -68, + -618, 385, + -310, -108, + -164, 165, + 61, -152, + -101, -412, + -268, -257, + -40, -20, + -28, -158, + -301, 271, + 380, -338, + -367, -132, + 64, 114, + -131, -225, + -156, -260, + -63, -116, + 155, -586, + -202, 254, + -287, 178, + 227, -106, + -294, 164, + 298, -100, + 185, 317, + 193, -45, + 28, 80, + -87, -433, + 22, -48, + 48, -237, + -229, -139, + 120, -364, + 268, -136, + 396, 125, + 130, -89, + -272, 118, + -256, -68, + -451, 488, + 143, -165, + -48, -190, + 106, 219, + 47, 435, + 245, 97, + 75, -418, + 121, -187, + 570, -200, + -351, 225, + -21, -217, + 234, -111, + 194, 14, + 242, 118, + 140, -397, + 355, 361, + -45, -195 +}; + +const SKP_Silk_NLSF_CBS SKP_Silk_NLSF_CB0_10_Stage_info[ NLSF_MSVQ_CB0_10_STAGES ] = +{ + { 64, &SKP_Silk_NLSF_MSVQ_CB0_10_Q15[ 10 * 0 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates_Q5[ 0 ] }, + { 16, &SKP_Silk_NLSF_MSVQ_CB0_10_Q15[ 10 * 64 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates_Q5[ 64 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_10_Q15[ 10 * 80 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates_Q5[ 80 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_10_Q15[ 10 * 88 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates_Q5[ 88 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_10_Q15[ 10 * 96 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates_Q5[ 96 ] }, + { 16, &SKP_Silk_NLSF_MSVQ_CB0_10_Q15[ 10 * 104 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates_Q5[ 104 ] } +}; + +const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB0_10 = +{ + NLSF_MSVQ_CB0_10_STAGES, + SKP_Silk_NLSF_CB0_10_Stage_info, + SKP_Silk_NLSF_MSVQ_CB0_10_ndelta_min_Q15, + SKP_Silk_NLSF_MSVQ_CB0_10_CDF, + SKP_Silk_NLSF_MSVQ_CB0_10_CDF_start_ptr, + SKP_Silk_NLSF_MSVQ_CB0_10_CDF_middle_idx +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10.h new file mode 100755 index 0000000..1e0af27 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10.h @@ -0,0 +1,51 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_TABLES_NLSF_CB0_10_H +#define SKP_SILK_TABLES_NLSF_CB0_10_H + +#include "SKP_Silk_define.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define NLSF_MSVQ_CB0_10_STAGES 6 +#define NLSF_MSVQ_CB0_10_VECTORS 120 + +/* NLSF codebook entropy coding tables */ +extern const SKP_uint16 SKP_Silk_NLSF_MSVQ_CB0_10_CDF[ NLSF_MSVQ_CB0_10_VECTORS + NLSF_MSVQ_CB0_10_STAGES ]; +extern const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB0_10_CDF_start_ptr[ NLSF_MSVQ_CB0_10_STAGES ]; +extern const SKP_int SKP_Silk_NLSF_MSVQ_CB0_10_CDF_middle_idx[ NLSF_MSVQ_CB0_10_STAGES ]; + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10_FLP.c new file mode 100755 index 0000000..045fdee --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_10_FLP.c @@ -0,0 +1,739 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/**********************************************/ +/* This file has been automatically generated */ +/* */ +/* ROM usage: 5.32 kB */ +/**********************************************/ + +#include "SKP_Silk_tables_FLP.h" +#include "SKP_Silk_tables_NLSF_CB0_10.h" + +const SKP_float SKP_Silk_NLSF_MSVQ_CB0_10_rates[ NLSF_MSVQ_CB0_10_VECTORS ] = +{ + 4.62500000000000000000f, 5.21875000000000000000f, + 5.28125000000000000000f, 5.31250000000000000000f, + 5.31250000000000000000f, 5.40625000000000000000f, + 5.40625000000000000000f, 5.46875000000000000000f, + 5.50000000000000000000f, 5.50000000000000000000f, + 5.50000000000000000000f, 5.53125000000000000000f, + 5.59375000000000000000f, 5.65625000000000000000f, + 5.65625000000000000000f, 5.65625000000000000000f, + 5.71875000000000000000f, 5.71875000000000000000f, + 5.71875000000000000000f, 5.75000000000000000000f, + 5.78125000000000000000f, 5.78125000000000000000f, + 5.78125000000000000000f, 5.78125000000000000000f, + 5.81250000000000000000f, 5.90625000000000000000f, + 5.90625000000000000000f, 5.90625000000000000000f, + 5.96875000000000000000f, 5.96875000000000000000f, + 5.96875000000000000000f, 6.06250000000000000000f, + 6.06250000000000000000f, 6.06250000000000000000f, + 6.09375000000000000000f, 6.09375000000000000000f, + 6.12500000000000000000f, 6.18750000000000000000f, + 6.21875000000000000000f, 6.25000000000000000000f, + 6.28125000000000000000f, 6.28125000000000000000f, + 6.31250000000000000000f, 6.34375000000000000000f, + 6.37500000000000000000f, 6.37500000000000000000f, + 6.40625000000000000000f, 6.40625000000000000000f, + 6.43750000000000000000f, 6.53125000000000000000f, + 6.56250000000000000000f, 6.56250000000000000000f, + 6.65625000000000000000f, 6.68750000000000000000f, + 6.81250000000000000000f, 6.87500000000000000000f, + 6.90625000000000000000f, 7.06250000000000000000f, + 7.21875000000000000000f, 7.31250000000000000000f, + 7.46875000000000000000f, 8.00000000000000000000f, + 8.00000000000000000000f, 8.00000000000000000000f, + 3.71875000000000000000f, 3.84375000000000000000f, + 3.84375000000000000000f, 3.84375000000000000000f, + 3.90625000000000000000f, 3.93750000000000000000f, + 3.93750000000000000000f, 3.93750000000000000000f, + 4.00000000000000000000f, 4.06250000000000000000f, + 4.06250000000000000000f, 4.09375000000000000000f, + 4.09375000000000000000f, 4.21875000000000000000f, + 4.31250000000000000000f, 4.34375000000000000000f, + 2.93750000000000000000f, 2.93750000000000000000f, + 2.96875000000000000000f, 2.96875000000000000000f, + 3.00000000000000000000f, 3.06250000000000000000f, + 3.06250000000000000000f, 3.09375000000000000000f, + 2.90625000000000000000f, 2.90625000000000000000f, + 2.96875000000000000000f, 3.00000000000000000000f, + 3.00000000000000000000f, 3.03125000000000000000f, + 3.06250000000000000000f, 3.12500000000000000000f, + 2.87500000000000000000f, 2.90625000000000000000f, + 3.03125000000000000000f, 3.03125000000000000000f, + 3.03125000000000000000f, 3.03125000000000000000f, + 3.06250000000000000000f, 3.06250000000000000000f, + 3.90625000000000000000f, 3.93750000000000000000f, + 3.93750000000000000000f, 3.96875000000000000000f, + 3.96875000000000000000f, 4.00000000000000000000f, + 4.00000000000000000000f, 4.00000000000000000000f, + 4.00000000000000000000f, 4.00000000000000000000f, + 4.03125000000000000000f, 4.03125000000000000000f, + 4.03125000000000000000f, 4.06250000000000000000f, + 4.06250000000000000000f, 4.09375000000000000000f +}; + +const SKP_float SKP_Silk_NLSF_MSVQ_CB0_10_ndelta_min[ 10 + 1 ] = +{ + 0.01718139648437500000f, + 0.00009155273437500000f, + 0.00067138671874999989f, + 0.00061035156250000000f, + 0.00009155273437500000f, + 0.00009155273437500000f, + 0.00402832031250000000f, + 0.00363159179687500000f, + 0.01092529296875000000f, + 0.00262451171875000000f, + 0.02941894531250000300f +}; + +const SKP_float SKP_Silk_NLSF_MSVQ_CB0_10[ 10 * NLSF_MSVQ_CB0_10_VECTORS ] = +{ + 0.06744384765625000000f, 0.12277221679687500000f, + 0.21304321289062497000f, 0.28259277343750000000f, + 0.38369750976562500000f, 0.47872924804687500000f, + 0.58615112304687500000f, 0.68307495117187489000f, + 0.79287719726562500000f, 0.88934326171875011000f, + 0.10025024414062500000f, 0.12731933593750000000f, + 0.18664550781250003000f, 0.33129882812500000000f, + 0.46658325195312494000f, 0.51348876953125000000f, + 0.60122680664062500000f, 0.67169189453125000000f, + 0.75442504882812500000f, 0.89456176757812500000f, + 0.04742431640624999300f, 0.07662963867187500000f, + 0.20071411132812500000f, 0.31546020507812500000f, + 0.42227172851562494000f, 0.50387573242187500000f, + 0.61297607421875000000f, 0.70843505859375000000f, + 0.80810546875000000000f, 0.89916992187500000000f, + 0.09344482421875000000f, 0.12258911132812500000f, + 0.17611694335937500000f, 0.30630493164062500000f, + 0.40786743164062500000f, 0.45629882812500000000f, + 0.61462402343750000000f, 0.69857788085937500000f, + 0.76992797851562500000f, 0.90341186523437500000f, + 0.06362915039062500000f, 0.10549926757812500000f, + 0.18109130859375000000f, 0.26605224609375000000f, + 0.35098266601562494000f, 0.41717529296875000000f, + 0.54922485351562500000f, 0.66580200195312500000f, + 0.76095581054687489000f, 0.87722778320312500000f, + 0.08471679687500000000f, 0.12490844726562501000f, + 0.19595336914062500000f, 0.31777954101562500000f, + 0.46115112304687500000f, 0.51287841796875000000f, + 0.63552856445312500000f, 0.72711181640625000000f, + 0.80285644531250000000f, 0.89755249023437500000f, + 0.08291625976562498600f, 0.12310791015625000000f, + 0.17385864257812500000f, 0.25827026367187500000f, + 0.43643188476562500000f, 0.49908447265625000000f, + 0.58004760742187500000f, 0.71450805664062500000f, + 0.78771972656249989000f, 0.86993408203125011000f, + 0.08764648437500000000f, 0.11297607421875001000f, + 0.17947387695312500000f, 0.33673095703124994000f, + 0.52310180664062500000f, 0.57614135742187500000f, + 0.64532470703125000000f, 0.71566772460937500000f, + 0.78787231445312500000f, 0.90332031250000000000f, + 0.09152221679687500000f, 0.12252807617187500000f, + 0.22451782226562500000f, 0.34237670898437500000f, + 0.39263916015625000000f, 0.52816772460937500000f, + 0.61282348632812500000f, 0.69104003906250000000f, + 0.81707763671875000000f, 0.88827514648437500000f, + 0.08978271484375000000f, 0.11798095703125000000f, + 0.18060302734375003000f, 0.36361694335937500000f, + 0.42446899414062500000f, 0.49047851562500000000f, + 0.62417602539062500000f, 0.67990112304687500000f, + 0.83343505859375000000f, 0.91021728515625011000f, + 0.06930541992187500000f, 0.10763549804687500000f, + 0.20159912109375000000f, 0.29690551757812500000f, + 0.39498901367187506000f, 0.53045654296875000000f, + 0.61718750000000000000f, 0.68191528320312500000f, + 0.75079345703125000000f, 0.86334228515624989000f, + 0.06735229492187500000f, 0.10101318359375000000f, + 0.17834472656250000000f, 0.28500366210937500000f, + 0.33999633789062500000f, 0.47763061523437506000f, + 0.56689453125000000000f, 0.64627075195312511000f, + 0.77975463867187489000f, 0.86145019531250011000f, + 0.12094116210937500000f, 0.15182495117187500000f, + 0.21060180664062500000f, 0.35363769531250000000f, + 0.41094970703125000000f, 0.47537231445312494000f, + 0.58688354492187500000f, 0.65209960937500000000f, + 0.77850341796875000000f, 0.84713745117187500000f, + 0.08389282226562500000f, 0.10830688476562500000f, + 0.21258544921875000000f, 0.42138671875000000000f, + 0.47769165039062500000f, 0.53848266601562500000f, + 0.61309814453125000000f, 0.68966674804687511000f, + 0.80770874023437500000f, 0.87088012695312489000f, + 0.06488037109375000000f, 0.10693359375000001000f, + 0.15591430664062500000f, 0.30377197265625000000f, + 0.38299560546875006000f, 0.44616699218750000000f, + 0.60128784179687500000f, 0.66183471679687500000f, + 0.80740356445312500000f, 0.88824462890625000000f, + 0.12103271484375000000f, 0.17532348632812500000f, + 0.22711181640625000000f, 0.29776000976562500000f, + 0.44152832031250000000f, 0.50061035156250000000f, + 0.58395385742187500000f, 0.70336914062500000000f, + 0.77438354492187489000f, 0.86642456054687500000f, + 0.09756469726562500000f, 0.14498901367187500000f, + 0.19686889648437500000f, 0.28375244140625000000f, + 0.39788818359374994000f, 0.45391845703125000000f, + 0.54815673828125000000f, 0.62948608398437500000f, + 0.72738647460937500000f, 0.86865234375000000000f, + 0.09750366210937500000f, 0.12454223632812500000f, + 0.19833374023437500000f, 0.37390136718750000000f, + 0.43606567382812500000f, 0.48950195312500000000f, + 0.56021118164062500000f, 0.63262939453125000000f, + 0.82336425781250000000f, 0.89443969726562489000f, + 0.04678344726562500000f, 0.07540893554687500000f, + 0.13690185546875000000f, 0.23791503906250000000f, + 0.37634277343750000000f, 0.48089599609375000000f, + 0.59713745117187500000f, 0.68048095703124989000f, + 0.78347778320312489000f, 0.88656616210937511000f, + 0.06109619140625000000f, 0.09066772460937500000f, + 0.15213012695312500000f, 0.24667358398437497000f, + 0.40225219726562500000f, 0.47103881835937500000f, + 0.55654907226562500000f, 0.65664672851562500000f, + 0.75057983398437500000f, 0.86520385742187500000f, + 0.11621093750000000000f, 0.15029907226562500000f, + 0.20477294921875003000f, 0.31130981445312500000f, + 0.36654663085937500000f, 0.43640136718750000000f, + 0.56326293945312500000f, 0.62228393554687500000f, + 0.80947875976562500000f, 0.88366699218750000000f, + 0.06961059570312500000f, 0.10430908203125000000f, + 0.15194702148437500000f, 0.26629638671875000000f, + 0.48718261718750000000f, 0.55249023437500000000f, + 0.61798095703125000000f, 0.69491577148437500000f, + 0.77166748046875000000f, 0.88360595703125000000f, + 0.09310913085937500000f, 0.16720581054687500000f, + 0.22247314453125000000f, 0.30053710937500000000f, + 0.38891601562500000000f, 0.44259643554687500000f, + 0.56961059570312500000f, 0.72277832031250000000f, + 0.79544067382812511000f, 0.88339233398437500000f, + 0.07214355468750000000f, 0.10879516601562499000f, + 0.16790771484375000000f, 0.29360961914062500000f, + 0.45538330078125000000f, 0.50723266601562500000f, + 0.57998657226562500000f, 0.64074707031250000000f, + 0.80291748046875000000f, 0.89422607421875000000f, + 0.12490844726562501000f, 0.15905761718750000000f, + 0.20852661132812500000f, 0.30151367187500000000f, + 0.49752807617187500000f, 0.55804443359375000000f, + 0.62777709960937500000f, 0.72064208984375000000f, + 0.79550170898437500000f, 0.88891601562500000000f, + 0.08975219726562500000f, 0.12194824218750000000f, + 0.18426513671875000000f, 0.32464599609374994000f, + 0.38659667968750000000f, 0.44100952148437500000f, + 0.51263427734375000000f, 0.59179687500000000000f, + 0.79501342773437500000f, 0.87026977539062489000f, + 0.11788940429687500000f, 0.15905761718750000000f, + 0.21420288085937500000f, 0.28894042968750000000f, + 0.33688354492187500000f, 0.40325927734374994000f, + 0.60858154296875000000f, 0.68188476562500000000f, + 0.76678466796875000000f, 0.90145874023437489000f, + 0.14083862304687500000f, 0.18835449218749997000f, + 0.23965454101562500000f, 0.31286621093750000000f, + 0.38485717773437506000f, 0.44082641601562500000f, + 0.60177612304687500000f, 0.68484497070312500000f, + 0.76055908203125000000f, 0.89541625976562500000f, + 0.10882568359375000000f, 0.13769531250000000000f, + 0.21316528320312500000f, 0.26501464843750000000f, + 0.32177734375000000000f, 0.49124145507812500000f, + 0.55108642578125000000f, 0.68588256835937500000f, + 0.79547119140625000000f, 0.85958862304687500000f, + 0.13674926757812500000f, 0.16751098632812500000f, + 0.22680664062500000000f, 0.34832763671875000000f, + 0.40255737304687500000f, 0.46463012695312500000f, + 0.61526489257812500000f, 0.67926025390625000000f, + 0.80822753906250000000f, 0.90686035156250000000f, + 0.10131835937500000000f, 0.13183593750000000000f, + 0.20205688476562500000f, 0.30111694335937500000f, + 0.35342407226562500000f, 0.42828369140625000000f, + 0.64599609375000000000f, 0.70831298828125000000f, + 0.81140136718750000000f, 0.91256713867187500000f, + 0.11578369140625000000f, 0.14309692382812500000f, + 0.21105957031250000000f, 0.26412963867187500000f, + 0.30953979492187500000f, 0.49267578125000000000f, + 0.59716796875000000000f, 0.65881347656250000000f, + 0.84097290039062500000f, 0.90310668945312489000f, + 0.07464599609375000000f, 0.09997558593750000000f, + 0.18060302734375003000f, 0.38583374023437500000f, + 0.50662231445312500000f, 0.54971313476562500000f, + 0.64471435546875011000f, 0.70724487304687489000f, + 0.83312988281250000000f, 0.90435791015625000000f, + 0.07476806640625000000f, 0.10748291015625000000f, + 0.16592407226562500000f, 0.26123046875000000000f, + 0.46646118164062500000f, 0.60763549804687500000f, + 0.66607666015625000000f, 0.73538208007812500000f, + 0.81076049804687489000f, 0.88739013671875000000f, + 0.07873535156250000000f, 0.11584472656249999000f, + 0.17028808593750000000f, 0.25445556640625000000f, + 0.30422973632812500000f, 0.38681030273437500000f, + 0.57699584960937500000f, 0.69436645507812500000f, + 0.77667236328125000000f, 0.89392089843749989000f, + 0.10147094726562500000f, 0.13159179687500000000f, + 0.19046020507812500000f, 0.23526000976562500000f, + 0.27966308593750000000f, 0.44104003906250000000f, + 0.66116333007812489000f, 0.72622680664062511000f, + 0.82690429687500000000f, 0.91116333007812489000f, + 0.10186767578125000000f, 0.12704467773437500000f, + 0.23614501953125000000f, 0.33917236328125000000f, + 0.38659667968750000000f, 0.45022583007812500000f, + 0.51669311523437500000f, 0.69384765625000000000f, + 0.78341674804687500000f, 0.85733032226562500000f, + 0.11718749999999999000f, 0.14511108398437500000f, + 0.23666381835937500000f, 0.41110229492187506000f, + 0.46807861328125000000f, 0.52429199218750000000f, + 0.61270141601562500000f, 0.68215942382812500000f, + 0.82949829101562500000f, 0.90768432617187500000f, + 0.07641601562500000000f, 0.12448120117187500000f, + 0.25485229492187500000f, 0.36981201171875000000f, + 0.45916748046875000000f, 0.56747436523437500000f, + 0.66174316406250000000f, 0.75390625000000000000f, + 0.83981323242187500000f, 0.91360473632812500000f, + 0.15972900390625000000f, 0.19354248046875000000f, + 0.25228881835937500000f, 0.36074829101562500000f, + 0.46249389648437500000f, 0.51147460937500000000f, + 0.63070678710937500000f, 0.71679687500000000000f, + 0.79190063476562500000f, 0.89437866210937500000f, + 0.08181762695312500000f, 0.10870361328125000000f, + 0.18395996093750003000f, 0.33041381835937506000f, + 0.56329345703125000000f, 0.62432861328125000000f, + 0.68063354492187500000f, 0.75381469726562500000f, + 0.82128906250000000000f, 0.91418457031250000000f, + 0.10296630859375000000f, 0.13818359375000000000f, + 0.19012451171875000000f, 0.25195312500000000000f, + 0.29031372070312500000f, 0.38848876953124994000f, + 0.56964111328125000000f, 0.63232421875000000000f, + 0.79367065429687500000f, 0.86746215820312500000f, + 0.08334350585937500000f, 0.11074829101562500000f, + 0.25390625000000000000f, 0.37994384765625000000f, + 0.43066406250000000000f, 0.50143432617187500000f, + 0.56604003906250000000f, 0.67437744140625000000f, + 0.77297973632812500000f, 0.84588623046875000000f, + 0.10623168945312500000f, 0.13430786132812500000f, + 0.22341918945312503000f, 0.28439331054687500000f, + 0.33758544921875000000f, 0.39956665039062500000f, + 0.46145629882812500000f, 0.68099975585937489000f, + 0.80355834960937500000f, 0.87707519531250000000f, + 0.10916137695312500000f, 0.15090942382812500000f, + 0.20352172851562500000f, 0.26831054687500000000f, + 0.31430053710937500000f, 0.38589477539062506000f, + 0.59524536132812500000f, 0.75579833984375000000f, + 0.82385253906250011000f, 0.90435791015625000000f, + 0.12384033203125000000f, 0.15441894531250000000f, + 0.22241210937500000000f, 0.31097412109375000000f, + 0.35778808593750000000f, 0.42529296875000000000f, + 0.48367309570312500000f, 0.56576538085937500000f, + 0.81484985351562500000f, 0.91079711914062500000f, + 0.13006591796875000000f, 0.16448974609374997000f, + 0.21536254882812503000f, 0.27410888671875000000f, + 0.31088256835937500000f, 0.46582031250000000000f, + 0.62500000000000000000f, 0.68176269531250000000f, + 0.79217529296875000000f, 0.85668945312500000000f, + 0.10388183593750000000f, 0.13211059570312500000f, + 0.20230102539062497000f, 0.24249267578125000000f, + 0.30886840820312500000f, 0.52383422851562500000f, + 0.59936523437500000000f, 0.67883300781249989000f, + 0.76483154296875000000f, 0.83837890625000000000f, + 0.09634399414062501400f, 0.12719726562500000000f, + 0.18905639648437500000f, 0.28439331054687500000f, + 0.32870483398437500000f, 0.40664672851562500000f, + 0.47045898437500000000f, 0.60473632812500000000f, + 0.75292968750000000000f, 0.84332275390625000000f, + 0.07638549804687500000f, 0.10598754882812500000f, + 0.15655517578125000000f, 0.20651245117187500000f, + 0.26156616210937500000f, 0.45477294921875000000f, + 0.58084106445312500000f, 0.66912841796874989000f, + 0.79544067382812511000f, 0.87670898437500000000f, + 0.12612915039062500000f, 0.15570068359375000000f, + 0.23049926757812503000f, 0.30682373046875000000f, + 0.35879516601562500000f, 0.45544433593750000000f, + 0.53207397460937500000f, 0.61602783203125000000f, + 0.73202514648437489000f, 0.80175781249999989000f, + 0.15173339843750000000f, 0.18734741210937500000f, + 0.24090576171875000000f, 0.29397583007812500000f, + 0.34545898437500000000f, 0.43624877929687500000f, + 0.66336059570312500000f, 0.74176025390625000000f, + 0.82150268554687489000f, 0.91268920898437500000f, + 0.09027099609375000000f, 0.11645507812500000000f, + 0.20907592773437500000f, 0.28088378906250000000f, + 0.33248901367187506000f, 0.55090332031250000000f, + 0.63449096679687500000f, 0.71221923828125000000f, + 0.84094238281250000000f, 0.90359497070312500000f, + 0.15972900390625000000f, 0.18395996093750003000f, + 0.24517822265625000000f, 0.30987548828125000000f, + 0.34307861328125000000f, 0.45132446289062500000f, + 0.57824707031250000000f, 0.63983154296875000000f, + 0.81130981445312500000f, 0.88888549804687500000f, + 0.15994262695312503000f, 0.20867919921875000000f, + 0.32122802734375006000f, 0.39120483398437500000f, + 0.44802856445312500000f, 0.52880859375000000000f, + 0.60815429687500000000f, 0.68164062500000000000f, + 0.79934692382812500000f, 0.87576293945312500000f, + 0.10412597656250000000f, 0.12973022460937500000f, + 0.18273925781250000000f, 0.21649169921875000000f, + 0.30233764648437500000f, 0.55673217773437500000f, + 0.66128540039062500000f, 0.72561645507812511000f, + 0.82302856445312500000f, 0.88766479492187500000f, + 0.07537841796875000000f, 0.09817504882812500000f, + 0.23794555664062500000f, 0.46679687499999994000f, + 0.52993774414062500000f, 0.58395385742187500000f, + 0.67074584960937500000f, 0.74023437500000000000f, + 0.83380126953124989000f, 0.89849853515625000000f, + 0.15072631835937500000f, 0.17712402343750000000f, + 0.24856567382812500000f, 0.36038208007812506000f, + 0.42337036132812500000f, 0.47601318359375000000f, + 0.52593994140625000000f, 0.59274291992187500000f, + 0.80798339843750000000f, 0.90469360351562500000f, + 0.15414428710937500000f, 0.18820190429687497000f, + 0.25094604492187500000f, 0.29464721679687500000f, + 0.37106323242187500000f, 0.54916381835937500000f, + 0.62451171875000000000f, 0.69677734375000011000f, + 0.81225585937500000000f, 0.86859130859375000000f, + 0.15219116210937500000f, 0.18026733398437500000f, + 0.28439331054687500000f, 0.34317016601562500000f, + 0.40075683593750000000f, 0.45849609375000000000f, + 0.53359985351562500000f, 0.69235229492187511000f, + 0.79379272460937511000f, 0.86282348632812489000f, + 0.15676879882812500000f, 0.21008300781250000000f, + 0.33645629882812500000f, 0.45623779296875000000f, + 0.52462768554687500000f, 0.59280395507812500000f, + 0.66549682617187489000f, 0.74441528320312511000f, + 0.82208251953125000000f, 0.89379882812500000000f, + 0.21536254882812503000f, 0.24060058593750000000f, + 0.29077148437500000000f, 0.31991577148437500000f, + 0.33447265625000000000f, 0.45199584960937500000f, + 0.58197021484375000000f, 0.66146850585937500000f, + 0.78262329101562511000f, 0.85507202148437500000f, + 0.20626831054687500000f, 0.21850585937500000000f, + 0.26080322265625000000f, 0.35946655273437500000f, + 0.37521362304687500000f, 0.39743041992187500000f, + 0.50741577148437500000f, 0.64389038085937500000f, + 0.75369262695312500000f, 0.86325073242187500000f, + 0.11788940429687500000f, 0.29791259765625000000f, + 0.33776855468749994000f, 0.34927368164062500000f, + 0.36770629882812506000f, 0.42602539062500000000f, + 0.55191040039062500000f, 0.65634155273437500000f, + 0.76977539062500000000f, 0.88491821289062489000f, + 0.01211547851562500000f, 0.01022338867187500000f, + 0.01986694335937500000f, 0.03564453125000000000f, + 0.01953125000000000000f, 0.02334594726562500000f, + 0.01419067382812500000f, 0.01010131835937500000f, + 0.00653076171875000000f, -0.00592041015625000000f, + -0.01763916015625000000f, -0.01974487304687500000f, + -0.02005004882812500000f, 0.02288818359375000000f, + 0.01721191406250000000f, 0.01870727539062500000f, + 0.01675415039062500000f, 0.01922607421875000000f, + 0.00927734375000000000f, -0.00158691406250000020f, + 0.02526855468749999700f, 0.02813720703125000000f, + 0.01351928710937500000f, 0.00338745117187500000f, + 0.00421142578125000000f, 0.00378417968750000000f, + 0.00515747070312500000f, 0.00042724609375000000f, + 0.00439453125000000000f, 0.00253295898437500040f, + 0.00402832031250000000f, 0.00177001953125000000f, + -0.01260375976562500000f, -0.02294921875000000000f, + 0.02651977539062500000f, 0.01025390625000000000f, + 0.01174926757812500200f, 0.00210571289062500000f, + 0.00170898437500000000f, 0.02532958984375000000f, + -0.00692749023437500000f, -0.00811767578125000000f, + -0.01123046875000000000f, -0.01342773437500000000f, + -0.03646850585937500000f, 0.00497436523437500000f, + 0.00384521484375000000f, -0.00695800781250000000f, + 0.02447509765625000000f, 0.00476074218750000000f, + 0.00573730468750000000f, 0.00366210937499999960f, + 0.01147460937500000000f, 0.00180053710937500000f, + -0.01092529296875000000f, -0.01702880859375000000f, + -0.04046630859375000000f, -0.00775146484375000000f, + -0.00616455078125000000f, -0.02407836914062500000f, + 0.00903320312500000000f, 0.00280761718750000000f, + -0.00213623046875000000f, -0.00393676757812500000f, + -0.02191162109375000000f, -0.03463745117187500000f, + 0.00891113281250000000f, -0.00088500976562500000f, + -0.01925659179687500000f, 0.01486206054687500000f, + -0.00479125976562500000f, -0.00466918945312500000f, + -0.00851440429687500000f, 0.00006103515625000000f, + -0.01278686523437500000f, -0.01043701171875000000f, + -0.00103759765625000000f, -0.01568603515625000000f, + -0.02438354492187499700f, -0.04794311523437500000f, + -0.02096557617187500000f, -0.01858520507812500000f, + -0.01666259765625000000f, -0.00396728515625000000f, + -0.00656127929687500000f, -0.00769042968750000000f, + -0.01361083984375000000f, -0.01751708984375000000f, + -0.04080200195312500000f, 0.00631713867187499910f, + -0.00219726562500000000f, 0.00097656250000000000f, + 0.00314331054687500000f, -0.01959228515625000000f, + 0.02874755859375000300f, 0.02236938476562499700f, + 0.00570678710937500090f, 0.00088500976562500000f, + -0.00643920898437500000f, -0.02484130859375000300f, + 0.00436401367187500000f, 0.00686645507812500000f, + 0.00061035156250000000f, 0.00073242187500000000f, + -0.00817871093750000000f, -0.01150512695312500000f, + 0.04953002929687499300f, 0.03457641601562500000f, + 0.02035522460937500000f, 0.00500488281250000000f, + 0.00936889648437500000f, 0.01116943359375000000f, + 0.00570678710937500090f, 0.00103759765625000000f, + 0.00189208984375000000f, -0.00955200195312500000f, + -0.02539062500000000300f, -0.04522705078125000000f, + -0.03604125976562500000f, 0.01473999023437500000f, + -0.00128173828125000000f, -0.00119018554687500000f, + -0.01373291015625000000f, -0.04290771484375000000f, + -0.01791381835937500000f, -0.00158691406250000020f, + -0.02319335937500000000f, 0.01019287109375000000f, + 0.00299072265625000000f, -0.00183105468749999980f, + -0.01525878906249999800f, -0.01489257812500000000f, + -0.03228759765625000000f, 0.00912475585937500000f, + 0.00399780273437500000f, -0.00762939453124999910f, + -0.00765991210937500090f, -0.02145385742187500000f, + 0.03164672851562500000f, 0.01733398437500000000f, + -0.01260375976562500000f, -0.00808715820312500000f, + 0.05148315429687500000f, 0.01748657226562500000f, + 0.01052856445312500000f, 0.00985717773437500000f, + 0.00299072265625000000f, 0.00186157226562500000f, + -0.00311279296875000000f, 0.00094604492187500000f, + 0.00411987304687500000f, 0.00454711914062500000f, + 0.01882934570312500000f, 0.01113891601562500000f, + -0.00119018554687500000f, 0.00103759765625000000f, + -0.01864624023437500000f, 0.03665161132812500000f, + 0.04336547851562500000f, 0.02246093750000000000f, + -0.01263427734374999800f, -0.01199340820312500000f, + -0.01501464843750000000f, -0.01046752929687500200f, + -0.00964355468750000000f, -0.01623535156250000000f, + 0.01611328125000000000f, 0.00524902343750000000f, + 0.00274658203125000000f, 0.00982666015625000000f, + -0.00897216796875000000f, -0.00973510742187500000f, + -0.01651000976562500000f, 0.01535034179687500000f, + 0.01950073242187500000f, 0.01223754882812500000f, + 0.00003051757812500000f, -0.00454711914062500000f, + -0.00222778320312500000f, -0.00509643554687500000f, + 0.00457763671875000000f, 0.00360107421875000000f, + 0.00939941406250000000f, 0.00665283203124999910f, + 0.00369262695312500000f, 0.00595092773437500000f, + -0.00436401367187500000f, -0.00796508789062500000f, + -0.03091430664062500000f, -0.02447509765625000000f, + 0.01181030273437500000f, 0.01330566406249999800f, + 0.00396728515625000000f, -0.01303100585937500200f, + -0.01367187500000000000f, -0.02078247070312500000f, + 0.00375366210937500000f, -0.00265502929687500000f, + -0.00765991210937500090f, -0.00344848632812500000f, + 0.00836181640625000000f, 0.00946044921875000000f, + 0.01358032226562500000f, 0.01528930664062500000f, + 0.01080322265625000200f, 0.00830078125000000000f, + 0.00430297851562500000f, -0.00869750976562500000f, + 0.01736450195312500000f, 0.02001953125000000000f, + 0.00112915039062500000f, -0.00149536132812500000f, + 0.00765991210937500090f, -0.01177978515625000000f, + -0.00802612304687500000f, 0.03424072265625000000f, + 0.01843261718750000000f, 0.01849365234375000000f, + 0.01025390625000000000f, 0.00289916992187500000f, + 0.00103759765625000000f, 0.00000000000000000000f, + 0.00259399414062500000f, 0.00549316406250000000f, + 0.00631713867187499910f, -0.01119995117187500000f, + -0.01898193359375000000f, 0.03265380859375000000f, + -0.00018310546875000000f, -0.00241088867187500000f, + -0.00488281250000000000f, -0.00280761718750000000f, + -0.00418090820312500000f, -0.00842285156250000000f, + -0.00985717773437500000f, -0.01132202148437500000f, + -0.02124023437500000000f, -0.03161621093750000000f, + 0.01242065429687500200f, 0.00311279296875000000f, + -0.00262451171875000000f, -0.00653076171875000000f, + -0.01470947265625000200f, -0.01974487304687500000f, + -0.00085449218750000000f, -0.00888061523437500000f, + -0.00296020507812500000f, -0.00549316406250000000f, + -0.00762939453124999910f, -0.01327514648437500000f, + -0.00054931640625000000f, -0.00231933593750000000f, + -0.01013183593750000200f, 0.01251220703125000000f, + 0.01242065429687500200f, 0.00512695312500000000f, + 0.01644897460937500000f, 0.01254272460937500000f, + 0.00775146484375000000f, 0.00338745117187500000f, + 0.00177001953125000000f, -0.00442504882812500000f, + 0.00610351562500000000f, 0.00091552734374999989f, + 0.00570678710937500090f, 0.00354003906250000000f, + 0.00399780273437500000f, -0.01119995117187500000f, + -0.01449584960937500000f, 0.02383422851562500300f, + -0.01705932617187500000f, 0.01712036132812500000f, + 0.00595092773437500000f, -0.00350952148437500040f, + 0.00024414062500000000f, -0.00512695312500000000f, + 0.00091552734374999989f, 0.00167846679687500000f, + -0.00372314453125000000f, 0.00399780273437500000f, + 0.00250244140625000000f, -0.00015258789062500000f, + -0.00833129882812500000f, -0.00152587890625000000f, + -0.01928710937500000000f, 0.02038574218750000000f, + 0.00012207031250000000f, 0.00097656250000000000f, + -0.00079345703125000011f, -0.00851440429687500000f, + 0.00961303710937500000f, 0.00503540039062499910f, + 0.00601196289062499910f, 0.01150512695312500000f, + 0.00473022460937500000f, -0.00125122070312500000f, + -0.00421142578125000000f, -0.00988769531250000000f, + -0.00332641601562499960f, -0.01882934570312500000f, + 0.01098632812500000000f, 0.00299072265625000000f, + -0.00161743164062500000f, -0.00973510742187500000f, + -0.00347900390625000000f, -0.00747680664062500000f, + -0.00250244140625000000f, 0.01547241210937500000f, + 0.01428222656250000000f, 0.00802612304687500000f, + -0.00418090820312500000f, -0.01187133789062500000f, + 0.01989746093750000000f, 0.01080322265625000200f, + -0.00054931640625000000f, -0.00692749023437500000f, + -0.01409912109375000000f, -0.00411987304687500000f, + 0.00967407226562500000f, 0.00161743164062500000f, + -0.00048828125000000000f, 0.00201416015625000000f, + -0.00219726562500000000f, -0.00384521484375000000f, + -0.01086425781250000000f, -0.01058959960937500000f, + -0.01000976562500000000f, -0.00219726562500000000f, + -0.01028442382812500000f, 0.00988769531250000000f, + 0.00463867187500000000f, 0.01065063476562500000f, + 0.00515747070312500000f, -0.00598144531250000000f, + 0.00546264648437500000f, 0.00775146484375000000f, + 0.00793457031250000000f, 0.00991821289062500000f, + -0.00225830078125000000f, -0.00244140625000000000f, + 0.00228881835937500000f, -0.00094604492187500000f, + 0.00823974609375000000f, 0.00839233398437500000f, + 0.00265502929687500000f, 0.00848388671875000000f, + -0.01361083984375000000f, -0.00918579101562500000f, + 0.00942993164062500000f, 0.00216674804687500000f, + -0.00076293945312500000f, -0.00738525390625000000f, + 0.01574707031250000000f, 0.00491333007812500000f, + -0.00494384765625000000f, -0.00253295898437500040f, + 0.01004028320312500000f, 0.00701904296875000090f, + -0.00949096679687500000f, -0.00790405273437500000f, + 0.00540161132812500090f, -0.00079345703125000011f, + -0.01409912109375000000f, 0.00271606445312500000f, + 0.00784301757812500000f, 0.00018310546875000000f, + -0.00396728515625000000f, -0.00283813476562499960f, + -0.01391601562500000000f, -0.00967407226562500000f, + -0.00674438476562500000f, -0.00628662109375000000f, + -0.01272583007812500000f, -0.00555419921875000000f, + -0.00225830078125000000f, 0.00714111328125000000f, + 0.00146484375000000000f, 0.00796508789062500000f, + 0.01095581054687500000f, 0.00704956054687500000f, + 0.00787353515625000000f, 0.00259399414062500000f, + -0.00860595703125000000f, 0.00769042968750000000f, + -0.00448608398437500000f, -0.00677490234375000000f, + 0.00765991210937500090f, -0.00631713867187499910f, + 0.01351928710937500000f, 0.00375366210937500000f, + -0.01272583007812500000f, -0.00109863281250000000f, + 0.00833129882812500000f, -0.00735473632812500090f, + 0.00732421874999999910f, -0.00341796875000000000f, + 0.00134277343749999980f, -0.00509643554687500000f, + 0.00384521484375000000f, -0.00378417968750000000f, + -0.00234985351562500000f, 0.00177001953125000000f, + -0.01223754882812500000f, 0.01016235351562500000f, + -0.00360107421875000000f, 0.00250244140625000000f, + 0.00384521484375000000f, 0.00460815429687500000f, + -0.01321411132812500000f, 0.01095581054687500000f, + -0.00396728515625000000f, -0.00311279296875000000f, + 0.00399780273437500000f, -0.00744628906250000000f, + 0.00262451171875000000f, 0.00259399414062500000f, + -0.01409912109375000000f, 0.01263427734374999800f, + -0.00732421874999999910f, 0.00048828125000000000f, + 0.00442504882812500000f, 0.00085449218750000000f, + -0.00625610351562500000f, -0.01467895507812500000f, + 0.01138305664062500000f, 0.00894165039062500000f, + -0.00219726562500000000f, -0.00531005859375000000f, + 0.00189208984375000000f, 0.00790405273437500000f, + -0.00024414062500000000f, -0.00054931640625000000f, + 0.01104736328125000000f, 0.00711059570312500000f, + 0.00564575195312500000f, 0.00131225585937500000f, + 0.00848388671875000000f, 0.00082397460937500000f, + 0.00588989257812500000f, 0.01739501953125000000f, + -0.00756835937500000000f, 0.00576782226562500000f, + 0.00280761718750000000f, 0.00094604492187500000f, + -0.00839233398437500000f, -0.00009155273437500000f, + 0.00741577148437500000f, 0.00537109374999999910f, + 0.01336669921875000200f, 0.00637817382812500090f, + 0.00628662109375000000f, -0.00155639648437500000f, + 0.00241088867187500000f, 0.00332641601562499960f, + 0.00512695312500000000f, -0.00564575195312500000f, + -0.00939941406250000000f, -0.00207519531250000000f, + -0.01885986328125000000f, 0.01174926757812500200f, + -0.00946044921875000000f, -0.00329589843750000000f, + -0.00500488281250000000f, 0.00503540039062499910f, + 0.00186157226562500000f, -0.00463867187500000000f, + -0.00308227539062500000f, -0.01257324218750000000f, + -0.00817871093750000000f, -0.00784301757812500000f, + -0.00122070312500000000f, -0.00061035156250000000f, + -0.00085449218750000000f, -0.00482177734375000000f, + -0.00918579101562500000f, 0.00827026367187500000f, + 0.01159667968750000000f, -0.01031494140625000000f, + -0.01119995117187500000f, -0.00402832031250000000f, + 0.00195312500000000000f, 0.00347900390625000000f, + -0.00399780273437500000f, -0.00686645507812500000f, + -0.00476074218750000000f, -0.00793457031250000000f, + -0.00192260742187500000f, -0.00354003906250000000f, + 0.00473022460937500000f, -0.01788330078125000000f, + -0.00616455078125000000f, 0.00775146484375000000f, + -0.00875854492187500000f, 0.00543212890625000000f, + 0.00692749023437500000f, -0.00323486328125000000f, + -0.00897216796875000000f, 0.00500488281250000000f, + 0.00909423828125000000f, -0.00305175781250000000f, + 0.00564575195312500000f, 0.00967407226562500000f, + 0.00588989257812500000f, -0.00137329101562500000f, + 0.00085449218750000000f, 0.00244140625000000000f, + -0.00265502929687500000f, -0.01321411132812500000f, + 0.00067138671874999989f, -0.00146484375000000000f, + 0.00146484375000000000f, -0.00723266601562500000f, + -0.00698852539062499910f, -0.00424194335937500000f, + 0.00366210937499999960f, -0.01110839843750000000f, + 0.00817871093750000000f, -0.00415039062500000000f, + 0.01208496093750000200f, 0.00381469726562499960f, + 0.00396728515625000000f, -0.00271606445312500000f, + -0.00830078125000000000f, 0.00360107421875000000f, + -0.00781250000000000000f, -0.00207519531250000000f, + -0.01376342773437500000f, 0.01489257812500000000f, + 0.00436401367187500000f, -0.00503540039062499910f, + -0.00146484375000000000f, -0.00579833984375000000f, + 0.00323486328125000000f, 0.00668334960937500090f, + 0.00143432617187500000f, 0.01327514648437500000f, + 0.00747680664062500000f, 0.00296020507812500000f, + 0.00228881835937500000f, -0.01275634765625000200f, + 0.00369262695312500000f, -0.00570678710937500090f, + 0.01739501953125000000f, -0.00610351562500000000f, + -0.01071166992187500000f, 0.00686645507812500000f, + -0.00064086914062500000f, -0.00662231445312500000f, + 0.00714111328125000000f, -0.00338745117187500000f, + 0.00592041015625000000f, 0.00042724609375000000f, + 0.00738525390625000000f, 0.00360107421875000000f, + 0.00427246093750000000f, -0.01211547851562500000f, + 0.01083374023437500000f, 0.01101684570312499800f, + -0.00137329101562500000f, -0.00595092773437500000f +}; + +const SKP_Silk_NLSF_CBS_FLP SKP_Silk_NLSF_CB0_10_Stage_info_FLP[ NLSF_MSVQ_CB0_10_STAGES ] = +{ + { 64, &SKP_Silk_NLSF_MSVQ_CB0_10[ 10 * 0 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates[ 0 ] }, + { 16, &SKP_Silk_NLSF_MSVQ_CB0_10[ 10 * 64 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates[ 64 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_10[ 10 * 80 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates[ 80 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_10[ 10 * 88 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates[ 88 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_10[ 10 * 96 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates[ 96 ] }, + { 16, &SKP_Silk_NLSF_MSVQ_CB0_10[ 10 * 104 ], &SKP_Silk_NLSF_MSVQ_CB0_10_rates[ 104 ] } +}; + +const SKP_Silk_NLSF_CB_FLP SKP_Silk_NLSF_CB0_10_FLP = +{ + NLSF_MSVQ_CB0_10_STAGES, + SKP_Silk_NLSF_CB0_10_Stage_info_FLP, + SKP_Silk_NLSF_MSVQ_CB0_10_ndelta_min, + SKP_Silk_NLSF_MSVQ_CB0_10_CDF, + SKP_Silk_NLSF_MSVQ_CB0_10_CDF_start_ptr, + SKP_Silk_NLSF_MSVQ_CB0_10_CDF_middle_idx +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16.c new file mode 100755 index 0000000..143d2c2 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16.c @@ -0,0 +1,1320 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/**********************************************/ +/* This file has been automatically generated */ +/* */ +/* ROM usage: 0.51 + 7.38 kB */ +/**********************************************/ + +#include "SKP_Silk_structs.h" +#include "SKP_Silk_tables_NLSF_CB0_16.h" +#include "SKP_Silk_tables.h" + +const SKP_uint16 SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ NLSF_MSVQ_CB0_16_VECTORS + NLSF_MSVQ_CB0_16_STAGES ] = +{ + 0, + 1449, + 2749, + 4022, + 5267, + 6434, + 7600, + 8647, + 9695, + 10742, + 11681, + 12601, + 13444, + 14251, + 15008, + 15764, + 16521, + 17261, + 18002, + 18710, + 19419, + 20128, + 20837, + 21531, + 22225, + 22919, + 23598, + 24277, + 24956, + 25620, + 26256, + 26865, + 27475, + 28071, + 28667, + 29263, + 29859, + 30443, + 31026, + 31597, + 32168, + 32727, + 33273, + 33808, + 34332, + 34855, + 35379, + 35902, + 36415, + 36927, + 37439, + 37941, + 38442, + 38932, + 39423, + 39914, + 40404, + 40884, + 41364, + 41844, + 42324, + 42805, + 43285, + 43754, + 44224, + 44694, + 45164, + 45623, + 46083, + 46543, + 46993, + 47443, + 47892, + 48333, + 48773, + 49213, + 49653, + 50084, + 50515, + 50946, + 51377, + 51798, + 52211, + 52614, + 53018, + 53422, + 53817, + 54212, + 54607, + 55002, + 55388, + 55775, + 56162, + 56548, + 56910, + 57273, + 57635, + 57997, + 58352, + 58698, + 59038, + 59370, + 59702, + 60014, + 60325, + 60630, + 60934, + 61239, + 61537, + 61822, + 62084, + 62346, + 62602, + 62837, + 63072, + 63302, + 63517, + 63732, + 63939, + 64145, + 64342, + 64528, + 64701, + 64867, + 65023, + 65151, + 65279, + 65407, + 65535, + 0, + 5099, + 9982, + 14760, + 19538, + 24213, + 28595, + 32976, + 36994, + 41012, + 44944, + 48791, + 52557, + 56009, + 59388, + 62694, + 65535, + 0, + 9955, + 19697, + 28825, + 36842, + 44686, + 52198, + 58939, + 65535, + 0, + 8949, + 17335, + 25720, + 33926, + 41957, + 49987, + 57845, + 65535, + 0, + 9724, + 18642, + 26998, + 35355, + 43532, + 51534, + 59365, + 65535, + 0, + 8750, + 17499, + 26249, + 34448, + 42471, + 50494, + 58178, + 65535, + 0, + 8730, + 17273, + 25816, + 34176, + 42536, + 50203, + 57869, + 65535, + 0, + 8769, + 17538, + 26307, + 34525, + 42742, + 50784, + 58319, + 65535, + 0, + 8736, + 17101, + 25466, + 33653, + 41839, + 50025, + 57864, + 65535, + 0, + 4368, + 8735, + 12918, + 17100, + 21283, + 25465, + 29558, + 33651, + 37744, + 41836, + 45929, + 50022, + 54027, + 57947, + 61782, + 65535 +}; + +const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB0_16_CDF_start_ptr[ NLSF_MSVQ_CB0_16_STAGES ] = +{ + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 0 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 129 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 146 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 155 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 164 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 173 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 182 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 191 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 200 ], + &SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ 209 ] +}; + +const SKP_int SKP_Silk_NLSF_MSVQ_CB0_16_CDF_middle_idx[ NLSF_MSVQ_CB0_16_STAGES ] = +{ + 42, + 8, + 4, + 5, + 5, + 5, + 5, + 5, + 5, + 9 +}; + +const SKP_int16 SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ NLSF_MSVQ_CB0_16_VECTORS ] = +{ + 176, 181, + 182, 183, + 186, 186, + 191, 191, + 191, 196, + 197, 201, + 203, 206, + 206, 206, + 207, 207, + 209, 209, + 209, 209, + 210, 210, + 210, 211, + 211, 211, + 212, 214, + 216, 216, + 217, 217, + 217, 217, + 218, 218, + 219, 219, + 220, 221, + 222, 223, + 223, 223, + 223, 224, + 224, 224, + 225, 225, + 226, 226, + 226, 226, + 227, 227, + 227, 227, + 227, 227, + 228, 228, + 228, 228, + 229, 229, + 229, 230, + 230, 230, + 231, 231, + 231, 231, + 232, 232, + 232, 232, + 233, 234, + 235, 235, + 235, 236, + 236, 236, + 236, 237, + 237, 237, + 237, 240, + 240, 240, + 240, 241, + 242, 243, + 244, 244, + 247, 247, + 248, 248, + 248, 249, + 251, 255, + 255, 256, + 260, 260, + 261, 264, + 264, 266, + 266, 268, + 271, 274, + 276, 279, + 288, 288, + 288, 288, + 118, 120, + 121, 121, + 122, 125, + 125, 129, + 129, 130, + 131, 132, + 136, 137, + 138, 145, + 87, 88, + 91, 97, + 98, 100, + 105, 106, + 92, 95, + 95, 96, + 97, 97, + 98, 99, + 88, 92, + 95, 95, + 96, 97, + 98, 109, + 93, 93, + 93, 96, + 97, 97, + 99, 101, + 93, 94, + 94, 95, + 95, 99, + 99, 99, + 93, 93, + 93, 96, + 96, 97, + 100, 102, + 93, 95, + 95, 96, + 96, 96, + 98, 99, + 125, 125, + 127, 127, + 127, 127, + 128, 128, + 128, 128, + 128, 128, + 129, 130, + 131, 132 +}; + +const SKP_int SKP_Silk_NLSF_MSVQ_CB0_16_ndelta_min_Q15[ 16 + 1 ] = +{ + 266, + 3, + 40, + 3, + 3, + 16, + 78, + 89, + 107, + 141, + 188, + 146, + 272, + 240, + 235, + 215, + 632 +}; + +const SKP_int16 SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * NLSF_MSVQ_CB0_16_VECTORS ] = +{ + 1170, 2278, 3658, 5374, + 7666, 9113, 11298, 13304, + 15371, 17549, 19587, 21487, + 23798, 26038, 28318, 30201, + 1628, 2334, 4115, 6036, + 7818, 9544, 11777, 14021, + 15787, 17408, 19466, 21261, + 22886, 24565, 26714, 28059, + 1724, 2670, 4056, 6532, + 8357, 10119, 12093, 14061, + 16491, 18795, 20417, 22402, + 24251, 26224, 28410, 29956, + 1493, 3427, 4789, 6399, + 8435, 10168, 12000, 14066, + 16229, 18210, 20040, 22098, + 24153, 26095, 28183, 30121, + 1119, 2089, 4295, 6245, + 8691, 10741, 12688, 15057, + 17028, 18792, 20717, 22514, + 24497, 26548, 28619, 30630, + 1363, 2417, 3927, 5556, + 7422, 9315, 11879, 13767, + 16143, 18520, 20458, 22578, + 24539, 26436, 28318, 30318, + 1122, 2503, 5216, 7148, + 9310, 11078, 13175, 14800, + 16864, 18700, 20436, 22488, + 24572, 26602, 28555, 30426, + 600, 1317, 2970, 5609, + 7694, 9784, 12169, 14087, + 16379, 18378, 20551, 22686, + 24739, 26697, 28646, 30355, + 941, 1882, 4274, 5540, + 8482, 9858, 11940, 14287, + 16091, 18501, 20326, 22612, + 24711, 26638, 28814, 30430, + 635, 1699, 4376, 5948, + 8097, 10115, 12274, 14178, + 16111, 17813, 19695, 21773, + 23927, 25866, 28022, 30134, + 1408, 2222, 3524, 5615, + 7345, 8849, 10989, 12772, + 15352, 17026, 18919, 21062, + 23329, 25215, 27209, 29023, + 701, 1307, 3548, 6301, + 7744, 9574, 11227, 12978, + 15170, 17565, 19775, 22097, + 24230, 26335, 28377, 30231, + 1752, 2364, 4879, 6569, + 7813, 9796, 11199, 14290, + 15795, 18000, 20396, 22417, + 24308, 26124, 28360, 30633, + 901, 1629, 3356, 4635, + 7256, 8767, 9971, 11558, + 15215, 17544, 19523, 21852, + 23900, 25978, 28133, 30184, + 981, 1669, 3323, 4693, + 6213, 8692, 10614, 12956, + 15211, 17711, 19856, 22122, + 24344, 26592, 28723, 30481, + 1607, 2577, 4220, 5512, + 8532, 10388, 11627, 13671, + 15752, 17199, 19840, 21859, + 23494, 25786, 28091, 30131, + 811, 1471, 3144, 5041, + 7430, 9389, 11174, 13255, + 15157, 16741, 19583, 22167, + 24115, 26142, 28383, 30395, + 1543, 2144, 3629, 6347, + 7333, 9339, 10710, 13596, + 15099, 17340, 20102, 21886, + 23732, 25637, 27818, 29917, + 492, 1185, 2940, 5488, + 7095, 8751, 11596, 13579, + 16045, 18015, 20178, 22127, + 24265, 26406, 28484, 30357, + 1547, 2282, 3693, 6341, + 7758, 9607, 11848, 13236, + 16564, 18069, 19759, 21404, + 24110, 26606, 28786, 30655, + 685, 1338, 3409, 5262, + 6950, 9222, 11414, 14523, + 16337, 17893, 19436, 21298, + 23293, 25181, 27973, 30520, + 887, 1581, 3057, 4318, + 7192, 8617, 10047, 13106, + 16265, 17893, 20233, 22350, + 24379, 26384, 28314, 30189, + 2285, 3745, 5662, 7576, + 9323, 11320, 13239, 15191, + 17175, 19225, 21108, 22972, + 24821, 26655, 28561, 30460, + 1496, 2108, 3448, 6898, + 8328, 9656, 11252, 12823, + 14979, 16482, 18180, 20085, + 22962, 25160, 27705, 29629, + 575, 1261, 3861, 6627, + 8294, 10809, 12705, 14768, + 17076, 19047, 20978, 23055, + 24972, 26703, 28720, 30345, + 1682, 2213, 3882, 6238, + 7208, 9646, 10877, 13431, + 14805, 16213, 17941, 20873, + 23550, 25765, 27756, 29461, + 888, 1616, 3924, 5195, + 7206, 8647, 9842, 11473, + 16067, 18221, 20343, 22774, + 24503, 26412, 28054, 29731, + 805, 1454, 2683, 4472, + 7936, 9360, 11398, 14345, + 16205, 17832, 19453, 21646, + 23899, 25928, 28387, 30463, + 1640, 2383, 3484, 5082, + 6032, 8606, 11640, 12966, + 15842, 17368, 19346, 21182, + 23638, 25889, 28368, 30299, + 1632, 2204, 4510, 7580, + 8718, 10512, 11962, 14096, + 15640, 17194, 19143, 22247, + 24563, 26561, 28604, 30509, + 2043, 2612, 3985, 6851, + 8038, 9514, 10979, 12789, + 15426, 16728, 18899, 20277, + 22902, 26209, 28711, 30618, + 2224, 2798, 4465, 5320, + 7108, 9436, 10986, 13222, + 14599, 18317, 20141, 21843, + 23601, 25700, 28184, 30582, + 835, 1541, 4083, 5769, + 7386, 9399, 10971, 12456, + 15021, 18642, 20843, 23100, + 25292, 26966, 28952, 30422, + 1795, 2343, 4809, 5896, + 7178, 8545, 10223, 13370, + 14606, 16469, 18273, 20736, + 23645, 26257, 28224, 30390, + 1734, 2254, 4031, 5188, + 6506, 7872, 9651, 13025, + 14419, 17305, 19495, 22190, + 24403, 26302, 28195, 30177, + 1841, 2349, 3968, 4764, + 6376, 9825, 11048, 13345, + 14682, 16252, 18183, 21363, + 23918, 26156, 28031, 29935, + 1432, 2047, 5631, 6927, + 8198, 9675, 11358, 13506, + 14802, 16419, 18339, 22019, + 24124, 26177, 28130, 30586, + 1730, 2320, 3744, 4808, + 6007, 9666, 10997, 13622, + 15234, 17495, 20088, 22002, + 23603, 25400, 27379, 29254, + 1267, 1915, 5483, 6812, + 8229, 9919, 11589, 13337, + 14747, 17965, 20552, 22167, + 24519, 26819, 28883, 30642, + 1526, 2229, 4240, 7388, + 8953, 10450, 11899, 13718, + 16861, 18323, 20379, 22672, + 24797, 26906, 28906, 30622, + 2175, 2791, 4104, 6875, + 8612, 9798, 12152, 13536, + 15623, 17682, 19213, 21060, + 24382, 26760, 28633, 30248, + 454, 1231, 4339, 5738, + 7550, 9006, 10320, 13525, + 16005, 17849, 20071, 21992, + 23949, 26043, 28245, 30175, + 2250, 2791, 4230, 5283, + 6762, 10607, 11879, 13821, + 15797, 17264, 20029, 22266, + 24588, 26437, 28244, 30419, + 1696, 2216, 4308, 8385, + 9766, 11030, 12556, 14099, + 16322, 17640, 19166, 20590, + 23967, 26858, 28798, 30562, + 2452, 3236, 4369, 6118, + 7156, 9003, 11509, 12796, + 15749, 17291, 19491, 22241, + 24530, 26474, 28273, 30073, + 1811, 2541, 3555, 5480, + 9123, 10527, 11894, 13659, + 15262, 16899, 19366, 21069, + 22694, 24314, 27256, 29983, + 1553, 2246, 4559, 5500, + 6754, 7874, 11739, 13571, + 15188, 17879, 20281, 22510, + 24614, 26649, 28786, 30755, + 1982, 2768, 3834, 5964, + 8732, 9908, 11797, 14813, + 16311, 17946, 21097, 22851, + 24456, 26304, 28166, 29755, + 1824, 2529, 3817, 5449, + 6854, 8714, 10381, 12286, + 14194, 15774, 19524, 21374, + 23695, 26069, 28096, 30212, + 2212, 2854, 3947, 5898, + 9930, 11556, 12854, 14788, + 16328, 17700, 20321, 22098, + 23672, 25291, 26976, 28586, + 2023, 2599, 4024, 4916, + 6613, 11149, 12457, 14626, + 16320, 17822, 19673, 21172, + 23115, 26051, 28825, 30758, + 1628, 2206, 3467, 4364, + 8679, 10173, 11864, 13679, + 14998, 16938, 19207, 21364, + 23850, 26115, 28124, 30273, + 2014, 2603, 4114, 7254, + 8516, 10043, 11822, 13503, + 16329, 17826, 19697, 21280, + 23151, 24661, 26807, 30161, + 2376, 2980, 4422, 5770, + 7016, 9723, 11125, 13516, + 15485, 16985, 19160, 20587, + 24401, 27180, 29046, 30647, + 2454, 3502, 4624, 6019, + 7632, 8849, 10792, 13964, + 15523, 17085, 19611, 21238, + 22856, 25108, 28106, 29890, + 1573, 2274, 3308, 5999, + 8977, 10104, 12457, 14258, + 15749, 18180, 19974, 21253, + 23045, 25058, 27741, 30315, + 1943, 2730, 4140, 6160, + 7491, 8986, 11309, 12775, + 14820, 16558, 17909, 19757, + 21512, 23605, 27274, 29527, + 2021, 2582, 4494, 5835, + 6993, 8245, 9827, 14733, + 16462, 17894, 19647, 21083, + 23764, 26667, 29072, 30990, + 1052, 1775, 3218, 4378, + 7666, 9403, 11248, 13327, + 14972, 17962, 20758, 22354, + 25071, 27209, 29001, 30609, + 2218, 2866, 4223, 5352, + 6581, 9980, 11587, 13121, + 15193, 16583, 18386, 20080, + 22013, 25317, 28127, 29880, + 2146, 2840, 4397, 5840, + 7449, 8721, 10512, 11936, + 13595, 17253, 19310, 20891, + 23417, 25627, 27749, 30231, + 1972, 2619, 3756, 6367, + 7641, 8814, 12286, 13768, + 15309, 18036, 19557, 20904, + 22582, 24876, 27800, 30440, + 2005, 2577, 4272, 7373, + 8558, 10223, 11770, 13402, + 16502, 18000, 19645, 21104, + 22990, 26806, 29505, 30942, + 1153, 1822, 3724, 5443, + 6990, 8702, 10289, 11899, + 13856, 15315, 17601, 21064, + 23692, 26083, 28586, 30639, + 1304, 1869, 3318, 7195, + 9613, 10733, 12393, 13728, + 15822, 17474, 18882, 20692, + 23114, 25540, 27684, 29244, + 2093, 2691, 4018, 6658, + 7947, 9147, 10497, 11881, + 15888, 17821, 19333, 21233, + 23371, 25234, 27553, 29998, + 575, 1331, 5304, 6910, + 8425, 10086, 11577, 13498, + 16444, 18527, 20565, 22847, + 24914, 26692, 28759, 30157, + 1435, 2024, 3283, 4156, + 7611, 10592, 12049, 13927, + 15459, 18413, 20495, 22270, + 24222, 26093, 28065, 30099, + 1632, 2168, 5540, 7478, + 8630, 10391, 11644, 14321, + 15741, 17357, 18756, 20434, + 22799, 26060, 28542, 30696, + 1407, 2245, 3405, 5639, + 9419, 10685, 12104, 13495, + 15535, 18357, 19996, 21689, + 24351, 26550, 28853, 30564, + 1675, 2226, 4005, 8223, + 9975, 11155, 12822, 14316, + 16504, 18137, 19574, 21050, + 22759, 24912, 28296, 30634, + 1080, 1614, 3622, 7565, + 8748, 10303, 11713, 13848, + 15633, 17434, 19761, 21825, + 23571, 25393, 27406, 29063, + 1693, 2229, 3456, 4354, + 5670, 10890, 12563, 14167, + 15879, 17377, 19817, 21971, + 24094, 26131, 28298, 30099, + 2042, 2959, 4195, 5740, + 7106, 8267, 11126, 14973, + 16914, 18295, 20532, 21982, + 23711, 25769, 27609, 29351, + 984, 1612, 3808, 5265, + 6885, 8411, 9547, 10889, + 12522, 16520, 19549, 21639, + 23746, 26058, 28310, 30374, + 2036, 2538, 4166, 7761, + 9146, 10412, 12144, 13609, + 15588, 17169, 18559, 20113, + 21820, 24313, 28029, 30612, + 1871, 2355, 4061, 5143, + 7464, 10129, 11941, 15001, + 16680, 18354, 19957, 22279, + 24861, 26872, 28988, 30615, + 2566, 3161, 4643, 6227, + 7406, 9970, 11618, 13416, + 15889, 17364, 19121, 20817, + 22592, 24720, 28733, 31082, + 1700, 2327, 4828, 5939, + 7567, 9154, 11087, 12771, + 14209, 16121, 20222, 22671, + 24648, 26656, 28696, 30745, + 3169, 3873, 5046, 6868, + 8184, 9480, 12335, 14068, + 15774, 17971, 20231, 21711, + 23520, 25245, 27026, 28730, + 1564, 2391, 4229, 6730, + 8905, 10459, 13026, 15033, + 17265, 19809, 21849, 23741, + 25490, 27312, 29061, 30527, + 2864, 3559, 4719, 6441, + 9592, 11055, 12763, 14784, + 16428, 18164, 20486, 22262, + 24183, 26263, 28383, 30224, + 2673, 3449, 4581, 5983, + 6863, 8311, 12464, 13911, + 15738, 17791, 19416, 21182, + 24025, 26561, 28723, 30440, + 2419, 3049, 4274, 6384, + 8564, 9661, 11288, 12676, + 14447, 17578, 19816, 21231, + 23099, 25270, 26899, 28926, + 1278, 2001, 3000, 5353, + 9995, 11777, 13018, 14570, + 16050, 17762, 19982, 21617, + 23371, 25083, 27656, 30172, + 932, 1624, 2798, 4570, + 8592, 9988, 11552, 13050, + 16921, 18677, 20415, 22810, + 24817, 26819, 28804, 30385, + 2324, 2973, 4156, 5702, + 6919, 8806, 10259, 12503, + 15015, 16567, 19418, 21375, + 22943, 24550, 27024, 29849, + 1564, 2373, 3455, 4907, + 5975, 7436, 11786, 14505, + 16107, 18148, 20019, 21653, + 23740, 25814, 28578, 30372, + 3025, 3729, 4866, 6520, + 9487, 10943, 12358, 14258, + 16174, 17501, 19476, 21408, + 23227, 24906, 27347, 29407, + 1270, 1965, 6802, 7995, + 9204, 10828, 12507, 14230, + 15759, 17860, 20369, 22502, + 24633, 26514, 28535, 30525, + 2210, 2749, 4266, 7487, + 9878, 11018, 12823, 14431, + 16247, 18626, 20450, 22054, + 23739, 25291, 27074, 29169, + 1275, 1926, 4330, 6573, + 8441, 10920, 13260, 15008, + 16927, 18573, 20644, 22217, + 23983, 25474, 27372, 28645, + 3015, 3670, 5086, 6372, + 7888, 9309, 10966, 12642, + 14495, 16172, 18080, 19972, + 22454, 24899, 27362, 29975, + 2882, 3733, 5113, 6482, + 8125, 9685, 11598, 13288, + 15405, 17192, 20178, 22426, + 24801, 27014, 29212, 30811, + 2300, 2968, 4101, 5442, + 6327, 7910, 12455, 13862, + 15747, 17505, 19053, 20679, + 22615, 24658, 27499, 30065, + 2257, 2940, 4430, 5991, + 7042, 8364, 9414, 11224, + 15723, 17420, 19253, 21469, + 23915, 26053, 28430, 30384, + 1227, 2045, 3818, 5011, + 6990, 9231, 11024, 13011, + 17341, 19017, 20583, 22799, + 25195, 26876, 29351, 30805, + 1354, 1924, 3789, 8077, + 10453, 11639, 13352, 14817, + 16743, 18189, 20095, 22014, + 24593, 26677, 28647, 30256, + 3142, 4049, 6197, 7417, + 8753, 10156, 11533, 13181, + 15947, 17655, 19606, 21402, + 23487, 25659, 28123, 30304, + 1317, 2263, 4725, 7611, + 9667, 11634, 14143, 16258, + 18724, 20698, 22379, 24007, + 25775, 27251, 28930, 30593, + 1570, 2323, 3818, 6215, + 9893, 11556, 13070, 14631, + 16152, 18290, 21386, 23346, + 25114, 26923, 28712, 30168, + 2297, 3905, 6287, 8558, + 10668, 12766, 15019, 17102, + 19036, 20677, 22341, 23871, + 25478, 27085, 28851, 30520, + 1915, 2507, 4033, 5749, + 7059, 8871, 10659, 12198, + 13937, 15383, 16869, 18707, + 23175, 25818, 28514, 30501, + 2404, 2918, 5190, 6252, + 7426, 9887, 12387, 14795, + 16754, 18368, 20338, 22003, + 24236, 26456, 28490, 30397, + 1621, 2227, 3479, 5085, + 9425, 12892, 14246, 15652, + 17205, 18674, 20446, 22209, + 23778, 25867, 27931, 30093, + 1869, 2390, 4105, 7021, + 11221, 12775, 14059, 15590, + 17024, 18608, 20595, 22075, + 23649, 25154, 26914, 28671, + 2551, 3252, 4688, 6562, + 7869, 9125, 10475, 11800, + 15402, 18780, 20992, 22555, + 24289, 25968, 27465, 29232, + 2705, 3493, 4735, 6360, + 7905, 9352, 11538, 13430, + 15239, 16919, 18619, 20094, + 21800, 23342, 25200, 29257, + 2166, 2791, 4011, 5081, + 5896, 9038, 13407, 14703, + 16543, 18189, 19896, 21857, + 24872, 26971, 28955, 30514, + 1865, 3021, 4696, 6534, + 8343, 9914, 12789, 14103, + 16533, 17729, 21340, 22439, + 24873, 26330, 28428, 30154, + 3369, 4345, 6573, 8763, + 10309, 11713, 13367, 14784, + 16483, 18145, 19839, 21247, + 23292, 25477, 27555, 29447, + 1265, 2184, 5443, 7893, + 10591, 13139, 15105, 16639, + 18402, 19826, 21419, 22995, + 24719, 26437, 28363, 30125, + 1584, 2004, 3535, 4450, + 8662, 10764, 12832, 14978, + 16972, 18794, 20932, 22547, + 24636, 26521, 28701, 30567, + 3419, 4528, 6602, 7890, + 9508, 10875, 12771, 14357, + 16051, 18330, 20630, 22490, + 25070, 26936, 28946, 30542, + 1726, 2252, 4597, 6950, + 8379, 9823, 11363, 12794, + 14306, 15476, 16798, 18018, + 21671, 25550, 28148, 30367, + 3385, 3870, 5307, 6388, + 7141, 8684, 12695, 14939, + 16480, 18277, 20537, 22048, + 23947, 25965, 28214, 29956, + 2771, 3306, 4450, 5560, + 6453, 9493, 13548, 14754, + 16743, 18447, 20028, 21736, + 23746, 25353, 27141, 29066, + 3028, 3900, 6617, 7893, + 9211, 10480, 12047, 13583, + 15182, 16662, 18502, 20092, + 22190, 24358, 26302, 28957, + 2000, 2550, 4067, 6837, + 9628, 11002, 12594, 14098, + 15589, 17195, 18679, 20099, + 21530, 23085, 24641, 29022, + 2844, 3302, 5103, 6107, + 6911, 8598, 12416, 14054, + 16026, 18567, 20672, 22270, + 23952, 25771, 27658, 30026, + 4043, 5150, 7268, 9056, + 10916, 12638, 14543, 16184, + 17948, 19691, 21357, 22981, + 24825, 26591, 28479, 30233, + 2109, 2625, 4320, 5525, + 7454, 10220, 12980, 14698, + 17627, 19263, 20485, 22381, + 24279, 25777, 27847, 30458, + 1550, 2667, 6473, 9496, + 10985, 12352, 13795, 15233, + 17099, 18642, 20461, 22116, + 24197, 26291, 28403, 30132, + 2411, 3084, 4145, 5394, + 6367, 8154, 13125, 16049, + 17561, 19125, 21258, 22762, + 24459, 26317, 28255, 29702, + 4159, 4516, 5956, 7635, + 8254, 8980, 11208, 14133, + 16210, 17875, 20196, 21864, + 23840, 25747, 28058, 30012, + 2026, 2431, 2845, 3618, + 7950, 9802, 12721, 14460, + 16576, 18984, 21376, 23319, + 24961, 26718, 28971, 30640, + 3429, 3833, 4472, 4912, + 7723, 10386, 12981, 15322, + 16699, 18807, 20778, 22551, + 24627, 26494, 28334, 30482, + 4740, 5169, 5796, 6485, + 6998, 8830, 11777, 14414, + 16831, 18413, 20789, 22369, + 24236, 25835, 27807, 30021, + 150, 168, -17, -107, + -142, -229, -320, -406, + -503, -620, -867, -935, + -902, -680, -398, -114, + -398, -355, 49, 255, + 114, 260, 399, 264, + 317, 431, 514, 531, + 435, 356, 238, 106, + -43, -36, -169, -224, + -391, -633, -776, -970, + -844, -455, -181, -12, + 85, 85, 164, 195, + 122, 85, -158, -640, + -903, 9, 7, -124, + 149, 32, 220, 369, + 242, 115, 79, 84, + -146, -216, -70, 1024, + 751, 574, 440, 377, + 352, 203, 30, 16, + -3, 81, 161, 100, + -148, -176, 933, 750, + 404, 171, -2, -146, + -411, -442, -541, -552, + -442, -269, -240, -52, + 603, 635, 405, 178, + 215, 19, -153, -167, + -290, -219, 151, 271, + 151, 119, 303, 266, + 100, 69, -293, -657, + 939, 659, 442, 351, + 132, 98, -16, -1, + -135, -200, -223, -89, + 167, 154, 172, 237, + -45, -183, -228, -486, + 263, 608, 158, -125, + -390, -227, -118, 43, + -457, -392, -769, -840, + 20, -117, -194, -189, + -173, -173, -33, 32, + 174, 144, 115, 167, + 57, 44, 14, 147, + 96, -54, -142, -129, + -254, -331, 304, 310, + -52, -419, -846, -1060, + -88, -123, -202, -343, + -554, -961, -951, 327, + 159, 81, 255, 227, + 120, 203, 256, 192, + 164, 224, 290, 195, + 216, 209, 128, 832, + 1028, 889, 698, 504, + 408, 355, 218, 32, + -115, -84, -276, -100, + -312, -484, 899, 682, + 465, 456, 241, -12, + -275, -425, -461, -367, + -33, -28, -102, -194, + -527, 863, 906, 463, + 245, 13, -212, -305, + -105, 163, 279, 176, + 93, 67, 115, 192, + 61, -50, -132, -175, + -224, -271, -629, -252, + 1158, 972, 638, 280, + 300, 326, 143, -152, + -214, -287, 53, -42, + -236, -352, -423, -248, + -129, -163, -178, -119, + 85, 57, 514, 382, + 374, 402, 424, 423, + 271, 197, 97, 40, + 39, -97, -191, -164, + -230, -256, -410, 396, + 327, 127, 10, -119, + -167, -291, -274, -141, + -99, -226, -218, -139, + -224, -209, -268, -442, + -413, 222, 58, 521, + 344, 258, 76, -42, + -142, -165, -123, -92, + 47, 8, -3, -191, + -11, -164, -167, -351, + -740, 311, 538, 291, + 184, 29, -105, 9, + -30, -54, -17, -77, + -271, -412, -622, -648, + 476, 186, -66, -197, + -73, -94, -15, 47, + 28, 112, -58, -33, + 65, 19, 84, 86, + 276, 114, 472, 786, + 799, 625, 415, 178, + -35, -26, 5, 9, + 83, 39, 37, 39, + -184, -374, -265, -362, + -501, 337, 716, 478, + -60, -125, -163, 362, + 17, -122, -233, 279, + 138, 157, 318, 193, + 189, 209, 266, 252, + -46, -56, -277, -429, + 464, 386, 142, 44, + -43, 66, 264, 182, + 47, 14, -26, -79, + 49, 15, -128, -203, + -400, -478, 325, 27, + 234, 411, 205, 129, + 12, 58, 123, 57, + 171, 137, 96, 128, + -32, 134, -12, 57, + 119, 26, -22, -165, + -500, -701, -528, -116, + 64, -8, 97, -9, + -162, -66, -156, -194, + -303, -546, -341, 546, + 358, 95, 45, 76, + 270, 403, 205, 100, + 123, 50, -53, -144, + -110, -13, 32, -228, + -130, 353, 296, 56, + -372, -253, 365, 73, + 10, -34, -139, -191, + -96, 5, 44, -85, + -179, -129, -192, -246, + -85, -110, -155, -44, + -27, 145, 138, 79, + 32, -148, -577, -634, + 191, 94, -9, -35, + -77, -84, -56, -171, + -298, -271, -243, -156, + -328, -235, -76, -128, + -121, 129, 13, -22, + 32, 45, -248, -65, + 193, -81, 299, 57, + -147, 192, -165, -354, + -334, -106, -156, -40, + -3, -68, 124, -257, + 78, 124, 170, 412, + 227, 105, -104, 12, + 154, 250, 274, 258, + 4, -27, 235, 152, + 51, 338, 300, 7, + -314, -411, 215, 170, + -9, -93, -77, 76, + 67, 54, 200, 315, + 163, 72, -91, -402, + 158, 187, -156, -91, + 290, 267, 167, 91, + 140, 171, 112, 9, + -42, -177, -440, 385, + 80, 15, 172, 129, + 41, -129, -372, -24, + -75, -30, -170, 10, + -118, 57, 78, -101, + 232, 161, 123, 256, + 277, 101, -192, -629, + -100, -60, -232, 66, + 13, -13, -80, -239, + 239, 37, 32, 89, + -319, -579, 450, 360, + 3, -29, -299, -89, + -54, -110, -246, -164, + 6, -188, 338, 176, + -92, 197, 137, 134, + 12, -2, 56, -183, + 114, -36, -131, -204, + 75, -25, -174, 191, + -15, -290, -429, -267, + 79, 37, 106, 23, + -384, 425, 70, -14, + 212, 105, 15, -2, + -42, -37, -123, 108, + 28, -48, 193, 197, + 173, -33, 37, 73, + -57, 256, 137, -58, + -430, -228, 217, -51, + -10, -58, -6, 22, + 104, 61, -119, 169, + 144, 16, -46, -394, + 60, 454, -80, -298, + -65, 25, 0, -24, + -65, -417, 465, 276, + -3, -194, -13, 130, + 19, -6, -21, -24, + -180, -53, -85, 20, + 118, 147, 113, -75, + -289, 226, -122, 227, + 270, 125, 109, 197, + 125, 138, 44, 60, + 25, -55, -167, -32, + -139, -193, -173, -316, + 287, -208, 253, 239, + 27, -80, -188, -28, + -182, -235, 156, -117, + 128, -48, -58, -226, + 172, 181, 167, 19, + 62, 10, 2, 181, + 151, 108, -16, -11, + -78, -331, 411, 133, + 17, 104, 64, -184, + 24, -30, -3, -283, + 121, 204, -8, -199, + -21, -80, -169, -157, + -191, -136, 81, 155, + 14, -131, 244, 74, + -57, -47, -280, 347, + 111, -77, -128, -142, + -194, -125, -6, -68, + 91, 1, 23, 14, + -154, -34, 23, -38, + -343, 503, 146, -38, + -46, -41, 58, 31, + 63, -48, -117, 45, + 28, 1, -89, -5, + -44, -29, -448, 487, + 204, 81, 46, -106, + -302, 380, 120, -38, + -12, -39, 70, -3, + 25, -65, 30, -11, + 34, -15, 22, -115, + 0, -79, -83, 45, + 114, 43, 150, 36, + 233, 149, 195, 5, + 25, -52, -475, 274, + 28, -39, -8, -66, + -255, 258, 56, 143, + -45, -190, 165, -60, + 20, 2, 125, -129, + 51, -8, -335, 288, + 38, 59, 25, -42, + 23, -118, -112, 11, + -55, -133, -109, 24, + -105, 78, -64, -245, + 202, -65, -127, 162, + 40, -94, 89, -85, + -119, -103, 97, 9, + -70, -28, 194, 86, + -112, -92, -114, 74, + -49, 46, -84, -178, + 113, 52, -205, 333, + 88, 222, 56, -55, + 13, 86, 4, -77, + 224, 114, -105, 112, + 125, -29, -18, -144, + 22, -58, -99, 28, + 114, -66, -32, -169, + -314, 285, 72, -74, + 179, 28, -79, -182, + 13, -55, 147, 13, + 12, -54, 31, -84, + -17, -75, -228, 83, + -375, 436, 110, -63, + -27, -136, 169, -56, + -8, -171, 184, -42, + 148, 68, 204, 235, + 110, -229, 91, 171, + -43, -3, -26, -99, + -111, 71, -170, 202, + -67, 181, -37, 109, + -120, 3, -55, -260, + -16, 152, 91, 142, + 42, 44, 134, 47, + 17, -35, 22, 79, + -169, 41, 46, 277, + -93, -49, -126, 37, + -103, -34, -22, -90, + -134, -205, 92, -9, + 1, -195, -239, 45, + 54, 18, -23, -1, + -80, -98, -20, -261, + 306, 72, 20, -89, + -217, 11, 6, -82, + 89, 13, -129, -89, + 83, -71, -55, 130, + -98, -146, -27, -57, + 53, 275, 17, 170, + -5, -54, 132, -64, + 72, 160, -125, -168, + 72, 40, 170, 78, + 248, 116, 20, 84, + 31, -34, 190, 38, + 13, -106, 225, 27, + -168, 24, -157, -122, + 165, 11, -161, -213, + -12, -51, -101, 42, + 101, 27, 55, 111, + 75, 71, -96, -1, + 65, -277, 393, -26, + -44, -68, -84, -66, + -95, 235, 179, -25, + -41, 27, -91, -128, + -222, 146, -72, -30, + -24, 55, -126, -68, + -58, -127, 13, -97, + -106, 174, -100, 155, + 101, -146, -21, 261, + 22, 38, -66, 65, + 4, 70, 64, 144, + 59, 213, 71, -337, + 303, -52, 51, -56, + 1, 10, -15, -5, + 34, 52, 228, 131, + 161, -127, -214, 238, + 123, 64, -147, -50, + -34, -127, 204, 162, + 85, 41, 5, -140, + 73, -150, 56, -96, + -66, -20, 2, -235, + 59, -22, -107, 150, + -16, -47, -4, 81, + -67, 167, 149, 149, + -157, 288, -156, -27, + -8, 18, 83, -24, + -41, -167, 158, -100, + 93, 53, 201, 15, + 42, 266, 278, -12, + -6, -37, 85, 6, + 20, -188, -271, 107, + -13, -80, 51, 202, + 173, -69, 78, -188, + 46, 4, 153, 12, + -138, 169, 5, -58, + -123, -108, -243, 150, + 10, -191, 246, -15, + 38, 25, -10, 14, + 61, 50, -206, -215, + -220, 90, 5, -149, + -219, 56, 142, 24, + -376, 77, -80, 75, + 6, 42, -101, 16, + 56, 14, -57, 3, + -17, 80, 57, -36, + 88, -59, -97, -19, + -148, 46, -219, 226, + 114, -4, -72, -15, + 37, -49, -28, 247, + 44, 123, 47, -122, + -38, 17, 4, -113, + -32, -224, 154, -134, + 196, 71, -267, -85, + 28, -70, 89, -120, + 99, -2, 64, 76, + -166, -48, 189, -35, + -92, -169, -123, 339, + 38, -25, 38, -35, + 225, -139, -50, -63, + 246, 60, -185, -109, + -49, -53, -167, 51, + 149, 60, -101, -33, + 25, -76, 120, 32, + -30, -83, 102, 91, + -186, -261, 131, -197 +}; + +const SKP_Silk_NLSF_CBS SKP_Silk_NLSF_CB0_16_Stage_info[ NLSF_MSVQ_CB0_16_STAGES ] = +{ + { 128, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 0 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 0 ] }, + { 16, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 128 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 128 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 144 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 144 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 152 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 152 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 160 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 160 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 168 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 168 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 176 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 176 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 184 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 184 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 192 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 192 ] }, + { 16, &SKP_Silk_NLSF_MSVQ_CB0_16_Q15[ 16 * 200 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates_Q5[ 200 ] } +}; + +const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB0_16 = +{ + NLSF_MSVQ_CB0_16_STAGES, + SKP_Silk_NLSF_CB0_16_Stage_info, + SKP_Silk_NLSF_MSVQ_CB0_16_ndelta_min_Q15, + SKP_Silk_NLSF_MSVQ_CB0_16_CDF, + SKP_Silk_NLSF_MSVQ_CB0_16_CDF_start_ptr, + SKP_Silk_NLSF_MSVQ_CB0_16_CDF_middle_idx +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16.h new file mode 100755 index 0000000..ef4028d --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16.h @@ -0,0 +1,51 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_TABLES_NLSF_CB0_16_H +#define SKP_SILK_TABLES_NLSF_CB0_16_H + +#include "SKP_Silk_define.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define NLSF_MSVQ_CB0_16_STAGES 10 +#define NLSF_MSVQ_CB0_16_VECTORS 216 + +/* NLSF codebook entropy coding tables */ +extern const SKP_uint16 SKP_Silk_NLSF_MSVQ_CB0_16_CDF[ NLSF_MSVQ_CB0_16_VECTORS + NLSF_MSVQ_CB0_16_STAGES ]; +extern const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB0_16_CDF_start_ptr[ NLSF_MSVQ_CB0_16_STAGES ]; +extern const SKP_int SKP_Silk_NLSF_MSVQ_CB0_16_CDF_middle_idx[ NLSF_MSVQ_CB0_16_STAGES ]; + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16_FLP.c new file mode 100755 index 0000000..6cf71f7 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB0_16_FLP.c @@ -0,0 +1,1925 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/**********************************************/ +/* This file has been automatically generated */ +/* */ +/* ROM usage: 14.76 kB */ +/**********************************************/ + +#include "SKP_Silk_tables_FLP.h" +#include "SKP_Silk_tables_NLSF_CB0_16.h" + +const SKP_float SKP_Silk_NLSF_MSVQ_CB0_16_rates[ NLSF_MSVQ_CB0_16_VECTORS ] = +{ + 5.50000000000000000000f, 5.65625000000000000000f, + 5.68750000000000000000f, 5.71875000000000000000f, + 5.81250000000000000000f, 5.81250000000000000000f, + 5.96875000000000000000f, 5.96875000000000000000f, + 5.96875000000000000000f, 6.12500000000000000000f, + 6.15625000000000000000f, 6.28125000000000000000f, + 6.34375000000000000000f, 6.43750000000000000000f, + 6.43750000000000000000f, 6.43750000000000000000f, + 6.46875000000000000000f, 6.46875000000000000000f, + 6.53125000000000000000f, 6.53125000000000000000f, + 6.53125000000000000000f, 6.53125000000000000000f, + 6.56250000000000000000f, 6.56250000000000000000f, + 6.56250000000000000000f, 6.59375000000000000000f, + 6.59375000000000000000f, 6.59375000000000000000f, + 6.62500000000000000000f, 6.68750000000000000000f, + 6.75000000000000000000f, 6.75000000000000000000f, + 6.78125000000000000000f, 6.78125000000000000000f, + 6.78125000000000000000f, 6.78125000000000000000f, + 6.81250000000000000000f, 6.81250000000000000000f, + 6.84375000000000000000f, 6.84375000000000000000f, + 6.87500000000000000000f, 6.90625000000000000000f, + 6.93750000000000000000f, 6.96875000000000000000f, + 6.96875000000000000000f, 6.96875000000000000000f, + 6.96875000000000000000f, 7.00000000000000000000f, + 7.00000000000000000000f, 7.00000000000000000000f, + 7.03125000000000000000f, 7.03125000000000000000f, + 7.06250000000000000000f, 7.06250000000000000000f, + 7.06250000000000000000f, 7.06250000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.12500000000000000000f, 7.12500000000000000000f, + 7.12500000000000000000f, 7.12500000000000000000f, + 7.15625000000000000000f, 7.15625000000000000000f, + 7.15625000000000000000f, 7.18750000000000000000f, + 7.18750000000000000000f, 7.18750000000000000000f, + 7.21875000000000000000f, 7.21875000000000000000f, + 7.21875000000000000000f, 7.21875000000000000000f, + 7.25000000000000000000f, 7.25000000000000000000f, + 7.25000000000000000000f, 7.25000000000000000000f, + 7.28125000000000000000f, 7.31250000000000000000f, + 7.34375000000000000000f, 7.34375000000000000000f, + 7.34375000000000000000f, 7.37500000000000000000f, + 7.37500000000000000000f, 7.37500000000000000000f, + 7.37500000000000000000f, 7.40625000000000000000f, + 7.40625000000000000000f, 7.40625000000000000000f, + 7.40625000000000000000f, 7.50000000000000000000f, + 7.50000000000000000000f, 7.50000000000000000000f, + 7.50000000000000000000f, 7.53125000000000000000f, + 7.56250000000000000000f, 7.59375000000000000000f, + 7.62500000000000000000f, 7.62500000000000000000f, + 7.71875000000000000000f, 7.71875000000000000000f, + 7.75000000000000000000f, 7.75000000000000000000f, + 7.75000000000000000000f, 7.78125000000000000000f, + 7.84375000000000000000f, 7.96875000000000000000f, + 7.96875000000000000000f, 8.00000000000000000000f, + 8.12500000000000000000f, 8.12500000000000000000f, + 8.15625000000000000000f, 8.25000000000000000000f, + 8.25000000000000000000f, 8.31250000000000000000f, + 8.31250000000000000000f, 8.37500000000000000000f, + 8.46875000000000000000f, 8.56250000000000000000f, + 8.62500000000000000000f, 8.71875000000000000000f, + 9.00000000000000000000f, 9.00000000000000000000f, + 9.00000000000000000000f, 9.00000000000000000000f, + 3.68750000000000000000f, 3.75000000000000000000f, + 3.78125000000000000000f, 3.78125000000000000000f, + 3.81250000000000000000f, 3.90625000000000000000f, + 3.90625000000000000000f, 4.03125000000000000000f, + 4.03125000000000000000f, 4.06250000000000000000f, + 4.09375000000000000000f, 4.12500000000000000000f, + 4.25000000000000000000f, 4.28125000000000000000f, + 4.31250000000000000000f, 4.53125000000000000000f, + 2.71875000000000000000f, 2.75000000000000000000f, + 2.84375000000000000000f, 3.03125000000000000000f, + 3.06250000000000000000f, 3.12500000000000000000f, + 3.28125000000000000000f, 3.31250000000000000000f, + 2.87500000000000000000f, 2.96875000000000000000f, + 2.96875000000000000000f, 3.00000000000000000000f, + 3.03125000000000000000f, 3.03125000000000000000f, + 3.06250000000000000000f, 3.09375000000000000000f, + 2.75000000000000000000f, 2.87500000000000000000f, + 2.96875000000000000000f, 2.96875000000000000000f, + 3.00000000000000000000f, 3.03125000000000000000f, + 3.06250000000000000000f, 3.40625000000000000000f, + 2.90625000000000000000f, 2.90625000000000000000f, + 2.90625000000000000000f, 3.00000000000000000000f, + 3.03125000000000000000f, 3.03125000000000000000f, + 3.09375000000000000000f, 3.15625000000000000000f, + 2.90625000000000000000f, 2.93750000000000000000f, + 2.93750000000000000000f, 2.96875000000000000000f, + 2.96875000000000000000f, 3.09375000000000000000f, + 3.09375000000000000000f, 3.09375000000000000000f, + 2.90625000000000000000f, 2.90625000000000000000f, + 2.90625000000000000000f, 3.00000000000000000000f, + 3.00000000000000000000f, 3.03125000000000000000f, + 3.12500000000000000000f, 3.18750000000000000000f, + 2.90625000000000000000f, 2.96875000000000000000f, + 2.96875000000000000000f, 3.00000000000000000000f, + 3.00000000000000000000f, 3.00000000000000000000f, + 3.06250000000000000000f, 3.09375000000000000000f, + 3.90625000000000000000f, 3.90625000000000000000f, + 3.96875000000000000000f, 3.96875000000000000000f, + 3.96875000000000000000f, 3.96875000000000000000f, + 4.00000000000000000000f, 4.00000000000000000000f, + 4.00000000000000000000f, 4.00000000000000000000f, + 4.00000000000000000000f, 4.00000000000000000000f, + 4.03125000000000000000f, 4.06250000000000000000f, + 4.09375000000000000000f, 4.12500000000000000000f +}; + +const SKP_float SKP_Silk_NLSF_MSVQ_CB0_16_ndelta_min[ 16 + 1 ] = +{ + 0.00811767578125000000f, + 0.00009155273437500000f, + 0.00122070312500000000f, + 0.00009155273437500000f, + 0.00009155273437500000f, + 0.00048828125000000000f, + 0.00238037109375000000f, + 0.00271606445312500000f, + 0.00326538085937500000f, + 0.00430297851562500000f, + 0.00573730468750000000f, + 0.00445556640625000000f, + 0.00830078125000000000f, + 0.00732421874999999910f, + 0.00717163085937500000f, + 0.00656127929687500000f, + 0.01928710937500000000f +}; + +const SKP_float SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * NLSF_MSVQ_CB0_16_VECTORS ] = +{ + 0.03570556640625000000f, 0.06951904296875000000f, + 0.11163330078125001000f, 0.16400146484375000000f, + 0.23394775390625000000f, 0.27810668945312500000f, + 0.34478759765624994000f, 0.40600585937500000000f, + 0.46908569335937500000f, 0.53555297851562500000f, + 0.59774780273437500000f, 0.65573120117187500000f, + 0.72625732421875000000f, 0.79461669921875000000f, + 0.86419677734375000000f, 0.92166137695312500000f, + 0.04968261718750000700f, 0.07122802734375000000f, + 0.12557983398437500000f, 0.18420410156250000000f, + 0.23858642578125000000f, 0.29125976562500000000f, + 0.35940551757812500000f, 0.42788696289062500000f, + 0.48178100585937500000f, 0.53125000000000000000f, + 0.59405517578125000000f, 0.64883422851562500000f, + 0.69842529296875000000f, 0.74966430664062500000f, + 0.81524658203125000000f, 0.85629272460937500000f, + 0.05261230468750000000f, 0.08148193359375000000f, + 0.12377929687500000000f, 0.19934082031250000000f, + 0.25503540039062500000f, 0.30880737304687500000f, + 0.36904907226562506000f, 0.42910766601562500000f, + 0.50326538085937500000f, 0.57357788085937500000f, + 0.62307739257812500000f, 0.68365478515625000000f, + 0.74008178710937511000f, 0.80029296875000011000f, + 0.86700439453125000000f, 0.91418457031250000000f, + 0.04556274414062500000f, 0.10458374023437501000f, + 0.14614868164062500000f, 0.19528198242187500000f, + 0.25741577148437500000f, 0.31030273437500000000f, + 0.36621093750000000000f, 0.42926025390625000000f, + 0.49526977539062500000f, 0.55572509765625000000f, + 0.61157226562500000000f, 0.67437744140625000000f, + 0.73709106445312500000f, 0.79635620117187500000f, + 0.86007690429687500000f, 0.91921997070312489000f, + 0.03414916992187500000f, 0.06375122070312500000f, + 0.13107299804687500000f, 0.19058227539062500000f, + 0.26522827148437500000f, 0.32778930664062500000f, + 0.38720703125000000000f, 0.45950317382812500000f, + 0.51965332031250000000f, 0.57348632812500000000f, + 0.63223266601562500000f, 0.68707275390625011000f, + 0.74758911132812500000f, 0.81018066406250000000f, + 0.87338256835937500000f, 0.93475341796875000000f, + 0.04159545898437500000f, 0.07376098632812500000f, + 0.11984252929687500000f, 0.16955566406249997000f, + 0.22650146484375000000f, 0.28427124023437500000f, + 0.36251831054687500000f, 0.42013549804687500000f, + 0.49264526367187500000f, 0.56518554687500000000f, + 0.62432861328125000000f, 0.68902587890625000000f, + 0.74887084960937500000f, 0.80676269531250000000f, + 0.86419677734375000000f, 0.92523193359375000000f, + 0.03424072265625000000f, 0.07638549804687500000f, + 0.15917968750000000000f, 0.21813964843750000000f, + 0.28411865234375000000f, 0.33807373046874994000f, + 0.40206909179687500000f, 0.45166015625000000000f, + 0.51464843750000000000f, 0.57067871093750000000f, + 0.62365722656250000000f, 0.68627929687499989000f, + 0.74987792968750011000f, 0.81182861328125000000f, + 0.87142944335937500000f, 0.92852783203125000000f, + 0.01831054687500000000f, 0.04019165039062500700f, + 0.09063720703125001400f, 0.17117309570312500000f, + 0.23480224609375000000f, 0.29858398437500000000f, + 0.37136840820312500000f, 0.42990112304687506000f, + 0.49984741210937494000f, 0.56085205078125000000f, + 0.62716674804687500000f, 0.69232177734375000000f, + 0.75497436523437489000f, 0.81472778320312500000f, + 0.87420654296875000000f, 0.92636108398437500000f, + 0.02871704101562500000f, 0.05743408203125000000f, + 0.13043212890625000000f, 0.16906738281250000000f, + 0.25885009765625000000f, 0.30084228515625000000f, + 0.36437988281250000000f, 0.43600463867187494000f, + 0.49105834960937506000f, 0.56460571289062500000f, + 0.62030029296875000000f, 0.69006347656250000000f, + 0.75411987304687511000f, 0.81292724609374989000f, + 0.87933349609375000000f, 0.92864990234375000000f, + 0.01937866210937500000f, 0.05184936523437500000f, + 0.13354492187500000000f, 0.18151855468750000000f, + 0.24710083007812500000f, 0.30868530273437500000f, + 0.37457275390625000000f, 0.43267822265625000000f, + 0.49166870117187500000f, 0.54360961914062500000f, + 0.60104370117187500000f, 0.66445922851562511000f, + 0.73019409179687500000f, 0.78936767578124989000f, + 0.85516357421875000000f, 0.91961669921875000000f, + 0.04296874999999999300f, 0.06781005859375000000f, + 0.10754394531250000000f, 0.17135620117187503000f, + 0.22415161132812497000f, 0.27005004882812500000f, + 0.33535766601562500000f, 0.38977050781250000000f, + 0.46850585937500000000f, 0.51959228515625000000f, + 0.57736206054687500000f, 0.64276123046875000000f, + 0.71194458007812500000f, 0.76950073242187500000f, + 0.83035278320312511000f, 0.88571166992187500000f, + 0.02139282226562500000f, 0.03988647460937500000f, + 0.10827636718750001000f, 0.19229125976562500000f, + 0.23632812500000000000f, 0.29217529296875000000f, + 0.34262084960937494000f, 0.39605712890625000000f, + 0.46295166015625000000f, 0.53604125976562500000f, + 0.60348510742187500000f, 0.67434692382812500000f, + 0.73944091796875000000f, 0.80368041992187500000f, + 0.86599731445312500000f, 0.92257690429687500000f, + 0.05346679687500000700f, 0.07214355468750000000f, + 0.14889526367187500000f, 0.20046997070312500000f, + 0.23843383789062500000f, 0.29895019531250000000f, + 0.34176635742187500000f, 0.43609619140625006000f, + 0.48202514648437500000f, 0.54931640625000000000f, + 0.62243652343750000000f, 0.68411254882812489000f, + 0.74182128906250011000f, 0.79724121093750000000f, + 0.86547851562500000000f, 0.93484497070312500000f, + 0.02749633789062500000f, 0.04971313476562500000f, + 0.10241699218749999000f, 0.14144897460937500000f, + 0.22143554687500000000f, 0.26754760742187500000f, + 0.30429077148437500000f, 0.35272216796875000000f, + 0.46432495117187500000f, 0.53540039062500000000f, + 0.59579467773437500000f, 0.66687011718750000000f, + 0.72937011718750000000f, 0.79278564453125000000f, + 0.85855102539062500000f, 0.92114257812500000000f, + 0.02993774414062500000f, 0.05093383789062500000f, + 0.10140991210937499000f, 0.14321899414062500000f, + 0.18960571289062500000f, 0.26525878906250000000f, + 0.32391357421875006000f, 0.39538574218750000000f, + 0.46420288085937506000f, 0.54049682617187500000f, + 0.60595703125000000000f, 0.67510986328124989000f, + 0.74291992187500000000f, 0.81152343750000000000f, + 0.87655639648437500000f, 0.93020629882812500000f, + 0.04904174804687500000f, 0.07864379882812500000f, + 0.12878417968750000000f, 0.16821289062499997000f, + 0.26037597656250000000f, 0.31701660156250000000f, + 0.35482788085937500000f, 0.41720581054687494000f, + 0.48071289062500000000f, 0.52487182617187500000f, + 0.60546875000000000000f, 0.66708374023437500000f, + 0.71697998046875000000f, 0.78692626953125000000f, + 0.85726928710937500000f, 0.91952514648437500000f, + 0.02474975585937500000f, 0.04489135742187500000f, + 0.09594726562500000000f, 0.15383911132812500000f, + 0.22674560546875000000f, 0.28652954101562500000f, + 0.34100341796875000000f, 0.40451049804687500000f, + 0.46255493164062494000f, 0.51089477539062500000f, + 0.59762573242187500000f, 0.67648315429687500000f, + 0.73593139648437511000f, 0.79779052734375000000f, + 0.86618041992187500000f, 0.92758178710937500000f, + 0.04708862304687499300f, 0.06542968750000000000f, + 0.11074829101562500000f, 0.19369506835937500000f, + 0.22378540039062503000f, 0.28500366210937500000f, + 0.32684326171875000000f, 0.41491699218750006000f, + 0.46078491210937506000f, 0.52917480468750000000f, + 0.61346435546875000000f, 0.66790771484375000000f, + 0.72424316406250000000f, 0.78237915039062500000f, + 0.84893798828125000000f, 0.91299438476562511000f, + 0.01501464843750000000f, 0.03616333007812500000f, + 0.08972167968750000000f, 0.16748046875000003000f, + 0.21652221679687500000f, 0.26705932617187500000f, + 0.35388183593749994000f, 0.41439819335937500000f, + 0.48965454101562500000f, 0.54977416992187500000f, + 0.61578369140625000000f, 0.67526245117187500000f, + 0.74050903320312489000f, 0.80584716796875000000f, + 0.86926269531250000000f, 0.92642211914062500000f, + 0.04721069335937500000f, 0.06964111328125000000f, + 0.11270141601562500000f, 0.19351196289062500000f, + 0.23675537109374997000f, 0.29318237304687500000f, + 0.36157226562500000000f, 0.40393066406250000000f, + 0.50549316406250000000f, 0.55142211914062500000f, + 0.60299682617187500000f, 0.65319824218750011000f, + 0.73577880859375000000f, 0.81195068359375000000f, + 0.87847900390625000000f, 0.93551635742187511000f, + 0.02090454101562500000f, 0.04083251953125000000f, + 0.10403442382812500000f, 0.16058349609375000000f, + 0.21209716796875000000f, 0.28143310546875000000f, + 0.34832763671875000000f, 0.44320678710937500000f, + 0.49856567382812500000f, 0.54605102539062500000f, + 0.59313964843750000000f, 0.64996337890625000000f, + 0.71084594726562500000f, 0.76846313476562500000f, + 0.85366821289062500000f, 0.93139648437500000000f, + 0.02706909179687500300f, 0.04824829101562500000f, + 0.09329223632812500000f, 0.13177490234375000000f, + 0.21948242187500000000f, 0.26296997070312500000f, + 0.30661010742187500000f, 0.39996337890625000000f, + 0.49636840820312500000f, 0.54605102539062500000f, + 0.61746215820312500000f, 0.68206787109375000000f, + 0.74398803710937511000f, 0.80517578125000000000f, + 0.86407470703125000000f, 0.92129516601562489000f, + 0.06973266601562500000f, 0.11428833007812500000f, + 0.17279052734375000000f, 0.23120117187500000000f, + 0.28451538085937500000f, 0.34545898437500000000f, + 0.40402221679687500000f, 0.46359252929687494000f, + 0.52413940429687500000f, 0.58670043945312500000f, + 0.64416503906250000000f, 0.70104980468750000000f, + 0.75747680664062500000f, 0.81344604492187489000f, + 0.87161254882812500000f, 0.92956542968750000000f, + 0.04565429687500000700f, 0.06433105468750000000f, + 0.10522460937500000000f, 0.21051025390625003000f, + 0.25415039062500000000f, 0.29467773437500000000f, + 0.34338378906250000000f, 0.39132690429687500000f, + 0.45712280273437500000f, 0.50299072265625000000f, + 0.55480957031250000000f, 0.61294555664062500000f, + 0.70074462890624989000f, 0.76782226562500000000f, + 0.84548950195312500000f, 0.90420532226562500000f, + 0.01754760742187500000f, 0.03848266601562500000f, + 0.11782836914062500000f, 0.20223999023437500000f, + 0.25311279296875000000f, 0.32986450195312500000f, + 0.38772583007812500000f, 0.45068359375000000000f, + 0.52111816406250000000f, 0.58126831054687500000f, + 0.64019775390624989000f, 0.70358276367187500000f, + 0.76208496093750011000f, 0.81491088867187500000f, + 0.87646484375000000000f, 0.92605590820312500000f, + 0.05133056640625000000f, 0.06753540039062500000f, + 0.11846923828125000000f, 0.19036865234374997000f, + 0.21997070312500000000f, 0.29437255859375000000f, + 0.33193969726562500000f, 0.40988159179687500000f, + 0.45181274414062494000f, 0.49478149414062506000f, + 0.54751586914062500000f, 0.63699340820312489000f, + 0.71868896484375011000f, 0.78628540039062500000f, + 0.84704589843750000000f, 0.89907836914062500000f, + 0.02709960937500000000f, 0.04931640625000000000f, + 0.11975097656250000000f, 0.15853881835937500000f, + 0.21990966796875003000f, 0.26388549804687500000f, + 0.30035400390625000000f, 0.35012817382812500000f, + 0.49032592773437500000f, 0.55606079101562500000f, + 0.62081909179687500000f, 0.69500732421875000000f, + 0.74777221679687500000f, 0.80603027343750000000f, + 0.85614013671875000000f, 0.90731811523437500000f, + 0.02456665039062500000f, 0.04437255859375000000f, + 0.08187866210937500000f, 0.13647460937500000000f, + 0.24218750000000000000f, 0.28564453125000000000f, + 0.34783935546875000000f, 0.43777465820312500000f, + 0.49453735351562500000f, 0.54418945312500000000f, + 0.59365844726562500000f, 0.66058349609375000000f, + 0.72933959960937489000f, 0.79125976562500000000f, + 0.86630249023437511000f, 0.92965698242187500000f, + 0.05004882812500000000f, 0.07272338867187500000f, + 0.10632324218750000000f, 0.15509033203125000000f, + 0.18408203125000000000f, 0.26263427734375000000f, + 0.35522460937499994000f, 0.39569091796875000000f, + 0.48345947265625000000f, 0.53002929687500000000f, + 0.59039306640625000000f, 0.64642333984375000000f, + 0.72137451171875011000f, 0.79006958007812511000f, + 0.86572265625000000000f, 0.92465209960937500000f, + 0.04980468750000000000f, 0.06726074218750000000f, + 0.13763427734375000000f, 0.23132324218750003000f, + 0.26605224609375000000f, 0.32080078125000000000f, + 0.36505126953125000000f, 0.43017578125000000000f, + 0.47729492187500000000f, 0.52471923828125000000f, + 0.58419799804687500000f, 0.67892456054687511000f, + 0.74960327148437489000f, 0.81057739257812500000f, + 0.87292480468750000000f, 0.93106079101562500000f, + 0.06234741210937500000f, 0.07971191406250001400f, + 0.12161254882812500000f, 0.20907592773437500000f, + 0.24530029296875000000f, 0.29034423828125000000f, + 0.33505249023437500000f, 0.39028930664062500000f, + 0.47076416015625000000f, 0.51049804687500000000f, + 0.57675170898437500000f, 0.61880493164062500000f, + 0.69891357421875000000f, 0.79983520507812500000f, + 0.87619018554687500000f, 0.93438720703125011000f, + 0.06787109375000000000f, 0.08538818359375000000f, + 0.13626098632812500000f, 0.16235351562500000000f, + 0.21691894531249997000f, 0.28796386718750000000f, + 0.33526611328125000000f, 0.40350341796875000000f, + 0.44552612304687500000f, 0.55899047851562500000f, + 0.61465454101562500000f, 0.66659545898437500000f, + 0.72024536132812511000f, 0.78430175781250000000f, + 0.86010742187500000000f, 0.93328857421875000000f, + 0.02548217773437500000f, 0.04702758789062500000f, + 0.12460327148437500000f, 0.17605590820312503000f, + 0.22540283203125000000f, 0.28683471679687500000f, + 0.33480834960937500000f, 0.38012695312500000000f, + 0.45840454101562500000f, 0.56890869140625000000f, + 0.63607788085937500000f, 0.70495605468750000000f, + 0.77185058593750000000f, 0.82293701171875000000f, + 0.88354492187500000000f, 0.92840576171875011000f, + 0.05477905273437500000f, 0.07150268554687500000f, + 0.14675903320312500000f, 0.17993164062500003000f, + 0.21905517578125000000f, 0.26077270507812500000f, + 0.31198120117187500000f, 0.40802001953125000000f, + 0.44573974609375000000f, 0.50259399414062500000f, + 0.55764770507812500000f, 0.63281250000000000000f, + 0.72158813476562500000f, 0.80130004882812500000f, + 0.86132812500000000000f, 0.92742919921875000000f, + 0.05291748046875000000f, 0.06878662109375000000f, + 0.12301635742187500000f, 0.15832519531250000000f, + 0.19854736328125000000f, 0.24023437500000000000f, + 0.29452514648437500000f, 0.39749145507812500000f, + 0.44003295898437494000f, 0.52810668945312500000f, + 0.59494018554687500000f, 0.67718505859374989000f, + 0.74472045898437500000f, 0.80267333984375000000f, + 0.86044311523437500000f, 0.92092895507812500000f, + 0.05618286132812500000f, 0.07168579101562500000f, + 0.12109375000000000000f, 0.14538574218750000000f, + 0.19458007812500000000f, 0.29983520507812500000f, + 0.33715820312500000000f, 0.40725708007812500000f, + 0.44805908203125000000f, 0.49597167968750000000f, + 0.55490112304687500000f, 0.65194702148437500000f, + 0.72991943359375000000f, 0.79821777343750000000f, + 0.85543823242187500000f, 0.91354370117187500000f, + 0.04370117187500000000f, 0.06246948242187500000f, + 0.17184448242187500000f, 0.21139526367187500000f, + 0.25018310546875000000f, 0.29525756835937500000f, + 0.34661865234375000000f, 0.41217041015625000000f, + 0.45172119140625000000f, 0.50106811523437500000f, + 0.55966186523437500000f, 0.67196655273437500000f, + 0.73620605468750000000f, 0.79885864257812500000f, + 0.85845947265625000000f, 0.93341064453125000000f, + 0.05279541015625000700f, 0.07080078125000000000f, + 0.11425781250000000000f, 0.14672851562500000000f, + 0.18331909179687500000f, 0.29498291015625000000f, + 0.33560180664062500000f, 0.41571044921875000000f, + 0.46490478515625000000f, 0.53390502929687500000f, + 0.61303710937500000000f, 0.67144775390625000000f, + 0.72030639648437500000f, 0.77514648437500000000f, + 0.83554077148437489000f, 0.89276123046875000000f, + 0.03866577148437500000f, 0.05844116210937500000f, + 0.16732788085937503000f, 0.20788574218750000000f, + 0.25112915039062500000f, 0.30270385742187500000f, + 0.35366821289062494000f, 0.40701293945312500000f, + 0.45004272460937506000f, 0.54824829101562500000f, + 0.62719726562500000000f, 0.67648315429687500000f, + 0.74826049804687500000f, 0.81845092773437500000f, + 0.88143920898437500000f, 0.93511962890625000000f, + 0.04656982421875000000f, 0.06802368164062500000f, + 0.12939453125000000000f, 0.22546386718750000000f, + 0.27322387695312500000f, 0.31890869140625000000f, + 0.36312866210937500000f, 0.41864013671875006000f, + 0.51455688476562500000f, 0.55917358398437500000f, + 0.62191772460937500000f, 0.69189453125000000000f, + 0.75674438476562500000f, 0.82110595703125000000f, + 0.88214111328124989000f, 0.93450927734375000000f, + 0.06637573242187500000f, 0.08517456054687500000f, + 0.12524414062500000000f, 0.20980834960937500000f, + 0.26281738281250000000f, 0.29901123046875000000f, + 0.37084960937500000000f, 0.41308593750000000000f, + 0.47677612304687500000f, 0.53961181640625000000f, + 0.58633422851562500000f, 0.64270019531250000000f, + 0.74407958984375000000f, 0.81665039062499989000f, + 0.87380981445312500000f, 0.92309570312500000000f, + 0.01385498046875000000f, 0.03756713867187500000f, + 0.13241577148437500000f, 0.17510986328125000000f, + 0.23040771484375000000f, 0.27484130859375000000f, + 0.31494140625000000000f, 0.41275024414062506000f, + 0.48843383789062500000f, 0.54470825195312500000f, + 0.61251831054687500000f, 0.67114257812500000000f, + 0.73086547851562500000f, 0.79476928710937500000f, + 0.86196899414062511000f, 0.92086791992187489000f, + 0.06866455078125000000f, 0.08517456054687500000f, + 0.12908935546875000000f, 0.16122436523437500000f, + 0.20635986328125000000f, 0.32369995117187506000f, + 0.36251831054687500000f, 0.42178344726562500000f, + 0.48208618164062494000f, 0.52685546875000000000f, + 0.61123657226562500000f, 0.67950439453125000000f, + 0.75036621093750000000f, 0.80679321289062500000f, + 0.86193847656250000000f, 0.92831420898437489000f, + 0.05175781250000000000f, 0.06762695312500000000f, + 0.13146972656250000000f, 0.25588989257812500000f, + 0.29803466796875000000f, 0.33660888671875000000f, + 0.38317871093750000000f, 0.43026733398437500000f, + 0.49810791015625000000f, 0.53833007812500000000f, + 0.58489990234375000000f, 0.62835693359375000000f, + 0.73141479492187489000f, 0.81964111328125000000f, + 0.87884521484375000000f, 0.93267822265625000000f, + 0.07482910156250000000f, 0.09875488281250000000f, + 0.13333129882812500000f, 0.18670654296875000000f, + 0.21838378906250000000f, 0.27474975585937500000f, + 0.35122680664062500000f, 0.39050292968750000000f, + 0.48062133789062506000f, 0.52767944335937500000f, + 0.59481811523437500000f, 0.67874145507812500000f, + 0.74859619140625000000f, 0.80792236328125000000f, + 0.86282348632812489000f, 0.91775512695312511000f, + 0.05526733398437500000f, 0.07754516601562500000f, + 0.10848999023437500000f, 0.16723632812500000000f, + 0.27841186523437500000f, 0.32125854492187500000f, + 0.36297607421875000000f, 0.41683959960937500000f, + 0.46575927734374994000f, 0.51571655273437500000f, + 0.59100341796875000000f, 0.64297485351562511000f, + 0.69256591796875000000f, 0.74200439453125000000f, + 0.83178710937500000000f, 0.91500854492187500000f, + 0.04739379882812500000f, 0.06854248046875000000f, + 0.13912963867187500000f, 0.16784667968749997000f, + 0.20611572265625003000f, 0.24029541015625000000f, + 0.35824584960937500000f, 0.41415405273437500000f, + 0.46350097656250000000f, 0.54562377929687500000f, + 0.61892700195312500000f, 0.68695068359375000000f, + 0.75115966796875000000f, 0.81326293945312500000f, + 0.87847900390625000000f, 0.93856811523437500000f, + 0.06048583984375000000f, 0.08447265625000000000f, + 0.11700439453125001000f, 0.18200683593750000000f, + 0.26647949218750000000f, 0.30236816406250000000f, + 0.36001586914062500000f, 0.45205688476562500000f, + 0.49777221679687506000f, 0.54766845703125000000f, + 0.64382934570312500000f, 0.69735717773437500000f, + 0.74633789062500000000f, 0.80273437500000000000f, + 0.85955810546875000000f, 0.90805053710937511000f, + 0.05566406250000000000f, 0.07717895507812500000f, + 0.11648559570312500000f, 0.16629028320312500000f, + 0.20916748046875003000f, 0.26593017578125000000f, + 0.31680297851562500000f, 0.37493896484375006000f, + 0.43316650390625000000f, 0.48138427734375000000f, + 0.59582519531250000000f, 0.65228271484375000000f, + 0.72311401367187500000f, 0.79556274414062500000f, + 0.85742187500000000000f, 0.92199707031250011000f, + 0.06750488281250000000f, 0.08709716796875001400f, + 0.12045288085937500000f, 0.17999267578125000000f, + 0.30303955078125000000f, 0.35266113281250000000f, + 0.39227294921875000000f, 0.45129394531249994000f, + 0.49829101562500006000f, 0.54016113281250000000f, + 0.62014770507812500000f, 0.67437744140625000000f, + 0.72241210937500011000f, 0.77182006835937500000f, + 0.82324218750000011000f, 0.87237548828125000000f, + 0.06173706054687500000f, 0.07931518554687500000f, + 0.12280273437500000000f, 0.15002441406250000000f, + 0.20181274414062500000f, 0.34024047851562494000f, + 0.38015747070312500000f, 0.44635009765625000000f, + 0.49804687500000000000f, 0.54388427734375000000f, + 0.60037231445312500000f, 0.64611816406250000000f, + 0.70541381835937500000f, 0.79501342773437500000f, + 0.87966918945312500000f, 0.93865966796875000000f, + 0.04968261718750000700f, 0.06732177734375000000f, + 0.10580444335937500000f, 0.13317871093750000000f, + 0.26486206054687500000f, 0.31045532226562500000f, + 0.36206054687500000000f, 0.41744995117187500000f, + 0.45770263671874994000f, 0.51690673828125000000f, + 0.58615112304687500000f, 0.65197753906249989000f, + 0.72784423828125000000f, 0.79696655273437500000f, + 0.85827636718750000000f, 0.92385864257812500000f, + 0.06146240234375000000f, 0.07943725585937500000f, + 0.12554931640625000000f, 0.22137451171875000000f, + 0.25988769531250000000f, 0.30648803710937500000f, + 0.36077880859375000000f, 0.41207885742187500000f, + 0.49832153320312500000f, 0.54400634765625000000f, + 0.60110473632812500000f, 0.64941406250000000000f, + 0.70651245117187500000f, 0.75259399414062500000f, + 0.81808471679687500000f, 0.92044067382812511000f, + 0.07250976562500000000f, 0.09094238281250000000f, + 0.13494873046875000000f, 0.17608642578125000000f, + 0.21411132812500000000f, 0.29672241210937500000f, + 0.33950805664062506000f, 0.41247558593750000000f, + 0.47256469726562506000f, 0.51834106445312500000f, + 0.58471679687500000000f, 0.62826538085937500000f, + 0.74465942382812500000f, 0.82946777343750000000f, + 0.88641357421875000000f, 0.93527221679687500000f, + 0.07489013671875000000f, 0.10687255859375000000f, + 0.14111328125000000000f, 0.18368530273437500000f, + 0.23291015625000000000f, 0.27005004882812500000f, + 0.32934570312500000000f, 0.42614746093750000000f, + 0.47372436523437500000f, 0.52139282226562500000f, + 0.59848022460937500000f, 0.64813232421875000000f, + 0.69750976562500000000f, 0.76623535156249989000f, + 0.85772705078125011000f, 0.91217041015625000000f, + 0.04800415039062500700f, 0.06939697265625000000f, + 0.10095214843750000000f, 0.18307495117187500000f, + 0.27395629882812500000f, 0.30834960937500000000f, + 0.38015747070312500000f, 0.43511962890625000000f, + 0.48062133789062506000f, 0.55480957031250000000f, + 0.60955810546875000000f, 0.64859008789062500000f, + 0.70327758789062500000f, 0.76470947265625000000f, + 0.84658813476562500000f, 0.92514038085937500000f, + 0.05929565429687500000f, 0.08331298828125000000f, + 0.12634277343750000000f, 0.18798828125000003000f, + 0.22860717773437500000f, 0.27423095703125000000f, + 0.34512329101562500000f, 0.38986206054687500000f, + 0.45227050781250000000f, 0.50531005859375000000f, + 0.54653930664062500000f, 0.60293579101562500000f, + 0.65649414062500011000f, 0.72036743164062500000f, + 0.83233642578124989000f, 0.90109252929687500000f, + 0.06167602539062500000f, 0.07879638671875000000f, + 0.13714599609375000000f, 0.17807006835937503000f, + 0.21340942382812497000f, 0.25161743164062500000f, + 0.29989624023437500000f, 0.44961547851562500000f, + 0.50238037109375000000f, 0.54608154296875000000f, + 0.59957885742187500000f, 0.64340209960937489000f, + 0.72521972656250000000f, 0.81381225585937500000f, + 0.88720703125000000000f, 0.94573974609375000000f, + 0.03210449218750000000f, 0.05416870117187500000f, + 0.09820556640624998600f, 0.13360595703125000000f, + 0.23394775390625000000f, 0.28695678710937500000f, + 0.34326171875000000000f, 0.40670776367187500000f, + 0.45690917968750000000f, 0.54815673828125000000f, + 0.63348388671875000000f, 0.68218994140625000000f, + 0.76510620117187500000f, 0.83035278320312511000f, + 0.88504028320312500000f, 0.93411254882812489000f, + 0.06768798828125000000f, 0.08746337890624998600f, + 0.12887573242187500000f, 0.16333007812500000000f, + 0.20083618164062500000f, 0.30456542968750000000f, + 0.35360717773437500000f, 0.40042114257812500000f, + 0.46365356445312500000f, 0.50607299804687500000f, + 0.56109619140625000000f, 0.61279296875000000000f, + 0.67178344726562500000f, 0.77261352539062500000f, + 0.85836791992187500000f, 0.91186523437500011000f, + 0.06549072265625000000f, 0.08666992187500000000f, + 0.13418579101562500000f, 0.17822265625000000000f, + 0.22732543945312500000f, 0.26614379882812500000f, + 0.32080078125000000000f, 0.36425781250000000000f, + 0.41488647460937500000f, 0.52651977539062500000f, + 0.58929443359375000000f, 0.63754272460937500000f, + 0.71463012695312500000f, 0.78207397460937500000f, + 0.84683227539062500000f, 0.92257690429687500000f, + 0.06018066406250000000f, 0.07992553710937500000f, + 0.11462402343750000000f, 0.19430541992187500000f, + 0.23318481445312503000f, 0.26898193359375000000f, + 0.37493896484375006000f, 0.42016601562500000000f, + 0.46719360351562506000f, 0.55041503906250000000f, + 0.59683227539062500000f, 0.63793945312500000000f, + 0.68914794921875011000f, 0.75915527343750000000f, + 0.84838867187500000000f, 0.92895507812500000000f, + 0.06118774414062500000f, 0.07864379882812500000f, + 0.13037109375000000000f, 0.22500610351562500000f, + 0.26116943359375000000f, 0.31198120117187500000f, + 0.35919189453125000000f, 0.40899658203125000000f, + 0.50360107421875000000f, 0.54931640625000000000f, + 0.59951782226562500000f, 0.64404296875000000000f, + 0.70159912109375000000f, 0.81805419921875000000f, + 0.90042114257812489000f, 0.94427490234375000000f, + 0.03518676757812500000f, 0.05560302734375000000f, + 0.11364746093750001000f, 0.16610717773437500000f, + 0.21331787109375000000f, 0.26556396484375000000f, + 0.31399536132812500000f, 0.36312866210937500000f, + 0.42285156250000000000f, 0.46737670898437500000f, + 0.53713989257812500000f, 0.64282226562500000000f, + 0.72302246093750011000f, 0.79598999023437500000f, + 0.87237548828125000000f, 0.93502807617187500000f, + 0.03979492187500000000f, 0.05703735351562500000f, + 0.10125732421875000000f, 0.21957397460937500000f, + 0.29336547851562500000f, 0.32754516601562500000f, + 0.37820434570312500000f, 0.41894531250000000000f, + 0.48284912109375000000f, 0.53326416015625000000f, + 0.57623291015625000000f, 0.63146972656250000000f, + 0.70538330078125000000f, 0.77941894531250000000f, + 0.84484863281250000000f, 0.89245605468750011000f, + 0.06387329101562500000f, 0.08212280273437500000f, + 0.12261962890625000000f, 0.20318603515625000000f, + 0.24252319335937500000f, 0.27914428710937500000f, + 0.32034301757812500000f, 0.36257934570312500000f, + 0.48486328125000006000f, 0.54385375976562500000f, + 0.58999633789062500000f, 0.64797973632812500000f, + 0.71322631835937489000f, 0.77008056640625000000f, + 0.84085083007812500000f, 0.91546630859375000000f, + 0.01754760742187500000f, 0.04061889648437499300f, + 0.16186523437500000000f, 0.21087646484374997000f, + 0.25711059570312500000f, 0.30780029296875000000f, + 0.35330200195312500000f, 0.41192626953125006000f, + 0.50183105468750000000f, 0.56539916992187500000f, + 0.62759399414062500000f, 0.69723510742187500000f, + 0.76031494140625000000f, 0.81457519531249989000f, + 0.87765502929687500000f, 0.92031860351562500000f, + 0.04379272460937500000f, 0.06176757812500000000f, + 0.10018920898437500000f, 0.12683105468750000000f, + 0.23226928710937500000f, 0.32324218750000000000f, + 0.36770629882812506000f, 0.42501831054687500000f, + 0.47177124023437500000f, 0.56192016601562500000f, + 0.62545776367187500000f, 0.67962646484375000000f, + 0.73919677734375000000f, 0.79629516601562489000f, + 0.85647583007812500000f, 0.91854858398437500000f, + 0.04980468750000000000f, 0.06616210937500000000f, + 0.16906738281250000000f, 0.22821044921875000000f, + 0.26336669921875000000f, 0.31710815429687500000f, + 0.35534667968750000000f, 0.43704223632812494000f, + 0.48037719726562500000f, 0.52969360351562500000f, + 0.57238769531250000000f, 0.62359619140625000000f, + 0.69577026367187500000f, 0.79528808593750000000f, + 0.87103271484375000000f, 0.93676757812500000000f, + 0.04293823242187500000f, 0.06851196289062500000f, + 0.10391235351562501000f, 0.17208862304687500000f, + 0.28744506835937500000f, 0.32608032226562506000f, + 0.36938476562500000000f, 0.41183471679687494000f, + 0.47409057617187500000f, 0.56021118164062500000f, + 0.61022949218750000000f, 0.66189575195312500000f, + 0.74313354492187500000f, 0.81024169921874989000f, + 0.88052368164062500000f, 0.93273925781250011000f, + 0.05111694335937500700f, 0.06793212890625000000f, + 0.12222290039062501000f, 0.25094604492187500000f, + 0.30441284179687500000f, 0.34042358398437500000f, + 0.39129638671875000000f, 0.43688964843750000000f, + 0.50366210937500000000f, 0.55349731445312500000f, + 0.59735107421875000000f, 0.64239501953125000000f, + 0.69454956054687500000f, 0.76025390625000000000f, + 0.86352539062500011000f, 0.93487548828125000000f, + 0.03295898437500000000f, 0.04925537109375000000f, + 0.11053466796875000000f, 0.23086547851562497000f, + 0.26696777343750000000f, 0.31442260742187500000f, + 0.35745239257812500000f, 0.42260742187500000000f, + 0.47708129882812500000f, 0.53204345703125000000f, + 0.60305786132812500000f, 0.66604614257812500000f, + 0.71932983398437500000f, 0.77493286132812500000f, + 0.83636474609375000000f, 0.88693237304687500000f, + 0.05166625976562500000f, 0.06802368164062500000f, + 0.10546875000000000000f, 0.13287353515625000000f, + 0.17303466796875000000f, 0.33233642578125000000f, + 0.38339233398437500000f, 0.43234252929687500000f, + 0.48458862304687500000f, 0.53030395507812500000f, + 0.60476684570312500000f, 0.67050170898437500000f, + 0.73529052734375000000f, 0.79745483398437500000f, + 0.86358642578125000000f, 0.91854858398437500000f, + 0.06231689453125000000f, 0.09030151367187501400f, + 0.12802124023437500000f, 0.17517089843750000000f, + 0.21685791015625000000f, 0.25228881835937500000f, + 0.33953857421875000000f, 0.45693969726562500000f, + 0.51617431640625000000f, 0.55831909179687500000f, + 0.62658691406250000000f, 0.67083740234375000000f, + 0.72360229492187500000f, 0.78640747070312500000f, + 0.84255981445312511000f, 0.89572143554687500000f, + 0.03002929687500000000f, 0.04919433593750000000f, + 0.11621093750000000000f, 0.16067504882812500000f, + 0.21011352539062500000f, 0.25668334960937500000f, + 0.29135131835937500000f, 0.33230590820312500000f, + 0.38214111328125000000f, 0.50415039062500000000f, + 0.59658813476562500000f, 0.66036987304687500000f, + 0.72467041015625011000f, 0.79522705078125000000f, + 0.86395263671874989000f, 0.92694091796875011000f, + 0.06213378906250000000f, 0.07745361328125000000f, + 0.12713623046875000000f, 0.23684692382812500000f, + 0.27911376953125000000f, 0.31774902343750000000f, + 0.37060546875000006000f, 0.41531372070312500000f, + 0.47570800781250000000f, 0.52395629882812500000f, + 0.56637573242187500000f, 0.61380004882812500000f, + 0.66589355468750000000f, 0.74197387695312500000f, + 0.85537719726562489000f, 0.93420410156249989000f, + 0.05709838867187500000f, 0.07186889648437500000f, + 0.12393188476562500000f, 0.15695190429687500000f, + 0.22778320312500000000f, 0.30911254882812500000f, + 0.36441040039062506000f, 0.45779418945312506000f, + 0.50903320312500000000f, 0.56011962890625000000f, + 0.60903930664062500000f, 0.67990112304687500000f, + 0.75869750976562489000f, 0.82006835937500000000f, + 0.88464355468750000000f, 0.93429565429687511000f, + 0.07830810546875000000f, 0.09646606445312500000f, + 0.14169311523437500000f, 0.19003295898437500000f, + 0.22601318359375000000f, 0.30426025390625000000f, + 0.35455322265625000000f, 0.40942382812500000000f, + 0.48489379882812500000f, 0.52990722656250000000f, + 0.58352661132812500000f, 0.63528442382812500000f, + 0.68945312500000000000f, 0.75439453125000000000f, + 0.87686157226562489000f, 0.94854736328125000000f, + 0.05187988281249999300f, 0.07101440429687500000f, + 0.14733886718750000000f, 0.18124389648437500000f, + 0.23092651367187500000f, 0.27935791015625000000f, + 0.33834838867187500000f, 0.38973999023437500000f, + 0.43362426757812506000f, 0.49197387695312500000f, + 0.61712646484375000000f, 0.69186401367187500000f, + 0.75219726562500000000f, 0.81347656250000000000f, + 0.87573242187499989000f, 0.93826293945312500000f, + 0.09671020507812500000f, 0.11819458007812501000f, + 0.15399169921875000000f, 0.20959472656250000000f, + 0.24975585937500000000f, 0.28930664062500000000f, + 0.37643432617187500000f, 0.42932128906250000000f, + 0.48138427734375000000f, 0.54843139648437500000f, + 0.61740112304687500000f, 0.66256713867187500000f, + 0.71777343750000000000f, 0.77041625976562500000f, + 0.82476806640625000000f, 0.87677001953124989000f, + 0.04772949218750000000f, 0.07296752929687500000f, + 0.12905883789062500000f, 0.20538330078125000000f, + 0.27175903320312500000f, 0.31918334960937500000f, + 0.39752197265625000000f, 0.45877075195312500000f, + 0.52688598632812500000f, 0.60452270507812500000f, + 0.66677856445312500000f, 0.72451782226562500000f, + 0.77789306640625000000f, 0.83349609375000000000f, + 0.88687133789062500000f, 0.93161010742187511000f, + 0.08740234375000000000f, 0.10861206054687501000f, + 0.14401245117187500000f, 0.19656372070312503000f, + 0.29272460937500000000f, 0.33737182617187500000f, + 0.38949584960937500000f, 0.45117187500000000000f, + 0.50134277343750000000f, 0.55432128906250000000f, + 0.62518310546875000000f, 0.67938232421875000000f, + 0.73800659179687511000f, 0.80148315429687500000f, + 0.86618041992187500000f, 0.92236328125000000000f, + 0.08157348632812498600f, 0.10525512695312501000f, + 0.13980102539062500000f, 0.18258666992187500000f, + 0.20944213867187500000f, 0.25363159179687500000f, + 0.38037109375000000000f, 0.42453002929687506000f, + 0.48028564453125000000f, 0.54293823242187500000f, + 0.59252929687500000000f, 0.64642333984375000000f, + 0.73318481445312500000f, 0.81057739257812500000f, + 0.87655639648437500000f, 0.92895507812500000000f, + 0.07382202148437500000f, 0.09304809570312500000f, + 0.13043212890625000000f, 0.19482421875000000000f, + 0.26135253906250000000f, 0.29483032226562500000f, + 0.34448242187499994000f, 0.38684082031250000000f, + 0.44088745117187500000f, 0.53643798828125000000f, + 0.60473632812500000000f, 0.64791870117187511000f, + 0.70492553710937500000f, 0.77117919921874989000f, + 0.82089233398437500000f, 0.88275146484374989000f, + 0.03900146484375000000f, 0.06106567382812500000f, + 0.09155273437500000000f, 0.16336059570312500000f, + 0.30502319335937500000f, 0.35940551757812500000f, + 0.39727783203125000000f, 0.44464111328125000000f, + 0.48980712890625000000f, 0.54205322265625000000f, + 0.60980224609375000000f, 0.65969848632812511000f, + 0.71322631835937489000f, 0.76547241210937500000f, + 0.84399414062500000000f, 0.92077636718749989000f, + 0.02844238281250000000f, 0.04956054687500000000f, + 0.08538818359375000000f, 0.13946533203125000000f, + 0.26220703125000000000f, 0.30480957031250000000f, + 0.35253906249999994000f, 0.39825439453125000000f, + 0.51638793945312500000f, 0.56997680664062500000f, + 0.62301635742187500000f, 0.69610595703125000000f, + 0.75735473632812500000f, 0.81845092773437500000f, + 0.87902832031250011000f, 0.92727661132812489000f, + 0.07092285156250000000f, 0.09072875976562500000f, + 0.12683105468750000000f, 0.17401123046875000000f, + 0.21115112304687500000f, 0.26873779296875000000f, + 0.31307983398437500000f, 0.38156127929687494000f, + 0.45822143554687494000f, 0.50558471679687500000f, + 0.59259033203125000000f, 0.65231323242187500000f, + 0.70016479492187500000f, 0.74920654296875000000f, + 0.82470703124999989000f, 0.91091918945312500000f, + 0.04772949218750000000f, 0.07241821289062500000f, + 0.10543823242187499000f, 0.14974975585937500000f, + 0.18234252929687500000f, 0.22692871093750000000f, + 0.35968017578125000000f, 0.44265747070312500000f, + 0.49154663085937500000f, 0.55383300781250000000f, + 0.61093139648437500000f, 0.66079711914062500000f, + 0.72448730468749989000f, 0.78778076171875000000f, + 0.87213134765625000000f, 0.92687988281250000000f, + 0.09231567382812501400f, 0.11380004882812500000f, + 0.14849853515625000000f, 0.19897460937500000000f, + 0.28952026367187500000f, 0.33395385742187500000f, + 0.37713623046875000000f, 0.43511962890625000000f, + 0.49359130859375000000f, 0.53408813476562500000f, + 0.59436035156250000000f, 0.65332031250000000000f, + 0.70883178710937500000f, 0.76007080078125000000f, + 0.83456420898437500000f, 0.89743041992187500000f, + 0.03875732421875000000f, 0.05996704101562500000f, + 0.20758056640625000000f, 0.24398803710937500000f, + 0.28088378906250000000f, 0.33044433593750000000f, + 0.38168334960937500000f, 0.43426513671875000000f, + 0.48092651367187500000f, 0.54504394531250000000f, + 0.62161254882812500000f, 0.68670654296875000000f, + 0.75173950195312500000f, 0.80914306640625000000f, + 0.87081909179687500000f, 0.93154907226562500000f, + 0.06744384765625000000f, 0.08389282226562500000f, + 0.13018798828125000000f, 0.22848510742187503000f, + 0.30145263671875000000f, 0.33624267578125000000f, + 0.39132690429687500000f, 0.44039916992187500000f, + 0.49581909179687494000f, 0.56842041015625000000f, + 0.62408447265625000000f, 0.67303466796875011000f, + 0.72445678710937500000f, 0.77182006835937500000f, + 0.82623291015625000000f, 0.89016723632812500000f, + 0.03890991210937500000f, 0.05877685546875000000f, + 0.13214111328125000000f, 0.20059204101562503000f, + 0.25759887695312500000f, 0.33325195312500000000f, + 0.40466308593750000000f, 0.45800781249999994000f, + 0.51657104492187500000f, 0.56680297851562500000f, + 0.63000488281250000000f, 0.67800903320312500000f, + 0.73190307617187500000f, 0.77740478515625000000f, + 0.83532714843750000000f, 0.87417602539062489000f, + 0.09201049804687500000f, 0.11199951171875000000f, + 0.15521240234375000000f, 0.19445800781250000000f, + 0.24072265625000000000f, 0.28408813476562500000f, + 0.33465576171875006000f, 0.38580322265624994000f, + 0.44235229492187500000f, 0.49353027343750000000f, + 0.55175781250000000000f, 0.60949707031250000000f, + 0.68524169921874989000f, 0.75985717773437500000f, + 0.83502197265624989000f, 0.91476440429687500000f, + 0.08795166015625001400f, 0.11392211914062500000f, + 0.15603637695312500000f, 0.19781494140625000000f, + 0.24795532226562503000f, 0.29556274414062500000f, + 0.35394287109375000000f, 0.40551757812500006000f, + 0.47012329101562500000f, 0.52465820312500000000f, + 0.61578369140625000000f, 0.68438720703125011000f, + 0.75686645507812500000f, 0.82440185546875000000f, + 0.89147949218750000000f, 0.94027709960937511000f, + 0.07019042968750000000f, 0.09057617187500000000f, + 0.12515258789062500000f, 0.16607666015625000000f, + 0.19308471679687500000f, 0.24139404296875000000f, + 0.38009643554687500000f, 0.42303466796875000000f, + 0.48056030273437500000f, 0.53421020507812500000f, + 0.58145141601562500000f, 0.63107299804687500000f, + 0.69015502929687500000f, 0.75250244140625000000f, + 0.83920288085937500000f, 0.91751098632812500000f, + 0.06887817382812500000f, 0.08972167968750000000f, + 0.13519287109375000000f, 0.18283081054687497000f, + 0.21490478515624997000f, 0.25524902343750000000f, + 0.28729248046875000000f, 0.34252929687500000000f, + 0.47982788085937500000f, 0.53161621093750000000f, + 0.58755493164062500000f, 0.65518188476562489000f, + 0.72982788085937500000f, 0.79507446289062500000f, + 0.86761474609375000000f, 0.92724609375000000000f, + 0.03744506835937500000f, 0.06240844726562500000f, + 0.11651611328124999000f, 0.15292358398437500000f, + 0.21331787109375000000f, 0.28170776367187500000f, + 0.33642578124999994000f, 0.39706420898437494000f, + 0.52920532226562500000f, 0.58035278320312500000f, + 0.62814331054687500000f, 0.69577026367187500000f, + 0.76889038085937500000f, 0.82019042968750000000f, + 0.89572143554687500000f, 0.94009399414062489000f, + 0.04132080078125000000f, 0.05871582031250000000f, + 0.11563110351562500000f, 0.24649047851562500000f, + 0.31900024414062500000f, 0.35519409179687500000f, + 0.40747070312500000000f, 0.45217895507812500000f, + 0.51095581054687500000f, 0.55508422851562500000f, + 0.61325073242187500000f, 0.67181396484374989000f, + 0.75051879882812500000f, 0.81411743164062500000f, + 0.87423706054687500000f, 0.92333984375000000000f, + 0.09588623046875000000f, 0.12356567382812501000f, + 0.18911743164062500000f, 0.22634887695312500000f, + 0.26712036132812500000f, 0.30993652343750000000f, + 0.35195922851562500000f, 0.40225219726562500000f, + 0.48666381835937500000f, 0.53878784179687500000f, + 0.59832763671875000000f, 0.65313720703125000000f, + 0.71676635742187500000f, 0.78305053710937511000f, + 0.85824584960937511000f, 0.92480468750000000000f, + 0.04019165039062500700f, 0.06906127929687500000f, + 0.14419555664062500000f, 0.23226928710937500000f, + 0.29501342773437500000f, 0.35504150390625000000f, + 0.43161010742187500000f, 0.49615478515625000000f, + 0.57141113281250000000f, 0.63165283203125000000f, + 0.68295288085937500000f, 0.73263549804687511000f, + 0.78659057617187489000f, 0.83163452148437500000f, + 0.88287353515625000000f, 0.93362426757812500000f, + 0.04791259765625000000f, 0.07089233398437500000f, + 0.11651611328124999000f, 0.18966674804687500000f, + 0.30191040039062500000f, 0.35266113281250000000f, + 0.39886474609375000000f, 0.44650268554687500000f, + 0.49291992187500006000f, 0.55816650390625000000f, + 0.65264892578125000000f, 0.71246337890625000000f, + 0.76641845703125011000f, 0.82162475585937500000f, + 0.87622070312500000000f, 0.92065429687500000000f, + 0.07009887695312500000f, 0.11917114257812500000f, + 0.19186401367187503000f, 0.26116943359375000000f, + 0.32556152343750006000f, 0.38958740234375000000f, + 0.45834350585937500000f, 0.52191162109375000000f, + 0.58093261718750000000f, 0.63101196289062500000f, + 0.68179321289062500000f, 0.72848510742187500000f, + 0.77752685546875000000f, 0.82656860351562500000f, + 0.88046264648437500000f, 0.93139648437500000000f, + 0.05844116210937500000f, 0.07650756835937500000f, + 0.12307739257812499000f, 0.17544555664062500000f, + 0.21542358398437497000f, 0.27072143554687500000f, + 0.32528686523437500000f, 0.37225341796875006000f, + 0.42532348632812500000f, 0.46945190429687500000f, + 0.51480102539062500000f, 0.57089233398437500000f, + 0.70724487304687489000f, 0.78790283203125011000f, + 0.87017822265625000000f, 0.93081665039062500000f, + 0.07336425781250000000f, 0.08905029296875000000f, + 0.15838623046875000000f, 0.19079589843750000000f, + 0.22662353515625003000f, 0.30172729492187500000f, + 0.37802124023437500000f, 0.45150756835937494000f, + 0.51129150390625000000f, 0.56054687500000000000f, + 0.62066650390625000000f, 0.67147827148437511000f, + 0.73962402343750000000f, 0.80737304687500000000f, + 0.86944580078125000000f, 0.92764282226562500000f, + 0.04946899414062500000f, 0.06796264648437500000f, + 0.10617065429687500000f, 0.15518188476562500000f, + 0.28762817382812500000f, 0.39343261718750006000f, + 0.43475341796875006000f, 0.47766113281250000000f, + 0.52505493164062500000f, 0.56988525390625000000f, + 0.62396240234375000000f, 0.67776489257812500000f, + 0.72564697265625000000f, 0.78939819335937500000f, + 0.85238647460937500000f, 0.91836547851562500000f, + 0.05703735351562500000f, 0.07293701171875000000f, + 0.12527465820312500000f, 0.21426391601562500000f, + 0.34243774414062500000f, 0.38986206054687500000f, + 0.42904663085937500000f, 0.47576904296875006000f, + 0.51953125000000000000f, 0.56787109375000000000f, + 0.62850952148437500000f, 0.67367553710937500000f, + 0.72171020507812489000f, 0.76763916015625000000f, + 0.82135009765625000000f, 0.87496948242187500000f, + 0.07785034179687500000f, 0.09924316406250000000f, + 0.14306640625000000000f, 0.20025634765625000000f, + 0.24014282226562500000f, 0.27847290039062500000f, + 0.31967163085937506000f, 0.36010742187500000000f, + 0.47003173828125000000f, 0.57312011718750000000f, + 0.64062500000000000000f, 0.68832397460937500000f, + 0.74124145507812500000f, 0.79248046874999989000f, + 0.83816528320312500000f, 0.89208984375000000000f, + 0.08255004882812500000f, 0.10659790039062501000f, + 0.14450073242187500000f, 0.19409179687500000000f, + 0.24124145507812503000f, 0.28540039062500000000f, + 0.35211181640625006000f, 0.40985107421875000000f, + 0.46505737304687500000f, 0.51632690429687500000f, + 0.56820678710937500000f, 0.61322021484375000000f, + 0.66528320312500000000f, 0.71234130859375000000f, + 0.76904296875000000000f, 0.89285278320312500000f, + 0.06610107421875000000f, 0.08517456054687500000f, + 0.12240600585937499000f, 0.15505981445312500000f, + 0.17993164062500003000f, 0.27581787109375000000f, + 0.40914916992187494000f, 0.44869995117187506000f, + 0.50485229492187500000f, 0.55508422851562500000f, + 0.60717773437500000000f, 0.66702270507812500000f, + 0.75903320312500000000f, 0.82308959960937500000f, + 0.88363647460937500000f, 0.93121337890625000000f, + 0.05691528320312499300f, 0.09219360351562500000f, + 0.14331054687500000000f, 0.19940185546875003000f, + 0.25460815429687500000f, 0.30255126953125000000f, + 0.39028930664062500000f, 0.43038940429687500000f, + 0.50454711914062500000f, 0.54104614257812500000f, + 0.65124511718750000000f, 0.68478393554687500000f, + 0.75906372070312500000f, 0.80352783203125000000f, + 0.86755371093750000000f, 0.92022705078125000000f, + 0.10281372070312500000f, 0.13259887695312500000f, + 0.20059204101562503000f, 0.26742553710937500000f, + 0.31460571289062500000f, 0.35745239257812500000f, + 0.40792846679687500000f, 0.45117187500000000000f, + 0.50302124023437500000f, 0.55374145507812500000f, + 0.60543823242187500000f, 0.64840698242187500000f, + 0.71081542968750000000f, 0.77749633789062489000f, + 0.84091186523437489000f, 0.89865112304687500000f, + 0.03860473632812500000f, 0.06665039062500000000f, + 0.16610717773437500000f, 0.24087524414062500000f, + 0.32321166992187500000f, 0.40097045898437506000f, + 0.46096801757812500000f, 0.50778198242187500000f, + 0.56158447265625000000f, 0.60504150390625000000f, + 0.65365600585937500000f, 0.70175170898437500000f, + 0.75436401367187500000f, 0.80679321289062500000f, + 0.86557006835937500000f, 0.91934204101562500000f, + 0.04833984375000000700f, 0.06115722656250000000f, + 0.10787963867187500000f, 0.13580322265625000000f, + 0.26434326171875000000f, 0.32849121093750000000f, + 0.39160156250000000000f, 0.45709228515625000000f, + 0.51794433593750000000f, 0.57354736328125000000f, + 0.63879394531250000000f, 0.68807983398437500000f, + 0.75183105468750000000f, 0.80935668945312500000f, + 0.87588500976562500000f, 0.93283081054687511000f, + 0.10433959960937500000f, 0.13818359375000000000f, + 0.20147705078124997000f, 0.24078369140624997000f, + 0.29016113281250000000f, 0.33187866210937494000f, + 0.38973999023437500000f, 0.43814086914062500000f, + 0.48983764648437500000f, 0.55938720703125000000f, + 0.62957763671875000000f, 0.68634033203125000000f, + 0.76507568359375000000f, 0.82202148437499989000f, + 0.88336181640625011000f, 0.93206787109375000000f, + 0.05267333984375000000f, 0.06872558593750000000f, + 0.14028930664062500000f, 0.21209716796875000000f, + 0.25570678710937500000f, 0.29977416992187500000f, + 0.34677124023437500000f, 0.39044189453125006000f, + 0.43658447265625000000f, 0.47229003906250000000f, + 0.51263427734375000000f, 0.54986572265625000000f, + 0.66134643554687511000f, 0.77972412109375000000f, + 0.85900878906249989000f, 0.92672729492187500000f, + 0.10330200195312500000f, 0.11810302734375000000f, + 0.16195678710937503000f, 0.19494628906250000000f, + 0.21792602539062500000f, 0.26501464843750000000f, + 0.38742065429687500000f, 0.45590209960937500000f, + 0.50292968750000000000f, 0.55776977539062500000f, + 0.62673950195312500000f, 0.67285156249999989000f, + 0.73080444335937489000f, 0.79238891601562500000f, + 0.86102294921875000000f, 0.91418457031250000000f, + 0.08456420898437500000f, 0.10089111328124999000f, + 0.13580322265625000000f, 0.16967773437500000000f, + 0.19692993164062497000f, 0.28970336914062500000f, + 0.41345214843750000000f, 0.45025634765625006000f, + 0.51095581054687500000f, 0.56295776367187500000f, + 0.61120605468750000000f, 0.66333007812499989000f, + 0.72467041015625011000f, 0.77371215820312500000f, + 0.82827758789062500000f, 0.88702392578125000000f, + 0.09240722656250000000f, 0.11901855468750001000f, + 0.20193481445312503000f, 0.24087524414062500000f, + 0.28109741210937500000f, 0.31982421875000000000f, + 0.36764526367187500000f, 0.41452026367187494000f, + 0.46331787109375000000f, 0.50848388671875000000f, + 0.56463623046875000000f, 0.61315917968750000000f, + 0.67718505859374989000f, 0.74334716796875000000f, + 0.80267333984375000000f, 0.88369750976562489000f, + 0.06103515624999999300f, 0.07781982421875000000f, + 0.12411499023437500000f, 0.20864868164062503000f, + 0.29382324218750000000f, 0.33575439453125000000f, + 0.38433837890625006000f, 0.43023681640625000000f, + 0.47573852539062500000f, 0.52474975585937500000f, + 0.57003784179687500000f, 0.61337280273437500000f, + 0.65704345703125000000f, 0.70449829101562500000f, + 0.75198364257812500000f, 0.88568115234375000000f, + 0.08679199218749998600f, 0.10076904296875000000f, + 0.15573120117187500000f, 0.18637084960937500000f, + 0.21090698242187500000f, 0.26239013671875000000f, + 0.37890625000000000000f, 0.42889404296875000000f, + 0.48907470703125000000f, 0.56661987304687500000f, + 0.63085937500000000000f, 0.67962646484375000000f, + 0.73095703125000000000f, 0.78646850585937500000f, + 0.84405517578125000000f, 0.91632080078125000000f, + 0.12338256835937500000f, 0.15716552734375000000f, + 0.22180175781250000000f, 0.27636718750000000000f, + 0.33312988281250000000f, 0.38568115234375006000f, + 0.44381713867187500000f, 0.49389648437500000000f, + 0.54772949218750000000f, 0.60092163085937500000f, + 0.65176391601562500000f, 0.70132446289062500000f, + 0.75759887695312500000f, 0.81149291992187500000f, + 0.86911010742187500000f, 0.92263793945312500000f, + 0.06436157226562500000f, 0.08010864257812500000f, + 0.13183593750000000000f, 0.16860961914062500000f, + 0.22747802734375000000f, 0.31188964843750000000f, + 0.39611816406250006000f, 0.44854736328125000000f, + 0.53793334960937500000f, 0.58786010742187500000f, + 0.62515258789062500000f, 0.68301391601562500000f, + 0.74093627929687500000f, 0.78665161132812500000f, + 0.84982299804687500000f, 0.92950439453125000000f, + 0.04730224609375000000f, 0.08139038085937501400f, + 0.19754028320312500000f, 0.28979492187500000000f, + 0.33523559570312500000f, 0.37695312500000000000f, + 0.42098999023437500000f, 0.46487426757812500000f, + 0.52182006835937500000f, 0.56890869140625000000f, + 0.62442016601562500000f, 0.67492675781250000000f, + 0.73843383789062489000f, 0.80233764648437500000f, + 0.86679077148437500000f, 0.91955566406250000000f, + 0.07357788085937500000f, 0.09411621093750000000f, + 0.12649536132812500000f, 0.16461181640625000000f, + 0.19430541992187500000f, 0.24884033203124997000f, + 0.40054321289062500000f, 0.48977661132812500000f, + 0.53591918945312500000f, 0.58364868164062500000f, + 0.64874267578125000000f, 0.69464111328125000000f, + 0.74642944335937500000f, 0.80313110351562500000f, + 0.86227416992187500000f, 0.90643310546875000000f, + 0.12692260742187500000f, 0.13781738281250000000f, + 0.18176269531250000000f, 0.23300170898437500000f, + 0.25189208984375000000f, 0.27404785156250000000f, + 0.34204101562500000000f, 0.43130493164062500000f, + 0.49468994140624994000f, 0.54550170898437500000f, + 0.61633300781250000000f, 0.66723632812500011000f, + 0.72753906250000000000f, 0.78573608398437511000f, + 0.85626220703125000000f, 0.91589355468750000000f, + 0.06182861328125000000f, 0.07418823242187500000f, + 0.08682250976562500000f, 0.11041259765625000000f, + 0.24261474609375000000f, 0.29913330078125000000f, + 0.38821411132812500000f, 0.44128417968750000000f, + 0.50585937500000000000f, 0.57934570312500000000f, + 0.65234375000000000000f, 0.71163940429687500000f, + 0.76174926757812500000f, 0.81536865234375000000f, + 0.88412475585937500000f, 0.93505859375000000000f, + 0.10464477539062500000f, 0.11697387695312500000f, + 0.13647460937500000000f, 0.14990234375000000000f, + 0.23568725585937500000f, 0.31695556640625000000f, + 0.39614868164062500000f, 0.46759033203125000000f, + 0.50961303710937500000f, 0.57394409179687500000f, + 0.63409423828125000000f, 0.68820190429687511000f, + 0.75155639648437500000f, 0.80853271484375000000f, + 0.86468505859375000000f, 0.93023681640625000000f, + 0.14465332031250000000f, 0.15774536132812500000f, + 0.17687988281250003000f, 0.19790649414062503000f, + 0.21356201171874997000f, 0.26947021484375000000f, + 0.35940551757812500000f, 0.43988037109375000000f, + 0.51364135742187500000f, 0.56192016601562500000f, + 0.63442993164062500000f, 0.68264770507812489000f, + 0.73962402343750000000f, 0.78842163085937511000f, + 0.84860229492187500000f, 0.91616821289062500000f, + 0.00457763671875000000f, 0.00512695312500000000f, + -0.00051879882812500000f, -0.00326538085937500000f, + -0.00433349609375000000f, -0.00698852539062499910f, + -0.00976562500000000000f, -0.01239013671875000000f, + -0.01535034179687500000f, -0.01892089843750000000f, + -0.02645874023437500000f, -0.02853393554687500000f, + -0.02752685546875000000f, -0.02075195312500000000f, + -0.01214599609375000000f, -0.00347900390625000000f, + -0.01214599609375000000f, -0.01083374023437500000f, + 0.00149536132812500000f, 0.00778198242187500000f, + 0.00347900390625000000f, 0.00793457031250000000f, + 0.01217651367187500000f, 0.00805664062500000000f, + 0.00967407226562500000f, 0.01315307617187500000f, + 0.01568603515625000000f, 0.01620483398437500000f, + 0.01327514648437500000f, 0.01086425781250000000f, + 0.00726318359375000000f, 0.00323486328125000000f, + -0.00131225585937500000f, -0.00109863281250000000f, + -0.00515747070312500000f, -0.00683593750000000000f, + -0.01193237304687500000f, -0.01931762695312500000f, + -0.02368164062500000000f, -0.02960205078125000000f, + -0.02575683593750000000f, -0.01388549804687500000f, + -0.00552368164062500000f, -0.00036621093750000000f, + 0.00259399414062500000f, 0.00259399414062500000f, + 0.00500488281250000000f, 0.00595092773437500000f, + 0.00372314453125000000f, 0.00259399414062500000f, + -0.00482177734375000000f, -0.01953125000000000000f, + -0.02755737304687500000f, 0.00027465820312500000f, + 0.00021362304687500000f, -0.00378417968750000000f, + 0.00454711914062500000f, 0.00097656250000000000f, + 0.00671386718750000000f, 0.01126098632812500000f, + 0.00738525390625000000f, 0.00350952148437500040f, + 0.00241088867187500000f, 0.00256347656250000000f, + -0.00445556640625000000f, -0.00659179687500000000f, + -0.00213623046875000000f, 0.03125000000000000000f, + 0.02291870117187500000f, 0.01751708984375000000f, + 0.01342773437500000000f, 0.01150512695312500000f, + 0.01074218749999999800f, 0.00619506835937500000f, + 0.00091552734374999989f, 0.00048828125000000000f, + -0.00009155273437500000f, 0.00247192382812500000f, + 0.00491333007812500000f, 0.00305175781250000000f, + -0.00451660156250000000f, -0.00537109374999999910f, + 0.02847290039062500000f, 0.02288818359375000000f, + 0.01232910156250000000f, 0.00521850585937500000f, + -0.00006103515625000000f, -0.00445556640625000000f, + -0.01254272460937500000f, -0.01348876953125000000f, + -0.01651000976562500000f, -0.01684570312500000000f, + -0.01348876953125000000f, -0.00820922851562500000f, + -0.00732421874999999910f, -0.00158691406250000020f, + 0.01840209960937500000f, 0.01937866210937500000f, + 0.01235961914062499800f, 0.00543212890625000000f, + 0.00656127929687500000f, 0.00057983398437500000f, + -0.00466918945312500000f, -0.00509643554687500000f, + -0.00885009765625000000f, -0.00668334960937500090f, + 0.00460815429687500000f, 0.00827026367187500000f, + 0.00460815429687500000f, 0.00363159179687500000f, + 0.00924682617187500000f, 0.00811767578125000000f, + 0.00305175781250000000f, 0.00210571289062500000f, + -0.00894165039062500000f, -0.02005004882812500000f, + 0.02865600585937500000f, 0.02011108398437500000f, + 0.01348876953125000000f, 0.01071166992187500000f, + 0.00402832031250000000f, 0.00299072265625000000f, + -0.00048828125000000000f, -0.00003051757812500000f, + -0.00411987304687500000f, -0.00610351562500000000f, + -0.00680541992187500000f, -0.00271606445312500000f, + 0.00509643554687500000f, 0.00469970703125000000f, + 0.00524902343750000000f, 0.00723266601562500000f, + -0.00137329101562500000f, -0.00558471679687500000f, + -0.00695800781250000000f, -0.01483154296875000000f, + 0.00802612304687500000f, 0.01855468750000000000f, + 0.00482177734375000000f, -0.00381469726562499960f, + -0.01190185546875000000f, -0.00692749023437500000f, + -0.00360107421875000000f, 0.00131225585937500000f, + -0.01394653320312500000f, -0.01196289062500000000f, + -0.02346801757812500000f, -0.02563476562500000000f, + 0.00061035156250000000f, -0.00357055664062500000f, + -0.00592041015625000000f, -0.00576782226562500000f, + -0.00527954101562500000f, -0.00527954101562500000f, + -0.00100708007812500000f, 0.00097656250000000000f, + 0.00531005859375000000f, 0.00439453125000000000f, + 0.00350952148437500040f, 0.00509643554687500000f, + 0.00173950195312500000f, 0.00134277343749999980f, + 0.00042724609375000000f, 0.00448608398437500000f, + 0.00292968750000000000f, -0.00164794921875000000f, + -0.00433349609375000000f, -0.00393676757812500000f, + -0.00775146484375000000f, -0.01010131835937500000f, + 0.00927734375000000000f, 0.00946044921875000000f, + -0.00158691406250000020f, -0.01278686523437500000f, + -0.02581787109375000000f, -0.03234863281250000000f, + -0.00268554687499999960f, -0.00375366210937500000f, + -0.00616455078125000000f, -0.01046752929687500200f, + -0.01690673828125000000f, -0.02932739257812500000f, + -0.02902221679687500000f, 0.00997924804687500000f, + 0.00485229492187500000f, 0.00247192382812500000f, + 0.00778198242187500000f, 0.00692749023437500000f, + 0.00366210937499999960f, 0.00619506835937500000f, + 0.00781250000000000000f, 0.00585937500000000000f, + 0.00500488281250000000f, 0.00683593750000000000f, + 0.00885009765625000000f, 0.00595092773437500000f, + 0.00659179687500000000f, 0.00637817382812500090f, + 0.00390625000000000000f, 0.02539062500000000300f, + 0.03137207031250000000f, 0.02713012695312500000f, + 0.02130126953125000000f, 0.01538085937500000000f, + 0.01245117187500000000f, 0.01083374023437500000f, + 0.00665283203124999910f, 0.00097656250000000000f, + -0.00350952148437500040f, -0.00256347656250000000f, + -0.00842285156250000000f, -0.00305175781250000000f, + -0.00952148437500000000f, -0.01477050781250000000f, + 0.02743530273437500000f, 0.02081298828124999700f, + 0.01419067382812500000f, 0.01391601562500000000f, + 0.00735473632812500090f, -0.00036621093750000000f, + -0.00839233398437500000f, -0.01296997070312499800f, + -0.01406860351562500000f, -0.01119995117187500000f, + -0.00100708007812500000f, -0.00085449218750000000f, + -0.00311279296875000000f, -0.00592041015625000000f, + -0.01608276367187500000f, 0.02633666992187500000f, + 0.02764892578125000000f, 0.01412963867187500000f, + 0.00747680664062500000f, 0.00039672851562500005f, + -0.00646972656250000000f, -0.00930786132812500000f, + -0.00320434570312500000f, 0.00497436523437500000f, + 0.00851440429687500000f, 0.00537109374999999910f, + 0.00283813476562499960f, 0.00204467773437500000f, + 0.00350952148437500040f, 0.00585937500000000000f, + 0.00186157226562500000f, -0.00152587890625000000f, + -0.00402832031250000000f, -0.00534057617187499910f, + -0.00683593750000000000f, -0.00827026367187500000f, + -0.01919555664062500000f, -0.00769042968750000000f, + 0.03533935546875000000f, 0.02966308593750000000f, + 0.01947021484375000000f, 0.00854492187500000000f, + 0.00915527343750000000f, 0.00994873046875000000f, + 0.00436401367187500000f, -0.00463867187500000000f, + -0.00653076171875000000f, -0.00875854492187500000f, + 0.00161743164062500000f, -0.00128173828125000000f, + -0.00720214843750000000f, -0.01074218749999999800f, + -0.01290893554687500000f, -0.00756835937500000000f, + -0.00393676757812500000f, -0.00497436523437500000f, + -0.00543212890625000000f, -0.00363159179687500000f, + 0.00259399414062500000f, 0.00173950195312500000f, + 0.01568603515625000000f, 0.01165771484375000000f, + 0.01141357421875000200f, 0.01226806640625000000f, + 0.01293945312500000000f, 0.01290893554687500000f, + 0.00827026367187500000f, 0.00601196289062499910f, + 0.00296020507812500000f, 0.00122070312500000000f, + 0.00119018554687500000f, -0.00296020507812500000f, + -0.00582885742187500000f, -0.00500488281250000000f, + -0.00701904296875000090f, -0.00781250000000000000f, + -0.01251220703125000000f, 0.01208496093750000200f, + 0.00997924804687500000f, 0.00387573242187500000f, + 0.00030517578125000000f, -0.00363159179687500000f, + -0.00509643554687500000f, -0.00888061523437500000f, + -0.00836181640625000000f, -0.00430297851562500000f, + -0.00302124023437500040f, -0.00689697265625000000f, + -0.00665283203124999910f, -0.00424194335937500000f, + -0.00683593750000000000f, -0.00637817382812500090f, + -0.00817871093750000000f, -0.01348876953125000000f, + -0.01260375976562500000f, 0.00677490234375000000f, + 0.00177001953125000000f, 0.01589965820312500000f, + 0.01049804687500000000f, 0.00787353515625000000f, + 0.00231933593750000000f, -0.00128173828125000000f, + -0.00433349609375000000f, -0.00503540039062499910f, + -0.00375366210937500000f, -0.00280761718750000000f, + 0.00143432617187500000f, 0.00024414062500000000f, + -0.00009155273437500000f, -0.00582885742187500000f, + -0.00033569335937499995f, -0.00500488281250000000f, + -0.00509643554687500000f, -0.01071166992187500000f, + -0.02258300781250000000f, 0.00949096679687500000f, + 0.01641845703125000000f, 0.00888061523437500000f, + 0.00561523437500000000f, 0.00088500976562500000f, + -0.00320434570312500000f, 0.00027465820312500000f, + -0.00091552734374999989f, -0.00164794921875000000f, + -0.00051879882812500000f, -0.00234985351562500000f, + -0.00827026367187500000f, -0.01257324218750000000f, + -0.01898193359375000000f, -0.01977539062500000000f, + 0.01452636718750000000f, 0.00567626953124999910f, + -0.00201416015625000000f, -0.00601196289062499910f, + -0.00222778320312500000f, -0.00286865234375000000f, + -0.00045776367187499995f, 0.00143432617187500000f, + 0.00085449218750000000f, 0.00341796875000000000f, + -0.00177001953125000000f, -0.00100708007812500000f, + 0.00198364257812500000f, 0.00057983398437500000f, + 0.00256347656250000000f, 0.00262451171875000000f, + 0.00842285156250000000f, 0.00347900390625000000f, + 0.01440429687500000000f, 0.02398681640625000000f, + 0.02438354492187499700f, 0.01907348632812500000f, + 0.01266479492187500000f, 0.00543212890625000000f, + -0.00106811523437500000f, -0.00079345703125000011f, + 0.00015258789062500000f, 0.00027465820312500000f, + 0.00253295898437500040f, 0.00119018554687500000f, + 0.00112915039062500000f, 0.00119018554687500000f, + -0.00561523437500000000f, -0.01141357421875000200f, + -0.00808715820312500000f, -0.01104736328125000000f, + -0.01528930664062500000f, 0.01028442382812500000f, + 0.02185058593750000000f, 0.01458740234374999800f, + -0.00183105468749999980f, -0.00381469726562499960f, + -0.00497436523437500000f, 0.01104736328125000000f, + 0.00051879882812500000f, -0.00372314453125000000f, + -0.00711059570312500000f, 0.00851440429687500000f, + 0.00421142578125000000f, 0.00479125976562500000f, + 0.00970458984375000000f, 0.00588989257812500000f, + 0.00576782226562500000f, 0.00637817382812500090f, + 0.00811767578125000000f, 0.00769042968750000000f, + -0.00140380859375000000f, -0.00170898437500000000f, + -0.00845336914062500000f, -0.01309204101562500000f, + 0.01416015625000000000f, 0.01177978515625000000f, + 0.00433349609375000000f, 0.00134277343749999980f, + -0.00131225585937500000f, 0.00201416015625000000f, + 0.00805664062500000000f, 0.00555419921875000000f, + 0.00143432617187500000f, 0.00042724609375000000f, + -0.00079345703125000011f, -0.00241088867187500000f, + 0.00149536132812500000f, 0.00045776367187499995f, + -0.00390625000000000000f, -0.00619506835937500000f, + -0.01220703125000000000f, -0.01458740234374999800f, + 0.00991821289062500000f, 0.00082397460937500000f, + 0.00714111328125000000f, 0.01254272460937500000f, + 0.00625610351562500000f, 0.00393676757812500000f, + 0.00036621093750000000f, 0.00177001953125000000f, + 0.00375366210937500000f, 0.00173950195312500000f, + 0.00521850585937500000f, 0.00418090820312500000f, + 0.00292968750000000000f, 0.00390625000000000000f, + -0.00097656250000000000f, 0.00408935546875000000f, + -0.00036621093750000000f, 0.00173950195312500000f, + 0.00363159179687500000f, 0.00079345703125000011f, + -0.00067138671874999989f, -0.00503540039062499910f, + -0.01525878906249999800f, -0.02139282226562500000f, + -0.01611328125000000000f, -0.00354003906250000000f, + 0.00195312500000000000f, -0.00024414062500000000f, + 0.00296020507812500000f, -0.00027465820312500000f, + -0.00494384765625000000f, -0.00201416015625000000f, + -0.00476074218750000000f, -0.00592041015625000000f, + -0.00924682617187500000f, -0.01666259765625000000f, + -0.01040649414062499800f, 0.01666259765625000000f, + 0.01092529296875000000f, 0.00289916992187500000f, + 0.00137329101562500000f, 0.00231933593750000000f, + 0.00823974609375000000f, 0.01229858398437500000f, + 0.00625610351562500000f, 0.00305175781250000000f, + 0.00375366210937500000f, 0.00152587890625000000f, + -0.00161743164062500000f, -0.00439453125000000000f, + -0.00335693359375000000f, -0.00039672851562500005f, + 0.00097656250000000000f, -0.00695800781250000000f, + -0.00396728515625000000f, 0.01077270507812500000f, + 0.00903320312500000000f, 0.00170898437500000000f, + -0.01135253906249999800f, -0.00772094726562500000f, + 0.01113891601562500000f, 0.00222778320312500000f, + 0.00030517578125000000f, -0.00103759765625000000f, + -0.00424194335937500000f, -0.00582885742187500000f, + -0.00292968750000000000f, 0.00015258789062500000f, + 0.00134277343749999980f, -0.00259399414062500000f, + -0.00546264648437500000f, -0.00393676757812500000f, + -0.00585937500000000000f, -0.00750732421875000000f, + -0.00259399414062500000f, -0.00335693359375000000f, + -0.00473022460937500000f, -0.00134277343749999980f, + -0.00082397460937500000f, 0.00442504882812500000f, + 0.00421142578125000000f, 0.00241088867187500000f, + 0.00097656250000000000f, -0.00451660156250000000f, + -0.01760864257812500000f, -0.01934814453125000000f, + 0.00582885742187500000f, 0.00286865234375000000f, + -0.00027465820312500000f, -0.00106811523437500000f, + -0.00234985351562500000f, -0.00256347656250000000f, + -0.00170898437500000000f, -0.00521850585937500000f, + -0.00909423828125000000f, -0.00827026367187500000f, + -0.00741577148437500000f, -0.00476074218750000000f, + -0.01000976562500000000f, -0.00717163085937500000f, + -0.00231933593750000000f, -0.00390625000000000000f, + -0.00369262695312500000f, 0.00393676757812500000f, + 0.00039672851562500005f, -0.00067138671874999989f, + 0.00097656250000000000f, 0.00137329101562500000f, + -0.00756835937500000000f, -0.00198364257812500000f, + 0.00588989257812500000f, -0.00247192382812500000f, + 0.00912475585937500000f, 0.00173950195312500000f, + -0.00448608398437500000f, 0.00585937500000000000f, + -0.00503540039062499910f, -0.01080322265625000200f, + -0.01019287109375000000f, -0.00323486328125000000f, + -0.00476074218750000000f, -0.00122070312500000000f, + -0.00009155273437500000f, -0.00207519531250000000f, + 0.00378417968750000000f, -0.00784301757812500000f, + 0.00238037109375000000f, 0.00378417968750000000f, + 0.00518798828125000000f, 0.01257324218750000000f, + 0.00692749023437500000f, 0.00320434570312500000f, + -0.00317382812500000040f, 0.00036621093750000000f, + 0.00469970703125000000f, 0.00762939453124999910f, + 0.00836181640625000000f, 0.00787353515625000000f, + 0.00012207031250000000f, -0.00082397460937500000f, + 0.00717163085937500000f, 0.00463867187500000000f, + 0.00155639648437500000f, 0.01031494140625000000f, + 0.00915527343750000000f, 0.00021362304687500000f, + -0.00958251953125000000f, -0.01254272460937500000f, + 0.00656127929687500000f, 0.00518798828125000000f, + -0.00027465820312500000f, -0.00283813476562499960f, + -0.00234985351562500000f, 0.00231933593750000000f, + 0.00204467773437500000f, 0.00164794921875000000f, + 0.00610351562500000000f, 0.00961303710937500000f, + 0.00497436523437500000f, 0.00219726562500000000f, + -0.00277709960937500000f, -0.01226806640625000000f, + 0.00482177734375000000f, 0.00570678710937500090f, + -0.00476074218750000000f, -0.00277709960937500000f, + 0.00885009765625000000f, 0.00814819335937500000f, + 0.00509643554687500000f, 0.00277709960937500000f, + 0.00427246093750000000f, 0.00521850585937500000f, + 0.00341796875000000000f, 0.00027465820312500000f, + -0.00128173828125000000f, -0.00540161132812500090f, + -0.01342773437500000000f, 0.01174926757812500200f, + 0.00244140625000000000f, 0.00045776367187499995f, + 0.00524902343750000000f, 0.00393676757812500000f, + 0.00125122070312500000f, -0.00393676757812500000f, + -0.01135253906249999800f, -0.00073242187500000000f, + -0.00228881835937500000f, -0.00091552734374999989f, + -0.00518798828125000000f, 0.00030517578125000000f, + -0.00360107421875000000f, 0.00173950195312500000f, + 0.00238037109375000000f, -0.00308227539062500000f, + 0.00708007812500000000f, 0.00491333007812500000f, + 0.00375366210937500000f, 0.00781250000000000000f, + 0.00845336914062500000f, 0.00308227539062500000f, + -0.00585937500000000000f, -0.01919555664062500000f, + -0.00305175781250000000f, -0.00183105468749999980f, + -0.00708007812500000000f, 0.00201416015625000000f, + 0.00039672851562500005f, -0.00039672851562500005f, + -0.00244140625000000000f, -0.00729370117187499910f, + 0.00729370117187499910f, 0.00112915039062500000f, + 0.00097656250000000000f, 0.00271606445312500000f, + -0.00973510742187500000f, -0.01766967773437500000f, + 0.01373291015625000000f, 0.01098632812500000000f, + 0.00009155273437500000f, -0.00088500976562500000f, + -0.00912475585937500000f, -0.00271606445312500000f, + -0.00164794921875000000f, -0.00335693359375000000f, + -0.00750732421875000000f, -0.00500488281250000000f, + 0.00018310546875000000f, -0.00573730468750000000f, + 0.01031494140625000000f, 0.00537109374999999910f, + -0.00280761718750000000f, 0.00601196289062499910f, + 0.00418090820312500000f, 0.00408935546875000000f, + 0.00036621093750000000f, -0.00006103515625000000f, + 0.00170898437500000000f, -0.00558471679687500000f, + 0.00347900390625000000f, -0.00109863281250000000f, + -0.00399780273437500000f, -0.00622558593750000000f, + 0.00228881835937500000f, -0.00076293945312500000f, + -0.00531005859375000000f, 0.00582885742187500000f, + -0.00045776367187499995f, -0.00885009765625000000f, + -0.01309204101562500000f, -0.00814819335937500000f, + 0.00241088867187500000f, 0.00112915039062500000f, + 0.00323486328125000000f, 0.00070190429687500000f, + -0.01171875000000000000f, 0.01296997070312499800f, + 0.00213623046875000000f, -0.00042724609375000000f, + 0.00646972656250000000f, 0.00320434570312500000f, + 0.00045776367187499995f, -0.00006103515625000000f, + -0.00128173828125000000f, -0.00112915039062500000f, + -0.00375366210937500000f, 0.00329589843750000000f, + 0.00085449218750000000f, -0.00146484375000000000f, + 0.00588989257812500000f, 0.00601196289062499910f, + 0.00527954101562500000f, -0.00100708007812500000f, + 0.00112915039062500000f, 0.00222778320312500000f, + -0.00173950195312500000f, 0.00781250000000000000f, + 0.00418090820312500000f, -0.00177001953125000000f, + -0.01312255859375000000f, -0.00695800781250000000f, + 0.00662231445312500000f, -0.00155639648437500000f, + -0.00030517578125000000f, -0.00177001953125000000f, + -0.00018310546875000000f, 0.00067138671874999989f, + 0.00317382812500000040f, 0.00186157226562500000f, + -0.00363159179687500000f, 0.00515747070312500000f, + 0.00439453125000000000f, 0.00048828125000000000f, + -0.00140380859375000000f, -0.01202392578124999800f, + 0.00183105468749999980f, 0.01385498046875000000f, + -0.00244140625000000000f, -0.00909423828125000000f, + -0.00198364257812500000f, 0.00076293945312500000f, + 0.00000000000000000000f, -0.00073242187500000000f, + -0.00198364257812500000f, -0.01272583007812500000f, + 0.01419067382812500000f, 0.00842285156250000000f, + -0.00009155273437500000f, -0.00592041015625000000f, + -0.00039672851562500005f, 0.00396728515625000000f, + 0.00057983398437500000f, -0.00018310546875000000f, + -0.00064086914062500000f, -0.00073242187500000000f, + -0.00549316406250000000f, -0.00161743164062500000f, + -0.00259399414062500000f, 0.00061035156250000000f, + 0.00360107421875000000f, 0.00448608398437500000f, + 0.00344848632812500000f, -0.00228881835937500000f, + -0.00881958007812500000f, 0.00689697265625000000f, + -0.00372314453125000000f, 0.00692749023437500000f, + 0.00823974609375000000f, 0.00381469726562499960f, + 0.00332641601562499960f, 0.00601196289062499910f, + 0.00381469726562499960f, 0.00421142578125000000f, + 0.00134277343749999980f, 0.00183105468749999980f, + 0.00076293945312500000f, -0.00167846679687500000f, + -0.00509643554687500000f, -0.00097656250000000000f, + -0.00424194335937500000f, -0.00588989257812500000f, + -0.00527954101562500000f, -0.00964355468750000000f, + 0.00875854492187500000f, -0.00634765625000000090f, + 0.00772094726562500000f, 0.00729370117187499910f, + 0.00082397460937500000f, -0.00244140625000000000f, + -0.00573730468750000000f, -0.00085449218750000000f, + -0.00555419921875000000f, -0.00717163085937500000f, + 0.00476074218750000000f, -0.00357055664062500000f, + 0.00390625000000000000f, -0.00146484375000000000f, + -0.00177001953125000000f, -0.00689697265625000000f, + 0.00524902343750000000f, 0.00552368164062500000f, + 0.00509643554687500000f, 0.00057983398437500000f, + 0.00189208984375000000f, 0.00030517578125000000f, + 0.00006103515625000000f, 0.00552368164062500000f, + 0.00460815429687500000f, 0.00329589843750000000f, + -0.00048828125000000000f, -0.00033569335937499995f, + -0.00238037109375000000f, -0.01010131835937500000f, + 0.01254272460937500000f, 0.00405883789062500000f, + 0.00051879882812500000f, 0.00317382812500000040f, + 0.00195312500000000000f, -0.00561523437500000000f, + 0.00073242187500000000f, -0.00091552734374999989f, + -0.00009155273437500000f, -0.00863647460937500000f, + 0.00369262695312500000f, 0.00622558593750000000f, + -0.00024414062500000000f, -0.00607299804687500000f, + -0.00064086914062500000f, -0.00244140625000000000f, + -0.00515747070312500000f, -0.00479125976562500000f, + -0.00582885742187500000f, -0.00415039062500000000f, + 0.00247192382812500000f, 0.00473022460937500000f, + 0.00042724609375000000f, -0.00399780273437500000f, + 0.00744628906250000000f, 0.00225830078125000000f, + -0.00173950195312500000f, -0.00143432617187500000f, + -0.00854492187500000000f, 0.01058959960937500000f, + 0.00338745117187500000f, -0.00234985351562500000f, + -0.00390625000000000000f, -0.00433349609375000000f, + -0.00592041015625000000f, -0.00381469726562499960f, + -0.00018310546875000000f, -0.00207519531250000000f, + 0.00277709960937500000f, 0.00003051757812500000f, + 0.00070190429687500000f, 0.00042724609375000000f, + -0.00469970703125000000f, -0.00103759765625000000f, + 0.00070190429687500000f, -0.00115966796875000000f, + -0.01046752929687500200f, 0.01535034179687500000f, + 0.00445556640625000000f, -0.00115966796875000000f, + -0.00140380859375000000f, -0.00125122070312500000f, + 0.00177001953125000000f, 0.00094604492187500000f, + 0.00192260742187500000f, -0.00146484375000000000f, + -0.00357055664062500000f, 0.00137329101562500000f, + 0.00085449218750000000f, 0.00003051757812500000f, + -0.00271606445312500000f, -0.00015258789062500000f, + -0.00134277343749999980f, -0.00088500976562500000f, + -0.01367187500000000000f, 0.01486206054687500000f, + 0.00622558593750000000f, 0.00247192382812500000f, + 0.00140380859375000000f, -0.00323486328125000000f, + -0.00921630859375000000f, 0.01159667968750000000f, + 0.00366210937499999960f, -0.00115966796875000000f, + -0.00036621093750000000f, -0.00119018554687500000f, + 0.00213623046875000000f, -0.00009155273437500000f, + 0.00076293945312500000f, -0.00198364257812500000f, + 0.00091552734374999989f, -0.00033569335937499995f, + 0.00103759765625000000f, -0.00045776367187499995f, + 0.00067138671874999989f, -0.00350952148437500040f, + 0.00000000000000000000f, -0.00241088867187500000f, + -0.00253295898437500040f, 0.00137329101562500000f, + 0.00347900390625000000f, 0.00131225585937500000f, + 0.00457763671875000000f, 0.00109863281250000000f, + 0.00711059570312500000f, 0.00454711914062500000f, + 0.00595092773437500000f, 0.00015258789062500000f, + 0.00076293945312500000f, -0.00158691406250000020f, + -0.01449584960937500000f, 0.00836181640625000000f, + 0.00085449218750000000f, -0.00119018554687500000f, + -0.00024414062500000000f, -0.00201416015625000000f, + -0.00778198242187500000f, 0.00787353515625000000f, + 0.00170898437500000000f, 0.00436401367187500000f, + -0.00137329101562500000f, -0.00579833984375000000f, + 0.00503540039062499910f, -0.00183105468749999980f, + 0.00061035156250000000f, 0.00006103515625000000f, + 0.00381469726562499960f, -0.00393676757812500000f, + 0.00155639648437500000f, -0.00024414062500000000f, + -0.01022338867187500000f, 0.00878906250000000000f, + 0.00115966796875000000f, 0.00180053710937500000f, + 0.00076293945312500000f, -0.00128173828125000000f, + 0.00070190429687500000f, -0.00360107421875000000f, + -0.00341796875000000000f, 0.00033569335937499995f, + -0.00167846679687500000f, -0.00405883789062500000f, + -0.00332641601562499960f, 0.00073242187500000000f, + -0.00320434570312500000f, 0.00238037109375000000f, + -0.00195312500000000000f, -0.00747680664062500000f, + 0.00616455078125000000f, -0.00198364257812500000f, + -0.00387573242187500000f, 0.00494384765625000000f, + 0.00122070312500000000f, -0.00286865234375000000f, + 0.00271606445312500000f, -0.00259399414062500000f, + -0.00363159179687500000f, -0.00314331054687500000f, + 0.00296020507812500000f, 0.00027465820312500000f, + -0.00213623046875000000f, -0.00085449218750000000f, + 0.00592041015625000000f, 0.00262451171875000000f, + -0.00341796875000000000f, -0.00280761718750000000f, + -0.00347900390625000000f, 0.00225830078125000000f, + -0.00149536132812500000f, 0.00140380859375000000f, + -0.00256347656250000000f, -0.00543212890625000000f, + 0.00344848632812500000f, 0.00158691406250000020f, + -0.00625610351562500000f, 0.01016235351562500000f, + 0.00268554687499999960f, 0.00677490234375000000f, + 0.00170898437500000000f, -0.00167846679687500000f, + 0.00039672851562500005f, 0.00262451171875000000f, + 0.00012207031250000000f, -0.00234985351562500000f, + 0.00683593750000000000f, 0.00347900390625000000f, + -0.00320434570312500000f, 0.00341796875000000000f, + 0.00381469726562499960f, -0.00088500976562500000f, + -0.00054931640625000000f, -0.00439453125000000000f, + 0.00067138671874999989f, -0.00177001953125000000f, + -0.00302124023437500040f, 0.00085449218750000000f, + 0.00347900390625000000f, -0.00201416015625000000f, + -0.00097656250000000000f, -0.00515747070312500000f, + -0.00958251953125000000f, 0.00869750976562500000f, + 0.00219726562500000000f, -0.00225830078125000000f, + 0.00546264648437500000f, 0.00085449218750000000f, + -0.00241088867187500000f, -0.00555419921875000000f, + 0.00039672851562500005f, -0.00167846679687500000f, + 0.00448608398437500000f, 0.00039672851562500005f, + 0.00036621093750000000f, -0.00164794921875000000f, + 0.00094604492187500000f, -0.00256347656250000000f, + -0.00051879882812500000f, -0.00228881835937500000f, + -0.00695800781250000000f, 0.00253295898437500040f, + -0.01144409179687500000f, 0.01330566406249999800f, + 0.00335693359375000000f, -0.00192260742187500000f, + -0.00082397460937500000f, -0.00415039062500000000f, + 0.00515747070312500000f, -0.00170898437500000000f, + -0.00024414062500000000f, -0.00521850585937500000f, + 0.00561523437500000000f, -0.00128173828125000000f, + 0.00451660156250000000f, 0.00207519531250000000f, + 0.00622558593750000000f, 0.00717163085937500000f, + 0.00335693359375000000f, -0.00698852539062499910f, + 0.00277709960937500000f, 0.00521850585937500000f, + -0.00131225585937500000f, -0.00009155273437500000f, + -0.00079345703125000011f, -0.00302124023437500040f, + -0.00338745117187500000f, 0.00216674804687500000f, + -0.00518798828125000000f, 0.00616455078125000000f, + -0.00204467773437500000f, 0.00552368164062500000f, + -0.00112915039062500000f, 0.00332641601562499960f, + -0.00366210937499999960f, 0.00009155273437500000f, + -0.00167846679687500000f, -0.00793457031250000000f, + -0.00048828125000000000f, 0.00463867187500000000f, + 0.00277709960937500000f, 0.00433349609375000000f, + 0.00128173828125000000f, 0.00134277343749999980f, + 0.00408935546875000000f, 0.00143432617187500000f, + 0.00051879882812500000f, -0.00106811523437500000f, + 0.00067138671874999989f, 0.00241088867187500000f, + -0.00515747070312500000f, 0.00125122070312500000f, + 0.00140380859375000000f, 0.00845336914062500000f, + -0.00283813476562499960f, -0.00149536132812500000f, + -0.00384521484375000000f, 0.00112915039062500000f, + -0.00314331054687500000f, -0.00103759765625000000f, + -0.00067138671874999989f, -0.00274658203125000000f, + -0.00408935546875000000f, -0.00625610351562500000f, + 0.00280761718750000000f, -0.00027465820312500000f, + 0.00003051757812500000f, -0.00595092773437500000f, + -0.00729370117187499910f, 0.00137329101562500000f, + 0.00164794921875000000f, 0.00054931640625000000f, + -0.00070190429687500000f, -0.00003051757812500000f, + -0.00244140625000000000f, -0.00299072265625000000f, + -0.00061035156250000000f, -0.00796508789062500000f, + 0.00933837890625000000f, 0.00219726562500000000f, + 0.00061035156250000000f, -0.00271606445312500000f, + -0.00662231445312500000f, 0.00033569335937499995f, + 0.00018310546875000000f, -0.00250244140625000000f, + 0.00271606445312500000f, 0.00039672851562500005f, + -0.00393676757812500000f, -0.00271606445312500000f, + 0.00253295898437500040f, -0.00216674804687500000f, + -0.00167846679687500000f, 0.00396728515625000000f, + -0.00299072265625000000f, -0.00445556640625000000f, + -0.00082397460937500000f, -0.00173950195312500000f, + 0.00161743164062500000f, 0.00839233398437500000f, + 0.00051879882812500000f, 0.00518798828125000000f, + -0.00015258789062500000f, -0.00164794921875000000f, + 0.00402832031250000000f, -0.00195312500000000000f, + 0.00219726562500000000f, 0.00488281250000000000f, + -0.00381469726562499960f, -0.00512695312500000000f, + 0.00219726562500000000f, 0.00122070312500000000f, + 0.00518798828125000000f, 0.00238037109375000000f, + 0.00756835937500000000f, 0.00354003906250000000f, + 0.00061035156250000000f, 0.00256347656250000000f, + 0.00094604492187500000f, -0.00103759765625000000f, + 0.00579833984375000000f, 0.00115966796875000000f, + 0.00039672851562500005f, -0.00323486328125000000f, + 0.00686645507812500000f, 0.00082397460937500000f, + -0.00512695312500000000f, 0.00073242187500000000f, + -0.00479125976562500000f, -0.00372314453125000000f, + 0.00503540039062499910f, 0.00033569335937499995f, + -0.00491333007812500000f, -0.00650024414062500000f, + -0.00036621093750000000f, -0.00155639648437500000f, + -0.00308227539062500000f, 0.00128173828125000000f, + 0.00308227539062500000f, 0.00082397460937500000f, + 0.00167846679687500000f, 0.00338745117187500000f, + 0.00228881835937500000f, 0.00216674804687500000f, + -0.00292968750000000000f, -0.00003051757812500000f, + 0.00198364257812500000f, -0.00845336914062500000f, + 0.01199340820312500000f, -0.00079345703125000011f, + -0.00134277343749999980f, -0.00207519531250000000f, + -0.00256347656250000000f, -0.00201416015625000000f, + -0.00289916992187500000f, 0.00717163085937500000f, + 0.00546264648437500000f, -0.00076293945312500000f, + -0.00125122070312500000f, 0.00082397460937500000f, + -0.00277709960937500000f, -0.00390625000000000000f, + -0.00677490234375000000f, 0.00445556640625000000f, + -0.00219726562500000000f, -0.00091552734374999989f, + -0.00073242187500000000f, 0.00167846679687500000f, + -0.00384521484375000000f, -0.00207519531250000000f, + -0.00177001953125000000f, -0.00387573242187500000f, + 0.00039672851562500005f, -0.00296020507812500000f, + -0.00323486328125000000f, 0.00531005859375000000f, + -0.00305175781250000000f, 0.00473022460937500000f, + 0.00308227539062500000f, -0.00445556640625000000f, + -0.00064086914062500000f, 0.00796508789062500000f, + 0.00067138671874999989f, 0.00115966796875000000f, + -0.00201416015625000000f, 0.00198364257812500000f, + 0.00012207031250000000f, 0.00213623046875000000f, + 0.00195312500000000000f, 0.00439453125000000000f, + 0.00180053710937500000f, 0.00650024414062500000f, + 0.00216674804687500000f, -0.01028442382812500000f, + 0.00924682617187500000f, -0.00158691406250000020f, + 0.00155639648437500000f, -0.00170898437500000000f, + 0.00003051757812500000f, 0.00030517578125000000f, + -0.00045776367187499995f, -0.00015258789062500000f, + 0.00103759765625000000f, 0.00158691406250000020f, + 0.00695800781250000000f, 0.00399780273437500000f, + 0.00491333007812500000f, -0.00387573242187500000f, + -0.00653076171875000000f, 0.00726318359375000000f, + 0.00375366210937500000f, 0.00195312500000000000f, + -0.00448608398437500000f, -0.00152587890625000000f, + -0.00103759765625000000f, -0.00387573242187500000f, + 0.00622558593750000000f, 0.00494384765625000000f, + 0.00259399414062500000f, 0.00125122070312500000f, + 0.00015258789062500000f, -0.00427246093750000000f, + 0.00222778320312500000f, -0.00457763671875000000f, + 0.00170898437500000000f, -0.00292968750000000000f, + -0.00201416015625000000f, -0.00061035156250000000f, + 0.00006103515625000000f, -0.00717163085937500000f, + 0.00180053710937500000f, -0.00067138671874999989f, + -0.00326538085937500000f, 0.00457763671875000000f, + -0.00048828125000000000f, -0.00143432617187500000f, + -0.00012207031250000000f, 0.00247192382812500000f, + -0.00204467773437500000f, 0.00509643554687500000f, + 0.00454711914062500000f, 0.00454711914062500000f, + -0.00479125976562500000f, 0.00878906250000000000f, + -0.00476074218750000000f, -0.00082397460937500000f, + -0.00024414062500000000f, 0.00054931640625000000f, + 0.00253295898437500040f, -0.00073242187500000000f, + -0.00125122070312500000f, -0.00509643554687500000f, + 0.00482177734375000000f, -0.00305175781250000000f, + 0.00283813476562499960f, 0.00161743164062500000f, + 0.00613403320312500000f, 0.00045776367187499995f, + 0.00128173828125000000f, 0.00811767578125000000f, + 0.00848388671875000000f, -0.00036621093750000000f, + -0.00018310546875000000f, -0.00112915039062500000f, + 0.00259399414062500000f, 0.00018310546875000000f, + 0.00061035156250000000f, -0.00573730468750000000f, + -0.00827026367187500000f, 0.00326538085937500000f, + -0.00039672851562500005f, -0.00244140625000000000f, + 0.00155639648437500000f, 0.00616455078125000000f, + 0.00527954101562500000f, -0.00210571289062500000f, + 0.00238037109375000000f, -0.00573730468750000000f, + 0.00140380859375000000f, 0.00012207031250000000f, + 0.00466918945312500000f, 0.00036621093750000000f, + -0.00421142578125000000f, 0.00515747070312500000f, + 0.00015258789062500000f, -0.00177001953125000000f, + -0.00375366210937500000f, -0.00329589843750000000f, + -0.00741577148437500000f, 0.00457763671875000000f, + 0.00030517578125000000f, -0.00582885742187500000f, + 0.00750732421875000000f, -0.00045776367187499995f, + 0.00115966796875000000f, 0.00076293945312500000f, + -0.00030517578125000000f, 0.00042724609375000000f, + 0.00186157226562500000f, 0.00152587890625000000f, + -0.00628662109375000000f, -0.00656127929687500000f, + -0.00671386718750000000f, 0.00274658203125000000f, + 0.00015258789062500000f, -0.00454711914062500000f, + -0.00668334960937500090f, 0.00170898437500000000f, + 0.00433349609375000000f, 0.00073242187500000000f, + -0.01147460937500000000f, 0.00234985351562500000f, + -0.00244140625000000000f, 0.00228881835937500000f, + 0.00018310546875000000f, 0.00128173828125000000f, + -0.00308227539062500000f, 0.00048828125000000000f, + 0.00170898437500000000f, 0.00042724609375000000f, + -0.00173950195312500000f, 0.00009155273437500000f, + -0.00051879882812500000f, 0.00244140625000000000f, + 0.00173950195312500000f, -0.00109863281250000000f, + 0.00268554687499999960f, -0.00180053710937500000f, + -0.00296020507812500000f, -0.00057983398437500000f, + -0.00451660156250000000f, 0.00140380859375000000f, + -0.00668334960937500090f, 0.00689697265625000000f, + 0.00347900390625000000f, -0.00012207031250000000f, + -0.00219726562500000000f, -0.00045776367187499995f, + 0.00112915039062500000f, -0.00149536132812500000f, + -0.00085449218750000000f, 0.00753784179687500000f, + 0.00134277343749999980f, 0.00375366210937500000f, + 0.00143432617187500000f, -0.00372314453125000000f, + -0.00115966796875000000f, 0.00051879882812500000f, + 0.00012207031250000000f, -0.00344848632812500000f, + -0.00097656250000000000f, -0.00683593750000000000f, + 0.00469970703125000000f, -0.00408935546875000000f, + 0.00598144531250000000f, 0.00216674804687500000f, + -0.00814819335937500000f, -0.00259399414062500000f, + 0.00085449218750000000f, -0.00213623046875000000f, + 0.00271606445312500000f, -0.00366210937499999960f, + 0.00302124023437500040f, -0.00006103515625000000f, + 0.00195312500000000000f, 0.00231933593750000000f, + -0.00506591796875000090f, -0.00146484375000000000f, + 0.00576782226562500000f, -0.00106811523437500000f, + -0.00280761718750000000f, -0.00515747070312500000f, + -0.00375366210937500000f, 0.01034545898437500000f, + 0.00115966796875000000f, -0.00076293945312500000f, + 0.00115966796875000000f, -0.00106811523437500000f, + 0.00686645507812500000f, -0.00424194335937500000f, + -0.00152587890625000000f, -0.00192260742187500000f, + 0.00750732421875000000f, 0.00183105468749999980f, + -0.00564575195312500000f, -0.00332641601562499960f, + -0.00149536132812500000f, -0.00161743164062500000f, + -0.00509643554687500000f, 0.00155639648437500000f, + 0.00454711914062500000f, 0.00183105468749999980f, + -0.00308227539062500000f, -0.00100708007812500000f, + 0.00076293945312500000f, -0.00231933593750000000f, + 0.00366210937499999960f, 0.00097656250000000000f, + -0.00091552734374999989f, -0.00253295898437500040f, + 0.00311279296875000000f, 0.00277709960937500000f, + -0.00567626953124999910f, -0.00796508789062500000f, + 0.00399780273437500000f, -0.00601196289062499910f +}; + +const SKP_Silk_NLSF_CBS_FLP SKP_Silk_NLSF_CB0_16_Stage_info_FLP[ NLSF_MSVQ_CB0_16_STAGES ] = +{ + { 128, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 0 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 0 ] }, + { 16, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 128 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 128 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 144 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 144 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 152 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 152 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 160 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 160 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 168 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 168 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 176 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 176 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 184 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 184 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 192 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 192 ] }, + { 16, &SKP_Silk_NLSF_MSVQ_CB0_16[ 16 * 200 ], &SKP_Silk_NLSF_MSVQ_CB0_16_rates[ 200 ] } +}; + +const SKP_Silk_NLSF_CB_FLP SKP_Silk_NLSF_CB0_16_FLP = +{ + NLSF_MSVQ_CB0_16_STAGES, + SKP_Silk_NLSF_CB0_16_Stage_info_FLP, + SKP_Silk_NLSF_MSVQ_CB0_16_ndelta_min, + SKP_Silk_NLSF_MSVQ_CB0_16_CDF, + SKP_Silk_NLSF_MSVQ_CB0_16_CDF_start_ptr, + SKP_Silk_NLSF_MSVQ_CB0_16_CDF_middle_idx +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10.c new file mode 100755 index 0000000..ea2dc02 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10.c @@ -0,0 +1,578 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/**********************************************/ +/* This file has been automatically generated */ +/* */ +/* ROM usage: 0.19 + 1.61 kB */ +/**********************************************/ + +#include "SKP_Silk_structs.h" +#include "SKP_Silk_tables_NLSF_CB1_10.h" +#include "SKP_Silk_tables.h" + +const SKP_uint16 SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ NLSF_MSVQ_CB1_10_VECTORS + NLSF_MSVQ_CB1_10_STAGES ] = +{ + 0, + 17096, + 24130, + 28997, + 33179, + 36696, + 40213, + 42493, + 44252, + 45973, + 47551, + 49095, + 50542, + 51898, + 53196, + 54495, + 55685, + 56851, + 57749, + 58628, + 59435, + 60207, + 60741, + 61220, + 61700, + 62179, + 62659, + 63138, + 63617, + 64097, + 64576, + 65056, + 65535, + 0, + 20378, + 33032, + 40395, + 46721, + 51707, + 56585, + 61157, + 65535, + 0, + 15055, + 25472, + 35447, + 42501, + 48969, + 54773, + 60212, + 65535, + 0, + 12069, + 22440, + 32812, + 40145, + 46870, + 53595, + 59630, + 65535, + 0, + 10839, + 19954, + 27957, + 35961, + 43965, + 51465, + 58805, + 65535, + 0, + 8933, + 17674, + 26415, + 34785, + 42977, + 50820, + 58496, + 65535 +}; + +const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB1_10_CDF_start_ptr[ NLSF_MSVQ_CB1_10_STAGES ] = +{ + &SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ 0 ], + &SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ 33 ], + &SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ 42 ], + &SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ 51 ], + &SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ 60 ], + &SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ 69 ] +}; + +const SKP_int SKP_Silk_NLSF_MSVQ_CB1_10_CDF_middle_idx[ NLSF_MSVQ_CB1_10_STAGES ] = +{ + 5, + 3, + 4, + 4, + 5, + 5 +}; + +const SKP_int16 SKP_Silk_NLSF_MSVQ_CB1_10_rates_Q5[ NLSF_MSVQ_CB1_10_VECTORS ] = +{ + 62, 103, + 120, 127, + 135, 135, + 155, 167, + 168, 172, + 173, 176, + 179, 181, + 181, 185, + 186, 198, + 199, 203, + 205, 222, + 227, 227, + 227, 227, + 227, 227, + 227, 227, + 227, 227, + 54, 76, + 101, 108, + 119, 120, + 123, 125, + 68, 85, + 87, 103, + 107, 112, + 115, 116, + 78, 85, + 85, 101, + 105, 105, + 110, 111, + 83, 91, + 97, 97, + 97, 100, + 101, 105, + 92, 93, + 93, 95, + 96, 98, + 99, 103 +}; + +const SKP_int SKP_Silk_NLSF_MSVQ_CB1_10_ndelta_min_Q15[ 10 + 1 ] = +{ + 462, + 3, + 64, + 74, + 98, + 50, + 97, + 68, + 120, + 53, + 639 +}; + +const SKP_int16 SKP_Silk_NLSF_MSVQ_CB1_10_Q15[ 10 * NLSF_MSVQ_CB1_10_VECTORS ] = +{ + 1877, 4646, + 7712, 10745, + 13964, 17028, + 20239, 23182, + 26471, 29287, + 1612, 3278, + 7086, 9975, + 13228, 16264, + 19596, 22690, + 26037, 28965, + 2169, 3830, + 6460, 8958, + 11960, 14750, + 18408, 21659, + 25018, 28043, + 3680, 6024, + 8986, 12256, + 15201, 18188, + 21741, 24460, + 27484, 30059, + 2584, 5187, + 7799, 10902, + 13179, 15765, + 19017, 22431, + 25891, 28698, + 3731, 5751, + 8650, 11742, + 15090, 17407, + 20391, 23421, + 26228, 29247, + 2107, 6323, + 8915, 12226, + 14775, 17791, + 20664, 23679, + 26829, 29353, + 1677, 2870, + 5386, 8077, + 11817, 15176, + 18657, 22006, + 25513, 28689, + 2111, 3625, + 7027, 10588, + 14059, 17193, + 21137, 24260, + 27577, 30036, + 2428, 4010, + 5765, 9376, + 13805, 15821, + 19444, 22389, + 25295, 29310, + 2256, 4628, + 8377, 12441, + 15283, 19462, + 22257, 25551, + 28432, 30304, + 2352, 3675, + 6129, 11868, + 14551, 16655, + 19624, 21883, + 26526, 28849, + 5243, 7248, + 10558, 13269, + 15651, 17919, + 21141, 23827, + 27102, 29519, + 4422, 6725, + 10449, 13273, + 16124, 19921, + 22826, 26061, + 28763, 30583, + 4508, 6291, + 9504, 11809, + 13827, 15950, + 19077, 22084, + 25740, 28658, + 2540, 4297, + 8579, 13578, + 16634, 19101, + 21547, 23887, + 26777, 29146, + 3377, 6358, + 10224, 14518, + 17905, 21056, + 23637, 25784, + 28161, 30109, + 4177, 5942, + 8159, 10108, + 12130, 15470, + 20191, 23326, + 26782, 29359, + 2492, 3801, + 6144, 9825, + 16000, 18671, + 20893, 23663, + 25899, 28974, + 3011, 4727, + 6834, 10505, + 12465, 14496, + 17065, 20052, + 25265, 28057, + 4149, 7197, + 12338, 15076, + 18002, 20190, + 22187, 24723, + 27083, 29125, + 2975, 4578, + 6448, 8378, + 9671, 13225, + 19502, 22277, + 26058, 28850, + 4102, 5760, + 7744, 9484, + 10744, 12308, + 14677, 19607, + 24841, 28381, + 4931, 9287, + 12477, 13395, + 13712, 14351, + 16048, 19867, + 24188, 28994, + 4141, 7867, + 13140, 17720, + 20064, 21108, + 21692, 22722, + 23736, 27449, + 4011, 8720, + 13234, 16206, + 17601, 18289, + 18524, 19689, + 23234, 27882, + 3420, 5995, + 11230, 15117, + 15907, 16783, + 17762, 23347, + 26898, 29946, + 3080, 6786, + 10465, 13676, + 18059, 23615, + 27058, 29082, + 29563, 29905, + 3038, 5620, + 9266, 12870, + 18803, 19610, + 20010, 20802, + 23882, 29306, + 3314, 6420, + 9046, 13262, + 15869, 23117, + 23667, 24215, + 24487, 25915, + 3469, 6963, + 10103, 15282, + 20531, 23240, + 25024, 26021, + 26736, 27255, + 3041, 6459, + 9777, 12896, + 16315, 19410, + 24070, 29353, + 31795, 32075, + -200, -134, + -113, -204, + -347, -440, + -352, -211, + -418, -172, + -313, 59, + 495, 772, + 721, 614, + 334, 444, + 225, 242, + 161, 16, + 274, 564, + -73, -188, + -395, -171, + 777, 508, + 1340, 1145, + 699, 196, + 223, 173, + 90, 25, + -26, 18, + 133, -105, + -360, -277, + 859, 634, + 41, -557, + -768, -926, + -601, -1021, + -1189, -365, + 225, 107, + 374, -50, + 433, 417, + 156, 39, + -597, -1397, + -1594, -592, + -485, -292, + 253, 87, + -0, -6, + -25, -345, + -240, 120, + 1261, 946, + 166, -277, + 241, 167, + 170, 429, + 518, 714, + 602, 254, + 134, 92, + -152, -324, + -394, 49, + -151, -304, + -724, -657, + -162, -369, + -35, 3, + -2, -312, + -200, -92, + -227, 242, + 628, 565, + -124, 1056, + 770, 101, + -84, -33, + 4, -192, + -272, 5, + -627, -977, + 419, 472, + 53, -103, + 145, 322, + -95, -31, + -100, -303, + -560, -1067, + -413, 714, + 283, 2, + -223, -367, + 523, 360, + -38, -115, + 378, -591, + -718, 448, + -481, -274, + 180, -88, + -581, -157, + -696, -1265, + 394, -479, + -23, 124, + -43, 19, + -113, -236, + -412, -659, + -200, 2, + -69, -342, + 199, 55, + 58, -36, + -51, -62, + 507, 507, + 427, 442, + 36, 601, + -141, 68, + 274, 274, + 68, -12, + -4, 71, + -193, -464, + -425, -383, + 408, 203, + -337, 236, + 410, -59, + -25, -341, + -449, 28, + -9, 90, + 332, -14, + -905, 96, + -540, -242, + 679, -59, + 192, -24, + 60, -217, + 5, -37, + 179, -20, + 311, 519, + 274, 72, + -326, -1030, + -262, 213, + 380, 82, + 328, 411, + -540, 574, + -283, 151, + 181, -402, + -278, -240, + -110, -227, + -264, -89, + -250, -259, + -27, 106, + -239, -98, + -390, 118, + 61, 104, + 294, 532, + 92, -13, + 60, -233, + 335, 541, + 307, -26, + -110, -91, + -231, -460, + 170, 201, + 96, -372, + 132, 435, + -302, 216, + -279, -41, + 74, 190, + 368, 273, + -186, -608, + -157, 159, + 12, 278, + 245, 307, + 25, -187, + -16, 55, + 30, -163, + 548, -307, + 106, -5, + 27, 330, + -416, 475, + 438, -235, + 104, 137, + 21, -5, + -300, -468, + 521, -347, + 170, -200, + -219, 308, + -122, -133, + 219, -16, + 359, 412, + -89, -111, + 48, 322, + 142, 177, + -286, -127, + -39, -63, + -42, -451, + 160, 308, + -57, 193, + -48, 74, + -346, 59, + -27, 27, + -469, -277, + -344, 282, + 262, 122, + 171, -249, + 27, 258, + 188, -3, + 67, -206, + -284, 291, + -117, -88, + -477, 375, + 50, 106, + 99, -182, + 438, -376, + -401, -49, + 119, -23, + -10, -48, + -116, -200, + -310, 121, + 73, 7, + 237, -226, + 139, -456, + 397, 35, + 3, -108, + 323, -75, + 332, 198, + -99, -21 +}; + +const SKP_Silk_NLSF_CBS SKP_Silk_NLSF_CB1_10_Stage_info[ NLSF_MSVQ_CB1_10_STAGES ] = +{ + { 32, &SKP_Silk_NLSF_MSVQ_CB1_10_Q15[ 10 * 0 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates_Q5[ 0 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10_Q15[ 10 * 32 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates_Q5[ 32 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10_Q15[ 10 * 40 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates_Q5[ 40 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10_Q15[ 10 * 48 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates_Q5[ 48 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10_Q15[ 10 * 56 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates_Q5[ 56 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10_Q15[ 10 * 64 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates_Q5[ 64 ] } +}; + +const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB1_10 = +{ + NLSF_MSVQ_CB1_10_STAGES, + SKP_Silk_NLSF_CB1_10_Stage_info, + SKP_Silk_NLSF_MSVQ_CB1_10_ndelta_min_Q15, + SKP_Silk_NLSF_MSVQ_CB1_10_CDF, + SKP_Silk_NLSF_MSVQ_CB1_10_CDF_start_ptr, + SKP_Silk_NLSF_MSVQ_CB1_10_CDF_middle_idx +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10.h new file mode 100755 index 0000000..789d0bf --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10.h @@ -0,0 +1,51 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_TABLES_NLSF_CB1_10_H +#define SKP_SILK_TABLES_NLSF_CB1_10_H + +#include "SKP_Silk_define.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define NLSF_MSVQ_CB1_10_STAGES 6 +#define NLSF_MSVQ_CB1_10_VECTORS 72 + +/* NLSF codebook entropy coding tables */ +extern const SKP_uint16 SKP_Silk_NLSF_MSVQ_CB1_10_CDF[ NLSF_MSVQ_CB1_10_VECTORS + NLSF_MSVQ_CB1_10_STAGES ]; +extern const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB1_10_CDF_start_ptr[ NLSF_MSVQ_CB1_10_STAGES ]; +extern const SKP_int SKP_Silk_NLSF_MSVQ_CB1_10_CDF_middle_idx[ NLSF_MSVQ_CB1_10_STAGES ]; + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10_FLP.c new file mode 100755 index 0000000..11eaae2 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_10_FLP.c @@ -0,0 +1,475 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/**********************************************/ +/* This file has been automatically generated */ +/* */ +/* ROM usage: 3.21 kB */ +/**********************************************/ + +#include "SKP_Silk_tables_FLP.h" +#include "SKP_Silk_tables_NLSF_CB1_10.h" + +const SKP_float SKP_Silk_NLSF_MSVQ_CB1_10_rates[ NLSF_MSVQ_CB1_10_VECTORS ] = +{ + 1.93750000000000000000f, 3.21875000000000000000f, + 3.75000000000000000000f, 3.96875000000000000000f, + 4.21875000000000000000f, 4.21875000000000000000f, + 4.84375000000000000000f, 5.21875000000000000000f, + 5.25000000000000000000f, 5.37500000000000000000f, + 5.40625000000000000000f, 5.50000000000000000000f, + 5.59375000000000000000f, 5.65625000000000000000f, + 5.65625000000000000000f, 5.78125000000000000000f, + 5.81250000000000000000f, 6.18750000000000000000f, + 6.21875000000000000000f, 6.34375000000000000000f, + 6.40625000000000000000f, 6.93750000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 1.68750000000000000000f, 2.37500000000000000000f, + 3.15625000000000000000f, 3.37500000000000000000f, + 3.71875000000000000000f, 3.75000000000000000000f, + 3.84375000000000000000f, 3.90625000000000000000f, + 2.12500000000000000000f, 2.65625000000000000000f, + 2.71875000000000000000f, 3.21875000000000000000f, + 3.34375000000000000000f, 3.50000000000000000000f, + 3.59375000000000000000f, 3.62500000000000000000f, + 2.43750000000000000000f, 2.65625000000000000000f, + 2.65625000000000000000f, 3.15625000000000000000f, + 3.28125000000000000000f, 3.28125000000000000000f, + 3.43750000000000000000f, 3.46875000000000000000f, + 2.59375000000000000000f, 2.84375000000000000000f, + 3.03125000000000000000f, 3.03125000000000000000f, + 3.03125000000000000000f, 3.12500000000000000000f, + 3.15625000000000000000f, 3.28125000000000000000f, + 2.87500000000000000000f, 2.90625000000000000000f, + 2.90625000000000000000f, 2.96875000000000000000f, + 3.00000000000000000000f, 3.06250000000000000000f, + 3.09375000000000000000f, 3.21875000000000000000f +}; + +const SKP_float SKP_Silk_NLSF_MSVQ_CB1_10_ndelta_min[ 10 + 1 ] = +{ + 0.01409912109375000000f, + 0.00009155273437500000f, + 0.00195312500000000000f, + 0.00225830078125000000f, + 0.00299072265625000000f, + 0.00152587890625000000f, + 0.00296020507812500000f, + 0.00207519531250000000f, + 0.00366210937499999960f, + 0.00161743164062500000f, + 0.01950073242187500000f +}; + +const SKP_float SKP_Silk_NLSF_MSVQ_CB1_10[ 10 * NLSF_MSVQ_CB1_10_VECTORS ] = +{ + 0.05728149414062500000f, 0.14178466796875000000f, + 0.23535156250000003000f, 0.32791137695312500000f, + 0.42614746093750000000f, 0.51965332031250000000f, + 0.61764526367187500000f, 0.70745849609375000000f, + 0.80783081054687511000f, 0.89376831054687500000f, + 0.04919433593750000000f, 0.10003662109375001000f, + 0.21624755859374997000f, 0.30441284179687500000f, + 0.40368652343750000000f, 0.49633789062499994000f, + 0.59802246093750000000f, 0.69244384765625011000f, + 0.79458618164062500000f, 0.88394165039062500000f, + 0.06619262695312500000f, 0.11688232421875000000f, + 0.19714355468750000000f, 0.27337646484375000000f, + 0.36499023437500000000f, 0.45013427734375000000f, + 0.56176757812500000000f, 0.66098022460937500000f, + 0.76348876953125000000f, 0.85580444335937489000f, + 0.11230468750000001000f, 0.18383789062500000000f, + 0.27423095703125000000f, 0.37402343749999994000f, + 0.46389770507812494000f, 0.55505371093750000000f, + 0.66348266601562500000f, 0.74645996093750000000f, + 0.83874511718749989000f, 0.91732788085937500000f, + 0.07885742187500000000f, 0.15829467773437500000f, + 0.23800659179687500000f, 0.33270263671874994000f, + 0.40219116210937500000f, 0.48110961914062500000f, + 0.58035278320312500000f, 0.68453979492187500000f, + 0.79013061523437500000f, 0.87579345703125000000f, + 0.11386108398437500000f, 0.17550659179687500000f, + 0.26397705078125000000f, 0.35833740234375000000f, + 0.46051025390625000000f, 0.53121948242187500000f, + 0.62228393554687500000f, 0.71475219726562500000f, + 0.80041503906250000000f, 0.89254760742187511000f, + 0.06430053710937500000f, 0.19296264648437500000f, + 0.27206420898437500000f, 0.37310791015625000000f, + 0.45089721679687500000f, 0.54293823242187500000f, + 0.63061523437500000000f, 0.72262573242187500000f, + 0.81875610351562500000f, 0.89578247070312500000f, + 0.05117797851562500000f, 0.08758544921875000000f, + 0.16436767578125000000f, 0.24649047851562500000f, + 0.36062622070312500000f, 0.46313476562500000000f, + 0.56936645507812500000f, 0.67156982421875011000f, + 0.77859497070312500000f, 0.87551879882812500000f, + 0.06442260742187500000f, 0.11062622070312501000f, + 0.21444702148437500000f, 0.32312011718750000000f, + 0.42904663085937500000f, 0.52468872070312500000f, + 0.64505004882812489000f, 0.74035644531250000000f, + 0.84158325195312500000f, 0.91662597656250011000f, + 0.07409667968750000000f, 0.12237548828125000000f, + 0.17593383789062500000f, 0.28613281250000000000f, + 0.42129516601562500000f, 0.48281860351562500000f, + 0.59338378906250000000f, 0.68325805664062511000f, + 0.77194213867187500000f, 0.89447021484375000000f, + 0.06884765625000000000f, 0.14123535156250000000f, + 0.25564575195312500000f, 0.37966918945312500000f, + 0.46640014648437500000f, 0.59393310546875000000f, + 0.67922973632812500000f, 0.77975463867187489000f, + 0.86767578124999989000f, 0.92480468750000000000f, + 0.07177734375000000000f, 0.11215209960937499000f, + 0.18704223632812500000f, 0.36218261718750000000f, + 0.44406127929687494000f, 0.50827026367187500000f, + 0.59887695312500000000f, 0.66781616210937500000f, + 0.80950927734375000000f, 0.88040161132812500000f, + 0.16000366210937500000f, 0.22119140625000000000f, + 0.32220458984375000000f, 0.40493774414062500000f, + 0.47763061523437506000f, 0.54684448242187500000f, + 0.64517211914062500000f, 0.72714233398437500000f, + 0.82708740234375000000f, 0.90084838867187489000f, + 0.13494873046875000000f, 0.20523071289062500000f, + 0.31887817382812500000f, 0.40505981445312500000f, + 0.49206542968750000000f, 0.60794067382812500000f, + 0.69659423828124989000f, 0.79531860351562500000f, + 0.87777709960937500000f, 0.93331909179687500000f, + 0.13757324218750000000f, 0.19198608398437500000f, + 0.29003906250000000000f, 0.36038208007812506000f, + 0.42196655273437500000f, 0.48675537109375000000f, + 0.58218383789062500000f, 0.67395019531250000000f, + 0.78552246093750000000f, 0.87457275390625000000f, + 0.07751464843750000000f, 0.13113403320312500000f, + 0.26181030273437500000f, 0.41436767578125000000f, + 0.50762939453125000000f, 0.58291625976562500000f, + 0.65756225585937500000f, 0.72897338867187500000f, + 0.81716918945312489000f, 0.88946533203125000000f, + 0.10305786132812501000f, 0.19403076171875003000f, + 0.31201171875000000000f, 0.44305419921875000000f, + 0.54641723632812500000f, 0.64257812500000000000f, + 0.72134399414062500000f, 0.78686523437500011000f, + 0.85940551757812500000f, 0.91885375976562500000f, + 0.12747192382812500000f, 0.18133544921875000000f, + 0.24899291992187497000f, 0.30847167968750000000f, + 0.37017822265625000000f, 0.47210693359375000000f, + 0.61618041992187500000f, 0.71185302734375000000f, + 0.81732177734375000000f, 0.89596557617187500000f, + 0.07604980468750000000f, 0.11599731445312501000f, + 0.18750000000000000000f, 0.29983520507812500000f, + 0.48828124999999994000f, 0.56979370117187500000f, + 0.63760375976562489000f, 0.72213745117187500000f, + 0.79037475585937500000f, 0.88421630859374989000f, + 0.09188842773437500000f, 0.14425659179687500000f, + 0.20855712890625000000f, 0.32058715820312500000f, + 0.38040161132812500000f, 0.44238281250000000000f, + 0.52078247070312500000f, 0.61193847656250000000f, + 0.77102661132812500000f, 0.85623168945312500000f, + 0.12661743164062500000f, 0.21963500976562500000f, + 0.37652587890625000000f, 0.46008300781249994000f, + 0.54937744140625000000f, 0.61614990234375000000f, + 0.67709350585937500000f, 0.75448608398437500000f, + 0.82650756835937500000f, 0.88882446289062511000f, + 0.09078979492187500000f, 0.13970947265625000000f, + 0.19677734375000000000f, 0.25567626953125000000f, + 0.29513549804687500000f, 0.40359497070312500000f, + 0.59515380859375000000f, 0.67984008789062500000f, + 0.79522705078125000000f, 0.88043212890625000000f, + 0.12518310546875000000f, 0.17578125000000000000f, + 0.23632812500000000000f, 0.28942871093750000000f, + 0.32788085937500000000f, 0.37561035156250000000f, + 0.44790649414062500000f, 0.59835815429687500000f, + 0.75808715820312500000f, 0.86611938476562489000f, + 0.15048217773437500000f, 0.28341674804687500000f, + 0.38076782226562500000f, 0.40878295898437500000f, + 0.41845703125000000000f, 0.43795776367187506000f, + 0.48974609375000000000f, 0.60629272460937500000f, + 0.73815917968750000000f, 0.88482666015624989000f, + 0.12637329101562500000f, 0.24008178710937500000f, + 0.40100097656250000000f, 0.54077148437500000000f, + 0.61230468750000000000f, 0.64416503906250000000f, + 0.66198730468750000000f, 0.69342041015625000000f, + 0.72436523437500000000f, 0.83767700195312500000f, + 0.12240600585937499000f, 0.26611328125000000000f, + 0.40386962890625006000f, 0.49456787109375006000f, + 0.53713989257812500000f, 0.55813598632812500000f, + 0.56530761718750000000f, 0.60086059570312500000f, + 0.70904541015625000000f, 0.85089111328125000000f, + 0.10437011718750000000f, 0.18295288085937500000f, + 0.34271240234375006000f, 0.46133422851562500000f, + 0.48544311523437500000f, 0.51217651367187500000f, + 0.54205322265625000000f, 0.71249389648437500000f, + 0.82086181640625000000f, 0.91387939453125000000f, + 0.09399414062500001400f, 0.20709228515625000000f, + 0.31936645507812506000f, 0.41735839843750000000f, + 0.55111694335937500000f, 0.72067260742187489000f, + 0.82574462890624989000f, 0.88751220703124989000f, + 0.90219116210937500000f, 0.91262817382812500000f, + 0.09271240234375000000f, 0.17150878906250003000f, + 0.28277587890625000000f, 0.39276123046875000000f, + 0.57382202148437500000f, 0.59844970703125000000f, + 0.61065673828125000000f, 0.63482666015625000000f, + 0.72882080078125011000f, 0.89434814453125000000f, + 0.10113525390625000000f, 0.19592285156250000000f, + 0.27606201171875000000f, 0.40472412109375000000f, + 0.48428344726562500000f, 0.70547485351562500000f, + 0.72225952148437500000f, 0.73898315429687500000f, + 0.74728393554687500000f, 0.79086303710937500000f, + 0.10586547851562500000f, 0.21249389648437500000f, + 0.30831909179687500000f, 0.46636962890625006000f, + 0.62655639648437500000f, 0.70922851562500000000f, + 0.76367187500000000000f, 0.79409790039062500000f, + 0.81591796875000000000f, 0.83175659179687500000f, + 0.09280395507812500000f, 0.19711303710937500000f, + 0.29837036132812500000f, 0.39355468750000000000f, + 0.49789428710937500000f, 0.59234619140625000000f, + 0.73455810546875000000f, 0.89578247070312500000f, + 0.97030639648437500000f, 0.97885131835937500000f, + -0.00610351562500000000f, -0.00408935546875000000f, + -0.00344848632812500000f, -0.00622558593750000000f, + -0.01058959960937500000f, -0.01342773437500000000f, + -0.01074218749999999800f, -0.00643920898437500000f, + -0.01275634765625000200f, -0.00524902343750000000f, + -0.00955200195312500000f, 0.00180053710937500000f, + 0.01510620117187500000f, 0.02355957031250000000f, + 0.02200317382812500000f, 0.01873779296875000000f, + 0.01019287109375000000f, 0.01354980468750000000f, + 0.00686645507812500000f, 0.00738525390625000000f, + 0.00491333007812500000f, 0.00048828125000000000f, + 0.00836181640625000000f, 0.01721191406250000000f, + -0.00222778320312500000f, -0.00573730468750000000f, + -0.01205444335937500000f, -0.00521850585937500000f, + 0.02371215820312499700f, 0.01550292968750000000f, + 0.04089355468750000000f, 0.03494262695312500000f, + 0.02133178710937500000f, 0.00598144531250000000f, + 0.00680541992187500000f, 0.00527954101562500000f, + 0.00274658203125000000f, 0.00076293945312500000f, + -0.00079345703125000011f, 0.00054931640625000000f, + 0.00405883789062500000f, -0.00320434570312500000f, + -0.01098632812500000000f, -0.00845336914062500000f, + 0.02621459960937500000f, 0.01934814453125000000f, + 0.00125122070312500000f, -0.01699829101562500000f, + -0.02343750000000000000f, -0.02825927734375000000f, + -0.01834106445312500000f, -0.03115844726562500000f, + -0.03628540039062500000f, -0.01113891601562500000f, + 0.00686645507812500000f, 0.00326538085937500000f, + 0.01141357421875000200f, -0.00152587890625000000f, + 0.01321411132812500000f, 0.01272583007812500000f, + 0.00476074218750000000f, 0.00119018554687500000f, + -0.01821899414062500000f, -0.04263305664062499300f, + -0.04864501953125000000f, -0.01806640625000000000f, + -0.01480102539062500000f, -0.00891113281250000000f, + 0.00772094726562500000f, 0.00265502929687500000f, + -0.00000000000000000000f, -0.00018310546875000000f, + -0.00076293945312500000f, -0.01052856445312500000f, + -0.00732421874999999910f, 0.00366210937499999960f, + 0.03848266601562500000f, 0.02886962890625000000f, + 0.00506591796875000090f, -0.00845336914062500000f, + 0.00735473632812500090f, 0.00509643554687500000f, + 0.00518798828125000000f, 0.01309204101562500000f, + 0.01580810546875000000f, 0.02178955078125000000f, + 0.01837158203125000000f, 0.00775146484375000000f, + 0.00408935546875000000f, 0.00280761718750000000f, + -0.00463867187500000000f, -0.00988769531250000000f, + -0.01202392578124999800f, 0.00149536132812500000f, + -0.00460815429687500000f, -0.00927734375000000000f, + -0.02209472656250000000f, -0.02005004882812500000f, + -0.00494384765625000000f, -0.01126098632812500000f, + -0.00106811523437500000f, 0.00009155273437500000f, + -0.00006103515625000000f, -0.00952148437500000000f, + -0.00610351562500000000f, -0.00280761718750000000f, + -0.00692749023437500000f, 0.00738525390625000000f, + 0.01916503906250000000f, 0.01724243164062500000f, + -0.00378417968750000000f, 0.03222656250000000000f, + 0.02349853515625000300f, 0.00308227539062500000f, + -0.00256347656250000000f, -0.00100708007812500000f, + 0.00012207031250000000f, -0.00585937500000000000f, + -0.00830078125000000000f, 0.00015258789062500000f, + -0.01913452148437500000f, -0.02981567382812500000f, + 0.01278686523437500000f, 0.01440429687500000000f, + 0.00161743164062500000f, -0.00314331054687500000f, + 0.00442504882812500000f, 0.00982666015625000000f, + -0.00289916992187500000f, -0.00094604492187500000f, + -0.00305175781250000000f, -0.00924682617187500000f, + -0.01708984375000000000f, -0.03256225585937500000f, + -0.01260375976562500000f, 0.02178955078125000000f, + 0.00863647460937500000f, 0.00006103515625000000f, + -0.00680541992187500000f, -0.01119995117187500000f, + 0.01596069335937500000f, 0.01098632812500000000f, + -0.00115966796875000000f, -0.00350952148437500040f, + 0.01153564453125000000f, -0.01803588867187500000f, + -0.02191162109375000000f, 0.01367187500000000000f, + -0.01467895507812500000f, -0.00836181640625000000f, + 0.00549316406250000000f, -0.00268554687499999960f, + -0.01773071289062500000f, -0.00479125976562500000f, + -0.02124023437500000000f, -0.03860473632812500000f, + 0.01202392578124999800f, -0.01461791992187500000f, + -0.00070190429687500000f, 0.00378417968750000000f, + -0.00131225585937500000f, 0.00057983398437500000f, + -0.00344848632812500000f, -0.00720214843750000000f, + -0.01257324218750000000f, -0.02011108398437500000f, + -0.00610351562500000000f, 0.00006103515625000000f, + -0.00210571289062500000f, -0.01043701171875000000f, + 0.00607299804687500000f, 0.00167846679687500000f, + 0.00177001953125000000f, -0.00109863281250000000f, + -0.00155639648437500000f, -0.00189208984375000000f, + 0.01547241210937500000f, 0.01547241210937500000f, + 0.01303100585937500200f, 0.01348876953125000000f, + 0.00109863281250000000f, 0.01834106445312500000f, + -0.00430297851562500000f, 0.00207519531250000000f, + 0.00836181640625000000f, 0.00836181640625000000f, + 0.00207519531250000000f, -0.00036621093750000000f, + -0.00012207031250000000f, 0.00216674804687500000f, + -0.00588989257812500000f, -0.01416015625000000000f, + -0.01296997070312499800f, -0.01168823242187499800f, + 0.01245117187500000000f, 0.00619506835937500000f, + -0.01028442382812500000f, 0.00720214843750000000f, + 0.01251220703125000000f, -0.00180053710937500000f, + -0.00076293945312500000f, -0.01040649414062499800f, + -0.01370239257812500200f, 0.00085449218750000000f, + -0.00027465820312500000f, 0.00274658203125000000f, + 0.01013183593750000200f, -0.00042724609375000000f, + -0.02761840820312499700f, 0.00292968750000000000f, + -0.01647949218750000000f, -0.00738525390625000000f, + 0.02072143554687500000f, -0.00180053710937500000f, + 0.00585937500000000000f, -0.00073242187500000000f, + 0.00183105468749999980f, -0.00662231445312500000f, + 0.00015258789062500000f, -0.00112915039062500000f, + 0.00546264648437500000f, -0.00061035156250000000f, + 0.00949096679687500000f, 0.01583862304687500000f, + 0.00836181640625000000f, 0.00219726562500000000f, + -0.00994873046875000000f, -0.03143310546875000000f, + -0.00799560546875000000f, 0.00650024414062500000f, + 0.01159667968750000000f, 0.00250244140625000000f, + 0.01000976562500000000f, 0.01254272460937500000f, + -0.01647949218750000000f, 0.01751708984375000000f, + -0.00863647460937500000f, 0.00460815429687500000f, + 0.00552368164062500000f, -0.01226806640625000000f, + -0.00848388671875000000f, -0.00732421874999999910f, + -0.00335693359375000000f, -0.00692749023437500000f, + -0.00805664062500000000f, -0.00271606445312500000f, + -0.00762939453124999910f, -0.00790405273437500000f, + -0.00082397460937500000f, 0.00323486328125000000f, + -0.00729370117187499910f, -0.00299072265625000000f, + -0.01190185546875000000f, 0.00360107421875000000f, + 0.00186157226562500000f, 0.00317382812500000040f, + 0.00897216796875000000f, 0.01623535156250000000f, + 0.00280761718750000000f, -0.00039672851562500005f, + 0.00183105468749999980f, -0.00711059570312500000f, + 0.01022338867187500000f, 0.01651000976562500000f, + 0.00936889648437500000f, -0.00079345703125000011f, + -0.00335693359375000000f, -0.00277709960937500000f, + -0.00704956054687500000f, -0.01403808593750000200f, + 0.00518798828125000000f, 0.00613403320312500000f, + 0.00292968750000000000f, -0.01135253906249999800f, + 0.00402832031250000000f, 0.01327514648437500000f, + -0.00921630859375000000f, 0.00659179687500000000f, + -0.00851440429687500000f, -0.00125122070312500000f, + 0.00225830078125000000f, 0.00579833984375000000f, + 0.01123046875000000000f, 0.00833129882812500000f, + -0.00567626953124999910f, -0.01855468750000000000f, + -0.00479125976562500000f, 0.00485229492187500000f, + 0.00036621093750000000f, 0.00848388671875000000f, + 0.00747680664062500000f, 0.00936889648437500000f, + 0.00076293945312500000f, -0.00570678710937500090f, + -0.00048828125000000000f, 0.00167846679687500000f, + 0.00091552734374999989f, -0.00497436523437500000f, + 0.01672363281250000000f, -0.00936889648437500000f, + 0.00323486328125000000f, -0.00015258789062500000f, + 0.00082397460937500000f, 0.01007080078124999800f, + -0.01269531250000000200f, 0.01449584960937500000f, + 0.01336669921875000200f, -0.00717163085937500000f, + 0.00317382812500000040f, 0.00418090820312500000f, + 0.00064086914062500000f, -0.00015258789062500000f, + -0.00915527343750000000f, -0.01428222656250000000f, + 0.01589965820312500000f, -0.01058959960937500000f, + 0.00518798828125000000f, -0.00610351562500000000f, + -0.00668334960937500090f, 0.00939941406250000000f, + -0.00372314453125000000f, -0.00405883789062500000f, + 0.00668334960937500090f, -0.00048828125000000000f, + 0.01095581054687500000f, 0.01257324218750000000f, + -0.00271606445312500000f, -0.00338745117187500000f, + 0.00146484375000000000f, 0.00982666015625000000f, + 0.00433349609375000000f, 0.00540161132812500090f, + -0.00872802734375000000f, -0.00387573242187500000f, + -0.00119018554687500000f, -0.00192260742187500000f, + -0.00128173828125000000f, -0.01376342773437500000f, + 0.00488281250000000000f, 0.00939941406250000000f, + -0.00173950195312500000f, 0.00588989257812500000f, + -0.00146484375000000000f, 0.00225830078125000000f, + -0.01055908203125000000f, 0.00180053710937500000f, + -0.00082397460937500000f, 0.00082397460937500000f, + -0.01431274414062499800f, -0.00845336914062500000f, + -0.01049804687500000000f, 0.00860595703125000000f, + 0.00799560546875000000f, 0.00372314453125000000f, + 0.00521850585937500000f, -0.00759887695312500000f, + 0.00082397460937500000f, 0.00787353515625000000f, + 0.00573730468750000000f, -0.00009155273437500000f, + 0.00204467773437500000f, -0.00628662109375000000f, + -0.00866699218750000000f, 0.00888061523437500000f, + -0.00357055664062500000f, -0.00268554687499999960f, + -0.01455688476562500000f, 0.01144409179687500000f, + 0.00152587890625000000f, 0.00323486328125000000f, + 0.00302124023437500040f, -0.00555419921875000000f, + 0.01336669921875000200f, -0.01147460937500000000f, + -0.01223754882812500000f, -0.00149536132812500000f, + 0.00363159179687500000f, -0.00070190429687500000f, + -0.00030517578125000000f, -0.00146484375000000000f, + -0.00354003906250000000f, -0.00610351562500000000f, + -0.00946044921875000000f, 0.00369262695312500000f, + 0.00222778320312500000f, 0.00021362304687500000f, + 0.00723266601562500000f, -0.00689697265625000000f, + 0.00424194335937500000f, -0.01391601562500000000f, + 0.01211547851562500000f, 0.00106811523437500000f, + 0.00009155273437500000f, -0.00329589843750000000f, + 0.00985717773437500000f, -0.00228881835937500000f, + 0.01013183593750000200f, 0.00604248046875000090f, + -0.00302124023437500040f, -0.00064086914062500000f +}; + +const SKP_Silk_NLSF_CBS_FLP SKP_Silk_NLSF_CB1_10_Stage_info_FLP[ NLSF_MSVQ_CB1_10_STAGES ] = +{ + { 32, &SKP_Silk_NLSF_MSVQ_CB1_10[ 10 * 0 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates[ 0 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10[ 10 * 32 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates[ 32 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10[ 10 * 40 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates[ 40 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10[ 10 * 48 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates[ 48 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10[ 10 * 56 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates[ 56 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_10[ 10 * 64 ], &SKP_Silk_NLSF_MSVQ_CB1_10_rates[ 64 ] } +}; + +const SKP_Silk_NLSF_CB_FLP SKP_Silk_NLSF_CB1_10_FLP = +{ + NLSF_MSVQ_CB1_10_STAGES, + SKP_Silk_NLSF_CB1_10_Stage_info_FLP, + SKP_Silk_NLSF_MSVQ_CB1_10_ndelta_min, + SKP_Silk_NLSF_MSVQ_CB1_10_CDF, + SKP_Silk_NLSF_MSVQ_CB1_10_CDF_start_ptr, + SKP_Silk_NLSF_MSVQ_CB1_10_CDF_middle_idx +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16.c new file mode 100755 index 0000000..b02f34d --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16.c @@ -0,0 +1,704 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/**********************************************/ +/* This file has been automatically generated */ +/* */ +/* ROM usage: 0.29 + 3.57 kB */ +/**********************************************/ + +#include "SKP_Silk_structs.h" +#include "SKP_Silk_tables_NLSF_CB1_16.h" +#include "SKP_Silk_tables.h" + +const SKP_uint16 SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ NLSF_MSVQ_CB1_16_VECTORS + NLSF_MSVQ_CB1_16_STAGES ] = +{ + 0, + 19099, + 26957, + 30639, + 34242, + 37546, + 40447, + 43287, + 46005, + 48445, + 49865, + 51284, + 52673, + 53975, + 55221, + 56441, + 57267, + 58025, + 58648, + 59232, + 59768, + 60248, + 60729, + 61210, + 61690, + 62171, + 62651, + 63132, + 63613, + 64093, + 64574, + 65054, + 65535, + 0, + 28808, + 38775, + 46801, + 51785, + 55886, + 59410, + 62572, + 65535, + 0, + 27376, + 38639, + 45052, + 51465, + 55448, + 59021, + 62594, + 65535, + 0, + 33403, + 39569, + 45102, + 49961, + 54047, + 57959, + 61788, + 65535, + 0, + 25851, + 43356, + 47828, + 52204, + 55964, + 59413, + 62507, + 65535, + 0, + 34277, + 40337, + 45432, + 50311, + 54326, + 58171, + 61853, + 65535, + 0, + 33538, + 39865, + 45302, + 50076, + 54549, + 58478, + 62159, + 65535, + 0, + 27445, + 35258, + 40665, + 46072, + 51362, + 56540, + 61086, + 65535, + 0, + 22080, + 30779, + 37065, + 43085, + 48849, + 54613, + 60133, + 65535, + 0, + 13417, + 21748, + 30078, + 38231, + 46383, + 53091, + 59515, + 65535 +}; + +const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB1_16_CDF_start_ptr[ NLSF_MSVQ_CB1_16_STAGES ] = +{ + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 0 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 33 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 42 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 51 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 60 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 69 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 78 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 87 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 96 ], + &SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ 105 ] +}; + +const SKP_int SKP_Silk_NLSF_MSVQ_CB1_16_CDF_middle_idx[ NLSF_MSVQ_CB1_16_STAGES ] = +{ + 5, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 4 +}; + +const SKP_int16 SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ NLSF_MSVQ_CB1_16_VECTORS ] = +{ + 57, 98, + 133, 134, + 138, 144, + 145, 147, + 152, 177, + 177, 178, + 181, 183, + 184, 202, + 206, 215, + 218, 222, + 227, 227, + 227, 227, + 227, 227, + 227, 227, + 227, 227, + 227, 227, + 38, 87, + 97, 119, + 128, 135, + 140, 143, + 40, 81, + 107, 107, + 129, 134, + 134, 143, + 31, 109, + 114, 120, + 128, 130, + 131, 132, + 43, 61, + 124, 125, + 132, 136, + 141, 142, + 30, 110, + 118, 120, + 129, 131, + 133, 133, + 31, 108, + 115, 121, + 124, 130, + 133, 137, + 40, 98, + 115, 115, + 116, 117, + 123, 124, + 50, 93, + 108, 110, + 112, 112, + 114, 115, + 73, 95, + 95, 96, + 96, 105, + 107, 110 +}; + +const SKP_int SKP_Silk_NLSF_MSVQ_CB1_16_ndelta_min_Q15[ 16 + 1 ] = +{ + 148, + 3, + 60, + 68, + 117, + 86, + 121, + 124, + 152, + 153, + 207, + 151, + 225, + 239, + 126, + 183, + 792 +}; + +const SKP_int16 SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * NLSF_MSVQ_CB1_16_VECTORS ] = +{ + 1309, 3060, 5071, 6996, + 9028, 10938, 12934, 14891, + 16933, 18854, 20792, 22764, + 24753, 26659, 28626, 30501, + 1264, 2745, 4610, 6408, + 8286, 10043, 12084, 14108, + 16118, 18163, 20095, 22164, + 24264, 26316, 28329, 30251, + 1044, 2080, 3672, 5179, + 7140, 9100, 11070, 13065, + 15423, 17790, 19931, 22101, + 24290, 26361, 28499, 30418, + 1131, 2476, 4478, 6149, + 7902, 9875, 11938, 13809, + 15869, 17730, 19948, 21707, + 23761, 25535, 27426, 28917, + 1040, 2004, 4026, 6100, + 8432, 10494, 12610, 14694, + 16797, 18775, 20799, 22782, + 24772, 26682, 28631, 30516, + 2310, 3812, 5913, 7933, + 10033, 11881, 13885, 15798, + 17751, 19576, 21482, 23276, + 25157, 27010, 28833, 30623, + 1254, 2847, 5013, 6781, + 8626, 10370, 12726, 14633, + 16281, 17852, 19870, 21472, + 23002, 24629, 26710, 27960, + 1468, 3059, 4987, 7026, + 8741, 10412, 12281, 14020, + 15970, 17723, 19640, 21522, + 23472, 25661, 27986, 30225, + 2171, 3566, 5605, 7384, + 9404, 11220, 13030, 14758, + 16687, 18417, 20346, 22091, + 24055, 26212, 28356, 30397, + 2409, 4676, 7543, 9786, + 11419, 12935, 14368, 15653, + 17366, 18943, 20762, 22477, + 24440, 26327, 28284, 30242, + 2354, 4222, 6820, 9107, + 11596, 13934, 15973, 17682, + 19158, 20517, 21991, 23420, + 25178, 26936, 28794, 30527, + 1323, 2414, 4184, 6039, + 7534, 9398, 11099, 13097, + 14799, 16451, 18434, 20887, + 23490, 25838, 28046, 30225, + 1361, 3243, 6048, 8511, + 11001, 13145, 15073, 16608, + 18126, 19381, 20912, 22607, + 24660, 26668, 28663, 30566, + 1216, 2648, 5901, 8422, + 10037, 11425, 12973, 14603, + 16686, 18600, 20555, 22415, + 24450, 26280, 28206, 30077, + 2417, 4048, 6316, 8433, + 10510, 12757, 15072, 17295, + 19573, 21503, 23329, 24782, + 26235, 27689, 29214, 30819, + 1012, 2345, 4991, 7377, + 9465, 11916, 14296, 16566, + 18672, 20544, 22292, 23838, + 25415, 27050, 28848, 30551, + 1937, 3693, 6267, 8019, + 10372, 12194, 14287, 15657, + 17431, 18864, 20769, 22206, + 24037, 25463, 27383, 28602, + 1969, 3305, 5017, 6726, + 8375, 9993, 11634, 13280, + 15078, 16751, 18464, 20119, + 21959, 23858, 26224, 29298, + 1198, 2647, 5428, 7423, + 9775, 12155, 14665, 16344, + 18121, 19790, 21557, 22847, + 24484, 25742, 27639, 28711, + 1636, 3353, 5447, 7597, + 9837, 11647, 13964, 16019, + 17862, 20116, 22319, 24037, + 25966, 28086, 29914, 31294, + 2676, 4105, 6378, 8223, + 10058, 11549, 13072, 14453, + 15956, 17355, 18931, 20402, + 22183, 23884, 25717, 27723, + 1373, 2593, 4449, 5633, + 7300, 8425, 9474, 10818, + 12769, 15722, 19002, 21429, + 23682, 25924, 28135, 30333, + 1596, 3183, 5378, 7164, + 8670, 10105, 11470, 12834, + 13991, 15042, 16642, 17903, + 20759, 25283, 27770, 30240, + 2037, 3987, 6237, 8117, + 9954, 12245, 14217, 15892, + 17775, 20114, 22314, 25942, + 26305, 26483, 26796, 28561, + 2181, 3858, 5760, 7924, + 10041, 11577, 13769, 15700, + 17429, 19879, 23583, 24538, + 25212, 25693, 28688, 30507, + 1992, 3882, 6474, 7883, + 9381, 12672, 14340, 15701, + 16658, 17832, 20850, 22885, + 24677, 26457, 28491, 30460, + 2391, 3988, 5448, 7432, + 11014, 12579, 13140, 14146, + 15898, 18592, 21104, 22993, + 24673, 27186, 28142, 29612, + 1713, 5102, 6989, 7798, + 8670, 10110, 12746, 14881, + 16709, 18407, 20126, 22107, + 24181, 26198, 28237, 30137, + 1612, 3617, 6148, 8359, + 9576, 11528, 14936, 17809, + 18287, 18729, 19001, 21111, + 24631, 26596, 28740, 30643, + 2266, 4168, 7862, 9546, + 9618, 9703, 10134, 13897, + 16265, 18432, 20587, 22605, + 24754, 26994, 29125, 30840, + 1840, 3917, 6272, 7809, + 9714, 11438, 13767, 15799, + 19244, 21972, 22980, 23180, + 23723, 25650, 29117, 31085, + 1458, 3612, 6008, 7488, + 9827, 11893, 14086, 15734, + 17440, 19535, 22424, 24767, + 29246, 29928, 30516, 30947, + -102, -121, -31, -6, + 5, -2, 8, -18, + -4, 6, 14, -2, + -12, -16, -12, -60, + -126, -353, -574, -677, + -657, -617, -498, -393, + -348, -277, -225, -164, + -102, -70, -31, 33, + 4, 379, 387, 551, + 605, 620, 532, 482, + 442, 454, 385, 347, + 322, 299, 266, 200, + 1168, 951, 672, 246, + 60, -161, -259, -234, + -253, -282, -203, -187, + -155, -176, -198, -178, + 10, 170, 393, 609, + 555, 208, -330, -571, + -769, -633, -319, -43, + 95, 105, 106, 116, + -152, -140, -125, 5, + 173, 274, 264, 331, + -37, -293, -609, -786, + -959, -814, -645, -238, + -91, 36, -11, -101, + -279, -227, -40, 90, + 530, 677, 890, 1104, + 999, 835, 564, 295, + -280, -364, -340, -331, + -284, 288, 761, 880, + 988, 627, 146, -226, + -203, -181, -142, 39, + 24, -26, -107, -92, + -161, -135, -131, -88, + -160, -156, -75, -43, + -36, -6, -33, 33, + -324, -415, -108, 124, + 157, 191, 203, 197, + 144, 109, 152, 176, + 190, 122, 101, 159, + 663, 668, 480, 400, + 379, 444, 446, 458, + 343, 351, 310, 228, + 133, 44, 75, 63, + -84, 39, -29, 35, + -94, -233, -261, -354, + 77, 262, -24, -145, + -333, -409, -404, -597, + -488, -300, 910, 592, + 412, 120, 130, -51, + -37, -77, -172, -181, + -159, -148, -72, -62, + 510, 516, 113, -585, + -1075, -957, -417, -195, + 9, 7, -88, -173, + -91, 54, 98, 95, + -28, 197, -527, -621, + 157, 122, -168, 147, + 309, 300, 336, 315, + 396, 408, 376, 106, + -162, -170, -315, 98, + 821, 908, 570, -33, + -312, -568, -572, -378, + -107, 23, 156, 93, + -129, -87, 20, -72, + -37, 40, 21, 27, + 48, 75, 77, 65, + 46, 71, 66, 47, + 136, 344, 236, 322, + 170, 283, 269, 291, + 162, -43, -204, -259, + -240, -305, -350, -312, + 447, 348, 345, 257, + 71, -131, -77, -190, + -202, -40, 35, 133, + 261, 365, 438, 303, + -8, 22, 140, 137, + -300, -641, -764, -268, + -23, -25, 73, -162, + -150, -212, -72, 6, + 39, 78, 104, -93, + -308, -136, 117, -71, + -513, -820, -700, -450, + -161, -23, 29, 78, + 337, 106, -406, -782, + -112, 233, 383, 62, + -126, 6, -77, -29, + -146, -123, -51, -27, + -27, -381, -641, 402, + 539, 8, -207, -366, + -36, -27, -204, -227, + -237, -189, -64, 51, + -92, -137, -281, 62, + 233, 92, 148, 294, + 363, 416, 564, 625, + 370, -36, -469, -462, + 102, 168, 32, 117, + -21, 97, 139, 89, + 104, 35, 4, 82, + 66, 58, 73, 93, + -76, -320, -236, -189, + -203, -142, -27, -73, + 9, -9, -25, 12, + -15, 4, 4, -50, + 314, 180, 162, -49, + 199, -108, -227, -66, + -447, -67, -264, -394, + 5, 55, -133, -176, + -116, -241, 272, 109, + 282, 262, 192, -64, + -392, -514, 156, 203, + 154, 72, -34, -160, + -73, 3, -33, -431, + 321, 18, -567, -590, + -108, 88, 66, 51, + -31, -193, -46, 65, + -29, -23, 215, -31, + 101, -113, 32, 304, + 88, 320, 448, 5, + -439, -562, -508, -135, + -13, -171, -8, 182, + -99, -181, -149, 376, + 476, 64, -396, -652, + -150, 176, 222, 65, + -590, 719, 271, 399, + 245, 72, -156, -152, + -176, 59, 94, 125, + -9, -7, 9, 1, + -61, -116, -82, 1, + 79, 22, -44, -15, + -48, -65, -62, -101, + -102, -54, -70, -78, + -80, -25, 398, 71, + 139, 38, 90, 194, + 222, 249, 165, 94, + 221, 262, 163, 91, + -206, 573, 200, -287, + -147, 5, -18, -85, + -74, -125, -87, 85, + 141, 4, -4, 28, + 234, 48, -150, -111, + -506, 237, -209, 345, + 94, -124, 77, 121, + 143, 12, -80, -48, + 191, 144, -93, -65, + -151, -643, 435, 106, + 87, 7, 65, 102, + 94, 68, 5, 99, + 222, 93, 94, 355, + -13, -89, -228, -503, + 287, 109, 108, 449, + 253, -29, -109, -116, + 15, -73, -20, 131, + -147, 72, 59, -150, + -594, 273, 316, 132, + 199, 106, 198, 212, + 220, 82, 45, -13, + 223, 137, 270, 38, + 252, 135, -177, -207, + -360, -102, 403, 406, + -14, 83, 64, 51, + -7, -99, -97, -88, + -124, -65, 42, 32, + 28, 29, 12, 20, + 119, -26, -212, -201, + 373, 251, 141, 103, + 36, -52, 66, 18, + -6, -95, -196, 5, + 98, -85, -108, 218, + -164, 20, 356, 172, + 37, 266, 23, 112, + -24, -99, -92, -178, + 29, -278, 388, -60, + -220, 300, -13, 154, + 191, 15, -37, -110, + -153, -150, -114, -7, + -94, -31, -62, -177, + 4, -70, 35, 453, + 147, -247, -328, 101, + 20, -114, 147, 108, + -119, -109, -102, -238, + 55, -102, 173, -89, + 129, 138, -330, -160, + 485, 154, -59, -170, + -20, -34, -261, -40, + -129, 77, -84, 69, + 83, 160, 169, 63, + -516, 30, 336, 52, + -0, -52, -124, 158, + 19, 197, -10, -375, + 405, 285, 114, -395, + -47, 196, 62, 87, + -106, -65, -75, -69, + -13, 34, 99, 59, + 83, 98, 44, 0, + 24, 18, 17, 70, + -22, 194, 208, 144, + -79, -15, 32, -104, + -28, -105, -186, -212, + -228, -79, -76, 51, + -71, 72, 118, -34, + -3, -171, 5, 2, + -108, -125, 62, -58, + 58, -121, 73, -466, + 92, 63, -94, -78, + -76, 212, 36, -225, + -71, -354, 152, 143, + -79, -246, -51, -31, + -6, -270, 240, 210, + 30, -157, -231, 74, + -146, 88, -273, 156, + 92, 56, 71, 2, + 318, 164, 32, -110, + -35, -41, -95, -106, + 11, 132, -68, 55, + 123, -83, -149, 212, + 132, 0, -194, 55, + 206, -108, -353, 289, + -195, 1, 233, -22, + -60, 20, 26, 68, + 166, 27, -58, 130, + 112, 107, 27, -165, + 115, -93, -37, 38, + 83, 483, 65, -229, + -13, 157, 85, 50, + 136, 10, 32, 83, + 82, 55, 5, -9, + -52, -78, -81, -51, + 40, 18, -127, -224, + -41, 53, -210, -113, + 24, -17, -187, -89, + 8, 121, 83, 77, + 91, -74, -35, -112, + -161, -173, 102, 132, + -125, -61, 103, -260, + 52, 166, -32, -156, + -87, -56, 60, -70, + -124, 242, 114, -251, + -166, 201, 127, 28, + -11, 23, -80, -115, + -20, -51, -348, 340, + -34, 133, 13, 92, + -124, -136, -120, -26, + -6, 17, 28, 21, + 120, -168, 160, -35, + 115, 28, 9, 7, + -56, 39, 156, 256, + -18, 1, 277, 82, + -70, -144, -88, -13, + -59, -157, 8, -134, + 21, -40, 58, -21, + 194, -276, 97, 279, + -56, -140, 125, 57, + -184, -204, -70, -2, + 128, -202, -78, 230, + -23, 161, -102, 1, + 1, 180, -31, -86, + -167, -57, -60, 27, + -13, 99, 108, 111, + 76, 69, 34, -21, + 53, 38, 34, 78, + 73, 219, 51, 15, + -72, -103, -207, 30, + 213, -14, 31, -94, + -40, -144, 67, 4, + 105, 59, -240, 25, + 244, 69, 58, 23, + -24, -5, -15, -133, + -71, -67, 181, 29, + -45, 121, 96, 51, + -72, -53, 56, -153, + -27, 85, 183, 211, + 105, -34, -46, 43, + -72, -93, 36, -128, + 29, 111, -95, -156, + -179, -235, 21, -39, + -71, -33, -61, -252, + 230, -131, 157, -21, + -85, -28, -123, 80, + -160, 63, 47, -6, + -49, -96, -19, 17, + -58, 17, -0, -13, + -170, 25, -35, 59, + 10, -31, -413, 81, + 62, 18, -164, 245, + 92, -165, 42, 26, + 126, -248, 193, -55, + 16, 39, 14, 50 +}; + +const SKP_Silk_NLSF_CBS SKP_Silk_NLSF_CB1_16_Stage_info[ NLSF_MSVQ_CB1_16_STAGES ] = +{ + { 32, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 0 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 0 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 32 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 32 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 40 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 40 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 48 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 48 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 56 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 56 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 64 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 64 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 72 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 72 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 80 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 80 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 88 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 88 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16_Q15[ 16 * 96 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates_Q5[ 96 ] } +}; + +const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB1_16 = +{ + NLSF_MSVQ_CB1_16_STAGES, + SKP_Silk_NLSF_CB1_16_Stage_info, + SKP_Silk_NLSF_MSVQ_CB1_16_ndelta_min_Q15, + SKP_Silk_NLSF_MSVQ_CB1_16_CDF, + SKP_Silk_NLSF_MSVQ_CB1_16_CDF_start_ptr, + SKP_Silk_NLSF_MSVQ_CB1_16_CDF_middle_idx +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16.h new file mode 100755 index 0000000..657f6a9 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16.h @@ -0,0 +1,51 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_TABLES_NLSF_CB1_16_H +#define SKP_SILK_TABLES_NLSF_CB1_16_H + +#include "SKP_Silk_define.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define NLSF_MSVQ_CB1_16_STAGES 10 +#define NLSF_MSVQ_CB1_16_VECTORS 104 + +/* NLSF codebook entropy coding tables */ +extern const SKP_uint16 SKP_Silk_NLSF_MSVQ_CB1_16_CDF[ NLSF_MSVQ_CB1_16_VECTORS + NLSF_MSVQ_CB1_16_STAGES ]; +extern const SKP_uint16 * const SKP_Silk_NLSF_MSVQ_CB1_16_CDF_start_ptr[ NLSF_MSVQ_CB1_16_STAGES ]; +extern const SKP_int SKP_Silk_NLSF_MSVQ_CB1_16_CDF_middle_idx[ NLSF_MSVQ_CB1_16_STAGES ]; + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16_FLP.c new file mode 100755 index 0000000..f9a820f --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_NLSF_CB1_16_FLP.c @@ -0,0 +1,973 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/**********************************************/ +/* This file has been automatically generated */ +/* */ +/* ROM usage: 7.14 kB */ +/**********************************************/ + +#include "SKP_Silk_tables_FLP.h" +#include "SKP_Silk_tables_NLSF_CB1_16.h" + +const SKP_float SKP_Silk_NLSF_MSVQ_CB1_16_rates[ NLSF_MSVQ_CB1_16_VECTORS ] = +{ + 1.78125000000000000000f, 3.06250000000000000000f, + 4.15625000000000000000f, 4.18750000000000000000f, + 4.31250000000000000000f, 4.50000000000000000000f, + 4.53125000000000000000f, 4.59375000000000000000f, + 4.75000000000000000000f, 5.53125000000000000000f, + 5.53125000000000000000f, 5.56250000000000000000f, + 5.65625000000000000000f, 5.71875000000000000000f, + 5.75000000000000000000f, 6.31250000000000000000f, + 6.43750000000000000000f, 6.71875000000000000000f, + 6.81250000000000000000f, 6.93750000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 7.09375000000000000000f, 7.09375000000000000000f, + 1.18750000000000000000f, 2.71875000000000000000f, + 3.03125000000000000000f, 3.71875000000000000000f, + 4.00000000000000000000f, 4.21875000000000000000f, + 4.37500000000000000000f, 4.46875000000000000000f, + 1.25000000000000000000f, 2.53125000000000000000f, + 3.34375000000000000000f, 3.34375000000000000000f, + 4.03125000000000000000f, 4.18750000000000000000f, + 4.18750000000000000000f, 4.46875000000000000000f, + 0.96875000000000000000f, 3.40625000000000000000f, + 3.56250000000000000000f, 3.75000000000000000000f, + 4.00000000000000000000f, 4.06250000000000000000f, + 4.09375000000000000000f, 4.12500000000000000000f, + 1.34375000000000000000f, 1.90625000000000000000f, + 3.87500000000000000000f, 3.90625000000000000000f, + 4.12500000000000000000f, 4.25000000000000000000f, + 4.40625000000000000000f, 4.43750000000000000000f, + 0.93750000000000000000f, 3.43750000000000000000f, + 3.68750000000000000000f, 3.75000000000000000000f, + 4.03125000000000000000f, 4.09375000000000000000f, + 4.15625000000000000000f, 4.15625000000000000000f, + 0.96875000000000000000f, 3.37500000000000000000f, + 3.59375000000000000000f, 3.78125000000000000000f, + 3.87500000000000000000f, 4.06250000000000000000f, + 4.15625000000000000000f, 4.28125000000000000000f, + 1.25000000000000000000f, 3.06250000000000000000f, + 3.59375000000000000000f, 3.59375000000000000000f, + 3.62500000000000000000f, 3.65625000000000000000f, + 3.84375000000000000000f, 3.87500000000000000000f, + 1.56250000000000000000f, 2.90625000000000000000f, + 3.37500000000000000000f, 3.43750000000000000000f, + 3.50000000000000000000f, 3.50000000000000000000f, + 3.56250000000000000000f, 3.59375000000000000000f, + 2.28125000000000000000f, 2.96875000000000000000f, + 2.96875000000000000000f, 3.00000000000000000000f, + 3.00000000000000000000f, 3.28125000000000000000f, + 3.34375000000000000000f, 3.43750000000000000000f +}; + +const SKP_float SKP_Silk_NLSF_MSVQ_CB1_16_ndelta_min[ 16 + 1 ] = +{ + 0.00451660156250000000f, + 0.00009155273437500000f, + 0.00183105468749999980f, + 0.00207519531250000000f, + 0.00357055664062500000f, + 0.00262451171875000000f, + 0.00369262695312500000f, + 0.00378417968750000000f, + 0.00463867187500000000f, + 0.00466918945312500000f, + 0.00631713867187499910f, + 0.00460815429687500000f, + 0.00686645507812500000f, + 0.00729370117187499910f, + 0.00384521484375000000f, + 0.00558471679687500000f, + 0.02416992187500000300f +}; + +const SKP_float SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * NLSF_MSVQ_CB1_16_VECTORS ] = +{ + 0.03994750976562499300f, 0.09338378906250000000f, + 0.15475463867187500000f, 0.21350097656250000000f, + 0.27551269531250000000f, 0.33380126953125000000f, + 0.39471435546875000000f, 0.45443725585937500000f, + 0.51675415039062500000f, 0.57537841796875000000f, + 0.63452148437500000000f, 0.69470214843750000000f, + 0.75540161132812500000f, 0.81356811523437500000f, + 0.87359619140625000000f, 0.93081665039062500000f, + 0.03857421875000000000f, 0.08377075195312498600f, + 0.14068603515625000000f, 0.19555664062500000000f, + 0.25286865234375000000f, 0.30648803710937500000f, + 0.36877441406250000000f, 0.43054199218750000000f, + 0.49188232421875006000f, 0.55429077148437500000f, + 0.61325073242187500000f, 0.67639160156250000000f, + 0.74047851562500000000f, 0.80310058593750000000f, + 0.86453247070312500000f, 0.92318725585937500000f, + 0.03186035156250000000f, 0.06347656250000000000f, + 0.11206054687500000000f, 0.15805053710937500000f, + 0.21789550781250003000f, 0.27770996093750000000f, + 0.33782958984375000000f, 0.39871215820312494000f, + 0.47067260742187500000f, 0.54290771484375000000f, + 0.60824584960937500000f, 0.67446899414062500000f, + 0.74127197265625000000f, 0.80447387695312500000f, + 0.86972045898437500000f, 0.92828369140625000000f, + 0.03451538085937500000f, 0.07556152343750000000f, + 0.13665771484375000000f, 0.18765258789062500000f, + 0.24114990234375000000f, 0.30136108398437500000f, + 0.36431884765624994000f, 0.42141723632812500000f, + 0.48428344726562500000f, 0.54107666015625000000f, + 0.60876464843750000000f, 0.66244506835937500000f, + 0.72512817382812500000f, 0.77926635742187500000f, + 0.83697509765625000000f, 0.88247680664062500000f, + 0.03173828125000000000f, 0.06115722656250000000f, + 0.12286376953125000000f, 0.18615722656250000000f, + 0.25732421875000000000f, 0.32025146484375000000f, + 0.38482666015625000000f, 0.44842529296875000000f, + 0.51260375976562500000f, 0.57296752929687500000f, + 0.63473510742187500000f, 0.69525146484375000000f, + 0.75598144531250000000f, 0.81427001953125000000f, + 0.87374877929687511000f, 0.93127441406250000000f, + 0.07049560546875000000f, 0.11633300781250001000f, + 0.18045043945312497000f, 0.24209594726562500000f, + 0.30618286132812500000f, 0.36257934570312500000f, + 0.42373657226562500000f, 0.48211669921875000000f, + 0.54171752929687500000f, 0.59741210937500000000f, + 0.65557861328125000000f, 0.71032714843750000000f, + 0.76773071289062500000f, 0.82427978515624989000f, + 0.87991333007812500000f, 0.93453979492187500000f, + 0.03826904296875000000f, 0.08688354492187500000f, + 0.15298461914062500000f, 0.20693969726562500000f, + 0.26324462890625000000f, 0.31646728515625000000f, + 0.38836669921875000000f, 0.44656372070312500000f, + 0.49685668945312494000f, 0.54479980468750000000f, + 0.60638427734375000000f, 0.65527343749999989000f, + 0.70196533203124989000f, 0.75161743164062500000f, + 0.81512451171875000000f, 0.85327148437500000000f, + 0.04479980468750000000f, 0.09335327148437500000f, + 0.15219116210937500000f, 0.21441650390625000000f, + 0.26675415039062500000f, 0.31774902343750000000f, + 0.37478637695312500000f, 0.42785644531250000000f, + 0.48736572265625000000f, 0.54086303710937500000f, + 0.59936523437500000000f, 0.65679931640625000000f, + 0.71630859375000000000f, 0.78311157226562500000f, + 0.85406494140625000000f, 0.92239379882812500000f, + 0.06625366210937500000f, 0.10882568359375000000f, + 0.17105102539062497000f, 0.22534179687500000000f, + 0.28698730468750000000f, 0.34240722656249994000f, + 0.39764404296875000000f, 0.45037841796875000000f, + 0.50924682617187500000f, 0.56204223632812500000f, + 0.62091064453125000000f, 0.67416381835937511000f, + 0.73410034179687489000f, 0.79992675781250000000f, + 0.86535644531250000000f, 0.92764282226562500000f, + 0.07351684570312500000f, 0.14270019531250000000f, + 0.23019409179687497000f, 0.29864501953125000000f, + 0.34848022460937500000f, 0.39474487304687500000f, + 0.43847656250000006000f, 0.47769165039062500000f, + 0.52996826171875000000f, 0.57809448242187500000f, + 0.63360595703125000000f, 0.68594360351562511000f, + 0.74584960937500000000f, 0.80343627929687500000f, + 0.86315917968750000000f, 0.92291259765625000000f, + 0.07183837890625000000f, 0.12884521484375000000f, + 0.20812988281250003000f, 0.27792358398437500000f, + 0.35388183593749994000f, 0.42523193359375000000f, + 0.48745727539062494000f, 0.53961181640625000000f, + 0.58465576171875000000f, 0.62612915039062500000f, + 0.67111206054687500000f, 0.71472167968750000000f, + 0.76837158203125000000f, 0.82202148437499989000f, + 0.87872314453125000000f, 0.93161010742187511000f, + 0.04037475585937500000f, 0.07366943359375000000f, + 0.12768554687500000000f, 0.18429565429687500000f, + 0.22991943359375000000f, 0.28680419921875000000f, + 0.33871459960937500000f, 0.39968872070312500000f, + 0.45162963867187500000f, 0.50204467773437500000f, + 0.56256103515625000000f, 0.63742065429687500000f, + 0.71685791015624989000f, 0.78851318359375011000f, + 0.85589599609374989000f, 0.92239379882812500000f, + 0.04153442382812500700f, 0.09896850585937500000f, + 0.18457031250000000000f, 0.25973510742187500000f, + 0.33572387695312500000f, 0.40115356445312500000f, + 0.45999145507812500000f, 0.50683593750000000000f, + 0.55316162109375000000f, 0.59146118164062500000f, + 0.63818359375000000000f, 0.68991088867187500000f, + 0.75256347656250011000f, 0.81384277343750000000f, + 0.87472534179687500000f, 0.93280029296875000000f, + 0.03710937500000000000f, 0.08081054687500000000f, + 0.18008422851562503000f, 0.25701904296875000000f, + 0.30630493164062500000f, 0.34866333007812500000f, + 0.39590454101562500000f, 0.44564819335937500000f, + 0.50921630859375000000f, 0.56762695312500000000f, + 0.62728881835937500000f, 0.68405151367187500000f, + 0.74615478515625000000f, 0.80200195312500000000f, + 0.86077880859375000000f, 0.91787719726562500000f, + 0.07376098632812500000f, 0.12353515625000000000f, + 0.19274902343750000000f, 0.25735473632812500000f, + 0.32073974609375000000f, 0.38931274414062494000f, + 0.45996093750000006000f, 0.52780151367187500000f, + 0.59732055664062500000f, 0.65621948242187489000f, + 0.71194458007812500000f, 0.75628662109375011000f, + 0.80062866210937489000f, 0.84500122070312500000f, + 0.89154052734375000000f, 0.94052124023437500000f, + 0.03088378906250000000f, 0.07156372070312500000f, + 0.15231323242187500000f, 0.22512817382812503000f, + 0.28884887695312500000f, 0.36364746093750000000f, + 0.43627929687500000000f, 0.50555419921875000000f, + 0.56982421875000000000f, 0.62695312500000000000f, + 0.68029785156250000000f, 0.72747802734375000000f, + 0.77560424804687511000f, 0.82550048828125011000f, + 0.88037109375000000000f, 0.93234252929687500000f, + 0.05911254882812500000f, 0.11270141601562500000f, + 0.19125366210937500000f, 0.24472045898437500000f, + 0.31652832031250000000f, 0.37213134765625000000f, + 0.43600463867187494000f, 0.47781372070312500000f, + 0.53195190429687500000f, 0.57568359375000000000f, + 0.63381958007812500000f, 0.67767333984375000000f, + 0.73355102539062500000f, 0.77706909179687489000f, + 0.83566284179687500000f, 0.87286376953125000000f, + 0.06008911132812500000f, 0.10086059570312500000f, + 0.15310668945312500000f, 0.20526123046875000000f, + 0.25558471679687500000f, 0.30496215820312500000f, + 0.35504150390625000000f, 0.40527343750000000000f, + 0.46014404296875000000f, 0.51119995117187500000f, + 0.56347656250000000000f, 0.61398315429687500000f, + 0.67013549804687500000f, 0.72808837890625000000f, + 0.80029296875000011000f, 0.89410400390625011000f, + 0.03656005859375000000f, 0.08078002929687500000f, + 0.16564941406250000000f, 0.22653198242187500000f, + 0.29830932617187500000f, 0.37094116210937500000f, + 0.44754028320312500000f, 0.49877929687500000000f, + 0.55300903320312500000f, 0.60394287109375000000f, + 0.65786743164062489000f, 0.69723510742187500000f, + 0.74719238281250011000f, 0.78558349609375000000f, + 0.84347534179687500000f, 0.87619018554687500000f, + 0.04992675781250000000f, 0.10232543945312500000f, + 0.16622924804687500000f, 0.23184204101562503000f, + 0.30020141601562500000f, 0.35543823242187500000f, + 0.42614746093750000000f, 0.48886108398437500000f, + 0.54510498046875000000f, 0.61389160156250000000f, + 0.68112182617187500000f, 0.73355102539062500000f, + 0.79241943359375000000f, 0.85711669921875011000f, + 0.91290283203125011000f, 0.95501708984375000000f, + 0.08166503906250000000f, 0.12527465820312500000f, + 0.19464111328125000000f, 0.25094604492187500000f, + 0.30694580078125000000f, 0.35244750976562500000f, + 0.39892578124999994000f, 0.44107055664062494000f, + 0.48693847656249994000f, 0.52963256835937500000f, + 0.57772827148437500000f, 0.62261962890625000000f, + 0.67697143554687500000f, 0.72888183593750000000f, + 0.78482055664062500000f, 0.84603881835937500000f, + 0.04190063476562500000f, 0.07913208007812500000f, + 0.13577270507812500000f, 0.17190551757812500000f, + 0.22277832031250000000f, 0.25711059570312500000f, + 0.28912353515625000000f, 0.33013916015625000000f, + 0.38967895507812500000f, 0.47979736328125006000f, + 0.57989501953125000000f, 0.65396118164062500000f, + 0.72271728515625000000f, 0.79113769531250000000f, + 0.85861206054687500000f, 0.92568969726562500000f, + 0.04870605468750000000f, 0.09713745117187500000f, + 0.16412353515625003000f, 0.21862792968750000000f, + 0.26458740234375000000f, 0.30838012695312500000f, + 0.35003662109375000000f, 0.39166259765625000000f, + 0.42697143554687500000f, 0.45904541015624994000f, + 0.50787353515625000000f, 0.54635620117187500000f, + 0.63351440429687500000f, 0.77157592773437500000f, + 0.84747314453125000000f, 0.92285156249999989000f, + 0.06216430664062500000f, 0.12167358398437500000f, + 0.19033813476562500000f, 0.24771118164062500000f, + 0.30377197265625000000f, 0.37368774414062500000f, + 0.43386840820312500000f, 0.48498535156250000000f, + 0.54244995117187500000f, 0.61383056640625000000f, + 0.68096923828125000000f, 0.79168701171875000000f, + 0.80276489257812500000f, 0.80819702148437500000f, + 0.81774902343750000000f, 0.87161254882812500000f, + 0.06655883789062500000f, 0.11773681640625000000f, + 0.17578125000000000000f, 0.24182128906250000000f, + 0.30642700195312500000f, 0.35330200195312500000f, + 0.42019653320312494000f, 0.47912597656250000000f, + 0.53189086914062500000f, 0.60665893554687500000f, + 0.71969604492187500000f, 0.74884033203125000000f, + 0.76940917968750000000f, 0.78408813476562511000f, + 0.87548828125000000000f, 0.93099975585937489000f, + 0.06079101562500000000f, 0.11846923828125000000f, + 0.19757080078125000000f, 0.24057006835937503000f, + 0.28628540039062500000f, 0.38671875000000006000f, + 0.43762207031250000000f, 0.47915649414062500000f, + 0.50836181640625000000f, 0.54418945312500000000f, + 0.63629150390625000000f, 0.69839477539062500000f, + 0.75308227539062511000f, 0.80740356445312500000f, + 0.86947631835937500000f, 0.92956542968750000000f, + 0.07296752929687500000f, 0.12170410156250000000f, + 0.16625976562500000000f, 0.22680664062500000000f, + 0.33612060546875000000f, 0.38388061523437500000f, + 0.40100097656250000000f, 0.43170166015625000000f, + 0.48516845703125006000f, 0.56738281250000000000f, + 0.64404296875000000000f, 0.70169067382812500000f, + 0.75296020507812500000f, 0.82965087890624989000f, + 0.85882568359375000000f, 0.90368652343750000000f, + 0.05227661132812500000f, 0.15570068359375000000f, + 0.21328735351562500000f, 0.23797607421875000000f, + 0.26458740234375000000f, 0.30853271484375000000f, + 0.38897705078125000000f, 0.45413208007812500000f, + 0.50991821289062500000f, 0.56173706054687500000f, + 0.61419677734375000000f, 0.67465209960937500000f, + 0.73794555664062500000f, 0.79949951171874989000f, + 0.86172485351562500000f, 0.91970825195312500000f, + 0.04919433593750000000f, 0.11038208007812500000f, + 0.18762207031250000000f, 0.25509643554687500000f, + 0.29223632812500000000f, 0.35180664062500006000f, + 0.45581054687500000000f, 0.54348754882812500000f, + 0.55807495117187500000f, 0.57156372070312500000f, + 0.57986450195312500000f, 0.64425659179687500000f, + 0.75167846679687500000f, 0.81164550781250000000f, + 0.87707519531250000000f, 0.93515014648437500000f, + 0.06915283203125000000f, 0.12719726562500000000f, + 0.23992919921875000000f, 0.29132080078125000000f, + 0.29351806640625000000f, 0.29611206054687500000f, + 0.30926513671875000000f, 0.42410278320312500000f, + 0.49636840820312500000f, 0.56250000000000000000f, + 0.62826538085937500000f, 0.68984985351562500000f, + 0.75543212890625000000f, 0.82379150390625000000f, + 0.88882446289062511000f, 0.94116210937500000000f, + 0.05615234375000000700f, 0.11953735351562501000f, + 0.19140625000000000000f, 0.23831176757812500000f, + 0.29644775390625000000f, 0.34906005859375000000f, + 0.42013549804687500000f, 0.48214721679687500000f, + 0.58728027343750000000f, 0.67053222656250000000f, + 0.70129394531250000000f, 0.70739746093750000000f, + 0.72396850585937489000f, 0.78277587890625000000f, + 0.88858032226562500000f, 0.94863891601562500000f, + 0.04449462890625000000f, 0.11022949218750000000f, + 0.18334960937500000000f, 0.22851562500000000000f, + 0.29989624023437500000f, 0.36294555664062500000f, + 0.42987060546875000000f, 0.48016357421875000000f, + 0.53222656250000000000f, 0.59616088867187500000f, + 0.68432617187500000000f, 0.75582885742187500000f, + 0.89251708984375000000f, 0.91333007812499989000f, + 0.93127441406250000000f, 0.94442749023437489000f, + -0.00311279296875000000f, -0.00369262695312500000f, + -0.00094604492187500000f, -0.00018310546875000000f, + 0.00015258789062500000f, -0.00006103515625000000f, + 0.00024414062500000000f, -0.00054931640625000000f, + -0.00012207031250000000f, 0.00018310546875000000f, + 0.00042724609375000000f, -0.00006103515625000000f, + -0.00036621093750000000f, -0.00048828125000000000f, + -0.00036621093750000000f, -0.00183105468749999980f, + -0.00384521484375000000f, -0.01077270507812500000f, + -0.01751708984375000000f, -0.02066040039062500000f, + -0.02005004882812500000f, -0.01882934570312500000f, + -0.01519775390625000000f, -0.01199340820312500000f, + -0.01062011718750000000f, -0.00845336914062500000f, + -0.00686645507812500000f, -0.00500488281250000000f, + -0.00311279296875000000f, -0.00213623046875000000f, + -0.00094604492187500000f, 0.00100708007812500000f, + 0.00012207031250000000f, 0.01156616210937500000f, + 0.01181030273437500000f, 0.01681518554687500000f, + 0.01846313476562500000f, 0.01892089843750000000f, + 0.01623535156250000000f, 0.01470947265625000200f, + 0.01348876953125000000f, 0.01385498046875000000f, + 0.01174926757812500200f, 0.01058959960937500000f, + 0.00982666015625000000f, 0.00912475585937500000f, + 0.00811767578125000000f, 0.00610351562500000000f, + 0.03564453125000000000f, 0.02902221679687500000f, + 0.02050781250000000000f, 0.00750732421875000000f, + 0.00183105468749999980f, -0.00491333007812500000f, + -0.00790405273437500000f, -0.00714111328125000000f, + -0.00772094726562500000f, -0.00860595703125000000f, + -0.00619506835937500000f, -0.00570678710937500090f, + -0.00473022460937500000f, -0.00537109374999999910f, + -0.00604248046875000090f, -0.00543212890625000000f, + 0.00030517578125000000f, 0.00518798828125000000f, + 0.01199340820312500000f, 0.01858520507812500000f, + 0.01693725585937500000f, 0.00634765625000000090f, + -0.01007080078124999800f, -0.01742553710937500000f, + -0.02346801757812500000f, -0.01931762695312500000f, + -0.00973510742187500000f, -0.00131225585937500000f, + 0.00289916992187500000f, 0.00320434570312500000f, + 0.00323486328125000000f, 0.00354003906250000000f, + -0.00463867187500000000f, -0.00427246093750000000f, + -0.00381469726562499960f, 0.00015258789062500000f, + 0.00527954101562500000f, 0.00836181640625000000f, + 0.00805664062500000000f, 0.01010131835937500000f, + -0.00112915039062500000f, -0.00894165039062500000f, + -0.01858520507812500000f, -0.02398681640625000000f, + -0.02926635742187500000f, -0.02484130859375000300f, + -0.01968383789062500000f, -0.00726318359375000000f, + -0.00277709960937500000f, 0.00109863281250000000f, + -0.00033569335937499995f, -0.00308227539062500000f, + -0.00851440429687500000f, -0.00692749023437500000f, + -0.00122070312500000000f, 0.00274658203125000000f, + 0.01617431640625000000f, 0.02066040039062500000f, + 0.02716064453125000000f, 0.03369140625000000000f, + 0.03048706054687500000f, 0.02548217773437500000f, + 0.01721191406250000000f, 0.00900268554687500000f, + -0.00854492187500000000f, -0.01110839843750000000f, + -0.01037597656250000000f, -0.01010131835937500000f, + -0.00866699218750000000f, 0.00878906250000000000f, + 0.02322387695312500000f, 0.02685546875000000000f, + 0.03015136718750000000f, 0.01913452148437500000f, + 0.00445556640625000000f, -0.00689697265625000000f, + -0.00619506835937500000f, -0.00552368164062500000f, + -0.00433349609375000000f, 0.00119018554687500000f, + 0.00073242187500000000f, -0.00079345703125000011f, + -0.00326538085937500000f, -0.00280761718750000000f, + -0.00491333007812500000f, -0.00411987304687500000f, + -0.00399780273437500000f, -0.00268554687499999960f, + -0.00488281250000000000f, -0.00476074218750000000f, + -0.00228881835937500000f, -0.00131225585937500000f, + -0.00109863281250000000f, -0.00018310546875000000f, + -0.00100708007812500000f, 0.00100708007812500000f, + -0.00988769531250000000f, -0.01266479492187500000f, + -0.00329589843750000000f, 0.00378417968750000000f, + 0.00479125976562500000f, 0.00582885742187500000f, + 0.00619506835937500000f, 0.00601196289062499910f, + 0.00439453125000000000f, 0.00332641601562499960f, + 0.00463867187500000000f, 0.00537109374999999910f, + 0.00579833984375000000f, 0.00372314453125000000f, + 0.00308227539062500000f, 0.00485229492187500000f, + 0.02023315429687500000f, 0.02038574218750000000f, + 0.01464843749999999800f, 0.01220703125000000000f, + 0.01156616210937500000f, 0.01354980468750000000f, + 0.01361083984375000000f, 0.01397705078124999800f, + 0.01046752929687500200f, 0.01071166992187500000f, + 0.00946044921875000000f, 0.00695800781250000000f, + 0.00405883789062500000f, 0.00134277343749999980f, + 0.00228881835937500000f, 0.00192260742187500000f, + -0.00256347656250000000f, 0.00119018554687500000f, + -0.00088500976562500000f, 0.00106811523437500000f, + -0.00286865234375000000f, -0.00711059570312500000f, + -0.00796508789062500000f, -0.01080322265625000200f, + 0.00234985351562500000f, 0.00799560546875000000f, + -0.00073242187500000000f, -0.00442504882812500000f, + -0.01016235351562500000f, -0.01248168945312500000f, + -0.01232910156250000000f, -0.01821899414062500000f, + -0.01489257812500000000f, -0.00915527343750000000f, + 0.02777099609375000000f, 0.01806640625000000000f, + 0.01257324218750000000f, 0.00366210937499999960f, + 0.00396728515625000000f, -0.00155639648437500000f, + -0.00112915039062500000f, -0.00234985351562500000f, + -0.00524902343750000000f, -0.00552368164062500000f, + -0.00485229492187500000f, -0.00451660156250000000f, + -0.00219726562500000000f, -0.00189208984375000000f, + 0.01556396484375000000f, 0.01574707031250000000f, + 0.00344848632812500000f, -0.01785278320312500000f, + -0.03280639648437500000f, -0.02920532226562500000f, + -0.01272583007812500000f, -0.00595092773437500000f, + 0.00027465820312500000f, 0.00021362304687500000f, + -0.00268554687499999960f, -0.00527954101562500000f, + -0.00277709960937500000f, 0.00164794921875000000f, + 0.00299072265625000000f, 0.00289916992187500000f, + -0.00085449218750000000f, 0.00601196289062499910f, + -0.01608276367187500000f, -0.01895141601562500000f, + 0.00479125976562500000f, 0.00372314453125000000f, + -0.00512695312500000000f, 0.00448608398437500000f, + 0.00942993164062500000f, 0.00915527343750000000f, + 0.01025390625000000000f, 0.00961303710937500000f, + 0.01208496093750000200f, 0.01245117187500000000f, + 0.01147460937500000000f, 0.00323486328125000000f, + -0.00494384765625000000f, -0.00518798828125000000f, + -0.00961303710937500000f, 0.00299072265625000000f, + 0.02505493164062499700f, 0.02770996093750000000f, + 0.01739501953125000000f, -0.00100708007812500000f, + -0.00952148437500000000f, -0.01733398437500000000f, + -0.01745605468750000000f, -0.01153564453125000000f, + -0.00326538085937500000f, 0.00070190429687500000f, + 0.00476074218750000000f, 0.00283813476562499960f, + -0.00393676757812500000f, -0.00265502929687500000f, + 0.00061035156250000000f, -0.00219726562500000000f, + -0.00112915039062500000f, 0.00122070312500000000f, + 0.00064086914062500000f, 0.00082397460937500000f, + 0.00146484375000000000f, 0.00228881835937500000f, + 0.00234985351562500000f, 0.00198364257812500000f, + 0.00140380859375000000f, 0.00216674804687500000f, + 0.00201416015625000000f, 0.00143432617187500000f, + 0.00415039062500000000f, 0.01049804687500000000f, + 0.00720214843750000000f, 0.00982666015625000000f, + 0.00518798828125000000f, 0.00863647460937500000f, + 0.00820922851562500000f, 0.00888061523437500000f, + 0.00494384765625000000f, -0.00131225585937500000f, + -0.00622558593750000000f, -0.00790405273437500000f, + -0.00732421874999999910f, -0.00930786132812500000f, + -0.01068115234374999800f, -0.00952148437500000000f, + 0.01364135742187499800f, 0.01062011718750000000f, + 0.01052856445312500000f, 0.00784301757812500000f, + 0.00216674804687500000f, -0.00399780273437500000f, + -0.00234985351562500000f, -0.00579833984375000000f, + -0.00616455078125000000f, -0.00122070312500000000f, + 0.00106811523437500000f, 0.00405883789062500000f, + 0.00796508789062500000f, 0.01113891601562500000f, + 0.01336669921875000200f, 0.00924682617187500000f, + -0.00024414062500000000f, 0.00067138671874999989f, + 0.00427246093750000000f, 0.00418090820312500000f, + -0.00915527343750000000f, -0.01956176757812500000f, + -0.02331542968750000000f, -0.00817871093750000000f, + -0.00070190429687500000f, -0.00076293945312500000f, + 0.00222778320312500000f, -0.00494384765625000000f, + -0.00457763671875000000f, -0.00646972656250000000f, + -0.00219726562500000000f, 0.00018310546875000000f, + 0.00119018554687500000f, 0.00238037109375000000f, + 0.00317382812500000040f, -0.00283813476562499960f, + -0.00939941406250000000f, -0.00415039062500000000f, + 0.00357055664062500000f, -0.00216674804687500000f, + -0.01565551757812500000f, -0.02502441406250000000f, + -0.02136230468749999700f, -0.01373291015625000000f, + -0.00491333007812500000f, -0.00070190429687500000f, + 0.00088500976562500000f, 0.00238037109375000000f, + 0.01028442382812500000f, 0.00323486328125000000f, + -0.01239013671875000000f, -0.02386474609375000000f, + -0.00341796875000000000f, 0.00711059570312500000f, + 0.01168823242187499800f, 0.00189208984375000000f, + -0.00384521484375000000f, 0.00018310546875000000f, + -0.00234985351562500000f, -0.00088500976562500000f, + -0.00445556640625000000f, -0.00375366210937500000f, + -0.00155639648437500000f, -0.00082397460937500000f, + -0.00082397460937500000f, -0.01162719726562500000f, + -0.01956176757812500000f, 0.01226806640625000000f, + 0.01644897460937500000f, 0.00024414062500000000f, + -0.00631713867187499910f, -0.01116943359375000000f, + -0.00109863281250000000f, -0.00082397460937500000f, + -0.00622558593750000000f, -0.00692749023437500000f, + -0.00723266601562500000f, -0.00576782226562500000f, + -0.00195312500000000000f, 0.00155639648437500000f, + -0.00280761718750000000f, -0.00418090820312500000f, + -0.00857543945312500000f, 0.00189208984375000000f, + 0.00711059570312500000f, 0.00280761718750000000f, + 0.00451660156250000000f, 0.00897216796875000000f, + 0.01107788085937500200f, 0.01269531250000000200f, + 0.01721191406250000000f, 0.01907348632812500000f, + 0.01129150390625000000f, -0.00109863281250000000f, + -0.01431274414062499800f, -0.01409912109375000000f, + 0.00311279296875000000f, 0.00512695312500000000f, + 0.00097656250000000000f, 0.00357055664062500000f, + -0.00064086914062500000f, 0.00296020507812500000f, + 0.00424194335937500000f, 0.00271606445312500000f, + 0.00317382812500000040f, 0.00106811523437500000f, + 0.00012207031250000000f, 0.00250244140625000000f, + 0.00201416015625000000f, 0.00177001953125000000f, + 0.00222778320312500000f, 0.00283813476562499960f, + -0.00231933593750000000f, -0.00976562500000000000f, + -0.00720214843750000000f, -0.00576782226562500000f, + -0.00619506835937500000f, -0.00433349609375000000f, + -0.00082397460937500000f, -0.00222778320312500000f, + 0.00027465820312500000f, -0.00027465820312500000f, + -0.00076293945312500000f, 0.00036621093750000000f, + -0.00045776367187499995f, 0.00012207031250000000f, + 0.00012207031250000000f, -0.00152587890625000000f, + 0.00958251953125000000f, 0.00549316406250000000f, + 0.00494384765625000000f, -0.00149536132812500000f, + 0.00607299804687500000f, -0.00329589843750000000f, + -0.00692749023437500000f, -0.00201416015625000000f, + -0.01364135742187499800f, -0.00204467773437500000f, + -0.00805664062500000000f, -0.01202392578124999800f, + 0.00015258789062500000f, 0.00167846679687500000f, + -0.00405883789062500000f, -0.00537109374999999910f, + -0.00354003906250000000f, -0.00735473632812500090f, + 0.00830078125000000000f, 0.00332641601562499960f, + 0.00860595703125000000f, 0.00799560546875000000f, + 0.00585937500000000000f, -0.00195312500000000000f, + -0.01196289062500000000f, -0.01568603515625000000f, + 0.00476074218750000000f, 0.00619506835937500000f, + 0.00469970703125000000f, 0.00219726562500000000f, + -0.00103759765625000000f, -0.00488281250000000000f, + -0.00222778320312500000f, 0.00009155273437500000f, + -0.00100708007812500000f, -0.01315307617187500000f, + 0.00979614257812500000f, 0.00054931640625000000f, + -0.01730346679687500000f, -0.01800537109375000000f, + -0.00329589843750000000f, 0.00268554687499999960f, + 0.00201416015625000000f, 0.00155639648437500000f, + -0.00094604492187500000f, -0.00588989257812500000f, + -0.00140380859375000000f, 0.00198364257812500000f, + -0.00088500976562500000f, -0.00070190429687500000f, + 0.00656127929687500000f, -0.00094604492187500000f, + 0.00308227539062500000f, -0.00344848632812500000f, + 0.00097656250000000000f, 0.00927734375000000000f, + 0.00268554687499999960f, 0.00976562500000000000f, + 0.01367187500000000000f, 0.00015258789062500000f, + -0.01339721679687500000f, -0.01715087890625000000f, + -0.01550292968750000000f, -0.00411987304687500000f, + -0.00039672851562500005f, -0.00521850585937500000f, + -0.00024414062500000000f, 0.00555419921875000000f, + -0.00302124023437500040f, -0.00552368164062500000f, + -0.00454711914062500000f, 0.01147460937500000000f, + 0.01452636718750000000f, 0.00195312500000000000f, + -0.01208496093750000200f, -0.01989746093750000000f, + -0.00457763671875000000f, 0.00537109374999999910f, + 0.00677490234375000000f, 0.00198364257812500000f, + -0.01800537109375000000f, 0.02194213867187500300f, + 0.00827026367187500000f, 0.01217651367187500000f, + 0.00747680664062500000f, 0.00219726562500000000f, + -0.00476074218750000000f, -0.00463867187500000000f, + -0.00537109374999999910f, 0.00180053710937500000f, + 0.00286865234375000000f, 0.00381469726562499960f, + -0.00027465820312500000f, -0.00021362304687500000f, + 0.00027465820312500000f, 0.00003051757812500000f, + -0.00186157226562500000f, -0.00354003906250000000f, + -0.00250244140625000000f, 0.00003051757812500000f, + 0.00241088867187500000f, 0.00067138671874999989f, + -0.00134277343749999980f, -0.00045776367187499995f, + -0.00146484375000000000f, -0.00198364257812500000f, + -0.00189208984375000000f, -0.00308227539062500000f, + -0.00311279296875000000f, -0.00164794921875000000f, + -0.00213623046875000000f, -0.00238037109375000000f, + -0.00244140625000000000f, -0.00076293945312500000f, + 0.01214599609375000000f, 0.00216674804687500000f, + 0.00424194335937500000f, 0.00115966796875000000f, + 0.00274658203125000000f, 0.00592041015625000000f, + 0.00677490234375000000f, 0.00759887695312500000f, + 0.00503540039062499910f, 0.00286865234375000000f, + 0.00674438476562500000f, 0.00799560546875000000f, + 0.00497436523437500000f, 0.00277709960937500000f, + -0.00628662109375000000f, 0.01748657226562500000f, + 0.00610351562500000000f, -0.00875854492187500000f, + -0.00448608398437500000f, 0.00015258789062500000f, + -0.00054931640625000000f, -0.00259399414062500000f, + -0.00225830078125000000f, -0.00381469726562499960f, + -0.00265502929687500000f, 0.00259399414062500000f, + 0.00430297851562500000f, 0.00012207031250000000f, + -0.00012207031250000000f, 0.00085449218750000000f, + 0.00714111328125000000f, 0.00146484375000000000f, + -0.00457763671875000000f, -0.00338745117187500000f, + -0.01544189453125000000f, 0.00723266601562500000f, + -0.00637817382812500090f, 0.01052856445312500000f, + 0.00286865234375000000f, -0.00378417968750000000f, + 0.00234985351562500000f, 0.00369262695312500000f, + 0.00436401367187500000f, 0.00036621093750000000f, + -0.00244140625000000000f, -0.00146484375000000000f, + 0.00582885742187500000f, 0.00439453125000000000f, + -0.00283813476562499960f, -0.00198364257812500000f, + -0.00460815429687500000f, -0.01962280273437500000f, + 0.01327514648437500000f, 0.00323486328125000000f, + 0.00265502929687500000f, 0.00021362304687500000f, + 0.00198364257812500000f, 0.00311279296875000000f, + 0.00286865234375000000f, 0.00207519531250000000f, + 0.00015258789062500000f, 0.00302124023437500040f, + 0.00677490234375000000f, 0.00283813476562499960f, + 0.00286865234375000000f, 0.01083374023437500000f, + -0.00039672851562500005f, -0.00271606445312500000f, + -0.00695800781250000000f, -0.01535034179687500000f, + 0.00875854492187500000f, 0.00332641601562499960f, + 0.00329589843750000000f, 0.01370239257812500200f, + 0.00772094726562500000f, -0.00088500976562500000f, + -0.00332641601562499960f, -0.00354003906250000000f, + 0.00045776367187499995f, -0.00222778320312500000f, + -0.00061035156250000000f, 0.00399780273437500000f, + -0.00448608398437500000f, 0.00219726562500000000f, + 0.00180053710937500000f, -0.00457763671875000000f, + -0.01812744140625000000f, 0.00833129882812500000f, + 0.00964355468750000000f, 0.00402832031250000000f, + 0.00607299804687500000f, 0.00323486328125000000f, + 0.00604248046875000090f, 0.00646972656250000000f, + 0.00671386718750000000f, 0.00250244140625000000f, + 0.00137329101562500000f, -0.00039672851562500005f, + 0.00680541992187500000f, 0.00418090820312500000f, + 0.00823974609375000000f, 0.00115966796875000000f, + 0.00769042968750000000f, 0.00411987304687500000f, + -0.00540161132812500090f, -0.00631713867187499910f, + -0.01098632812500000000f, -0.00311279296875000000f, + 0.01229858398437500000f, 0.01239013671875000000f, + -0.00042724609375000000f, 0.00253295898437500040f, + 0.00195312500000000000f, 0.00155639648437500000f, + -0.00021362304687500000f, -0.00302124023437500040f, + -0.00296020507812500000f, -0.00268554687499999960f, + -0.00378417968750000000f, -0.00198364257812500000f, + 0.00128173828125000000f, 0.00097656250000000000f, + 0.00085449218750000000f, 0.00088500976562500000f, + 0.00036621093750000000f, 0.00061035156250000000f, + 0.00363159179687500000f, -0.00079345703125000011f, + -0.00646972656250000000f, -0.00613403320312500000f, + 0.01138305664062500000f, 0.00765991210937500090f, + 0.00430297851562500000f, 0.00314331054687500000f, + 0.00109863281250000000f, -0.00158691406250000020f, + 0.00201416015625000000f, 0.00054931640625000000f, + -0.00018310546875000000f, -0.00289916992187500000f, + -0.00598144531250000000f, 0.00015258789062500000f, + 0.00299072265625000000f, -0.00259399414062500000f, + -0.00329589843750000000f, 0.00665283203124999910f, + -0.00500488281250000000f, 0.00061035156250000000f, + 0.01086425781250000000f, 0.00524902343750000000f, + 0.00112915039062500000f, 0.00811767578125000000f, + 0.00070190429687500000f, 0.00341796875000000000f, + -0.00073242187500000000f, -0.00302124023437500040f, + -0.00280761718750000000f, -0.00543212890625000000f, + 0.00088500976562500000f, -0.00848388671875000000f, + 0.01184082031250000000f, -0.00183105468749999980f, + -0.00671386718750000000f, 0.00915527343750000000f, + -0.00039672851562500005f, 0.00469970703125000000f, + 0.00582885742187500000f, 0.00045776367187499995f, + -0.00112915039062500000f, -0.00335693359375000000f, + -0.00466918945312500000f, -0.00457763671875000000f, + -0.00347900390625000000f, -0.00021362304687500000f, + -0.00286865234375000000f, -0.00094604492187500000f, + -0.00189208984375000000f, -0.00540161132812500090f, + 0.00012207031250000000f, -0.00213623046875000000f, + 0.00106811523437500000f, 0.01382446289062500000f, + 0.00448608398437500000f, -0.00753784179687500000f, + -0.01000976562500000000f, 0.00308227539062500000f, + 0.00061035156250000000f, -0.00347900390625000000f, + 0.00448608398437500000f, 0.00329589843750000000f, + -0.00363159179687500000f, -0.00332641601562499960f, + -0.00311279296875000000f, -0.00726318359375000000f, + 0.00167846679687500000f, -0.00311279296875000000f, + 0.00527954101562500000f, -0.00271606445312500000f, + 0.00393676757812500000f, 0.00421142578125000000f, + -0.01007080078124999800f, -0.00488281250000000000f, + 0.01480102539062500000f, 0.00469970703125000000f, + -0.00180053710937500000f, -0.00518798828125000000f, + -0.00061035156250000000f, -0.00103759765625000000f, + -0.00796508789062500000f, -0.00122070312500000000f, + -0.00393676757812500000f, 0.00234985351562500000f, + -0.00256347656250000000f, 0.00210571289062500000f, + 0.00253295898437500040f, 0.00488281250000000000f, + 0.00515747070312500000f, 0.00192260742187500000f, + -0.01574707031250000000f, 0.00091552734374999989f, + 0.01025390625000000000f, 0.00158691406250000020f, + -0.00000000000000000000f, -0.00158691406250000020f, + -0.00378417968750000000f, 0.00482177734375000000f, + 0.00057983398437500000f, 0.00601196289062499910f, + -0.00030517578125000000f, -0.01144409179687500000f, + 0.01235961914062499800f, 0.00869750976562500000f, + 0.00347900390625000000f, -0.01205444335937500000f, + -0.00143432617187500000f, 0.00598144531250000000f, + 0.00189208984375000000f, 0.00265502929687500000f, + -0.00323486328125000000f, -0.00198364257812500000f, + -0.00228881835937500000f, -0.00210571289062500000f, + -0.00039672851562500005f, 0.00103759765625000000f, + 0.00302124023437500040f, 0.00180053710937500000f, + 0.00253295898437500040f, 0.00299072265625000000f, + 0.00134277343749999980f, 0.00000000000000000000f, + 0.00073242187500000000f, 0.00054931640625000000f, + 0.00051879882812500000f, 0.00213623046875000000f, + -0.00067138671874999989f, 0.00592041015625000000f, + 0.00634765625000000090f, 0.00439453125000000000f, + -0.00241088867187500000f, -0.00045776367187499995f, + 0.00097656250000000000f, -0.00317382812500000040f, + -0.00085449218750000000f, -0.00320434570312500000f, + -0.00567626953124999910f, -0.00646972656250000000f, + -0.00695800781250000000f, -0.00241088867187500000f, + -0.00231933593750000000f, 0.00155639648437500000f, + -0.00216674804687500000f, 0.00219726562500000000f, + 0.00360107421875000000f, -0.00103759765625000000f, + -0.00009155273437500000f, -0.00521850585937500000f, + 0.00015258789062500000f, 0.00006103515625000000f, + -0.00329589843750000000f, -0.00381469726562499960f, + 0.00189208984375000000f, -0.00177001953125000000f, + 0.00177001953125000000f, -0.00369262695312500000f, + 0.00222778320312500000f, -0.01422119140625000000f, + 0.00280761718750000000f, 0.00192260742187500000f, + -0.00286865234375000000f, -0.00238037109375000000f, + -0.00231933593750000000f, 0.00646972656250000000f, + 0.00109863281250000000f, -0.00686645507812500000f, + -0.00216674804687500000f, -0.01080322265625000200f, + 0.00463867187500000000f, 0.00436401367187500000f, + -0.00241088867187500000f, -0.00750732421875000000f, + -0.00155639648437500000f, -0.00094604492187500000f, + -0.00018310546875000000f, -0.00823974609375000000f, + 0.00732421874999999910f, 0.00640869140625000000f, + 0.00091552734374999989f, -0.00479125976562500000f, + -0.00704956054687500000f, 0.00225830078125000000f, + -0.00445556640625000000f, 0.00268554687499999960f, + -0.00833129882812500000f, 0.00476074218750000000f, + 0.00280761718750000000f, 0.00170898437500000000f, + 0.00216674804687500000f, 0.00006103515625000000f, + 0.00970458984375000000f, 0.00500488281250000000f, + 0.00097656250000000000f, -0.00335693359375000000f, + -0.00106811523437500000f, -0.00125122070312500000f, + -0.00289916992187500000f, -0.00323486328125000000f, + 0.00033569335937499995f, 0.00402832031250000000f, + -0.00207519531250000000f, 0.00167846679687500000f, + 0.00375366210937500000f, -0.00253295898437500040f, + -0.00454711914062500000f, 0.00646972656250000000f, + 0.00402832031250000000f, 0.00000000000000000000f, + -0.00592041015625000000f, 0.00167846679687500000f, + 0.00628662109375000000f, -0.00329589843750000000f, + -0.01077270507812500000f, 0.00881958007812500000f, + -0.00595092773437500000f, 0.00003051757812500000f, + 0.00711059570312500000f, -0.00067138671874999989f, + -0.00183105468749999980f, 0.00061035156250000000f, + 0.00079345703125000011f, 0.00207519531250000000f, + 0.00506591796875000090f, 0.00082397460937500000f, + -0.00177001953125000000f, 0.00396728515625000000f, + 0.00341796875000000000f, 0.00326538085937500000f, + 0.00082397460937500000f, -0.00503540039062499910f, + 0.00350952148437500040f, -0.00283813476562499960f, + -0.00112915039062500000f, 0.00115966796875000000f, + 0.00253295898437500040f, 0.01473999023437500000f, + 0.00198364257812500000f, -0.00698852539062499910f, + -0.00039672851562500005f, 0.00479125976562500000f, + 0.00259399414062500000f, 0.00152587890625000000f, + 0.00415039062500000000f, 0.00030517578125000000f, + 0.00097656250000000000f, 0.00253295898437500040f, + 0.00250244140625000000f, 0.00167846679687500000f, + 0.00015258789062500000f, -0.00027465820312500000f, + -0.00158691406250000020f, -0.00238037109375000000f, + -0.00247192382812500000f, -0.00155639648437500000f, + 0.00122070312500000000f, 0.00054931640625000000f, + -0.00387573242187500000f, -0.00683593750000000000f, + -0.00125122070312500000f, 0.00161743164062500000f, + -0.00640869140625000000f, -0.00344848632812500000f, + 0.00073242187500000000f, -0.00051879882812500000f, + -0.00570678710937500090f, -0.00271606445312500000f, + 0.00024414062500000000f, 0.00369262695312500000f, + 0.00253295898437500040f, 0.00234985351562500000f, + 0.00277709960937500000f, -0.00225830078125000000f, + -0.00106811523437500000f, -0.00341796875000000000f, + -0.00491333007812500000f, -0.00527954101562500000f, + 0.00311279296875000000f, 0.00402832031250000000f, + -0.00381469726562499960f, -0.00186157226562500000f, + 0.00314331054687500000f, -0.00793457031250000000f, + 0.00158691406250000020f, 0.00506591796875000090f, + -0.00097656250000000000f, -0.00476074218750000000f, + -0.00265502929687500000f, -0.00170898437500000000f, + 0.00183105468749999980f, -0.00213623046875000000f, + -0.00378417968750000000f, 0.00738525390625000000f, + 0.00347900390625000000f, -0.00765991210937500090f, + -0.00506591796875000090f, 0.00613403320312500000f, + 0.00387573242187500000f, 0.00085449218750000000f, + -0.00033569335937499995f, 0.00070190429687500000f, + -0.00244140625000000000f, -0.00350952148437500040f, + -0.00061035156250000000f, -0.00155639648437500000f, + -0.01062011718750000000f, 0.01037597656250000000f, + -0.00103759765625000000f, 0.00405883789062500000f, + 0.00039672851562500005f, 0.00280761718750000000f, + -0.00378417968750000000f, -0.00415039062500000000f, + -0.00366210937499999960f, -0.00079345703125000011f, + -0.00018310546875000000f, 0.00051879882812500000f, + 0.00085449218750000000f, 0.00064086914062500000f, + 0.00366210937499999960f, -0.00512695312500000000f, + 0.00488281250000000000f, -0.00106811523437500000f, + 0.00350952148437500040f, 0.00085449218750000000f, + 0.00027465820312500000f, 0.00021362304687500000f, + -0.00170898437500000000f, 0.00119018554687500000f, + 0.00476074218750000000f, 0.00781250000000000000f, + -0.00054931640625000000f, 0.00003051757812500000f, + 0.00845336914062500000f, 0.00250244140625000000f, + -0.00213623046875000000f, -0.00439453125000000000f, + -0.00268554687499999960f, -0.00039672851562500005f, + -0.00180053710937500000f, -0.00479125976562500000f, + 0.00024414062500000000f, -0.00408935546875000000f, + 0.00064086914062500000f, -0.00122070312500000000f, + 0.00177001953125000000f, -0.00064086914062500000f, + 0.00592041015625000000f, -0.00842285156250000000f, + 0.00296020507812500000f, 0.00851440429687500000f, + -0.00170898437500000000f, -0.00427246093750000000f, + 0.00381469726562499960f, 0.00173950195312500000f, + -0.00561523437500000000f, -0.00622558593750000000f, + -0.00213623046875000000f, -0.00006103515625000000f, + 0.00390625000000000000f, -0.00616455078125000000f, + -0.00238037109375000000f, 0.00701904296875000090f, + -0.00070190429687500000f, 0.00491333007812500000f, + -0.00311279296875000000f, 0.00003051757812500000f, + 0.00003051757812500000f, 0.00549316406250000000f, + -0.00094604492187500000f, -0.00262451171875000000f, + -0.00509643554687500000f, -0.00173950195312500000f, + -0.00183105468749999980f, 0.00082397460937500000f, + -0.00039672851562500005f, 0.00302124023437500040f, + 0.00329589843750000000f, 0.00338745117187500000f, + 0.00231933593750000000f, 0.00210571289062500000f, + 0.00103759765625000000f, -0.00064086914062500000f, + 0.00161743164062500000f, 0.00115966796875000000f, + 0.00103759765625000000f, 0.00238037109375000000f, + 0.00222778320312500000f, 0.00668334960937500090f, + 0.00155639648437500000f, 0.00045776367187499995f, + -0.00219726562500000000f, -0.00314331054687500000f, + -0.00631713867187499910f, 0.00091552734374999989f, + 0.00650024414062500000f, -0.00042724609375000000f, + 0.00094604492187500000f, -0.00286865234375000000f, + -0.00122070312500000000f, -0.00439453125000000000f, + 0.00204467773437500000f, 0.00012207031250000000f, + 0.00320434570312500000f, 0.00180053710937500000f, + -0.00732421874999999910f, 0.00076293945312500000f, + 0.00744628906250000000f, 0.00210571289062500000f, + 0.00177001953125000000f, 0.00070190429687500000f, + -0.00073242187500000000f, -0.00015258789062500000f, + -0.00045776367187499995f, -0.00405883789062500000f, + -0.00216674804687500000f, -0.00204467773437500000f, + 0.00552368164062500000f, 0.00088500976562500000f, + -0.00137329101562500000f, 0.00369262695312500000f, + 0.00292968750000000000f, 0.00155639648437500000f, + -0.00219726562500000000f, -0.00161743164062500000f, + 0.00170898437500000000f, -0.00466918945312500000f, + -0.00082397460937500000f, 0.00259399414062500000f, + 0.00558471679687500000f, 0.00643920898437500000f, + 0.00320434570312500000f, -0.00103759765625000000f, + -0.00140380859375000000f, 0.00131225585937500000f, + -0.00219726562500000000f, -0.00283813476562499960f, + 0.00109863281250000000f, -0.00390625000000000000f, + 0.00088500976562500000f, 0.00338745117187500000f, + -0.00289916992187500000f, -0.00476074218750000000f, + -0.00546264648437500000f, -0.00717163085937500000f, + 0.00064086914062500000f, -0.00119018554687500000f, + -0.00216674804687500000f, -0.00100708007812500000f, + -0.00186157226562500000f, -0.00769042968750000000f, + 0.00701904296875000090f, -0.00399780273437500000f, + 0.00479125976562500000f, -0.00064086914062500000f, + -0.00259399414062500000f, -0.00085449218750000000f, + -0.00375366210937500000f, 0.00244140625000000000f, + -0.00488281250000000000f, 0.00192260742187500000f, + 0.00143432617187500000f, -0.00018310546875000000f, + -0.00149536132812500000f, -0.00292968750000000000f, + -0.00057983398437500000f, 0.00051879882812500000f, + -0.00177001953125000000f, 0.00051879882812500000f, + -0.00000000000000000000f, -0.00039672851562500005f, + -0.00518798828125000000f, 0.00076293945312500000f, + -0.00106811523437500000f, 0.00180053710937500000f, + 0.00030517578125000000f, -0.00094604492187500000f, + -0.01260375976562500000f, 0.00247192382812500000f, + 0.00189208984375000000f, 0.00054931640625000000f, + -0.00500488281250000000f, 0.00747680664062500000f, + 0.00280761718750000000f, -0.00503540039062499910f, + 0.00128173828125000000f, 0.00079345703125000011f, + 0.00384521484375000000f, -0.00756835937500000000f, + 0.00588989257812500000f, -0.00167846679687500000f, + 0.00048828125000000000f, 0.00119018554687500000f, + 0.00042724609375000000f, 0.00152587890625000000f +}; + +const SKP_Silk_NLSF_CBS_FLP SKP_Silk_NLSF_CB1_16_Stage_info_FLP[ NLSF_MSVQ_CB1_16_STAGES ] = +{ + { 32, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 0 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 0 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 32 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 32 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 40 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 40 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 48 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 48 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 56 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 56 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 64 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 64 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 72 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 72 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 80 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 80 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 88 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 88 ] }, + { 8, &SKP_Silk_NLSF_MSVQ_CB1_16[ 16 * 96 ], &SKP_Silk_NLSF_MSVQ_CB1_16_rates[ 96 ] } +}; + +const SKP_Silk_NLSF_CB_FLP SKP_Silk_NLSF_CB1_16_FLP = +{ + NLSF_MSVQ_CB1_16_STAGES, + SKP_Silk_NLSF_CB1_16_Stage_info_FLP, + SKP_Silk_NLSF_MSVQ_CB1_16_ndelta_min, + SKP_Silk_NLSF_MSVQ_CB1_16_CDF, + SKP_Silk_NLSF_MSVQ_CB1_16_CDF_start_ptr, + SKP_Silk_NLSF_MSVQ_CB1_16_CDF_middle_idx +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_gain.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_gain.c new file mode 100755 index 0000000..36cf647 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_gain.c @@ -0,0 +1,77 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_tables.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +const SKP_uint16 SKP_Silk_gain_CDF[ 2 ][ 65 ] = +{ +{ + 0, 18, 45, 94, 181, 320, 519, 777, + 1093, 1468, 1909, 2417, 2997, 3657, 4404, 5245, + 6185, 7228, 8384, 9664, 11069, 12596, 14244, 16022, + 17937, 19979, 22121, 24345, 26646, 29021, 31454, 33927, + 36438, 38982, 41538, 44068, 46532, 48904, 51160, 53265, + 55184, 56904, 58422, 59739, 60858, 61793, 62568, 63210, + 63738, 64165, 64504, 64769, 64976, 65133, 65249, 65330, + 65386, 65424, 65451, 65471, 65487, 65501, 65513, 65524, + 65535 +}, +{ + 0, 214, 581, 1261, 2376, 3920, 5742, 7632, + 9449, 11157, 12780, 14352, 15897, 17427, 18949, 20462, + 21957, 23430, 24889, 26342, 27780, 29191, 30575, 31952, + 33345, 34763, 36200, 37642, 39083, 40519, 41930, 43291, + 44602, 45885, 47154, 48402, 49619, 50805, 51959, 53069, + 54127, 55140, 56128, 57101, 58056, 58979, 59859, 60692, + 61468, 62177, 62812, 63368, 63845, 64242, 64563, 64818, + 65023, 65184, 65306, 65391, 65447, 65482, 65505, 65521, + 65535 +} +}; + +const SKP_int SKP_Silk_gain_CDF_offset = 32; + + +const SKP_uint16 SKP_Silk_delta_gain_CDF[ 46 ] = { + 0, 2358, 3856, 7023, 15376, 53058, 59135, 61555, + 62784, 63498, 63949, 64265, 64478, 64647, 64783, 64894, + 64986, 65052, 65113, 65169, 65213, 65252, 65284, 65314, + 65338, 65359, 65377, 65392, 65403, 65415, 65424, 65432, + 65440, 65448, 65455, 65462, 65470, 65477, 65484, 65491, + 65499, 65506, 65513, 65521, 65528, 65535 +}; + +const SKP_int SKP_Silk_delta_gain_CDF_offset = 5; + +#ifdef __cplusplus +} +#endif diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_other.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_other.c new file mode 100755 index 0000000..0afbc72 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_other.c @@ -0,0 +1,148 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_structs.h" +#include "SKP_Silk_define.h" +#include "SKP_Silk_tables.h" +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Piece-wise linear mapping from bitrate in kbps to coding quality in dB SNR */ +const SKP_int32 TargetRate_table_NB[ TARGET_RATE_TAB_SZ ] = { + 0, 8000, 9000, 11000, 13000, 16000, 22000, MAX_TARGET_RATE_BPS +}; +const SKP_int32 TargetRate_table_MB[ TARGET_RATE_TAB_SZ ] = { + 0, 10000, 12000, 14000, 17000, 21000, 28000, MAX_TARGET_RATE_BPS +}; +const SKP_int32 TargetRate_table_WB[ TARGET_RATE_TAB_SZ ] = { + 0, 11000, 14000, 17000, 21000, 26000, 36000, MAX_TARGET_RATE_BPS +}; +const SKP_int32 TargetRate_table_SWB[ TARGET_RATE_TAB_SZ ] = { + 0, 13000, 16000, 19000, 25000, 32000, 46000, MAX_TARGET_RATE_BPS +}; +const SKP_int32 SNR_table_Q1[ TARGET_RATE_TAB_SZ ] = { + 19, 31, 35, 39, 43, 47, 54, 64 +}; + +const SKP_int32 SNR_table_one_bit_per_sample_Q7[ 4 ] = { + 1984, 2240, 2408, 2708 +}; + +/* Filter coeficicnts for HP filter: 4. Order filter implementad as two biquad filters */ +const SKP_int16 SKP_Silk_SWB_detect_B_HP_Q13[ NB_SOS ][ 3 ] = { + //{400, -550, 400}, {400, 130, 400}, {400, 390, 400} + {575, -948, 575}, {575, -221, 575}, {575, 104, 575} +}; +const SKP_int16 SKP_Silk_SWB_detect_A_HP_Q13[ NB_SOS ][ 2 ] = { + {14613, 6868}, {12883, 7337}, {11586, 7911} + //{14880, 6900}, {14400, 7300}, {13700, 7800} +}; + +/* Decoder high-pass filter coefficients for 24 kHz sampling, -6 dB @ 44 Hz */ +const SKP_int16 SKP_Silk_Dec_A_HP_24[ DEC_HP_ORDER ] = {-16220, 8030}; // second order AR coefs, Q13 +const SKP_int16 SKP_Silk_Dec_B_HP_24[ DEC_HP_ORDER + 1 ] = {8000, -16000, 8000}; // second order MA coefs, Q13 + +/* Decoder high-pass filter coefficients for 16 kHz sampling, - 6 dB @ 46 Hz */ +const SKP_int16 SKP_Silk_Dec_A_HP_16[ DEC_HP_ORDER ] = {-16127, 7940}; // second order AR coefs, Q13 +const SKP_int16 SKP_Silk_Dec_B_HP_16[ DEC_HP_ORDER + 1 ] = {8000, -16000, 8000}; // second order MA coefs, Q13 + +/* Decoder high-pass filter coefficients for 12 kHz sampling, -6 dB @ 44 Hz */ +const SKP_int16 SKP_Silk_Dec_A_HP_12[ DEC_HP_ORDER ] = {-16043, 7859}; // second order AR coefs, Q13 +const SKP_int16 SKP_Silk_Dec_B_HP_12[ DEC_HP_ORDER + 1 ] = {8000, -16000, 8000}; // second order MA coefs, Q13 + +/* Decoder high-pass filter coefficients for 8 kHz sampling, -6 dB @ 43 Hz */ +const SKP_int16 SKP_Silk_Dec_A_HP_8[ DEC_HP_ORDER ] = {-15885, 7710}; // second order AR coefs, Q13 +const SKP_int16 SKP_Silk_Dec_B_HP_8[ DEC_HP_ORDER + 1 ] = {8000, -16000, 8000}; // second order MA coefs, Q13 + +/* table for LSB coding */ +const SKP_uint16 SKP_Silk_lsb_CDF[ 3 ] = {0, 40000, 65535}; + +/* tables for LTPScale */ +const SKP_uint16 SKP_Silk_LTPscale_CDF[ 4 ] = {0, 32000, 48000, 65535}; +const SKP_int SKP_Silk_LTPscale_offset = 2; + +/* tables for VAD flag */ +const SKP_uint16 SKP_Silk_vadflag_CDF[ 3 ] = {0, 22000, 65535}; // 66% for speech, 33% for no speech +const SKP_int SKP_Silk_vadflag_offset = 1; + +/* tables for sampling rate */ +const SKP_int SKP_Silk_SamplingRates_table[ 4 ] = {8, 12, 16, 24}; +const SKP_uint16 SKP_Silk_SamplingRates_CDF[ 5 ] = {0, 16000, 32000, 48000, 65535}; +const SKP_int SKP_Silk_SamplingRates_offset = 2; + +/* tables for NLSF interpolation factor */ +const SKP_uint16 SKP_Silk_NLSF_interpolation_factor_CDF[ 6 ] = {0, 3706, 8703, 19226, 30926, 65535}; +const SKP_int SKP_Silk_NLSF_interpolation_factor_offset = 4; + +/* Table for frame termination indication */ +const SKP_uint16 SKP_Silk_FrameTermination_CDF[ 5 ] = {0, 20000, 45000, 56000, 65535}; +const SKP_int SKP_Silk_FrameTermination_offset = 2; + +/* Table for random seed */ +const SKP_uint16 SKP_Silk_Seed_CDF[ 5 ] = {0, 16384, 32768, 49152, 65535}; +const SKP_int SKP_Silk_Seed_offset = 2; + +/* Quantization offsets */ +const SKP_int16 SKP_Silk_Quantization_Offsets_Q10[ 2 ][ 2 ] = { + { OFFSET_VL_Q10, OFFSET_VH_Q10 }, { OFFSET_UVL_Q10, OFFSET_UVH_Q10 } +}; + +/* Table for LTPScale */ +const SKP_int16 SKP_Silk_LTPScales_table_Q14[ 3 ] = { 15565, 11469, 8192 }; + +#if SWITCH_TRANSITION_FILTERING +/* Elliptic/Cauer filters designed with 0.1 dB passband ripple, + 80 dB minimum stopband attenuation, and + [0.95 : 0.15 : 0.35] normalized cut off frequencies. */ + +/* Interpolation points for filter coefficients used in the bandwidth transition smoother */ +const SKP_int32 SKP_Silk_Transition_LP_B_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NB ] = +{ +{ 250767114, 501534038, 250767114 }, +{ 209867381, 419732057, 209867381 }, +{ 170987846, 341967853, 170987846 }, +{ 131531482, 263046905, 131531482 }, +{ 89306658, 178584282, 89306658 } +}; + +/* Interpolation points for filter coefficients used in the bandwidth transition smoother */ +const SKP_int32 SKP_Silk_Transition_LP_A_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NA ] = +{ +{ 506393414, 239854379 }, +{ 411067935, 169683996 }, +{ 306733530, 116694253 }, +{ 185807084, 77959395 }, +{ 35497197, 57401098 } +}; +#endif + +#ifdef __cplusplus +} +#endif + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_other_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_other_FLP.c new file mode 100755 index 0000000..16eea19 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_other_FLP.c @@ -0,0 +1,35 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_structs_FLP.h" +#include "SKP_Silk_tables_FLP.h" + +const SKP_float SKP_Silk_HarmShapeFIR_FLP[ HARM_SHAPE_FIR_TAPS ] = { 16384.0f / 65536.0f, 32767.0f / 65536.0f, 16384.0f / 65536.0f }; + +const SKP_float SKP_Silk_Quantization_Offsets[ 2 ][ 2 ] = { + { OFFSET_VL_Q10 / 1024.0f, OFFSET_VH_Q10 / 1024.0f }, { OFFSET_UVL_Q10 / 1024.0f, OFFSET_UVH_Q10 / 1024.0f } +}; diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_pitch_lag.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_pitch_lag.c new file mode 100755 index 0000000..f86d2f2 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_pitch_lag.c @@ -0,0 +1,199 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_tables.h" + +const SKP_uint16 SKP_Silk_pitch_lag_NB_CDF[ 8 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) + 2 ] = { + 0, 194, 395, 608, 841, 1099, 1391, 1724, + 2105, 2544, 3047, 3624, 4282, 5027, 5865, 6799, + 7833, 8965, 10193, 11510, 12910, 14379, 15905, 17473, + 19065, 20664, 22252, 23814, 25335, 26802, 28206, 29541, + 30803, 31992, 33110, 34163, 35156, 36098, 36997, 37861, + 38698, 39515, 40319, 41115, 41906, 42696, 43485, 44273, + 45061, 45847, 46630, 47406, 48175, 48933, 49679, 50411, + 51126, 51824, 52502, 53161, 53799, 54416, 55011, 55584, + 56136, 56666, 57174, 57661, 58126, 58570, 58993, 59394, + 59775, 60134, 60472, 60790, 61087, 61363, 61620, 61856, + 62075, 62275, 62458, 62625, 62778, 62918, 63045, 63162, + 63269, 63368, 63459, 63544, 63623, 63698, 63769, 63836, + 63901, 63963, 64023, 64081, 64138, 64194, 64248, 64301, + 64354, 64406, 64457, 64508, 64558, 64608, 64657, 64706, + 64754, 64803, 64851, 64899, 64946, 64994, 65041, 65088, + 65135, 65181, 65227, 65272, 65317, 65361, 65405, 65449, + 65492, 65535 +}; + +const SKP_int SKP_Silk_pitch_lag_NB_CDF_offset = 43; + +const SKP_uint16 SKP_Silk_pitch_contour_NB_CDF[ 12 ] = { + 0, 14445, 18587, 25628, 30013, 34859, 40597, 48426, + 54460, 59033, 62990, 65535 +}; + +const SKP_int SKP_Silk_pitch_contour_NB_CDF_offset = 5; + +const SKP_uint16 SKP_Silk_pitch_lag_MB_CDF[ 12 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) + 2 ] = { + 0, 132, 266, 402, 542, 686, 838, 997, + 1167, 1349, 1546, 1760, 1993, 2248, 2528, 2835, + 3173, 3544, 3951, 4397, 4882, 5411, 5984, 6604, + 7270, 7984, 8745, 9552, 10405, 11300, 12235, 13206, + 14209, 15239, 16289, 17355, 18430, 19507, 20579, 21642, + 22688, 23712, 24710, 25677, 26610, 27507, 28366, 29188, + 29971, 30717, 31427, 32104, 32751, 33370, 33964, 34537, + 35091, 35630, 36157, 36675, 37186, 37692, 38195, 38697, + 39199, 39701, 40206, 40713, 41222, 41733, 42247, 42761, + 43277, 43793, 44309, 44824, 45336, 45845, 46351, 46851, + 47347, 47836, 48319, 48795, 49264, 49724, 50177, 50621, + 51057, 51484, 51902, 52312, 52714, 53106, 53490, 53866, + 54233, 54592, 54942, 55284, 55618, 55944, 56261, 56571, + 56873, 57167, 57453, 57731, 58001, 58263, 58516, 58762, + 58998, 59226, 59446, 59656, 59857, 60050, 60233, 60408, + 60574, 60732, 60882, 61024, 61159, 61288, 61410, 61526, + 61636, 61742, 61843, 61940, 62033, 62123, 62210, 62293, + 62374, 62452, 62528, 62602, 62674, 62744, 62812, 62879, + 62945, 63009, 63072, 63135, 63196, 63256, 63316, 63375, + 63434, 63491, 63549, 63605, 63661, 63717, 63772, 63827, + 63881, 63935, 63988, 64041, 64094, 64147, 64199, 64252, + 64304, 64356, 64409, 64461, 64513, 64565, 64617, 64669, + 64721, 64773, 64824, 64875, 64925, 64975, 65024, 65072, + 65121, 65168, 65215, 65262, 65308, 65354, 65399, 65445, + 65490, 65535 +}; + +const SKP_int SKP_Silk_pitch_lag_MB_CDF_offset = 64; + +const SKP_uint16 SKP_Silk_pitch_lag_WB_CDF[ 16 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) + 2 ] = { + 0, 106, 213, 321, 429, 539, 651, 766, + 884, 1005, 1132, 1264, 1403, 1549, 1705, 1870, + 2047, 2236, 2439, 2658, 2893, 3147, 3420, 3714, + 4030, 4370, 4736, 5127, 5546, 5993, 6470, 6978, + 7516, 8086, 8687, 9320, 9985, 10680, 11405, 12158, + 12938, 13744, 14572, 15420, 16286, 17166, 18057, 18955, + 19857, 20759, 21657, 22547, 23427, 24293, 25141, 25969, + 26774, 27555, 28310, 29037, 29736, 30406, 31048, 31662, + 32248, 32808, 33343, 33855, 34345, 34815, 35268, 35704, + 36127, 36537, 36938, 37330, 37715, 38095, 38471, 38844, + 39216, 39588, 39959, 40332, 40707, 41084, 41463, 41844, + 42229, 42615, 43005, 43397, 43791, 44186, 44583, 44982, + 45381, 45780, 46179, 46578, 46975, 47371, 47765, 48156, + 48545, 48930, 49312, 49690, 50064, 50433, 50798, 51158, + 51513, 51862, 52206, 52544, 52877, 53204, 53526, 53842, + 54152, 54457, 54756, 55050, 55338, 55621, 55898, 56170, + 56436, 56697, 56953, 57204, 57449, 57689, 57924, 58154, + 58378, 58598, 58812, 59022, 59226, 59426, 59620, 59810, + 59994, 60173, 60348, 60517, 60681, 60840, 60993, 61141, + 61284, 61421, 61553, 61679, 61800, 61916, 62026, 62131, + 62231, 62326, 62417, 62503, 62585, 62663, 62737, 62807, + 62874, 62938, 62999, 63057, 63113, 63166, 63217, 63266, + 63314, 63359, 63404, 63446, 63488, 63528, 63567, 63605, + 63642, 63678, 63713, 63748, 63781, 63815, 63847, 63879, + 63911, 63942, 63973, 64003, 64033, 64063, 64092, 64121, + 64150, 64179, 64207, 64235, 64263, 64291, 64319, 64347, + 64374, 64401, 64428, 64455, 64481, 64508, 64534, 64560, + 64585, 64610, 64635, 64660, 64685, 64710, 64734, 64758, + 64782, 64807, 64831, 64855, 64878, 64902, 64926, 64950, + 64974, 64998, 65022, 65045, 65069, 65093, 65116, 65139, + 65163, 65186, 65209, 65231, 65254, 65276, 65299, 65321, + 65343, 65364, 65386, 65408, 65429, 65450, 65471, 65493, + 65514, 65535 +}; + +const SKP_int SKP_Silk_pitch_lag_WB_CDF_offset = 86; + + +const SKP_uint16 SKP_Silk_pitch_lag_SWB_CDF[ 24 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) + 2 ] = { + 0, 253, 505, 757, 1008, 1258, 1507, 1755, + 2003, 2249, 2494, 2738, 2982, 3225, 3469, 3713, + 3957, 4202, 4449, 4698, 4949, 5203, 5460, 5720, + 5983, 6251, 6522, 6798, 7077, 7361, 7650, 7942, + 8238, 8539, 8843, 9150, 9461, 9775, 10092, 10411, + 10733, 11057, 11383, 11710, 12039, 12370, 12701, 13034, + 13368, 13703, 14040, 14377, 14716, 15056, 15398, 15742, + 16087, 16435, 16785, 17137, 17492, 17850, 18212, 18577, + 18946, 19318, 19695, 20075, 20460, 20849, 21243, 21640, + 22041, 22447, 22856, 23269, 23684, 24103, 24524, 24947, + 25372, 25798, 26225, 26652, 27079, 27504, 27929, 28352, + 28773, 29191, 29606, 30018, 30427, 30831, 31231, 31627, + 32018, 32404, 32786, 33163, 33535, 33902, 34264, 34621, + 34973, 35320, 35663, 36000, 36333, 36662, 36985, 37304, + 37619, 37929, 38234, 38535, 38831, 39122, 39409, 39692, + 39970, 40244, 40513, 40778, 41039, 41295, 41548, 41796, + 42041, 42282, 42520, 42754, 42985, 43213, 43438, 43660, + 43880, 44097, 44312, 44525, 44736, 44945, 45153, 45359, + 45565, 45769, 45972, 46175, 46377, 46578, 46780, 46981, + 47182, 47383, 47585, 47787, 47989, 48192, 48395, 48599, + 48804, 49009, 49215, 49422, 49630, 49839, 50049, 50259, + 50470, 50682, 50894, 51107, 51320, 51533, 51747, 51961, + 52175, 52388, 52601, 52813, 53025, 53236, 53446, 53655, + 53863, 54069, 54274, 54477, 54679, 54879, 55078, 55274, + 55469, 55662, 55853, 56042, 56230, 56415, 56598, 56779, + 56959, 57136, 57311, 57484, 57654, 57823, 57989, 58152, + 58314, 58473, 58629, 58783, 58935, 59084, 59230, 59373, + 59514, 59652, 59787, 59919, 60048, 60174, 60297, 60417, + 60533, 60647, 60757, 60865, 60969, 61070, 61167, 61262, + 61353, 61442, 61527, 61609, 61689, 61765, 61839, 61910, + 61979, 62045, 62109, 62170, 62230, 62287, 62343, 62396, + 62448, 62498, 62547, 62594, 62640, 62685, 62728, 62770, + 62811, 62852, 62891, 62929, 62967, 63004, 63040, 63075, + 63110, 63145, 63178, 63212, 63244, 63277, 63308, 63340, + 63371, 63402, 63432, 63462, 63491, 63521, 63550, 63578, + 63607, 63635, 63663, 63690, 63718, 63744, 63771, 63798, + 63824, 63850, 63875, 63900, 63925, 63950, 63975, 63999, + 64023, 64046, 64069, 64092, 64115, 64138, 64160, 64182, + 64204, 64225, 64247, 64268, 64289, 64310, 64330, 64351, + 64371, 64391, 64411, 64431, 64450, 64470, 64489, 64508, + 64527, 64545, 64564, 64582, 64600, 64617, 64635, 64652, + 64669, 64686, 64702, 64719, 64735, 64750, 64766, 64782, + 64797, 64812, 64827, 64842, 64857, 64872, 64886, 64901, + 64915, 64930, 64944, 64959, 64974, 64988, 65003, 65018, + 65033, 65048, 65063, 65078, 65094, 65109, 65125, 65141, + 65157, 65172, 65188, 65204, 65220, 65236, 65252, 65268, + 65283, 65299, 65314, 65330, 65345, 65360, 65375, 65390, + 65405, 65419, 65434, 65449, 65463, 65477, 65492, 65506, + 65521, 65535 +}; + +const SKP_int SKP_Silk_pitch_lag_SWB_CDF_offset = 128; + + +const SKP_uint16 SKP_Silk_pitch_contour_CDF[ 35 ] = { + 0, 372, 843, 1315, 1836, 2644, 3576, 4719, + 6088, 7621, 9396, 11509, 14245, 17618, 20777, 24294, + 27992, 33116, 40100, 44329, 47558, 50679, 53130, 55557, + 57510, 59022, 60285, 61345, 62316, 63140, 63762, 64321, + 64729, 65099, 65535 +}; + +const SKP_int SKP_Silk_pitch_contour_CDF_offset = 17; + +const SKP_uint16 SKP_Silk_pitch_delta_CDF[23] = { + 0, 343, 740, 1249, 1889, 2733, 3861, 5396, + 7552, 10890, 16053, 24152, 30220, 34680, 37973, 40405, + 42243, 43708, 44823, 45773, 46462, 47055, 65535 +}; + +const SKP_int SKP_Silk_pitch_delta_CDF_offset = 11; diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_pulses_per_block.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_pulses_per_block.c new file mode 100755 index 0000000..cce996a --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_pulses_per_block.c @@ -0,0 +1,235 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_tables.h" + +const SKP_int SKP_Silk_max_pulses_table[ 4 ] = { + 6, 8, 12, 18 +}; + +const SKP_uint16 SKP_Silk_pulses_per_block_CDF[ 10 ][ 21 ] = +{ +{ + 0, 47113, 61501, 64590, 65125, 65277, 65352, 65407, + 65450, 65474, 65488, 65501, 65508, 65514, 65516, 65520, + 65521, 65523, 65524, 65526, 65535 +}, +{ + 0, 26368, 47760, 58803, 63085, 64567, 65113, 65333, + 65424, 65474, 65498, 65511, 65517, 65520, 65523, 65525, + 65526, 65528, 65529, 65530, 65535 +}, +{ + 0, 9601, 28014, 45877, 57210, 62560, 64611, 65260, + 65447, 65500, 65511, 65519, 65521, 65525, 65526, 65529, + 65530, 65531, 65532, 65534, 65535 +}, +{ + 0, 3351, 12462, 25972, 39782, 50686, 57644, 61525, + 63521, 64506, 65009, 65255, 65375, 65441, 65471, 65488, + 65497, 65505, 65509, 65512, 65535 +}, +{ + 0, 488, 2944, 9295, 19712, 32160, 43976, 53121, + 59144, 62518, 64213, 65016, 65346, 65470, 65511, 65515, + 65525, 65529, 65531, 65534, 65535 +}, +{ + 0, 17013, 30405, 40812, 48142, 53466, 57166, 59845, + 61650, 62873, 63684, 64223, 64575, 64811, 64959, 65051, + 65111, 65143, 65165, 65183, 65535 +}, +{ + 0, 2994, 8323, 15845, 24196, 32300, 39340, 45140, + 49813, 53474, 56349, 58518, 60167, 61397, 62313, 62969, + 63410, 63715, 63906, 64056, 65535 +}, +{ + 0, 88, 721, 2795, 7542, 14888, 24420, 34593, + 43912, 51484, 56962, 60558, 62760, 64037, 64716, 65069, + 65262, 65358, 65398, 65420, 65535 +}, +{ + 0, 287, 789, 2064, 4398, 8174, 13534, 20151, + 27347, 34533, 41295, 47242, 52070, 55772, 58458, 60381, + 61679, 62533, 63109, 63519, 65535 +}, +{ + 0, 1, 3, 91, 4521, 14708, 28329, 41955, + 52116, 58375, 61729, 63534, 64459, 64924, 65092, 65164, + 65182, 65198, 65203, 65211, 65535 +} +}; + +const SKP_int SKP_Silk_pulses_per_block_CDF_offset = 6; + + +const SKP_int16 SKP_Silk_pulses_per_block_BITS_Q6[ 9 ][ 20 ] = +{ +{ + 30, 140, 282, 444, 560, 625, 654, 677, + 731, 780, 787, 844, 859, 960, 896, 1024, + 960, 1024, 960, 821 +}, +{ + 84, 103, 164, 252, 350, 442, 526, 607, + 663, 731, 787, 859, 923, 923, 960, 1024, + 960, 1024, 1024, 875 +}, +{ + 177, 117, 120, 162, 231, 320, 426, 541, + 657, 803, 832, 960, 896, 1024, 923, 1024, + 1024, 1024, 960, 1024 +}, +{ + 275, 182, 146, 144, 166, 207, 261, 322, + 388, 450, 516, 582, 637, 710, 762, 821, + 832, 896, 923, 734 +}, +{ + 452, 303, 216, 170, 153, 158, 182, 220, + 274, 337, 406, 489, 579, 681, 896, 811, + 896, 960, 923, 1024 +}, +{ + 125, 147, 170, 202, 232, 265, 295, 332, + 368, 406, 443, 483, 520, 563, 606, 646, + 704, 739, 757, 483 +}, +{ + 285, 232, 200, 190, 193, 206, 224, 244, + 266, 289, 315, 340, 367, 394, 425, 462, + 496, 539, 561, 350 +}, +{ + 611, 428, 319, 242, 202, 178, 172, 180, + 199, 229, 268, 313, 364, 422, 482, 538, + 603, 683, 739, 586 +}, +{ + 501, 450, 364, 308, 264, 231, 212, 204, + 204, 210, 222, 241, 265, 295, 326, 362, + 401, 437, 469, 321 +} +}; + +const SKP_uint16 SKP_Silk_rate_levels_CDF[ 2 ][ 10 ] = +{ +{ + 0, 2005, 12717, 20281, 31328, 36234, 45816, 57753, + 63104, 65535 +}, +{ + 0, 8553, 23489, 36031, 46295, 53519, 56519, 59151, + 64185, 65535 +} +}; + +const SKP_int SKP_Silk_rate_levels_CDF_offset = 4; + + +const SKP_int16 SKP_Silk_rate_levels_BITS_Q6[ 2 ][ 9 ] = +{ +{ + 322, 167, 199, 164, 239, 178, 157, 231, + 304 +}, +{ + 188, 137, 153, 171, 204, 285, 297, 237, + 358 +} +}; + +const SKP_uint16 SKP_Silk_shell_code_table0[ 33 ] = { + 0, 32748, 65535, 0, 9505, 56230, 65535, 0, + 4093, 32204, 61720, 65535, 0, 2285, 16207, 48750, + 63424, 65535, 0, 1709, 9446, 32026, 55752, 63876, + 65535, 0, 1623, 6986, 21845, 45381, 59147, 64186, + 65535 +}; + +const SKP_uint16 SKP_Silk_shell_code_table1[ 52 ] = { + 0, 32691, 65535, 0, 12782, 52752, 65535, 0, + 4847, 32665, 60899, 65535, 0, 2500, 17305, 47989, + 63369, 65535, 0, 1843, 10329, 32419, 55433, 64277, + 65535, 0, 1485, 7062, 21465, 43414, 59079, 64623, + 65535, 0, 0, 4841, 14797, 31799, 49667, 61309, + 65535, 65535, 0, 0, 0, 8032, 21695, 41078, + 56317, 65535, 65535, 65535 +}; + +const SKP_uint16 SKP_Silk_shell_code_table2[ 102 ] = { + 0, 32615, 65535, 0, 14447, 50912, 65535, 0, + 6301, 32587, 59361, 65535, 0, 3038, 18640, 46809, + 62852, 65535, 0, 1746, 10524, 32509, 55273, 64278, + 65535, 0, 1234, 6360, 21259, 43712, 59651, 64805, + 65535, 0, 1020, 4461, 14030, 32286, 51249, 61904, + 65100, 65535, 0, 851, 3435, 10006, 23241, 40797, + 55444, 63009, 65252, 65535, 0, 0, 2075, 7137, + 17119, 31499, 46982, 58723, 63976, 65535, 65535, 0, + 0, 0, 3820, 11572, 23038, 37789, 51969, 61243, + 65535, 65535, 65535, 0, 0, 0, 0, 6882, + 16828, 30444, 44844, 57365, 65535, 65535, 65535, 65535, + 0, 0, 0, 0, 0, 10093, 22963, 38779, + 54426, 65535, 65535, 65535, 65535, 65535 +}; + +const SKP_uint16 SKP_Silk_shell_code_table3[ 207 ] = { + 0, 32324, 65535, 0, 15328, 49505, 65535, 0, + 7474, 32344, 57955, 65535, 0, 3944, 19450, 45364, + 61873, 65535, 0, 2338, 11698, 32435, 53915, 63734, + 65535, 0, 1506, 7074, 21778, 42972, 58861, 64590, + 65535, 0, 1027, 4490, 14383, 32264, 50980, 61712, + 65043, 65535, 0, 760, 3022, 9696, 23264, 41465, + 56181, 63253, 65251, 65535, 0, 579, 2256, 6873, + 16661, 31951, 48250, 59403, 64198, 65360, 65535, 0, + 464, 1783, 5181, 12269, 24247, 39877, 53490, 61502, + 64591, 65410, 65535, 0, 366, 1332, 3880, 9273, + 18585, 32014, 45928, 56659, 62616, 64899, 65483, 65535, + 0, 286, 1065, 3089, 6969, 14148, 24859, 38274, + 50715, 59078, 63448, 65091, 65481, 65535, 0, 0, + 482, 2010, 5302, 10408, 18988, 30698, 43634, 54233, + 60828, 64119, 65288, 65535, 65535, 0, 0, 0, + 1006, 3531, 7857, 14832, 24543, 36272, 47547, 56883, + 62327, 64746, 65535, 65535, 65535, 0, 0, 0, + 0, 1863, 4950, 10730, 19284, 29397, 41382, 52335, + 59755, 63834, 65535, 65535, 65535, 65535, 0, 0, + 0, 0, 0, 2513, 7290, 14487, 24275, 35312, + 46240, 55841, 62007, 65535, 65535, 65535, 65535, 65535, + 0, 0, 0, 0, 0, 0, 3606, 9573, + 18764, 28667, 40220, 51290, 59924, 65535, 65535, 65535, + 65535, 65535, 65535, 0, 0, 0, 0, 0, + 0, 0, 4879, 13091, 23376, 36061, 49395, 59315, + 65535, 65535, 65535, 65535, 65535, 65535, 65535 +}; + +const SKP_uint16 SKP_Silk_shell_code_table_offsets[ 19 ] = { + 0, 0, 3, 7, 12, 18, 25, 33, + 42, 52, 63, 75, 88, 102, 117, 133, + 150, 168, 187 +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_sign.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_sign.c new file mode 100755 index 0000000..c44978b --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_sign.c @@ -0,0 +1,42 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_tables.h" + +const SKP_uint16 SKP_Silk_sign_CDF[ 36 ] = +{ + 37840, 36944, 36251, 35304, + 34715, 35503, 34529, 34296, + 34016, 47659, 44945, 42503, + 40235, 38569, 40254, 37851, + 37243, 36595, 43410, 44121, + 43127, 40978, 38845, 40433, + 38252, 37795, 36637, 59159, + 55630, 51806, 48073, 45036, + 48416, 43857, 42678, 41146, +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_type_offset.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_type_offset.c new file mode 100755 index 0000000..96d8926 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tables_type_offset.c @@ -0,0 +1,52 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_tables.h" + +const SKP_uint16 SKP_Silk_type_offset_CDF[ 5 ] = { + 0, 37522, 41030, 44212, 65535 +}; + +const SKP_int SKP_Silk_type_offset_CDF_offset = 2; + + +const SKP_uint16 SKP_Silk_type_offset_joint_CDF[ 4 ][ 5 ] = +{ +{ + 0, 57686, 61230, 62358, 65535 +}, +{ + 0, 18346, 40067, 43659, 65535 +}, +{ + 0, 22694, 24279, 35507, 65535 +}, +{ + 0, 6067, 7215, 13010, 65535 +} +}; + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tuning_parameters.h b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tuning_parameters.h new file mode 100755 index 0000000..3f8a696 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_tuning_parameters.h @@ -0,0 +1,183 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#ifndef SKP_SILK_TUNING_PARAMETERS_H +#define SKP_SILK_TUNING_PARAMETERS_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*******************/ +/* Pitch estimator */ +/*******************/ + +/* Level of noise floor for whitening filter LPC analysis in pitch analysis */ +#define FIND_PITCH_WHITE_NOISE_FRACTION 1e-3f + +/* Bandwidth expansion for whitening filter in pitch analysis */ +#define FIND_PITCH_BANDWITH_EXPANSION 0.99f + +/* Threshold used by pitch estimator for early escape */ +#define FIND_PITCH_CORRELATION_THRESHOLD_HC_MODE 0.7f +#define FIND_PITCH_CORRELATION_THRESHOLD_MC_MODE 0.75f +#define FIND_PITCH_CORRELATION_THRESHOLD_LC_MODE 0.8f + +/*********************/ +/* Linear prediction */ +/*********************/ + +/* LPC analysis defines: regularization and bandwidth expansion */ +#define FIND_LPC_COND_FAC 2.5e-5f +#define FIND_LPC_CHIRP 0.99995f + +/* LTP analysis defines */ +#define FIND_LTP_COND_FAC 1e-5f +#define LTP_DAMPING 0.01f +#define LTP_SMOOTHING 0.1f + +/* LTP quantization settings */ +#define MU_LTP_QUANT_NB 0.03f +#define MU_LTP_QUANT_MB 0.025f +#define MU_LTP_QUANT_WB 0.02f +#define MU_LTP_QUANT_SWB 0.016f + +/***********************/ +/* High pass filtering */ +/***********************/ + +/* Smoothing parameters for low end of pitch frequency range estimation */ +#define VARIABLE_HP_SMTH_COEF1 0.1f +#define VARIABLE_HP_SMTH_COEF2 0.015f + +/* Min and max values for low end of pitch frequency range estimation */ +#define VARIABLE_HP_MIN_FREQ 80.0f +#define VARIABLE_HP_MAX_FREQ 150.0f + +/* Max absolute difference between log2 of pitch frequency and smoother state, to enter the smoother */ +#define VARIABLE_HP_MAX_DELTA_FREQ 0.4f + +/***********/ +/* Various */ +/***********/ + +/* Required speech activity for counting frame as active */ +#define WB_DETECT_ACTIVE_SPEECH_LEVEL_THRES 0.7f + +#define SPEECH_ACTIVITY_DTX_THRES 0.1f + +/* Speech Activity LBRR enable threshold (needs tuning) */ +#define LBRR_SPEECH_ACTIVITY_THRES 0.5f + +/*************************/ +/* Perceptual parameters */ +/*************************/ + +/* reduction in coding SNR during low speech activity */ +#define BG_SNR_DECR_dB 4.0f + +/* factor for reducing quantization noise during voiced speech */ +#define HARM_SNR_INCR_dB 2.0f + +/* factor for reducing quantization noise for unvoiced sparse signals */ +#define SPARSE_SNR_INCR_dB 2.0f + +/* threshold for sparseness measure above which to use lower quantization offset during unvoiced */ +#define SPARSENESS_THRESHOLD_QNT_OFFSET 0.75f + +/* warping control */ +#define WARPING_MULTIPLIER 0.015f + +/* fraction added to first autocorrelation value */ +#define SHAPE_WHITE_NOISE_FRACTION 1e-5f + +/* noise shaping filter chirp factor */ +#define BANDWIDTH_EXPANSION 0.95f + +/* difference between chirp factors for analysis and synthesis noise shaping filters at low bitrates */ +#define LOW_RATE_BANDWIDTH_EXPANSION_DELTA 0.01f + +/* gain reduction for fricatives */ +#define DE_ESSER_COEF_SWB_dB 2.0f +#define DE_ESSER_COEF_WB_dB 1.0f + +/* extra harmonic boosting (signal shaping) at low bitrates */ +#define LOW_RATE_HARMONIC_BOOST 0.1f + +/* extra harmonic boosting (signal shaping) for noisy input signals */ +#define LOW_INPUT_QUALITY_HARMONIC_BOOST 0.1f + +/* harmonic noise shaping */ +#define HARMONIC_SHAPING 0.3f + +/* extra harmonic noise shaping for high bitrates or noisy input */ +#define HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING 0.2f + +/* parameter for shaping noise towards higher frequencies */ +#define HP_NOISE_COEF 0.3f + +/* parameter for shaping noise even more towards higher frequencies during voiced speech */ +#define HARM_HP_NOISE_COEF 0.35f + +/* parameter for applying a high-pass tilt to the input signal */ +#define INPUT_TILT 0.05f + +/* parameter for extra high-pass tilt to the input signal at high rates */ +#define HIGH_RATE_INPUT_TILT 0.1f + +/* parameter for reducing noise at the very low frequencies */ +#define LOW_FREQ_SHAPING 3.0f + +/* less reduction of noise at the very low frequencies for signals with low SNR at low frequencies */ +#define LOW_QUALITY_LOW_FREQ_SHAPING_DECR 0.5f + +/* noise floor to put a lower limit on the quantization step size */ +#define NOISE_FLOOR_dB 4.0f + +/* noise floor relative to active speech gain level */ +#define RELATIVE_MIN_GAIN_dB -50.0f + +/* subframe smoothing coefficient for determining active speech gain level (lower -> more smoothing) */ +#define GAIN_SMOOTHING_COEF 1e-3f + +/* subframe smoothing coefficient for HarmBoost, HarmShapeGain, Tilt (lower -> more smoothing) */ +#define SUBFR_SMTH_COEF 0.4f + +/* parameters defining the R/D tradeoff in the residual quantizer */ +#define LAMBDA_OFFSET 1.2f +#define LAMBDA_SPEECH_ACT -0.3f +#define LAMBDA_DELAYED_DECISIONS -0.05f +#define LAMBDA_INPUT_QUALITY -0.2f +#define LAMBDA_CODING_QUALITY -0.1f +#define LAMBDA_QUANT_OFFSET 1.5f + +#ifdef __cplusplus +} +#endif + +#endif // SKP_SILK_TUNING_PARAMETERS_H diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_warped_autocorrelation_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_warped_autocorrelation_FLP.c new file mode 100755 index 0000000..16956f4 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_warped_autocorrelation_FLP.c @@ -0,0 +1,69 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +/* Autocorrelations for a warped frequency axis */ +void SKP_Silk_warped_autocorrelation_FLP( + SKP_float *corr, /* O Result [order + 1] */ + const SKP_float *input, /* I Input data to correlate */ + const SKP_float warping, /* I Warping coefficient */ + const SKP_int length, /* I Length of input */ + const SKP_int order /* I Correlation order (even) */ +) +{ + SKP_int n, i; + double tmp1, tmp2; + double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; + double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; + + /* Order must be even */ + SKP_assert( ( order & 1 ) == 0 ); + + /* Loop over samples */ + for( n = 0; n < length; n++ ) { + tmp1 = input[ n ]; + /* Loop over allpass sections */ + for( i = 0; i < order; i += 2 ) { + /* Output of allpass section */ + tmp2 = state[ i ] + warping * ( state[ i + 1 ] - tmp1 ); + state[ i ] = tmp1; + C[ i ] += state[ 0 ] * tmp1; + /* Output of allpass section */ + tmp1 = state[ i + 1 ] + warping * ( state[ i + 2 ] - tmp2 ); + state[ i + 1 ] = tmp2; + C[ i + 1 ] += state[ 0 ] * tmp2; + } + state[ order ] = tmp1; + C[ order ] += state[ 0 ] * tmp1; + } + + /* Copy correlations in SKP_float output format */ + for( i = 0; i < order + 1; i++ ) { + corr[ i ] = ( SKP_float )C[ i ]; + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_wrappers_FLP.c b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_wrappers_FLP.c new file mode 100755 index 0000000..a7f1efa --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/SKP_Silk_wrappers_FLP.c @@ -0,0 +1,256 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +#include "SKP_Silk_main_FLP.h" + +/* Wrappers. Calls flp / fix code */ + +/* Convert AR filter coefficients to NLSF parameters */ +void SKP_Silk_A2NLSF_FLP( + SKP_float *pNLSF, /* O NLSF vector [ LPC_order ] */ + const SKP_float *pAR, /* I LPC coefficients [ LPC_order ] */ + const SKP_int LPC_order /* I LPC order */ +) +{ + SKP_int i; + SKP_int NLSF_fix[ MAX_LPC_ORDER ]; + SKP_int32 a_fix_Q16[ MAX_LPC_ORDER ]; + + for( i = 0; i < LPC_order; i++ ) { + a_fix_Q16[ i ] = SKP_float2int( pAR[ i ] * 65536.0f ); + } + SKP_Silk_A2NLSF( NLSF_fix, a_fix_Q16, LPC_order ); + + for( i = 0; i < LPC_order; i++ ) { + pNLSF[ i ] = ( SKP_float )NLSF_fix[ i ] * ( 1.0f / 32768.0f ); + } +} + +/* Convert LSF parameters to AR prediction filter coefficients */ +void SKP_Silk_NLSF2A_stable_FLP( + SKP_float *pAR, /* O LPC coefficients [ LPC_order ] */ + const SKP_float *pNLSF, /* I NLSF vector [ LPC_order ] */ + const SKP_int LPC_order /* I LPC order */ +) +{ + SKP_int i; + SKP_int NLSF_fix[ MAX_LPC_ORDER ]; + SKP_int16 a_fix_Q12[ MAX_LPC_ORDER ]; + + for( i = 0; i < LPC_order; i++ ) { + NLSF_fix[ i ] = ( SKP_int )SKP_CHECK_FIT16( SKP_float2int( pNLSF[ i ] * 32768.0f ) ); + } + + SKP_Silk_NLSF2A_stable( a_fix_Q12, NLSF_fix, LPC_order ); + + for( i = 0; i < LPC_order; i++ ) { + pAR[ i ] = ( SKP_float )a_fix_Q12[ i ] / 4096.0f; + } +} + + +/* LSF stabilizer, for a single input data vector */ +void SKP_Silk_NLSF_stabilize_FLP( + SKP_float *pNLSF, /* I/O (Un)stable NLSF vector [ LPC_order ] */ + const SKP_float *pNDelta_min, /* I Normalized delta min vector[LPC_order+1]*/ + const SKP_int LPC_order /* I LPC order */ +) +{ + SKP_int i; + SKP_int NLSF_Q15[ MAX_LPC_ORDER ], ndelta_min_Q15[ MAX_LPC_ORDER + 1 ]; + + for( i = 0; i < LPC_order; i++ ) { + NLSF_Q15[ i ] = ( SKP_int )SKP_float2int( pNLSF[ i ] * 32768.0f ); + ndelta_min_Q15[ i ] = ( SKP_int )SKP_float2int( pNDelta_min[ i ] * 32768.0f ); + } + ndelta_min_Q15[ LPC_order ] = ( SKP_int )SKP_float2int( pNDelta_min[ LPC_order ] * 32768.0f ); + + /* NLSF stabilizer, for a single input data vector */ + SKP_Silk_NLSF_stabilize( NLSF_Q15, ndelta_min_Q15, LPC_order ); + + for( i = 0; i < LPC_order; i++ ) { + pNLSF[ i ] = ( SKP_float )NLSF_Q15[ i ] * ( 1.0f / 32768.0f ); + } +} + +/* Interpolation function with fixed point rounding */ +void SKP_Silk_interpolate_wrapper_FLP( + SKP_float xi[], /* O Interpolated vector */ + const SKP_float x0[], /* I First vector */ + const SKP_float x1[], /* I Second vector */ + const SKP_float ifact, /* I Interp. factor, weight on second vector */ + const SKP_int d /* I Number of parameters */ +) +{ + SKP_int x0_int[ MAX_LPC_ORDER ], x1_int[ MAX_LPC_ORDER ], xi_int[ MAX_LPC_ORDER ]; + SKP_int ifact_Q2 = ( SKP_int )( ifact * 4.0f ); + SKP_int i; + + /* Convert input from flp to fix */ + for( i = 0; i < d; i++ ) { + x0_int[ i ] = SKP_float2int( x0[ i ] * 32768.0f ); + x1_int[ i ] = SKP_float2int( x1[ i ] * 32768.0f ); + } + + /* Interpolate two vectors */ + SKP_Silk_interpolate( xi_int, x0_int, x1_int, ifact_Q2, d ); + + /* Convert output from fix to flp */ + for( i = 0; i < d; i++ ) { + xi[ i ] = ( SKP_float )xi_int[ i ] * ( 1.0f / 32768.0f ); + } +} + +/****************************************/ +/* Floating-point Silk VAD wrapper */ +/****************************************/ +SKP_int SKP_Silk_VAD_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const SKP_int16 *pIn /* I Input signal */ +) +{ + SKP_int i, ret, SA_Q8, SNR_dB_Q7, Tilt_Q15; + SKP_int Quality_Bands_Q15[ VAD_N_BANDS ]; + + ret = SKP_Silk_VAD_GetSA_Q8( &psEnc->sCmn.sVAD, &SA_Q8, &SNR_dB_Q7, Quality_Bands_Q15, &Tilt_Q15, + pIn, psEnc->sCmn.frame_length ); + + psEnc->speech_activity = ( SKP_float )SA_Q8 / 256.0f; + for( i = 0; i < VAD_N_BANDS; i++ ) { + psEncCtrl->input_quality_bands[ i ] = ( SKP_float )Quality_Bands_Q15[ i ] / 32768.0f; + } + psEncCtrl->input_tilt = ( SKP_float )Tilt_Q15 / 32768.0f; + + return ret; +} + +/****************************************/ +/* Floating-point Silk NSQ wrapper */ +/****************************************/ +void SKP_Silk_NSQ_wrapper_FLP( + SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const SKP_float x[], /* I Prefiltered input signal */ + SKP_int8 q[], /* O Quantized pulse signal */ + const SKP_int useLBRR /* I LBRR flag */ +) +{ + SKP_int i, j; + SKP_float tmp_float; + SKP_int16 x_16[ MAX_FRAME_LENGTH ]; + /* Prediction and coding parameters */ + SKP_int32 Gains_Q16[ NB_SUBFR ]; + SKP_DWORD_ALIGN SKP_int16 PredCoef_Q12[ 2 ][ MAX_LPC_ORDER ]; + SKP_int16 LTPCoef_Q14[ LTP_ORDER * NB_SUBFR ]; + SKP_int LTP_scale_Q14; + + /* Noise shaping parameters */ + /* Testing */ + SKP_int16 AR2_Q13[ NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; + SKP_int32 LF_shp_Q14[ NB_SUBFR ]; /* Packs two int16 coefficients per int32 value */ + SKP_int Lambda_Q10; + SKP_int Tilt_Q14[ NB_SUBFR ]; + SKP_int HarmShapeGain_Q14[ NB_SUBFR ]; + + /* Convert control struct to fix control struct */ + /* Noise shape parameters */ + for( i = 0; i < NB_SUBFR; i++ ) { + /* Convert only the data in use */ + for( j = 0; j < psEnc->sCmn.shapingLPCOrder; j++ ) { + AR2_Q13[ i * MAX_SHAPE_LPC_ORDER + j ] = SKP_float2int( psEncCtrl->AR2[ i * MAX_SHAPE_LPC_ORDER + j ] * 8192.0f ); + } + /* Clear the rest only to get rid of analysis tool warnings */ + for( ; j < MAX_SHAPE_LPC_ORDER; j++ ) { + AR2_Q13[ i * MAX_SHAPE_LPC_ORDER + j ] = 0; + } + } + + for( i = 0; i < NB_SUBFR; i++ ) { + LF_shp_Q14[ i ] = SKP_LSHIFT32( SKP_float2int( psEncCtrl->LF_AR_shp[ i ] * 16384.0f ), 16 ) | + (SKP_uint16)SKP_float2int( psEncCtrl->LF_MA_shp[ i ] * 16384.0f ); + Tilt_Q14[ i ] = (SKP_int)SKP_float2int( psEncCtrl->Tilt[ i ] * 16384.0f ); + HarmShapeGain_Q14[ i ] = (SKP_int)SKP_float2int( psEncCtrl->HarmShapeGain[ i ] * 16384.0f ); + } + Lambda_Q10 = ( SKP_int )SKP_float2int( psEncCtrl->Lambda * 1024.0f ); + + /* prediction and coding parameters */ + for( i = 0; i < NB_SUBFR * LTP_ORDER; i++ ) { + LTPCoef_Q14[ i ] = ( SKP_int16 )SKP_float2int( psEncCtrl->LTPCoef[ i ] * 16384.0f ); + } + + for( j = 0; j < NB_SUBFR >> 1; j++ ) { + for( i = 0; i < psEnc->sCmn.predictLPCOrder; i++ ) { + PredCoef_Q12[ j ][ i ] = ( SKP_int16 )SKP_float2int( psEncCtrl->PredCoef[ j ][ i ] * 4096.0f ); + } + /* Clear the rest only to get rid of analysis tool warnings */ + for( ; i < MAX_LPC_ORDER; i++ ) { + PredCoef_Q12[ j ][ i ] = 0; + } + } + + for( i = 0; i < NB_SUBFR; i++ ) { + tmp_float = SKP_LIMIT( ( psEncCtrl->Gains[ i ] * 65536.0f ), 2147483000.0f, -2147483000.0f ); + Gains_Q16[ i ] = SKP_float2int( tmp_float ); + if( psEncCtrl->Gains[ i ] > 0.0f ) { + SKP_assert( tmp_float >= 0.0f ); + SKP_assert( Gains_Q16[ i ] >= 0 ); + } + } + + if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) { + LTP_scale_Q14 = SKP_Silk_LTPScales_table_Q14[ psEncCtrl->sCmn.LTP_scaleIndex ]; + } else { + LTP_scale_Q14 = 0; + } + + /* Convert input to fix */ + SKP_float2short_array( x_16, x, psEnc->sCmn.frame_length ); + + /* Call NSQ */ + if( useLBRR ) { + if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) { + SKP_Silk_NSQ_del_dec( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sCmn.sNSQ_LBRR, + x_16, q, psEncCtrl->sCmn.NLSFInterpCoef_Q2, PredCoef_Q12[ 0 ], LTPCoef_Q14, AR2_Q13, + HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, Lambda_Q10, LTP_scale_Q14 ); + } else { + SKP_Silk_NSQ( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sCmn.sNSQ_LBRR, + x_16, q, psEncCtrl->sCmn.NLSFInterpCoef_Q2, PredCoef_Q12[ 0 ], LTPCoef_Q14, AR2_Q13, + HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, Lambda_Q10, LTP_scale_Q14 ); + } + } else { + if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) { + SKP_Silk_NSQ_del_dec( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sCmn.sNSQ, + x_16, q, psEncCtrl->sCmn.NLSFInterpCoef_Q2, PredCoef_Q12[ 0 ], LTPCoef_Q14, AR2_Q13, + HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, Lambda_Q10, LTP_scale_Q14 ); + } else { + SKP_Silk_NSQ( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sCmn.sNSQ, + x_16, q, psEncCtrl->sCmn.NLSFInterpCoef_Q2, PredCoef_Q12[ 0 ], LTPCoef_Q14, AR2_Q13, + HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, Lambda_Q10, LTP_scale_Q14 ); + } + } +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/Silk_FLP.vcproj b/external/SILK_SDK_SRC_FLP_v1.0.9/src/Silk_FLP.vcproj new file mode 100755 index 0000000..645fb5a --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/Silk_FLP.vcproj @@ -0,0 +1,744 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/src/Silk_FLP.vcxproj b/external/SILK_SDK_SRC_FLP_v1.0.9/src/Silk_FLP.vcxproj new file mode 100755 index 0000000..a4a933e --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/src/Silk_FLP.vcxproj @@ -0,0 +1,331 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {56B91D01-9150-4BBF-AFA1-5B68AB991B76} + Silk + Win32Proj + + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)\src\ + $(SolutionDir)\src\ + $(Configuration)\ + $(Configuration)\ + $(SolutionDir)\src\ + $(SolutionDir)\src\ + $(Configuration)\ + $(Configuration)\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + SKP_$(ProjectName)_$(Platform)_debug + SKP_$(ProjectName)_$(Platform)_debug + SKP_$(ProjectName)_$(Platform)_mt + SKP_$(ProjectName)_$(Platform)_mt + + + + Disabled + Neither + ../interface;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Fast + + + Level3 + EditAndContinue + + + SKP_Silk_FLP_Win32_debug.lib + + + + + + + + + Disabled + Neither + ../interface;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Fast + + + Level3 + ProgramDatabase + + + SKP_Silk_FLP_x64_debug.lib + + + + + + + + + MaxSpeed + Default + Neither + ../interface;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + false + false + MultiThreaded + Fast + + + Level3 + ProgramDatabase + + + SKP_Silk_FLP_Win32_mt.lib + + + + + + + + + MaxSpeed + Default + Neither + ../interface;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + false + false + MultiThreaded + Fast + + + Level3 + ProgramDatabase + + + SKP_Silk_FLP_x64_mt.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/Dec_SDK.vcproj b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Dec_SDK.vcproj new file mode 100755 index 0000000..131586b --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Dec_SDK.vcproj @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/Dec_SDK.vcxproj b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Dec_SDK.vcxproj new file mode 100755 index 0000000..ed959bc --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Dec_SDK.vcxproj @@ -0,0 +1,201 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {82685D7F-0589-42BD-877C-31A952D53A8E} + Test + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir) + $(SolutionDir) + $(Configuration)_Dec\ + $(Configuration)_Dec\ + true + true + $(SolutionDir) + $(SolutionDir) + $(Configuration)_Dec\ + $(Configuration)_Dec\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + Decoder_debug + Decoder_debug + Decoder + Decoder + + + + Disabled + ../interface;../src;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;COMPILE_SDK;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + $(OutDir)Decoder_debug.exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + true + $(TargetDir)$(TargetName).pdb + Console + MachineX86 + + + + + Disabled + ../interface;../src;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;COMPILE_SDK;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir)Decoder_debug.exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + true + $(TargetDir)$(TargetName).pdb + Console + + + + + ../interface;../src;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;COMPILE_SDK;%(PreprocessorDefinitions) + MultiThreaded + Fast + + + Level3 + ProgramDatabase + + + /fixed:no %(AdditionalOptions) + $(OutDir)Decoder.exe + %(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + false + Console + true + true + MachineX86 + + + + + ../interface;../src;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;COMPILE_SDK;%(PreprocessorDefinitions) + MultiThreaded + Fast + + + Level3 + ProgramDatabase + + + /fixed:no %(AdditionalOptions) + $(OutDir)Decoder.exe + %(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + false + Console + true + true + + + + + + + + + + + + + + {56b91d01-9150-4bbf-afa1-5b68ab991b76} + false + + + + + + \ No newline at end of file diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/Decoder.c b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Decoder.c new file mode 100755 index 0000000..d1f298f --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Decoder.c @@ -0,0 +1,472 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + + +/*****************************/ +/* Silk decoder test program */ +/*****************************/ + +#ifdef _WIN32 +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include +#include +#include +#include "SKP_Silk_SDK_API.h" +#include "SKP_Silk_SigProc_FIX.h" + +/* Define codec specific settings should be moved to h file */ +#define MAX_BYTES_PER_FRAME 1024 +#define MAX_INPUT_FRAMES 5 +#define MAX_FRAME_LENGTH 480 +#define FRAME_LENGTH_MS 20 +#define MAX_API_FS_KHZ 48 +#define MAX_LBRR_DELAY 2 + +#ifdef _SYSTEM_IS_BIG_ENDIAN +/* Function to convert a little endian int16 to a */ +/* big endian int16 or vica verca */ +void swap_endian( + SKP_int16 vec[], + SKP_int len +) +{ + SKP_int i; + SKP_int16 tmp; + SKP_uint8 *p1, *p2; + + for( i = 0; i < len; i++ ){ + tmp = vec[ i ]; + p1 = (SKP_uint8 *)&vec[ i ]; p2 = (SKP_uint8 *)&tmp; + p1[ 0 ] = p2[ 1 ]; p1[ 1 ] = p2[ 0 ]; + } +} +#endif + +#if (defined(_WIN32) || defined(_WINCE)) +#include /* timer */ +#else // Linux or Mac +#include +#endif + +#ifdef _WIN32 + +unsigned long GetHighResolutionTime() /* O: time in usec*/ +{ + /* Returns a time counter in microsec */ + /* the resolution is platform dependent */ + /* but is typically 1.62 us resolution */ + LARGE_INTEGER lpPerformanceCount; + LARGE_INTEGER lpFrequency; + QueryPerformanceCounter(&lpPerformanceCount); + QueryPerformanceFrequency(&lpFrequency); + return (unsigned long)((1000000*(lpPerformanceCount.QuadPart)) / lpFrequency.QuadPart); +} +#else // Linux or Mac +unsigned long GetHighResolutionTime() /* O: time in usec*/ +{ + struct timeval tv; + gettimeofday(&tv, 0); + return((tv.tv_sec*1000000)+(tv.tv_usec)); +} +#endif // _WIN32 + +/* Seed for the random number generator, which is used for simulating packet loss */ +static SKP_int32 rand_seed = 1; + +static void print_usage(char* argv[]) { + printf( "\nusage: %s in.bit out.pcm [settings]\n", argv[ 0 ] ); + printf( "\nin.bit : Bitstream input to decoder" ); + printf( "\nout.pcm : Speech output from decoder" ); + printf( "\n settings:" ); + printf( "\n-Fs_API : Sampling rate of output signal in Hz; default: 24000" ); + printf( "\n-loss : Simulated packet loss percentage (0-100); default: 0" ); + printf( "\n-quiet : Print out just some basic values" ); + printf( "\n" ); +} + +int main( int argc, char* argv[] ) +{ + unsigned long tottime, starttime; + double filetime; + size_t counter; + SKP_int32 args, totPackets, i, k; + SKP_int16 ret, len, tot_len; + SKP_int16 nBytes; + SKP_uint8 payload[ MAX_BYTES_PER_FRAME * MAX_INPUT_FRAMES * ( MAX_LBRR_DELAY + 1 ) ]; + SKP_uint8 *payloadEnd = NULL, *payloadToDec = NULL; + SKP_uint8 FECpayload[ MAX_BYTES_PER_FRAME * MAX_INPUT_FRAMES ], *payloadPtr; + SKP_int16 nBytesFEC; + SKP_int16 nBytesPerPacket[ MAX_LBRR_DELAY + 1 ], totBytes; + SKP_int16 out[ ( ( FRAME_LENGTH_MS * MAX_API_FS_KHZ ) << 1 ) * MAX_INPUT_FRAMES ], *outPtr; + char speechOutFileName[ 150 ], bitInFileName[ 150 ]; + FILE *bitInFile, *speechOutFile; + SKP_int32 packetSize_ms=0, API_Fs_Hz = 0; + SKP_int32 decSizeBytes; + void *psDec; + SKP_float loss_prob; + SKP_int32 frames, lost, quiet; + SKP_SILK_SDK_DecControlStruct DecControl; + + if( argc < 3 ) { + print_usage( argv ); + exit( 0 ); + } + + /* default settings */ + quiet = 0; + loss_prob = 0.0f; + + /* get arguments */ + args = 1; + strcpy( bitInFileName, argv[ args ] ); + args++; + strcpy( speechOutFileName, argv[ args ] ); + args++; + while( args < argc ) { + if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-loss" ) == 0 ) { + sscanf( argv[ args + 1 ], "%f", &loss_prob ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-Fs_API" ) == 0 ) { + sscanf( argv[ args + 1 ], "%d", &API_Fs_Hz ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-quiet" ) == 0 ) { + quiet = 1; + args++; + } else { + printf( "Error: unrecognized setting: %s\n\n", argv[ args ] ); + print_usage( argv ); + exit( 0 ); + } + } + + if( !quiet ) { + printf("********** Silk Decoder (Fixed Point) v %s ********************\n", SKP_Silk_SDK_get_version()); + printf("********** Compiled for %d bit cpu *******************************\n", (int)sizeof(void*) * 8 ); + printf( "Input: %s\n", bitInFileName ); + printf( "Output: %s\n", speechOutFileName ); + } + + /* Open files */ + bitInFile = fopen( bitInFileName, "rb" ); + if( bitInFile == NULL ) { + printf( "Error: could not open input file %s\n", bitInFileName ); + exit( 0 ); + } + + /* Check Silk header */ + { + char header_buf[ 50 ]; + counter = fread( header_buf, sizeof( char ), strlen( "#!SILK_V3" ), bitInFile ); + header_buf[ strlen( "#!SILK_V3" ) ] = '\0'; /* Terminate with a null character */ + if( strcmp( header_buf, "#!SILK_V3" ) != 0 ) { + /* Non-equal strings */ + printf( "Error: Wrong Header %s\n", header_buf ); + exit( 0 ); + } + } + + speechOutFile = fopen( speechOutFileName, "wb" ); + if( speechOutFile == NULL ) { + printf( "Error: could not open output file %s\n", speechOutFileName ); + exit( 0 ); + } + + /* Set the samplingrate that is requested for the output */ + if( API_Fs_Hz == 0 ) { + DecControl.API_sampleRate = 24000; + } else { + DecControl.API_sampleRate = API_Fs_Hz; + } + + /* Initialize to one frame per packet, for proper concealment before first packet arrives */ + DecControl.framesPerPacket = 1; + + /* Create decoder */ + ret = SKP_Silk_SDK_Get_Decoder_Size( &decSizeBytes ); + if( ret ) { + printf( "\nSKP_Silk_SDK_Get_Decoder_Size returned %d", ret ); + } + psDec = malloc( decSizeBytes ); + + /* Reset decoder */ + ret = SKP_Silk_SDK_InitDecoder( psDec ); + if( ret ) { + printf( "\nSKP_Silk_InitDecoder returned %d", ret ); + } + + totPackets = 0; + tottime = 0; + payloadEnd = payload; + + /* Simulate the jitter buffer holding MAX_FEC_DELAY packets */ + for( i = 0; i < MAX_LBRR_DELAY; i++ ) { + /* Read payload size */ + counter = fread( &nBytes, sizeof( SKP_int16 ), 1, bitInFile ); +#ifdef _SYSTEM_IS_BIG_ENDIAN + swap_endian( &nBytes, 1 ); +#endif + /* Read payload */ + counter = fread( payloadEnd, sizeof( SKP_uint8 ), nBytes, bitInFile ); + + if( ( SKP_int16 )counter < nBytes ) { + break; + } + nBytesPerPacket[ i ] = nBytes; + payloadEnd += nBytes; + totPackets++; + } + + while( 1 ) { + /* Read payload size */ + counter = fread( &nBytes, sizeof( SKP_int16 ), 1, bitInFile ); +#ifdef _SYSTEM_IS_BIG_ENDIAN + swap_endian( &nBytes, 1 ); +#endif + if( nBytes < 0 || counter < 1 ) { + break; + } + + /* Read payload */ + counter = fread( payloadEnd, sizeof( SKP_uint8 ), nBytes, bitInFile ); + if( ( SKP_int16 )counter < nBytes ) { + break; + } + + /* Simulate losses */ + rand_seed = SKP_RAND( rand_seed ); + if( ( ( ( float )( ( rand_seed >> 16 ) + ( 1 << 15 ) ) ) / 65535.0f >= ( loss_prob / 100.0f ) ) && ( counter > 0 ) ) { + nBytesPerPacket[ MAX_LBRR_DELAY ] = nBytes; + payloadEnd += nBytes; + } else { + nBytesPerPacket[ MAX_LBRR_DELAY ] = 0; + } + + if( nBytesPerPacket[ 0 ] == 0 ) { + /* Indicate lost packet */ + lost = 1; + + /* Packet loss. Search after FEC in next packets. Should be done in the jitter buffer */ + payloadPtr = payload; + for( i = 0; i < MAX_LBRR_DELAY; i++ ) { + if( nBytesPerPacket[ i + 1 ] > 0 ) { + starttime = GetHighResolutionTime(); + SKP_Silk_SDK_search_for_LBRR( payloadPtr, nBytesPerPacket[ i + 1 ], ( i + 1 ), FECpayload, &nBytesFEC ); + tottime += GetHighResolutionTime() - starttime; + if( nBytesFEC > 0 ) { + payloadToDec = FECpayload; + nBytes = nBytesFEC; + lost = 0; + break; + } + } + payloadPtr += nBytesPerPacket[ i + 1 ]; + } + } else { + lost = 0; + nBytes = nBytesPerPacket[ 0 ]; + payloadToDec = payload; + } + + /* Silk decoder */ + outPtr = out; + tot_len = 0; + starttime = GetHighResolutionTime(); + + if( lost == 0 ) { + /* No Loss: Decode all frames in the packet */ + frames = 0; + do { + /* Decode 20 ms */ + ret = SKP_Silk_SDK_Decode( psDec, &DecControl, 0, payloadToDec, nBytes, outPtr, &len ); + if( ret ) { + printf( "\nSKP_Silk_SDK_Decode returned %d", ret ); + } + + frames++; + outPtr += len; + tot_len += len; + if( frames > MAX_INPUT_FRAMES ) { + /* Hack for corrupt stream that could generate too many frames */ + outPtr = out; + tot_len = 0; + frames = 0; + } + /* Until last 20 ms frame of packet has been decoded */ + } while( DecControl.moreInternalDecoderFrames ); + } else { + /* Loss: Decode enough frames to cover one packet duration */ + for( i = 0; i < DecControl.framesPerPacket; i++ ) { + /* Generate 20 ms */ + ret = SKP_Silk_SDK_Decode( psDec, &DecControl, 1, payloadToDec, nBytes, outPtr, &len ); + if( ret ) { + printf( "\nSKP_Silk_Decode returned %d", ret ); + } + outPtr += len; + tot_len += len; + } + } + + packetSize_ms = tot_len / ( DecControl.API_sampleRate / 1000 ); + tottime += GetHighResolutionTime() - starttime; + totPackets++; + + /* Write output to file */ +#ifdef _SYSTEM_IS_BIG_ENDIAN + swap_endian( out, tot_len ); +#endif + fwrite( out, sizeof( SKP_int16 ), tot_len, speechOutFile ); + + /* Update buffer */ + totBytes = 0; + for( i = 0; i < MAX_LBRR_DELAY; i++ ) { + totBytes += nBytesPerPacket[ i + 1 ]; + } + SKP_memmove( payload, &payload[ nBytesPerPacket[ 0 ] ], totBytes * sizeof( SKP_uint8 ) ); + payloadEnd -= nBytesPerPacket[ 0 ]; + SKP_memmove( nBytesPerPacket, &nBytesPerPacket[ 1 ], MAX_LBRR_DELAY * sizeof( SKP_int16 ) ); + + if( !quiet ) { + fprintf( stderr, "\rPackets decoded: %d", totPackets ); + } + } + + /* Empty the recieve buffer */ + for( k = 0; k < MAX_LBRR_DELAY; k++ ) { + if( nBytesPerPacket[ 0 ] == 0 ) { + /* Indicate lost packet */ + lost = 1; + + /* Packet loss. Search after FEC in next packets. Should be done in the jitter buffer */ + payloadPtr = payload; + for( i = 0; i < MAX_LBRR_DELAY; i++ ) { + if( nBytesPerPacket[ i + 1 ] > 0 ) { + starttime = GetHighResolutionTime(); + SKP_Silk_SDK_search_for_LBRR( payloadPtr, nBytesPerPacket[ i + 1 ], ( i + 1 ), FECpayload, &nBytesFEC ); + tottime += GetHighResolutionTime() - starttime; + if( nBytesFEC > 0 ) { + payloadToDec = FECpayload; + nBytes = nBytesFEC; + lost = 0; + break; + } + } + payloadPtr += nBytesPerPacket[ i + 1 ]; + } + } else { + lost = 0; + nBytes = nBytesPerPacket[ 0 ]; + payloadToDec = payload; + } + + /* Silk decoder */ + outPtr = out; + tot_len = 0; + starttime = GetHighResolutionTime(); + + if( lost == 0 ) { + /* No loss: Decode all frames in the packet */ + frames = 0; + do { + /* Decode 20 ms */ + ret = SKP_Silk_SDK_Decode( psDec, &DecControl, 0, payloadToDec, nBytes, outPtr, &len ); + if( ret ) { + printf( "\nSKP_Silk_SDK_Decode returned %d", ret ); + } + + frames++; + outPtr += len; + tot_len += len; + if( frames > MAX_INPUT_FRAMES ) { + /* Hack for corrupt stream that could generate too many frames */ + outPtr = out; + tot_len = 0; + frames = 0; + } + /* Until last 20 ms frame of packet has been decoded */ + } while( DecControl.moreInternalDecoderFrames ); + } else { + /* Loss: Decode enough frames to cover one packet duration */ + + /* Generate 20 ms */ + for( i = 0; i < DecControl.framesPerPacket; i++ ) { + ret = SKP_Silk_SDK_Decode( psDec, &DecControl, 1, payloadToDec, nBytes, outPtr, &len ); + if( ret ) { + printf( "\nSKP_Silk_Decode returned %d", ret ); + } + outPtr += len; + tot_len += len; + } + } + + packetSize_ms = tot_len / ( DecControl.API_sampleRate / 1000 ); + tottime += GetHighResolutionTime() - starttime; + totPackets++; + + /* Write output to file */ +#ifdef _SYSTEM_IS_BIG_ENDIAN + swap_endian( out, tot_len ); +#endif + fwrite( out, sizeof( SKP_int16 ), tot_len, speechOutFile ); + + /* Update Buffer */ + totBytes = 0; + for( i = 0; i < MAX_LBRR_DELAY; i++ ) { + totBytes += nBytesPerPacket[ i + 1 ]; + } + SKP_memmove( payload, &payload[ nBytesPerPacket[ 0 ] ], totBytes * sizeof( SKP_uint8 ) ); + payloadEnd -= nBytesPerPacket[ 0 ]; + SKP_memmove( nBytesPerPacket, &nBytesPerPacket[ 1 ], MAX_LBRR_DELAY * sizeof( SKP_int16 ) ); + + if( !quiet ) { + fprintf( stderr, "\rPackets decoded: %d", totPackets ); + } + } + + if( !quiet ) { + printf( "\nDecoding Finished \n" ); + } + + /* Free decoder */ + free( psDec ); + + /* Close files */ + fclose( speechOutFile ); + fclose( bitInFile ); + + filetime = totPackets * 1e-3 * packetSize_ms; + if( !quiet ) { + printf("\nFile length: %.3f s", filetime); + printf("\nTime for decoding: %.3f s (%.3f%% of realtime)", 1e-6 * tottime, 1e-4 * tottime / filetime); + printf("\n\n"); + } else { + /* print time and % of realtime */ + printf( "%.3f %.3f %d\n", 1e-6 * tottime, 1e-4 * tottime / filetime, totPackets ); + } + return 0; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/Enc_SDK.vcproj b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Enc_SDK.vcproj new file mode 100755 index 0000000..4415931 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Enc_SDK.vcproj @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/Enc_SDK.vcxproj b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Enc_SDK.vcxproj new file mode 100755 index 0000000..038b559 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Enc_SDK.vcxproj @@ -0,0 +1,201 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {6D97A8EF-5724-4D85-8BF4-C583714BBA78} + Enc + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir) + $(SolutionDir) + $(Configuration)\Enc\ + $(Configuration)\Enc\ + true + true + $(SolutionDir) + $(SolutionDir) + $(Configuration)_Enc\ + $(Configuration)_Enc\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + Encoder_debug + Encoder_debug + Encoder + Encoder + + + + Disabled + ../interface;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + $(OutDir)Encoder_debug.exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + true + $(TargetDir)$(TargetName).pdb + Console + MachineX86 + + + + + Disabled + ../interface;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir)Encoder_debug.exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + true + $(TargetDir)$(TargetName).pdb + Console + + + + + ../interface;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Fast + + + Level3 + ProgramDatabase + + + /fixed:no %(AdditionalOptions) + $(OutDir)Encoder.exe + %(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + false + Console + true + true + MachineX86 + + + + + ../interface;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Fast + + + Level3 + ProgramDatabase + + + /fixed:no %(AdditionalOptions) + $(OutDir)Encoder.exe + %(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + false + Console + true + true + + + + + + + + + + + + + + {56b91d01-9150-4bbf-afa1-5b68ab991b76} + false + + + + + + \ No newline at end of file diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/Encoder.c b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Encoder.c new file mode 100755 index 0000000..e03cbf8 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/Encoder.c @@ -0,0 +1,369 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + + +/*****************************/ +/* Silk encoder test program */ +/*****************************/ + +#ifdef _WIN32 +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include +#include +#include +#include "SKP_Silk_SDK_API.h" + +/* Define codec specific settings */ +#define MAX_BYTES_PER_FRAME 250 // Equals peak bitrate of 100 kbps +#define MAX_INPUT_FRAMES 5 +#define FRAME_LENGTH_MS 20 +#define MAX_API_FS_KHZ 48 + +#ifdef _SYSTEM_IS_BIG_ENDIAN +/* Function to convert a little endian int16 to a */ +/* big endian int16 or vica verca */ +void swap_endian( + SKP_int16 vec[], /* I/O array of */ + SKP_int len /* I length */ +) +{ + SKP_int i; + SKP_int16 tmp; + SKP_uint8 *p1, *p2; + + for( i = 0; i < len; i++ ){ + tmp = vec[ i ]; + p1 = (SKP_uint8 *)&vec[ i ]; p2 = (SKP_uint8 *)&tmp; + p1[ 0 ] = p2[ 1 ]; p1[ 1 ] = p2[ 0 ]; + } +} +#endif + +#if (defined(_WIN32) || defined(_WINCE)) +#include /* timer */ +#else // Linux or Mac +#include +#endif + +#ifdef _WIN32 + +unsigned long GetHighResolutionTime() /* O: time in usec*/ +{ + /* Returns a time counter in microsec */ + /* the resolution is platform dependent */ + /* but is typically 1.62 us resolution */ + LARGE_INTEGER lpPerformanceCount; + LARGE_INTEGER lpFrequency; + QueryPerformanceCounter(&lpPerformanceCount); + QueryPerformanceFrequency(&lpFrequency); + return (unsigned long)((1000000*(lpPerformanceCount.QuadPart)) / lpFrequency.QuadPart); +} +#else // Linux or Mac +unsigned long GetHighResolutionTime() /* O: time in usec*/ +{ + struct timeval tv; + gettimeofday(&tv, 0); + return((tv.tv_sec*1000000)+(tv.tv_usec)); +} +#endif // _WIN32 + +static void print_usage( char* argv[] ) { + printf( "\nusage: %s in.pcm out.bit [settings]\n", argv[ 0 ] ); + printf( "\nin.pcm : Speech input to encoder" ); + printf( "\nout.bit : Bitstream output from encoder" ); + printf( "\n settings:" ); + printf( "\n-Fs_API : API sampling rate in Hz, default: 24000" ); + printf( "\n-Fs_maxInternal : Maximum internal sampling rate in Hz, default: 24000" ); + printf( "\n-packetlength : Packet interval in ms, default: 20" ); + printf( "\n-rate : Target bitrate; default: 25000" ); + printf( "\n-loss : Uplink loss estimate, in percent (0-100); default: 0" ); + printf( "\n-inbandFEC : Enable inband FEC usage (0/1); default: 0" ); + printf( "\n-complexity : Set complexity, 0: low, 1: medium, 2: high; default: 2" ); + printf( "\n-DTX : Enable DTX (0/1); default: 0" ); + printf( "\n-quiet : Print only some basic values" ); + printf( "\n"); +} + +int main( int argc, char* argv[] ) +{ + unsigned long tottime, starttime; + double filetime; + size_t counter; + SKP_int32 k, args, totPackets, totActPackets, ret; + SKP_int16 nBytes; + double sumBytes, sumActBytes, avg_rate, act_rate, nrg; + SKP_uint8 payload[ MAX_BYTES_PER_FRAME * MAX_INPUT_FRAMES ]; + SKP_int16 in[ FRAME_LENGTH_MS * MAX_API_FS_KHZ * MAX_INPUT_FRAMES ]; + char speechInFileName[ 150 ], bitOutFileName[ 150 ]; + FILE *bitOutFile, *speechInFile; + SKP_int32 encSizeBytes; + void *psEnc; +#ifdef _SYSTEM_IS_BIG_ENDIAN + SKP_int16 nBytes_LE; +#endif + + /* default settings */ + SKP_int32 API_fs_Hz = 24000; + SKP_int32 max_internal_fs_Hz = 0; + SKP_int32 targetRate_bps = 25000; + SKP_int32 smplsSinceLastPacket, packetSize_ms = 20; + SKP_int32 frameSizeReadFromFile_ms = 20; + SKP_int32 packetLoss_perc = 0; +#if LOW_COMPLEXITY_ONLY + SKP_int32 complexity_mode = 0; +#else + SKP_int32 complexity_mode = 2; +#endif + SKP_int32 DTX_enabled = 0, INBandFEC_enabled = 0, quiet = 0; + SKP_SILK_SDK_EncControlStruct encControl; // Struct for input to encoder + SKP_SILK_SDK_EncControlStruct encStatus; // Struct for status of encoder + + if( argc < 3 ) { + print_usage( argv ); + exit( 0 ); + } + + /* get arguments */ + args = 1; + strcpy( speechInFileName, argv[ args ] ); + args++; + strcpy( bitOutFileName, argv[ args ] ); + args++; + while( args < argc ) { + if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-Fs_API" ) == 0 ) { + sscanf( argv[ args + 1 ], "%d", &API_fs_Hz ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-Fs_maxInternal" ) == 0 ) { + sscanf( argv[ args + 1 ], "%d", &max_internal_fs_Hz ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-packetlength" ) == 0 ) { + sscanf( argv[ args + 1 ], "%d", &packetSize_ms ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-rate" ) == 0 ) { + sscanf( argv[ args + 1 ], "%d", &targetRate_bps ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-loss" ) == 0 ) { + sscanf( argv[ args + 1 ], "%d", &packetLoss_perc ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-complexity" ) == 0 ) { + sscanf( argv[ args + 1 ], "%d", &complexity_mode ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-inbandFEC" ) == 0 ) { + sscanf( argv[ args + 1 ], "%d", &INBandFEC_enabled ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-DTX") == 0 ) { + sscanf( argv[ args + 1 ], "%d", &DTX_enabled ); + args += 2; + } else if( SKP_STR_CASEINSENSITIVE_COMPARE( argv[ args ], "-quiet" ) == 0 ) { + quiet = 1; + args++; + } else { + printf( "Error: unrecognized setting: %s\n\n", argv[ args ] ); + print_usage( argv ); + exit( 0 ); + } + } + + /* If no max internal is specified, set to minimum of API fs and 24 kHz */ + if( max_internal_fs_Hz == 0 ) { + max_internal_fs_Hz = 24000; + if( API_fs_Hz < max_internal_fs_Hz ) { + max_internal_fs_Hz = API_fs_Hz; + } + } + + /* Print options */ + if( !quiet ) { + if( sizeof(SKP_float) == sizeof(float) ) { + printf("********** Silk Encoder (Single Precision) v %s ***************\n", SKP_Silk_SDK_get_version()); + } else { + printf("********** Silk Encoder (Double Precision) v %s ***************\n", SKP_Silk_SDK_get_version()); + } + printf("********** Compiled for %d bit cpu ******************************* \n", (int)sizeof(void*) * 8 ); + printf( "Input: %s\n", speechInFileName ); + printf( "Output: %s\n", bitOutFileName ); + printf( "API sampling rate: %d Hz\n", API_fs_Hz ); + printf( "Maximum internal sampling rate: %d Hz\n", max_internal_fs_Hz ); + printf( "Packet interval: %d ms\n", packetSize_ms ); + printf( "Inband FEC used: %d\n", INBandFEC_enabled ); + printf( "DTX used: %d\n", DTX_enabled ); + printf( "Complexity: %d\n", complexity_mode ); + printf( "Target bitrate: %d bps\n", targetRate_bps ); + } + + /* Open files */ + speechInFile = fopen( speechInFileName, "rb" ); + if( speechInFile == NULL ) { + printf( "Error: could not open input file %s\n", speechInFileName ); + exit( 0 ); + } + bitOutFile = fopen( bitOutFileName, "wb" ); + if( bitOutFile == NULL ) { + printf( "Error: could not open output file %s\n", bitOutFileName ); + exit( 0 ); + } + + /* Add Silk header to stream */ + { + static const char Silk_header[] = "#!SILK_V3"; + fwrite( Silk_header, sizeof( char ), strlen( Silk_header ), bitOutFile ); + } + + /* Create Encoder */ + ret = SKP_Silk_SDK_Get_Encoder_Size( &encSizeBytes ); + if( ret ) { + printf( "\nError: SKP_Silk_create_encoder returned %d\n", ret ); + exit( 0 ); + } + + psEnc = malloc( encSizeBytes ); + + /* Reset Encoder */ + ret = SKP_Silk_SDK_InitEncoder( psEnc, &encStatus ); + if( ret ) { + printf( "\nError: SKP_Silk_reset_encoder returned %d\n", ret ); + exit( 0 ); + } + + /* Set Encoder parameters */ + encControl.API_sampleRate = API_fs_Hz; + encControl.maxInternalSampleRate = max_internal_fs_Hz; + encControl.packetSize = ( packetSize_ms * API_fs_Hz ) / 1000; + encControl.packetLossPercentage = packetLoss_perc; + encControl.useInBandFEC = INBandFEC_enabled; + encControl.useDTX = DTX_enabled; + encControl.complexity = complexity_mode; + encControl.bitRate = ( targetRate_bps > 0 ? targetRate_bps : 0 ); + + if( API_fs_Hz > MAX_API_FS_KHZ * 1000 || API_fs_Hz < 0 ) { + printf( "\nError: API sampling rate = %d out of range, valid range 8000 - 48000 \n \n", API_fs_Hz ); + exit( 0 ); + } + + tottime = 0; + totPackets = 0; + totActPackets = 0; + smplsSinceLastPacket = 0; + sumBytes = 0.0; + sumActBytes = 0.0; + smplsSinceLastPacket = 0; + + while( 1 ) { + /* Read input from file */ + counter = fread( in, sizeof( SKP_int16 ), ( frameSizeReadFromFile_ms * API_fs_Hz ) / 1000, speechInFile ); +#ifdef _SYSTEM_IS_BIG_ENDIAN + swap_endian( in, counter ); +#endif + if( ( SKP_int )counter < ( ( frameSizeReadFromFile_ms * API_fs_Hz ) / 1000 ) ) { + break; + } + + /* max payload size */ + nBytes = MAX_BYTES_PER_FRAME * MAX_INPUT_FRAMES; + + starttime = GetHighResolutionTime(); + + /* Silk Encoder */ + ret = SKP_Silk_SDK_Encode( psEnc, &encControl, in, (SKP_int16)counter, payload, &nBytes ); + if( ret ) { + printf( "\nSKP_Silk_Encode returned %d", ret ); + } + + tottime += GetHighResolutionTime() - starttime; + + /* Get packet size */ + packetSize_ms = ( SKP_int )( ( 1000 * ( SKP_int32 )encControl.packetSize ) / encControl.API_sampleRate ); + + smplsSinceLastPacket += ( SKP_int )counter; + + if( ( ( 1000 * smplsSinceLastPacket ) / API_fs_Hz ) == packetSize_ms ) { + /* Sends a dummy zero size packet in case of DTX period */ + /* to make it work with the decoder test program. */ + /* In practice should be handled by RTP sequence numbers */ + totPackets++; + sumBytes += nBytes; + nrg = 0.0; + for( k = 0; k < ( SKP_int )counter; k++ ) { + nrg += in[ k ] * (double)in[ k ]; + } + if( ( nrg / ( SKP_int )counter ) > 1e3 ) { + sumActBytes += nBytes; + totActPackets++; + } + + /* Write payload size */ +#ifdef _SYSTEM_IS_BIG_ENDIAN + nBytes_LE = nBytes; + swap_endian( &nBytes_LE, 1 ); + fwrite( &nBytes_LE, sizeof( SKP_int16 ), 1, bitOutFile ); +#else + fwrite( &nBytes, sizeof( SKP_int16 ), 1, bitOutFile ); +#endif + + /* Write payload */ + fwrite( payload, sizeof( SKP_uint8 ), nBytes, bitOutFile ); + + smplsSinceLastPacket = 0; + + if( !quiet ) { + fprintf( stderr, "\rPackets encoded: %d", totPackets ); + } + } + } + + /* Write dummy because it can not end with 0 bytes */ + nBytes = -1; + + /* Write payload size */ + fwrite( &nBytes, sizeof( SKP_int16 ), 1, bitOutFile ); + + /* Free Encoder */ + free( psEnc ); + + fclose( speechInFile ); + fclose( bitOutFile ); + + filetime = totPackets * 1e-3 * packetSize_ms; + avg_rate = 8.0 / packetSize_ms * sumBytes / totPackets; + act_rate = 8.0 / packetSize_ms * sumActBytes / totActPackets; + if( !quiet ) { + printf( "\nFile length: %.3f s", filetime ); + printf( "\nTime for encoding: %.3f s (%.3f%% of realtime)", 1e-6 * tottime, 1e-4 * tottime / filetime ); + printf( "\nAverage bitrate: %.3f kbps", avg_rate ); + printf( "\nActive bitrate: %.3f kbps", act_rate ); + printf( "\n\n" ); + } else { + /* print time and % of realtime */ + printf("%.3f %.3f %d ", 1e-6 * tottime, 1e-4 * tottime / filetime, totPackets ); + /* print average and active bitrates */ + printf( "%.3f %.3f \n", avg_rate, act_rate ); + } + + return 0; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/SignalCompare.vcproj b/external/SILK_SDK_SRC_FLP_v1.0.9/test/SignalCompare.vcproj new file mode 100755 index 0000000..1627697 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/SignalCompare.vcproj @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/SignalCompare.vcxproj b/external/SILK_SDK_SRC_FLP_v1.0.9/test/SignalCompare.vcxproj new file mode 100755 index 0000000..f6dc3ba --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/SignalCompare.vcxproj @@ -0,0 +1,187 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {7FE8F544-9175-40C3-A187-7F15CE9A75D8} + Test + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir) + $(SolutionDir) + $(Configuration)_SigCmp\ + $(Configuration)_SigCmp\ + true + true + $(SolutionDir) + $(SolutionDir) + $(Configuration)_SigCmp\ + $(Configuration)_SigCmp\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + $(ProjectName)_debug + $(ProjectName)_debug + + + + Disabled + ..\interface;..\src;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + $(SolutionDir)SignalCompare_debug.exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + true + $(TargetDir)$(TargetName).pdb + Console + MachineX86 + + + + + Disabled + ..\interface;..\src;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(SolutionDir)SignalCompare_debug.exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + true + $(TargetDir)$(TargetName).pdb + Console + + + + + ..\interface;..\src;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Fast + + + Level3 + ProgramDatabase + + + /fixed:no %(AdditionalOptions) + $(SolutionDir)SignalCompare.exe + %(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + false + Console + true + true + MachineX86 + + + + + ..\interface;..\src;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Fast + + + Level3 + ProgramDatabase + + + /fixed:no %(AdditionalOptions) + $(SolutionDir)SignalCompare.exe + %(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + false + Console + true + true + + + + + + + + + \ No newline at end of file diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test/signalCompare.c b/external/SILK_SDK_SRC_FLP_v1.0.9/test/signalCompare.c new file mode 100755 index 0000000..3418288 --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test/signalCompare.c @@ -0,0 +1,375 @@ +/*********************************************************************** +Copyright (c) 2006-2012, Skype Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, (subject to the limitations in the disclaimer below) +are permitted provided that the following conditions are met: +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +- Neither the name of Skype Limited, nor the names of specific +contributors, may be used to endorse or promote products derived from +this software without specific prior written permission. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED +BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +***********************************************************************/ + +/* +* Compare two audio signals and compute weighted SNR difference +*/ + +#ifdef _WIN32 +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +#include +#include +#include +#include + +#include "SKP_Silk_SigProc_FIX.h" + +#define FRAME_LENGTH_MS 10 +#define WIN_LENGTH_MS 20 +#define BW_EXPANSION 0.7f + +#define MAX_FS_KHZ 48 +#define LPC_ORDER 10 +#define SNR_THRESHOLD 15.0 + +#ifdef __cplusplus +extern "C" +{ +#endif +/* Internally used functions */ +void Autocorrelation( + SKP_float *results, /* o result (length correlationCount) */ + const SKP_float *inputData, /* i input data to correlate */ + SKP_int inputDataSize, /* i length of input */ + SKP_int correlationCount /* i number of correlation taps to compute */ +); + +/* inner product of two SKP_float arrays, with result as double */ +double Inner_product( + const SKP_float *data1, + const SKP_float *data2, + SKP_int dataSize +); +/* Solve the normal equations using the Levinson-Durbin recursion */ +SKP_float Levinsondurbin( /* O prediction error energy */ + SKP_float A[], /* O prediction coefficients [order] */ + const SKP_float corr[], /* I input auto-correlations [order + 1] */ + const SKP_int order /* I prediction order */ +); + +/* Chirp (bw expand) LP AR filter */ +void Bwexpander( + SKP_float *ar, /* io AR filter to be expanded (without leading 1) */ + const SKP_int d, /* i length of ar */ + const SKP_float chirp /* i chirp factor (typically in range (0..1) ) */ +); + +#ifdef __cplusplus +} +#endif + +static void print_usage(char* argv[]) { + printf("\nusage: %s ref.pcm test.pcm [settings]\n", argv[ 0 ]); + printf("\nref.pcm : Reference file"); + printf("\ntest.pcm : File to be tested, should be of same length as ref.pcm"); + printf("\n settings:"); + printf("\n-diff : Only determine bit-exactness"); + printf("\n-fs : Sampling rate in Hz, max: %d; default: 48000", MAX_FS_KHZ * 1000 ); + printf("\n"); +} + + +int main(int argc, char* argv[]) +{ + SKP_int args, n, i, counterRef, counterTest; + char testInFileName[150], refInFileName[150]; + FILE *refInFile, *testInFile; + SKP_int nFrames = 0, isUnequal = 0; + SKP_int diff = 0, Fs_kHz; + SKP_int32 Fs_Hz = 24000; + SKP_float c, refWhtnd, testWhtnd, refNrg, diffNrg; + double SNR = 0.0; + SKP_int16 refIn[WIN_LENGTH_MS * MAX_FS_KHZ], testIn[WIN_LENGTH_MS * MAX_FS_KHZ]; + SKP_float refWin[WIN_LENGTH_MS * MAX_FS_KHZ]; + SKP_float autoCorr[LPC_ORDER + 1], LPC_Coef[LPC_ORDER]; + + if (argc < 3) { + print_usage(argv); + exit(0); + } + + /* get arguments */ + args = 1; + strcpy(refInFileName, argv[args]); + args++; + strcpy(testInFileName, argv[args]); + args++; + while(args < argc ) { + if (SKP_STR_CASEINSENSITIVE_COMPARE(argv[args], "-diff") == 0) { + diff = 1; + args++; + }else if (SKP_STR_CASEINSENSITIVE_COMPARE(argv[args], "-fs") == 0) { + sscanf(argv[args+1], "%d", &Fs_Hz); + args += 2; + } else { + printf("Error: unrecognized setting: %s\n\n", argv[args]); + print_usage(argv); + exit(0); + } + } + + Fs_kHz = SKP_DIV32_16( Fs_Hz, 1000 ); + + if( Fs_kHz > MAX_FS_KHZ ) { + printf("Error: sampling rate too high: %d\n\n", Fs_kHz); + print_usage(argv); + exit(0); + } + + printf("Reference: %s\n", refInFileName); + //printf("Test: %s\n", testInFileName); + + /* open files */ + refInFile = fopen(refInFileName, "rb"); + if (refInFile==NULL) { + printf("Error: could not open input file %s\n", refInFileName); + exit(0); + } + testInFile = fopen(testInFileName, "rb"); + if (testInFile==NULL) { + printf("Error: could not open input file %s\n", testInFileName); + exit(0); + } + + SKP_memset( refIn, 0, sizeof(refIn) ); + SKP_memset( testIn, 0, sizeof(testIn) ); + + while(1) { + /* Read inputs */ + counterRef = (SKP_int)fread(&refIn[(WIN_LENGTH_MS - FRAME_LENGTH_MS) * Fs_kHz], + sizeof(SKP_int16), FRAME_LENGTH_MS * Fs_kHz, refInFile); + counterTest = (SKP_int)fread(&testIn[(WIN_LENGTH_MS - FRAME_LENGTH_MS) * Fs_kHz], + sizeof(SKP_int16), FRAME_LENGTH_MS * Fs_kHz, testInFile); + if(counterRef != FRAME_LENGTH_MS * Fs_kHz || counterTest != FRAME_LENGTH_MS * Fs_kHz){ + break; + } + + /* test for bit-exactness */ + for( n = 0; n < FRAME_LENGTH_MS * Fs_kHz; n++ ) { + if( refIn[(WIN_LENGTH_MS - FRAME_LENGTH_MS) * Fs_kHz + n] != + testIn[(WIN_LENGTH_MS - FRAME_LENGTH_MS) * Fs_kHz + n] ) { + isUnequal = 1; + break; + } + } + + /* apply sine window */ + for( n = 0; n < WIN_LENGTH_MS * Fs_kHz; n++ ) { + c = (SKP_float)sin( 3.14159265 * (n + 1) / (WIN_LENGTH_MS * Fs_kHz + 1) ); + refWin[n] = refIn[n] * c; + } + + /* LPC analysis on reference signal */ + + /* Calculate auto correlation */ + Autocorrelation(autoCorr, refWin, WIN_LENGTH_MS * Fs_kHz, LPC_ORDER + 1); + + /* Add white noise */ + autoCorr[ 0 ] += autoCorr[ 0 ] * 1e-6f + 1.0f; + + /* Convert correlations to prediction coefficients */ + Levinsondurbin(LPC_Coef, autoCorr, LPC_ORDER); + + /* Bandwdith expansion */ + Bwexpander(LPC_Coef, LPC_ORDER, BW_EXPANSION); + + /* Filter both signals */ + refNrg = 1.0f; + diffNrg = 1e-10f; + for( n = (WIN_LENGTH_MS - FRAME_LENGTH_MS) / 2 * Fs_kHz; + n < (WIN_LENGTH_MS + FRAME_LENGTH_MS) / 2 * Fs_kHz; n++ ) { + refWhtnd = refIn[n]; + testWhtnd = testIn[n]; + for( i = 0; i < LPC_ORDER; i++ ) { + refWhtnd -= LPC_Coef[ i ] * refIn[n - i - 1]; + testWhtnd -= LPC_Coef[ i ] * testIn[n - i - 1]; + } + refNrg += refWhtnd * refWhtnd; + diffNrg += (refWhtnd - testWhtnd) * (refWhtnd - testWhtnd); + } + + /* weighted SNR */ + if( refNrg > FRAME_LENGTH_MS * Fs_kHz ) { + SNR += 10.0 * log10( refNrg / diffNrg ); + nFrames++; + } + + /* Update Buffer */ + SKP_memmove( refIn, &refIn[FRAME_LENGTH_MS * Fs_kHz], (WIN_LENGTH_MS - FRAME_LENGTH_MS) * Fs_kHz * sizeof(SKP_int16)); + SKP_memmove( testIn, &testIn[FRAME_LENGTH_MS * Fs_kHz], (WIN_LENGTH_MS - FRAME_LENGTH_MS) * Fs_kHz * sizeof(SKP_int16)); + } + + if( diff ) { + if( isUnequal ) { + printf("Signals differ\n"); + } else { + if(counterRef != counterTest){ + printf("Warning: signals differ in length\n"); + } + printf("Signals are bit-exact PASS\n"); + } + } else { + if( nFrames == 0 ) { + printf("At least one signal too short or not loud enough\n"); + exit(0); + } + if(counterRef != counterTest){ + printf("Warning: signals differ in length\n"); + } + if( isUnequal == 0 ) { + printf("Signals are bit-exact PASS\n"); + } else { + printf("Average weighted SNR: %4.1f dB ", SNR / nFrames); + if( SNR / nFrames < SNR_THRESHOLD ) { + printf("FAIL\n"); + } else { + printf("PASS\n"); + } + } + } + printf("\n"); + + /* Close Files */ + fclose(refInFile); + fclose(testInFile); + + return 0; +} + +/* compute autocorrelation */ +void Autocorrelation( + SKP_float *results, /* o result (length correlationCount) */ + const SKP_float *inputData, /* i input data to correlate */ + SKP_int inputDataSize, /* i length of input */ + SKP_int correlationCount /* i number of correlation taps to compute */ +) +{ + SKP_int i; + + if (correlationCount > inputDataSize) { + correlationCount = inputDataSize; + } + + for( i = 0; i < correlationCount; i++ ) { + results[ i ] = (SKP_float)Inner_product( inputData, inputData + i, inputDataSize - i ); + } +} + +/* inner product of two SKP_float arrays, with result as double */ +double Inner_product( + const SKP_float *data1, + const SKP_float *data2, + SKP_int dataSize +) +{ + SKP_int i, dataSize4; + double result; + + /* 4x unrolled loop */ + result = 0.0f; + dataSize4 = dataSize & 0xFFFC; + for( i = 0; i < dataSize4; i += 4 ) { + result += data1[ i + 0 ] * data2[ i + 0 ] + + data1[ i + 1 ] * data2[ i + 1 ] + + data1[ i + 2 ] * data2[ i + 2 ] + + data1[ i + 3 ] * data2[ i + 3 ]; + } + + /* add any remaining products */ + for( ; i < dataSize; i++ ) { + result += data1[ i ] * data2[ i ]; + } + + return result; +} + +/* Solve the normal equations using the Levinson-Durbin recursion */ +SKP_float Levinsondurbin( /* O prediction error energy */ + SKP_float A[], /* O prediction coefficients [order] */ + const SKP_float corr[], /* I input auto-correlations [order + 1] */ + const SKP_int order /* I prediction order */ +) +{ + SKP_int i, mHalf, m; + SKP_float min_nrg, nrg, t, km, Atmp1, Atmp2; + + min_nrg = 1e-12f * corr[ 0 ] + 1e-9f; + nrg = corr[ 0 ]; + nrg = SKP_max(min_nrg, nrg); + A[ 0 ] = corr[ 1 ] / nrg; + nrg -= A[ 0 ] * corr[ 1 ]; + nrg = SKP_max(min_nrg, nrg); + + for( m = 1; m < order; m++ ) + { + t = corr[ m + 1 ]; + for( i = 0; i < m; i++ ) { + t -= A[ i ] * corr[ m - i ]; + } + + /* reflection coefficient */ + km = t / nrg; + + /* residual energy */ + nrg -= km * t; + nrg = SKP_max(min_nrg, nrg); + + mHalf = m >> 1; + for( i = 0; i < mHalf; i++ ) { + Atmp1 = A[ i ]; + Atmp2 = A[ m - i - 1 ]; + A[ m - i - 1 ] -= km * Atmp1; + A[ i ] -= km * Atmp2; + } + if( m & 1 ) { + A[ mHalf ] -= km * A[ mHalf ]; + } + A[ m ] = km; + } + + /* return the residual energy */ + return nrg; +} + +/* Chirp (bw expand) LP AR filter */ +void Bwexpander( + SKP_float *ar, /* io AR filter to be expanded (without leading 1) */ + const SKP_int d, /* i length of ar */ + const SKP_float chirp /* i chirp factor (typically in range (0..1) ) */ +) +{ + SKP_int i; + SKP_float cfac = chirp; + + for( i = 0; i < d - 1; i++ ) { + ar[ i ] *= cfac; + cfac *= chirp; + } + ar[ d - 1 ] *= cfac; +} diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/How to use the test vectors.txt b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/How to use the test vectors.txt new file mode 100755 index 0000000..827696d --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/How to use the test vectors.txt @@ -0,0 +1,15 @@ +Use the following scripts to verify the decoder implementation: + +o test_decoder.bat / test_decoder.sh + + Make sure the decoder executable to be tested exists in the parent directory, and run + test_decoder.bat (win) or test_decoder.sh (linux/mac). This will run the decoder + and compare the output audio file with the reference audio files. The result is + written to test_decoder_report.txt. + For each file, the bitstreams are either bit-exact or they match up to a certain + average weighted SNR. The compatibility test is passed if each file is reported as + "PASS". + + +NOTE: When using the shell script, make sure it is marked as executable. + This can be done by: chmod +x *.sh diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_20_ms_24_kbps_10_loss_FEC.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_20_ms_24_kbps_10_loss_FEC.bit new file mode 100755 index 0000000..6315116 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_20_ms_24_kbps_10_loss_FEC.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_40_ms_16_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_40_ms_16_kbps.bit new file mode 100755 index 0000000..24bbb1c Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_40_ms_16_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_60_ms_10_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_60_ms_10_kbps.bit new file mode 100755 index 0000000..cc70d97 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_12_kHz_60_ms_10_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_20_ms_32_kbps_10_loss_FEC.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_20_ms_32_kbps_10_loss_FEC.bit new file mode 100755 index 0000000..a0df8fa Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_20_ms_32_kbps_10_loss_FEC.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_40_ms_20_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_40_ms_20_kbps.bit new file mode 100755 index 0000000..a8dae4d Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_40_ms_20_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_60_ms_12_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_60_ms_12_kbps.bit new file mode 100755 index 0000000..bd1aa1b Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_16_kHz_60_ms_12_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_20_ms_40_kbps_10_loss_FEC.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_20_ms_40_kbps_10_loss_FEC.bit new file mode 100755 index 0000000..0c3192d Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_20_ms_40_kbps_10_loss_FEC.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_40_ms_24_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_40_ms_24_kbps.bit new file mode 100755 index 0000000..02858e5 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_40_ms_24_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_60_ms_16_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_60_ms_16_kbps.bit new file mode 100755 index 0000000..ef5bcf0 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_24_kHz_60_ms_16_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_32_kHz_max_8_kHz_20_ms_8_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_32_kHz_max_8_kHz_20_ms_8_kbps.bit new file mode 100755 index 0000000..ad955c4 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_32_kHz_max_8_kHz_20_ms_8_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_44100_Hz_20_ms_7_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_44100_Hz_20_ms_7_kbps.bit new file mode 100755 index 0000000..5d4eb47 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_44100_Hz_20_ms_7_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_20_ms_20_kbps_10_loss_FEC.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_20_ms_20_kbps_10_loss_FEC.bit new file mode 100755 index 0000000..50b719f Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_20_ms_20_kbps_10_loss_FEC.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_40_ms_12_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_40_ms_12_kbps.bit new file mode 100755 index 0000000..186e892 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_40_ms_12_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_60_ms_8_kbps.bit b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_60_ms_8_kbps.bit new file mode 100755 index 0000000..582cab2 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/bitstream/payload_8_kHz_60_ms_8_kbps.bit differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_12_kHz.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_12_kHz.pcm new file mode 100755 index 0000000..740c0f4 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_12_kHz.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_16_kHz.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_16_kHz.pcm new file mode 100755 index 0000000..96c9797 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_16_kHz.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_24_kHz.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_24_kHz.pcm new file mode 100755 index 0000000..3d73f14 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_24_kHz.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_32_kHz.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_32_kHz.pcm new file mode 100755 index 0000000..cb0efc3 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_32_kHz.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_44100_Hz.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_44100_Hz.pcm new file mode 100755 index 0000000..d3c20a9 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_44100_Hz.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_8_kHz.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_8_kHz.pcm new file mode 100755 index 0000000..a9245ba Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/input/testvector_input_8_kHz.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_20_ms_24_kbps_10_loss_FEC.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_20_ms_24_kbps_10_loss_FEC.pcm new file mode 100755 index 0000000..8600798 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_20_ms_24_kbps_10_loss_FEC.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_40_ms_16_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_40_ms_16_kbps.pcm new file mode 100755 index 0000000..88bfbc1 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_40_ms_16_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps.pcm new file mode 100755 index 0000000..fcd0044 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_12_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_12_kHz_out.pcm new file mode 100755 index 0000000..3ed4bbd Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_12_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_16_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_16_kHz_out.pcm new file mode 100755 index 0000000..7aec0a9 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_16_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_32_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_32_kHz_out.pcm new file mode 100755 index 0000000..8a42c20 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_32_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_44100_Hz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_44100_Hz_out.pcm new file mode 100755 index 0000000..64fde74 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_44100_Hz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_48_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_48_kHz_out.pcm new file mode 100755 index 0000000..2fe8639 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_12_kHz_60_ms_10_kbps_48_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_20_ms_32_kbps_10_loss_FEC.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_20_ms_32_kbps_10_loss_FEC.pcm new file mode 100755 index 0000000..a1a6836 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_20_ms_32_kbps_10_loss_FEC.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_40_ms_20_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_40_ms_20_kbps.pcm new file mode 100755 index 0000000..5265a6d Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_40_ms_20_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_60_ms_12_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_60_ms_12_kbps.pcm new file mode 100755 index 0000000..298ebbd Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_60_ms_12_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_60_ms_12_kbps_16_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_60_ms_12_kbps_16_kHz_out.pcm new file mode 100755 index 0000000..e66c315 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_16_kHz_60_ms_12_kbps_16_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_20_ms_40_kbps_10_loss_FEC.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_20_ms_40_kbps_10_loss_FEC.pcm new file mode 100755 index 0000000..a194d62 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_20_ms_40_kbps_10_loss_FEC.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_40_ms_24_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_40_ms_24_kbps.pcm new file mode 100755 index 0000000..29f6ccc Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_40_ms_24_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_60_ms_16_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_60_ms_16_kbps.pcm new file mode 100755 index 0000000..6df0006 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_24_kHz_60_ms_16_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps.pcm new file mode 100755 index 0000000..a8b3702 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_32_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_32_kHz_out.pcm new file mode 100755 index 0000000..dc62c43 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_32_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_44100_Hz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_44100_Hz_out.pcm new file mode 100755 index 0000000..b0216db Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_44100_Hz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_48_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_48_kHz_out.pcm new file mode 100755 index 0000000..f9e71f2 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_32_kHz_max_8_kHz_20_ms_8_kbps_48_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_44100_Hz_20_ms_7_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_44100_Hz_20_ms_7_kbps.pcm new file mode 100755 index 0000000..c17d2ea Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_44100_Hz_20_ms_7_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_20_ms_20_kbps_10_loss_FEC.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_20_ms_20_kbps_10_loss_FEC.pcm new file mode 100755 index 0000000..14a4b2a Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_20_ms_20_kbps_10_loss_FEC.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_40_ms_12_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_40_ms_12_kbps.pcm new file mode 100755 index 0000000..310f3ba Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_40_ms_12_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps.pcm new file mode 100755 index 0000000..1db314e Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_12_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_12_kHz_out.pcm new file mode 100755 index 0000000..82ca6a3 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_12_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_16_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_16_kHz_out.pcm new file mode 100755 index 0000000..bddc021 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_16_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_8_kHz_out.pcm b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_8_kHz_out.pcm new file mode 100755 index 0000000..0ce9234 Binary files /dev/null and b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/output/testvector_output_8_kHz_60_ms_8_kbps_8_kHz_out.pcm differ diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/test_decoder.bat b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/test_decoder.bat new file mode 100755 index 0000000..ff10c9e --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/test_decoder.bat @@ -0,0 +1,143 @@ +@echo off + +SET BITSTREAMPATH=./test_vectors/bitstream/ +SET OUTPUTPATH=./test_vectors/output/ +SET DEC=Decoder.exe +SET COMP=SignalCompare.exe + +cd .. + +:: 8 kHz + +:: 8 kHz, 60 ms, 8 kbps, complexity 0 +SET PARAMS=8_kHz_60_ms_8_kbps +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm -fs 24000 > test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 8000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_8_kHz_out.pcm tmp.pcm -fs 8000 >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 12000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_12_kHz_out.pcm tmp.pcm -fs 12000 >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 16000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt + +:: 8 kHz, 40 ms, 12 kbps, complexity 1 +SET PARAMS=8_kHz_40_ms_12_kbps +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + +:: 8 kHz, 20 ms, 20 kbps, 10% packet loss, FEC +SET PARAMS=8_kHz_20_ms_20_kbps_10_loss_FEC +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -loss 10 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + + +:: 12 kHz + +:: 12 kHz, 60 ms, 10 kbps, complexity 0 +SET PARAMS=12_kHz_60_ms_10_kbps +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 12000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_12_kHz_out.pcm tmp.pcm -fs 12000 >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 16000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 32000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_32_kHz_out.pcm tmp.pcm -fs 32000 >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 44100 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_44100_Hz_out.pcm tmp.pcm -fs 44100 >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 48000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_48_kHz_out.pcm tmp.pcm -fs 48000 >> test_decoder_report.txt + +:: 12 kHz, 40 ms, 16 kbps, complexity 1 +SET PARAMS=12_kHz_40_ms_16_kbps +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + +:: 12 kHz, 20 ms, 24 kbps, 10% packet loss, FEC +SET PARAMS=12_kHz_20_ms_24_kbps_10_loss_FEC +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -loss 10 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + + +:: 16 kHz + +:: 16 kHz, 60 ms, 12 kbps, complexity 0 +SET PARAMS=16_kHz_60_ms_12_kbps +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 16000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt + +:: 16 kHz, 40 ms, 20 kbps, complexity 1 +SET PARAMS=16_kHz_40_ms_20_kbps +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + +:: 16 kHz, 20 ms, 32 kbps, 10% packet loss, FEC +SET PARAMS=16_kHz_20_ms_32_kbps_10_loss_FEC +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -loss 10 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + + +:: 24 kHz + +:: 24 kHz, 60 ms, 16 kbps, complexity 0 +SET PARAMS=24_kHz_60_ms_16_kbps +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + +:: 24 kHz, 40 ms, 24 kbps, complexity 1 +SET PARAMS=24_kHz_40_ms_24_kbps +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + +:: 24 kHz, 20 ms, 40 kbps, 10% packet loss, FEC +SET PARAMS=24_kHz_20_ms_40_kbps_10_loss_FEC +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -loss 10 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + + +:: 32 kHz + +:: 32 kHz, 20 ms, 8 kbps, maxInternal 8kHz +SET PARAMS=32_kHz_max_8_kHz_20_ms_8_kbps + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 32000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_32_kHz_out.pcm tmp.pcm -fs 32000 >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 44100 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_44100_Hz_out.pcm tmp.pcm -fs 44100 >> test_decoder_report.txt + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm -Fs_API 48000 +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%_48_kHz_out.pcm tmp.pcm -fs 48000 >> test_decoder_report.txt + + +:: 44100 Hz + +:: 44100 Hz, 20 ms, 40 kbps +SET PARAMS=44100_Hz_20_ms_7_kbps + +%DEC% %BITSTREAMPATH%payload_%PARAMS%.bit tmp.pcm +%COMP% %OUTPUTPATH%testvector_output_%PARAMS%.pcm tmp.pcm >> test_decoder_report.txt + + +del tmp.pcm +move test_decoder_report.txt ./test_vectors/test_decoder_report.txt + +echo. +echo The results have been saved as test_decoder_report.txt +echo. + +pause diff --git a/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/test_decoder.sh b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/test_decoder.sh new file mode 100755 index 0000000..08e61fa --- /dev/null +++ b/external/SILK_SDK_SRC_FLP_v1.0.9/test_vectors/test_decoder.sh @@ -0,0 +1,142 @@ +#!/bin/bash + +BITSTREAMPATH=./test_vectors/bitstream/ +OUTPUTPATH=./test_vectors/output/ +DEC=decoder +COMP=signalcompare + +cd .. + + +# 8 kHz + +# 8 kHz, 60 ms, 8 kbps, complexity 0 +PARAMS=8_kHz_60_ms_8_kbps +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm -fs 24000 > test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 8000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_8_kHz_out.pcm tmp.pcm -fs 8000 >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 12000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_12_kHz_out.pcm tmp.pcm -fs 12000 >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 16000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt + +# 8 kHz, 40 ms, 12 kbps, complexity 1 +PARAMS=8_kHz_40_ms_12_kbps +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + +# 8 kHz, 20 ms, 20 kbps, 10% packet loss, FEC +PARAMS=8_kHz_20_ms_20_kbps_10_loss_FEC +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -loss 10 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + + +# 12 kHz + +# 12 kHz, 60 ms, 10 kbps, complexity 0 +PARAMS=12_kHz_60_ms_10_kbps +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 12000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_12_kHz_out.pcm tmp.pcm -fs 12000 >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 16000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 32000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_32_kHz_out.pcm tmp.pcm -fs 32000 >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 44100 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_44100_Hz_out.pcm tmp.pcm -fs 44100 >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 48000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_48_kHz_out.pcm tmp.pcm -fs 48000 >> test_decoder_report.txt + +# 12 kHz, 40 ms, 16 kbps, complexity 1 +PARAMS=12_kHz_40_ms_16_kbps +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + +# 12 kHz, 20 ms, 24 kbps, 10% packet loss, FEC +PARAMS=12_kHz_20_ms_24_kbps_10_loss_FEC +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -loss 10 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + + +# 16 kHz + +# 16 kHz, 60 ms, 12 kbps, complexity 0 +PARAMS=16_kHz_60_ms_12_kbps +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 16000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_16_kHz_out.pcm tmp.pcm -fs 16000 >> test_decoder_report.txt + +# 16 kHz, 40 ms, 20 kbps, complexity 1 +PARAMS=16_kHz_40_ms_20_kbps +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + +# 16 kHz, 20 ms, 32 kbps, 10% packet loss, FEC +PARAMS=16_kHz_20_ms_32_kbps_10_loss_FEC +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -loss 10 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + + +# 24 kHz + +# 24 kHz, 60 ms, 16 kbps, complexity 0 +PARAMS=24_kHz_60_ms_16_kbps +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + +# 24 kHz, 40 ms, 24 kbps, complexity 1 +PARAMS=24_kHz_40_ms_24_kbps +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + +# 24 kHz, 20 ms, 40 kbps, 10% packet loss, FEC +PARAMS=24_kHz_20_ms_40_kbps_10_loss_FEC +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -loss 10 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + + +# 32 kHz + +# 32 kHz, 20 ms, 8 kbps, maxInternal 8kHz +PARAMS=32_kHz_max_8_kHz_20_ms_8_kbps + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 32000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_32_kHz_out.pcm tmp.pcm -fs 32000 >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 44100 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_44100_Hz_out.pcm tmp.pcm -fs 44100 >> test_decoder_report.txt + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm -Fs_API 48000 +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}_48_kHz_out.pcm tmp.pcm -fs 48000 >> test_decoder_report.txt + + +# 44100 Hz + +# 44100 Hz, 20 ms, 40 kbps +PARAMS=44100_Hz_20_ms_7_kbps + +./${DEC} ${BITSTREAMPATH}payload_${PARAMS}.bit tmp.pcm +./${COMP} ${OUTPUTPATH}testvector_output_${PARAMS}.pcm tmp.pcm >> test_decoder_report.txt + + +rm tmp.pcm +mv test_decoder_report.txt ./test_vectors/test_decoder_report.txt + +echo "" +echo "The results have been saved as test_decoder_report.txt" +echo "" \ No newline at end of file diff --git a/external/cbase64-1.1/AUTHORS b/external/cbase64-1.1/AUTHORS deleted file mode 100644 index 8dd4161..0000000 --- a/external/cbase64-1.1/AUTHORS +++ /dev/null @@ -1,24 +0,0 @@ -cbase64: Base64 Encoding/Decoding Routines -====================================== - -Authors: -------- - -Jordan Cristiano - - -libb64: Base64 Encoding/Decoding Routines -====================================== - -Authors: -------- - -Chris Venter chris.venter@gmail.com http://controlaltfire.com - -Contributors: ------------- - -Mario Rugiero -Shlok Datye -Peter K. Lee - diff --git a/external/cbase64-1.1/LICENSE b/external/cbase64-1.1/LICENSE deleted file mode 100644 index a6b5606..0000000 --- a/external/cbase64-1.1/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright-Only Dedication (based on United States law) -or Public Domain Certification - -The person or persons who have associated work with this document (the -"Dedicator" or "Certifier") hereby either (a) certifies that, to the best of -his knowledge, the work of authorship identified is in the public domain of the -country from which the work is published, or (b) hereby dedicates whatever -copyright the dedicators holds in the work of authorship identified below (the -"Work") to the public domain. A certifier, moreover, dedicates any copyright -interest he may have in the associated work, and for these purposes, is -described as a "dedicator" below. - -A certifier has taken reasonable steps to verify the copyright status of this -work. Certifier recognizes that his good faith efforts may not shield him from -liability if in fact the work certified is not in the public domain. - -Dedicator makes this dedication for the benefit of the public at large and to -the detriment of the Dedicator's heirs and successors. Dedicator intends this -dedication to be an overt act of relinquishment in perpetuity of all present -and future rights under copyright law, whether vested or contingent, in the -Work. Dedicator understands that such relinquishment of all rights includes -the relinquishment of all rights to enforce (by lawsuit or otherwise) those -copyrights in the Work. - -Dedicator recognizes that, once placed in the public domain, the Work may be -freely reproduced, distributed, transmitted, used, modified, built upon, or -otherwise exploited by anyone for any purpose, commercial or non-commercial, -and in any way, including by methods that have not yet been invented or -conceived. \ No newline at end of file diff --git a/external/cbase64-1.1/README.md b/external/cbase64-1.1/README.md deleted file mode 100644 index 22e9b7d..0000000 --- a/external/cbase64-1.1/README.md +++ /dev/null @@ -1,169 +0,0 @@ -cbase64: Base64 Encoding/Decoding Routines -====================================== - -Forked from libb64-1.2.1. -* Removed c++ helpers -* Made header only -* Added output length calculation functions -* Removed chars per line limit -* Removed ending newline - -### Usage -``` -#define CBASE64_IMPLEMENTATION -``` -before you include this file in *one* C or C++ file to create the implementation. - -``` -// i.e. it should look like this: -#include ... -#include ... -#include ... -#define CBASE64_IMPLEMENTATION -#include "cbase64.h" -``` - -Overview: --------- -libb64 is a library of ANSI C routines for fast encoding/decoding data into and -from a base64-encoded format. C++ wrappers are included, as well as the source -code for standalone encoding and decoding executables. - -base64 consists of ASCII text, and is therefore a useful encoding for storing -binary data in a text file, such as xml, or sending binary data over text-only -email. - -References: ----------- -* Wikipedia article: - http://en.wikipedia.org/wiki/Base64 -* base64, another implementation of a commandline en/decoder: - http://www.fourmilab.ch/webtools/base64/ - -Why? ---- -I did this because I need an implementation of base64 encoding and decoding, -without any licensing problems. Most OS implementations are released under -either the GNU/GPL, or a BSD-variant, which is not what I require. - -Also, the chance to actually use the co-routine implementation in code is rare, -and its use here is fitting. I couldn't pass up the chance. -For more information on this technique, see "Coroutines in C", by Simon Tatham, -which can be found online here: -http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html - -So then, under which license do I release this code? On to the next section... - -License: -------- -This work is released under into the Public Domain. -It basically boils down to this: I put this work in the public domain, and you -can take it and do whatever you want with it. - -An example of this "license" is the Creative Commons Public Domain License, a -copy of which can be found in the LICENSE file, and also online at -http://creativecommons.org/licenses/publicdomain/ - -Commandline Use: ---------------- -There is a new executable available, it is simply called base64. -It can encode and decode files, as instructed by the user. - -To encode a file: -$ ./base64 -e filea fileb -fileb will now be the base64-encoded version of filea. - -To decode a file: -$ ./base64 -d fileb filec -filec will now be identical to filea. - -Programming: ------------ -Some C++ wrappers are provided as well, so you don't have to get your hands -dirty. Encoding from standard input to standard output is as simple as - -``` - #include - #include - int main() - { - base64::encoder E; - E.encode(std::cin, std::cout); - return 0; - } -``` - -Both standalone executables and a static library is provided in the package, - -Example code: ------------- -The 'examples' directory contains some simple example C code, that demonstrates -how to use the C interface of the library. - -Implementation: --------------- -It is DAMN fast, if I may say so myself. The C code uses a little trick which -has been used to implement coroutines, of which one can say that this -implementation is an example. - -(To see how the libb64 codebase compares with some other BASE64 implementations -available, see the BENCHMARKS file) - -The trick involves the fact that a switch-statement may legally cross into -sub-blocks. A very thorough and enlightening essay on co-routines in C, using -this method, can be found in the above mentioned "Coroutines in C", by Simon -Tatham: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html - -For example, an RLE decompressing routine, adapted from the article: -``` -1 static int STATE = 0; -2 static int len, c; -3 switch (STATE) -4 { -5 while (1) -6 { -7 c = getchar(); -8 if (c == EOF) return EOF; -9 if (c == 0xFF) { -10 len = getchar(); -11 c = getchar(); -12 while (len--) -13 { -14 STATE = 0; -15 return c; -16 case 0: -17 } -18 } else -19 STATE = 1; -20 return c; -21 case 1: -22 } -23 } -24 } -``` - -As can be seen from this example, a coroutine depends on a state variable, -which it sets directly before exiting (lines 14 and 119). The next time the -routine is entered, the switch moves control to the specific point directly -after the previous exit (lines 16 and 21).hands - -(As an aside, in the mentioned article the combination of the top-level switch, -the various setting of the state, the return of a value, and the labelling of -the exit point is wrapped in #define macros, making the structure of the -routine even clearer.) - -The obvious problem with any such routine is the static keyword. -Any static variables in a function spell doom for multithreaded applications. -Also, in situations where this coroutine is used by more than one other -coroutines, the consistency is disturbed. - -What is needed is a structure for storing these variabled, which is passed to -the routine seperately. This obviously breaks the modularity of the function, -since now the caller has to worry about and care for the internal state of the -routine (the callee). This allows for a fast, multithreading-enabled -implementation, which may (obviously) be wrapped in a C++ object for ease of -use. - -The base64 encoding and decoding functionality in this package is implemented -in exactly this way, providing both a high-speed high-maintanence C interface, -and a wrapped C++ which is low-maintanence and only slightly less performant. diff --git a/external/cbase64-1.1/include/cbase64/cbase64.h b/external/cbase64-1.1/include/cbase64/cbase64.h deleted file mode 100644 index 62b535a..0000000 --- a/external/cbase64-1.1/include/cbase64/cbase64.h +++ /dev/null @@ -1,244 +0,0 @@ - -/* cbase64 - public domain base64 encoder/decoder - - Do this: - #define CBASE64_IMPLEMENTATION - before you include this file in *one* C or C++ file to create the implementation. - - // i.e. it should look like this: - #include ... - #include ... - #include ... - #define CBASE64_IMPLEMENTATION - #include "cbase64.h" - -*/ - -#ifndef CBASE64_H -#define CBASE64_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - step_A, step_B, step_C, step_D -} cbase64_step; - -typedef struct -{ - cbase64_step step; - unsigned char result; -} cbase64_encodestate; - -typedef struct -{ - cbase64_step step; - char result; -} cbase64_decodestate; - -void cbase64_init_encodestate(cbase64_encodestate* state_in); -void cbase64_init_decodestate(cbase64_decodestate* state_in); - -unsigned int cbase64_calc_encoded_length(unsigned int length_in); -unsigned int cbase64_calc_decoded_length(const char* code_in, unsigned int length_in); - -unsigned int cbase64_encode_block(const unsigned char* data_in, unsigned int length_in, - char* code_out, cbase64_encodestate* state_in); - -unsigned int cbase64_decode_block(const char* code_in, unsigned int length_in, - unsigned char* data_out, cbase64_decodestate* state_in); - -unsigned int cbase64_encode_blockend(char* code_out, cbase64_encodestate* state_in); - -#ifdef __cplusplus -} -#endif - -#endif // CBASE64_H - -#ifdef CBASE64_IMPLEMENTATION - -char cbase64__encode_value(unsigned char value_in) -{ - static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - return encoding[(int)value_in]; -} - -char cbase64__decode_value(char value_in) -{ - static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; - static const char decoding_size = sizeof(decoding); - value_in -= 43; - if (value_in < 0 || value_in >= decoding_size) return -1; - return decoding[(int)value_in]; -} - -void cbase64_init_encodestate(cbase64_encodestate* state_in) -{ - state_in->step = step_A; - state_in->result = '\0'; -} - -void cbase64_init_decodestate(cbase64_decodestate* state_in) -{ - state_in->step = step_A; - state_in->result = '\0'; -} - -unsigned int cbase64_calc_encoded_length(unsigned int length_in) -{ - return 4 * (length_in / 3) + ((length_in % 3 != 0) ? 4 : 0); -} - -unsigned int cbase64_calc_decoded_length(const char* code_in, unsigned int length_in) -{ - if (length_in == 0 || ((length_in & 3) != 0)) - { - return 0; - } - const char secondlast = code_in[length_in - 2]; - const char last = code_in[length_in - 1]; - return 3 * (length_in / 4) - (secondlast == '=') - (last == '='); -} - -unsigned int cbase64_encode_block(const unsigned char* data_in, unsigned int length_in, - char* code_out, cbase64_encodestate* state_in) -{ - const unsigned char* datachar = data_in; - const unsigned char* const datatextend = data_in + length_in; - char* codechar = code_out; - unsigned char result = state_in->result; - unsigned char fragment; - - switch (state_in->step) - { - while (1) - { - case step_A: - if (datachar == datatextend) - { - state_in->step = step_A; - state_in->result = result; - return codechar - code_out; - } - fragment = *datachar++; - result = (fragment & 0x0fc) >> 2; - *codechar++ = cbase64__encode_value(result); - result = (fragment & 0x003) << 4; - case step_B: - if (datachar == datatextend) - { - state_in->step = step_B; - state_in->result = result; - return codechar - code_out; - } - fragment = *datachar++; - result |= (fragment & 0x0f0) >> 4; - *codechar++ = cbase64__encode_value(result); - result = (fragment & 0x00f) << 2; - case step_C: - if (datachar == datatextend) - { - state_in->step = step_C; - state_in->result = result; - return codechar - code_out; - } - fragment = *datachar++; - result |= (fragment & 0x0c0) >> 6; - *codechar++ = cbase64__encode_value(result); - result = (fragment & 0x03f) >> 0; - *codechar++ = cbase64__encode_value(result); - } - } - // control should not reach here - return codechar - code_out; -} - -unsigned int cbase64_decode_block(const char* code_in, unsigned int length_in, - unsigned char* data_out, cbase64_decodestate* state_in) -{ - const char* codechar = code_in; - const char* const codeend = code_in + length_in; - unsigned char* datachar = data_out; - char fragment; - char overwrite = state_in->result; - - switch (state_in->step) - { - while (1) - { - case step_A: - do { - if (codechar == codeend) - { - state_in->step = step_A; - state_in->result = overwrite; - return datachar - data_out; - } - fragment = cbase64__decode_value(*codechar++); - } while (fragment < 0); - *datachar = (fragment & 0x03f) << 2; - case step_B: - do { - if (codechar == codeend) - { - state_in->step = step_B; - state_in->result = overwrite; - return datachar - data_out; - } - fragment = cbase64__decode_value(*codechar++); - } while (fragment < 0); - *datachar++ |= (fragment & 0x030) >> 4; - overwrite = (fragment & 0x00f) << 4; - case step_C: - do { - if (codechar == codeend) - { - state_in->step = step_C; - state_in->result = overwrite; - return datachar - data_out; - } - fragment = cbase64__decode_value(*codechar++); - } while (fragment < 0); - *datachar++ = overwrite | (fragment & 0x03c) >> 2; - overwrite = (fragment & 0x003) << 6; - case step_D: - do { - if (codechar == codeend) - { - state_in->step = step_D; - state_in->result = overwrite; - return datachar - data_out; - } - fragment = cbase64__decode_value(*codechar++); - } while (fragment < 0); - *datachar++ = overwrite | (fragment & 0x03f); - } - } - // control should not reach here - return datachar - data_out; -} - -unsigned int cbase64_encode_blockend(char* code_out, cbase64_encodestate* state_in) -{ - char* codechar = code_out; - switch (state_in->step) - { - case step_B: - *codechar++ = cbase64__encode_value(state_in->result); - *codechar++ = '='; - *codechar++ = '='; - break; - case step_C: - *codechar++ = cbase64__encode_value(state_in->result); - *codechar++ = '='; - break; - case step_A: - break; - } - return codechar - code_out; -} - -#endif // CBASE64_IMPLEMENTATION diff --git a/external/celt-e18de77/config.h b/external/celt-e18de77/config.h index 4abd80d..48ee4c5 100644 --- a/external/celt-e18de77/config.h +++ b/external/celt-e18de77/config.h @@ -24,4 +24,4 @@ #pragma warning(disable : 4996)// This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. #endif -#endif CONFIG_H +#endif // CONFIG_H diff --git a/external/json_checker/JSON_checker.cpp b/external/json_checker/JSON_checker.cpp deleted file mode 100644 index b7c6a6a..0000000 --- a/external/json_checker/JSON_checker.cpp +++ /dev/null @@ -1,398 +0,0 @@ -/* JSON_checker.c */ - -/* 2007-08-24 */ - -/* -Copyright (c) 2005 JSON.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -The Software shall be used for Good, not Evil. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include -#include "json_checker/JSON_checker.h" - -#define __ -1 /* the universal error code */ - -/* - Characters are mapped into these 31 character classes. This allows for - a significant reduction in the size of the state transition table. -*/ - -enum classes { - C_SPACE, /* space */ - C_WHITE, /* other whitespace */ - C_LCURB, /* { */ - C_RCURB, /* } */ - C_LSQRB, /* [ */ - C_RSQRB, /* ] */ - C_COLON, /* : */ - C_COMMA, /* , */ - C_QUOTE, /* " */ - C_BACKS, /* \ */ - C_SLASH, /* / */ - C_PLUS, /* + */ - C_MINUS, /* - */ - C_POINT, /* . */ - C_ZERO , /* 0 */ - C_DIGIT, /* 123456789 */ - C_LOW_A, /* a */ - C_LOW_B, /* b */ - C_LOW_C, /* c */ - C_LOW_D, /* d */ - C_LOW_E, /* e */ - C_LOW_F, /* f */ - C_LOW_L, /* l */ - C_LOW_N, /* n */ - C_LOW_R, /* r */ - C_LOW_S, /* s */ - C_LOW_T, /* t */ - C_LOW_U, /* u */ - C_ABCDF, /* ABCDF */ - C_E, /* E */ - C_ETC, /* everything else */ - NR_CLASSES -}; - -static int ascii_class[128] = { -/* - This array maps the 128 ASCII characters into character classes. - The remaining Unicode characters should be mapped to C_ETC. - Non-whitespace control characters are errors. -*/ - __, __, __, __, __, __, __, __, - __, C_WHITE, C_WHITE, __, __, C_WHITE, __, __, - __, __, __, __, __, __, __, __, - __, __, __, __, __, __, __, __, - - C_SPACE, C_ETC, C_QUOTE, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, - C_ETC, C_ETC, C_ETC, C_PLUS, C_COMMA, C_MINUS, C_POINT, C_SLASH, - C_ZERO, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, - C_DIGIT, C_DIGIT, C_COLON, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, - - C_ETC, C_ABCDF, C_ABCDF, C_ABCDF, C_ABCDF, C_E, C_ABCDF, C_ETC, - C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, - C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, C_ETC, - C_ETC, C_ETC, C_ETC, C_LSQRB, C_BACKS, C_RSQRB, C_ETC, C_ETC, - - C_ETC, C_LOW_A, C_LOW_B, C_LOW_C, C_LOW_D, C_LOW_E, C_LOW_F, C_ETC, - C_ETC, C_ETC, C_ETC, C_ETC, C_LOW_L, C_ETC, C_LOW_N, C_ETC, - C_ETC, C_ETC, C_LOW_R, C_LOW_S, C_LOW_T, C_LOW_U, C_ETC, C_ETC, - C_ETC, C_ETC, C_ETC, C_LCURB, C_ETC, C_RCURB, C_ETC, C_ETC -}; - - -/* - The state codes. -*/ -enum states { - GO, /* start */ - OK, /* ok */ - OB, /* object */ - KE, /* key */ - CO, /* colon */ - VA, /* value */ - AR, /* array */ - ST, /* string */ - ES, /* escape */ - U1, /* u1 */ - U2, /* u2 */ - U3, /* u3 */ - U4, /* u4 */ - MI, /* minus */ - ZE, /* zero */ - IN, /* integer */ - FR, /* fraction */ - E1, /* e */ - E2, /* ex */ - E3, /* exp */ - T1, /* tr */ - T2, /* tru */ - T3, /* true */ - F1, /* fa */ - F2, /* fal */ - F3, /* fals */ - F4, /* false */ - N1, /* nu */ - N2, /* nul */ - N3, /* null */ - NR_STATES -}; - - -static int state_transition_table[NR_STATES][NR_CLASSES] = { -/* - The state transition table takes the current state and the current symbol, - and returns either a new state or an action. An action is represented as a - negative number. A JSON text is accepted if at the end of the text the - state is OK and if the mode is MODE_DONE. - - white 1-9 ABCDF etc - space | { } [ ] : , " \ / + - . 0 | a b c d e f l n r s t u | E |*/ -/*start GO*/ {GO,GO,-6,__,-5,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*ok OK*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*object OB*/ {OB,OB,__,-9,__,__,__,__,ST,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*key KE*/ {KE,KE,__,__,__,__,__,__,ST,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*colon CO*/ {CO,CO,__,__,__,__,-2,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*value VA*/ {VA,VA,-6,__,-5,__,__,__,ST,__,__,__,MI,__,ZE,IN,__,__,__,__,__,F1,__,N1,__,__,T1,__,__,__,__}, -/*array AR*/ {AR,AR,-6,__,-5,-7,__,__,ST,__,__,__,MI,__,ZE,IN,__,__,__,__,__,F1,__,N1,__,__,T1,__,__,__,__}, -/*string ST*/ {ST,__,ST,ST,ST,ST,ST,ST,-4,ES,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST,ST}, -/*escape ES*/ {__,__,__,__,__,__,__,__,ST,ST,ST,__,__,__,__,__,__,ST,__,__,__,ST,__,ST,ST,__,ST,U1,__,__,__}, -/*u1 U1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,U2,U2,U2,U2,U2,U2,U2,U2,__,__,__,__,__,__,U2,U2,__}, -/*u2 U2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,U3,U3,U3,U3,U3,U3,U3,U3,__,__,__,__,__,__,U3,U3,__}, -/*u3 U3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,U4,U4,U4,U4,U4,U4,U4,U4,__,__,__,__,__,__,U4,U4,__}, -/*u4 U4*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,ST,ST,ST,ST,ST,ST,ST,ST,__,__,__,__,__,__,ST,ST,__}, -/*minus MI*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,ZE,IN,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*zero ZE*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,FR,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*int IN*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,FR,IN,IN,__,__,__,__,E1,__,__,__,__,__,__,__,__,E1,__}, -/*frac FR*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,__,FR,FR,__,__,__,__,E1,__,__,__,__,__,__,__,__,E1,__}, -/*e E1*/ {__,__,__,__,__,__,__,__,__,__,__,E2,E2,__,E3,E3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*ex E2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,E3,E3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*exp E3*/ {OK,OK,__,-8,__,-7,__,-3,__,__,__,__,__,__,E3,E3,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*tr T1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,T2,__,__,__,__,__,__}, -/*tru T2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,T3,__,__,__}, -/*true T3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,OK,__,__,__,__,__,__,__,__,__,__}, -/*fa F1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F2,__,__,__,__,__,__,__,__,__,__,__,__,__,__}, -/*fal F2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F3,__,__,__,__,__,__,__,__}, -/*fals F3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,F4,__,__,__,__,__}, -/*false F4*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,OK,__,__,__,__,__,__,__,__,__,__}, -/*nu N1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,N2,__,__,__}, -/*nul N2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,N3,__,__,__,__,__,__,__,__}, -/*null N3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,OK,__,__,__,__,__,__,__,__}, -}; - - -/* - These modes can be pushed on the stack. -*/ -enum modes { - MODE_ARRAY, - MODE_DONE, - MODE_KEY, - MODE_OBJECT, -}; - -static bool -reject(JSON_checker jc) -{ -/* - Delete the JSON_checker object. -*/ - free((void*)jc->stack); - free((void*)jc); - return false; -} - - -static bool -push(JSON_checker jc, int mode) -{ -/* - Push a mode onto the stack. Return false if there is overflow. -*/ - jc->top += 1; - if (jc->top >= jc->depth) { - return false; - } - jc->stack[jc->top] = mode; - return true; -} - - -static bool -pop(JSON_checker jc, int mode) -{ -/* - Pop the stack, assuring that the current mode matches the expectation. - Return false if there is underflow or if the modes mismatch. -*/ - if (jc->top < 0 || jc->stack[jc->top] != mode) { - return false; - } - jc->top -= 1; - return true; -} - - -JSON_checker -new_JSON_checker(int depth) -{ -/* - new_JSON_checker starts the checking process by constructing a JSON_checker - object. It takes a depth parameter that restricts the level of maximum - nesting. - - To continue the process, call JSON_checker_char for each character in the - JSON text, and then call JSON_checker_done to obtain the final result. - These functions are fully reentrant. - - The JSON_checker object will be deleted by JSON_checker_done. - JSON_checker_char will delete the JSON_checker object if it sees an error. -*/ - JSON_checker jc = (JSON_checker)malloc(sizeof(struct JSON_checker_struct)); - jc->state = GO; - jc->depth = depth; - jc->top = -1; - jc->stack = (int*)calloc(depth, sizeof(int)); - push(jc, MODE_DONE); - return jc; -} - - -bool -JSON_checker_char(JSON_checker jc, int next_char) -{ -/* - After calling new_JSON_checker, call this function for each character (or - partial character) in your JSON text. It can accept UTF-8, UTF-16, or - UTF-32. It returns true if things are looking ok so far. If it rejects the - text, it deletes the JSON_checker object and returns false. -*/ - int next_class, next_state; -/* - Determine the character's class. -*/ - if (next_char < 0) { - return reject(jc); - } - if (next_char >= 128) { - next_class = C_ETC; - } else { - next_class = ascii_class[next_char]; - if (next_class <= __) { - return reject(jc); - } - } -/* - Get the next state from the state transition table. -*/ - next_state = state_transition_table[jc->state][next_class]; - if (next_state >= 0) { -/* - Change the state. -*/ - jc->state = next_state; - } else { -/* - Or perform one of the actions. -*/ - switch (next_state) { -/* empty } */ - case -9: - if (!pop(jc, MODE_KEY)) { - return reject(jc); - } - jc->state = OK; - break; - -/* } */ case -8: - if (!pop(jc, MODE_OBJECT)) { - return reject(jc); - } - jc->state = OK; - break; - -/* ] */ case -7: - if (!pop(jc, MODE_ARRAY)) { - return reject(jc); - } - jc->state = OK; - break; - -/* { */ case -6: - if (!push(jc, MODE_KEY)) { - return reject(jc); - } - jc->state = OB; - break; - -/* [ */ case -5: - if (!push(jc, MODE_ARRAY)) { - return reject(jc); - } - jc->state = AR; - break; - -/* " */ case -4: - switch (jc->stack[jc->top]) { - case MODE_KEY: - jc->state = CO; - break; - case MODE_ARRAY: - case MODE_OBJECT: - jc->state = OK; - break; - default: - return reject(jc); - } - break; - -/* , */ case -3: - switch (jc->stack[jc->top]) { - case MODE_OBJECT: -/* - A comma causes a flip from object mode to key mode. -*/ - if (!pop(jc, MODE_OBJECT) || !push(jc, MODE_KEY)) { - return reject(jc); - } - jc->state = KE; - break; - case MODE_ARRAY: - jc->state = VA; - break; - default: - return reject(jc); - } - break; - -/* : */ case -2: -/* - A colon causes a flip from key mode to object mode. -*/ - if (!pop(jc, MODE_KEY) || !push(jc, MODE_OBJECT)) { - return reject(jc); - } - jc->state = VA; - break; -/* - Bad action. -*/ - default: - return reject(jc); - } - } - return true; -} - - -bool -JSON_checker_done(JSON_checker jc) -{ -/* - The JSON_checker_done function should be called after all of the characters - have been processed, but only if every call to JSON_checker_char returned - true. This function deletes the JSON_checker and returns true if the JSON - text was accepted. -*/ - int result = jc->state == OK && pop(jc, MODE_DONE); - reject(jc); - return (result != 0); -} diff --git a/external/json_checker/include/json_checker/JSON_checker.h b/external/json_checker/include/json_checker/JSON_checker.h deleted file mode 100644 index 5a7be32..0000000 --- a/external/json_checker/include/json_checker/JSON_checker.h +++ /dev/null @@ -1,17 +0,0 @@ - -#pragma once - -/* JSON_checker.h */ - -typedef struct JSON_checker_struct { - int state; - int depth; - int top; - int* stack; -} * JSON_checker; - - -JSON_checker new_JSON_checker(int depth); -bool JSON_checker_char(JSON_checker jc, int next_char); -bool JSON_checker_done(JSON_checker jc); - diff --git a/external/rapidjson-1.0.2/CHANGELOG.md b/external/rapidjson-1.0.2/CHANGELOG.md deleted file mode 100644 index 8ad9b3c..0000000 --- a/external/rapidjson-1.0.2/CHANGELOG.md +++ /dev/null @@ -1,79 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## [Unreleased] - -## [1.0.2] - 2015-05-14 - -### Added -* Add Value::XXXMember(...) overloads for std::string (#335) - -### Fixed -* Include rapidjson.h for all internal/error headers. -* Parsing some numbers incorrectly in full-precision mode (`kFullPrecisionParseFlag`) (#342) -* Fix alignment of 64bit platforms (#328) -* Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502573f1afd3341073dd24b12c3db20fbde4) - -### Changed -* CMakeLists for include as a thirdparty in projects (#334, #337) -* Change Document::ParseStream() to use stack allocator for Reader (ffbe38614732af8e0b3abdc8b50071f386a4a685) - -## [1.0.1] - 2015-04-25 - -### Added -* Changelog following [Keep a CHANGELOG](https://github.com/olivierlacan/keep-a-changelog) suggestions. - -### Fixed -* Parsing of some numbers (e.g. "1e-00011111111111") causing assertion (#314). -* Visual C++ 32-bit compilation error in `diyfp.h` (#317). - -## [1.0.0] - 2015-04-22 - -### Added -* 100% [Coverall](https://coveralls.io/r/miloyip/rapidjson?branch=master) coverage. -* Version macros (#311) - -### Fixed -* A bug in trimming long number sequence (4824f12efbf01af72b8cb6fc96fae7b097b73015). -* Double quote in unicode escape (#288). -* Negative zero roundtrip (double only) (#289). -* Standardize behavior of `memcpy()` and `malloc()` (0c5c1538dcfc7f160e5a4aa208ddf092c787be5a, #305, 0e8bbe5e3ef375e7f052f556878be0bd79e9062d). - -### Removed -* Remove an invalid `Document::ParseInsitu()` API (e7f1c6dd08b522cfcf9aed58a333bd9a0c0ccbeb). - -## 1.0-beta - 2015-04-8 - -### Added -* RFC 7159 (#101) -* Optional Iterative Parser (#76) -* Deep-copy values (#20) -* Error code and message (#27) -* ASCII Encoding (#70) -* `kParseStopWhenDoneFlag` (#83) -* `kParseFullPrecisionFlag` (881c91d696f06b7f302af6d04ec14dd08db66ceb) -* Add `Key()` to handler concept (#134) -* C++11 compatibility and support (#128) -* Optimized number-to-string and vice versa conversions (#137, #80) -* Short-String Optimization (#131) -* Local stream optimization by traits (#32) -* Travis & Appveyor Continuous Integration, with Valgrind verification (#24, #242) -* Redo all documentation (English, Simplified Chinese) - -### Changed -* Copyright ownership transfered to THL A29 Limited (a Tencent company). -* Migrating from Premake to CMAKE (#192) -* Resolve all warning reports - -### Removed -* Remove other JSON libraries for performance comparison (#180) - -## 0.11 - 2012-11-16 - -## 0.1 - 2011-11-18 - -[Unreleased]: https://github.com/miloyip/rapidjson/compare/v1.0.2...HEAD -[1.0.2]: https://github.com/miloyip/rapidjson/compare/v1.0.1...v1.0.2 -[1.0.1]: https://github.com/miloyip/rapidjson/compare/v1.0.0...v1.0.1 -[1.0.0]: https://github.com/miloyip/rapidjson/compare/v1.0-beta...v1.0.0 diff --git a/external/rapidjson-1.0.2/include/rapidjson/allocators.h b/external/rapidjson-1.0.2/include/rapidjson/allocators.h deleted file mode 100644 index d74a671..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/allocators.h +++ /dev/null @@ -1,261 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_ALLOCATORS_H_ -#define RAPIDJSON_ALLOCATORS_H_ - -#include "rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Allocator - -/*! \class rapidjson::Allocator - \brief Concept for allocating, resizing and freeing memory block. - - Note that Malloc() and Realloc() are non-static but Free() is static. - - So if an allocator need to support Free(), it needs to put its pointer in - the header of memory block. - -\code -concept Allocator { - static const bool kNeedFree; //!< Whether this allocator needs to call Free(). - - // Allocate a memory block. - // \param size of the memory block in bytes. - // \returns pointer to the memory block. - void* Malloc(size_t size); - - // Resize a memory block. - // \param originalPtr The pointer to current memory block. Null pointer is permitted. - // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.) - // \param newSize the new size in bytes. - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize); - - // Free a memory block. - // \param pointer to the memory block. Null pointer is permitted. - static void Free(void *ptr); -}; -\endcode -*/ - -/////////////////////////////////////////////////////////////////////////////// -// CrtAllocator - -//! C-runtime library allocator. -/*! This class is just wrapper for standard C library memory routines. - \note implements Allocator concept -*/ -class CrtAllocator { -public: - static const bool kNeedFree = true; - void* Malloc(size_t size) { - if (size) // behavior of malloc(0) is implementation defined. - return std::malloc(size); - else - return NULL; // standardize to returning NULL. - } - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { - (void)originalSize; - if (newSize == 0) { - std::free(originalPtr); - return NULL; - } - return std::realloc(originalPtr, newSize); - } - static void Free(void *ptr) { std::free(ptr); } -}; - -/////////////////////////////////////////////////////////////////////////////// -// MemoryPoolAllocator - -//! Default memory allocator used by the parser and DOM. -/*! This allocator allocate memory blocks from pre-allocated memory chunks. - - It does not free memory blocks. And Realloc() only allocate new memory. - - The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default. - - User may also supply a buffer as the first chunk. - - If the user-buffer is full then additional chunks are allocated by BaseAllocator. - - The user-buffer is not deallocated by this allocator. - - \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator. - \note implements Allocator concept -*/ -template -class MemoryPoolAllocator { -public: - static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator) - - //! Constructor with chunkSize. - /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. - \param baseAllocator The allocator for allocating memory chunks. - */ - MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : - chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(0), baseAllocator_(baseAllocator), ownBaseAllocator_(0) - { - } - - //! Constructor with user-supplied buffer. - /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size. - - The user buffer will not be deallocated when this allocator is destructed. - - \param buffer User supplied buffer. - \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader). - \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. - \param baseAllocator The allocator for allocating memory chunks. - */ - MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : - chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(buffer), baseAllocator_(baseAllocator), ownBaseAllocator_(0) - { - RAPIDJSON_ASSERT(buffer != 0); - RAPIDJSON_ASSERT(size > sizeof(ChunkHeader)); - chunkHead_ = reinterpret_cast(buffer); - chunkHead_->capacity = size - sizeof(ChunkHeader); - chunkHead_->size = 0; - chunkHead_->next = 0; - } - - //! Destructor. - /*! This deallocates all memory chunks, excluding the user-supplied buffer. - */ - ~MemoryPoolAllocator() { - Clear(); - RAPIDJSON_DELETE(ownBaseAllocator_); - } - - //! Deallocates all memory chunks, excluding the user-supplied buffer. - void Clear() { - while (chunkHead_ && chunkHead_ != userBuffer_) { - ChunkHeader* next = chunkHead_->next; - baseAllocator_->Free(chunkHead_); - chunkHead_ = next; - } - if (chunkHead_ && chunkHead_ == userBuffer_) - chunkHead_->size = 0; // Clear user buffer - } - - //! Computes the total capacity of allocated memory chunks. - /*! \return total capacity in bytes. - */ - size_t Capacity() const { - size_t capacity = 0; - for (ChunkHeader* c = chunkHead_; c != 0; c = c->next) - capacity += c->capacity; - return capacity; - } - - //! Computes the memory blocks allocated. - /*! \return total used bytes. - */ - size_t Size() const { - size_t size = 0; - for (ChunkHeader* c = chunkHead_; c != 0; c = c->next) - size += c->size; - return size; - } - - //! Allocates a memory block. (concept Allocator) - void* Malloc(size_t size) { - if (!size) - return NULL; - - size = RAPIDJSON_ALIGN(size); - if (chunkHead_ == 0 || chunkHead_->size + size > chunkHead_->capacity) - AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size); - - void *buffer = reinterpret_cast(chunkHead_ + 1) + chunkHead_->size; - chunkHead_->size += size; - return buffer; - } - - //! Resizes a memory block (concept Allocator) - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { - if (originalPtr == 0) - return Malloc(newSize); - - if (newSize == 0) - return NULL; - - // Do not shrink if new size is smaller than original - if (originalSize >= newSize) - return originalPtr; - - // Simply expand it if it is the last allocation and there is sufficient space - if (originalPtr == (char *)(chunkHead_ + 1) + chunkHead_->size - originalSize) { - size_t increment = static_cast(newSize - originalSize); - increment = RAPIDJSON_ALIGN(increment); - if (chunkHead_->size + increment <= chunkHead_->capacity) { - chunkHead_->size += increment; - return originalPtr; - } - } - - // Realloc process: allocate and copy memory, do not free original buffer. - void* newBuffer = Malloc(newSize); - RAPIDJSON_ASSERT(newBuffer != 0); // Do not handle out-of-memory explicitly. - if (originalSize) - std::memcpy(newBuffer, originalPtr, originalSize); - return newBuffer; - } - - //! Frees a memory block (concept Allocator) - static void Free(void *ptr) { (void)ptr; } // Do nothing - -private: - //! Copy constructor is not permitted. - MemoryPoolAllocator(const MemoryPoolAllocator& rhs) /* = delete */; - //! Copy assignment operator is not permitted. - MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) /* = delete */; - - //! Creates a new chunk. - /*! \param capacity Capacity of the chunk in bytes. - */ - void AddChunk(size_t capacity) { - if (!baseAllocator_) - ownBaseAllocator_ = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator()); - ChunkHeader* chunk = reinterpret_cast(baseAllocator_->Malloc(sizeof(ChunkHeader) + capacity)); - chunk->capacity = capacity; - chunk->size = 0; - chunk->next = chunkHead_; - chunkHead_ = chunk; - } - - static const int kDefaultChunkCapacity = 64 * 1024; //!< Default chunk capacity. - - //! Chunk header for perpending to each chunk. - /*! Chunks are stored as a singly linked list. - */ - struct ChunkHeader { - size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself). - size_t size; //!< Current size of allocated memory in bytes. - ChunkHeader *next; //!< Next chunk in the linked list. - }; - - ChunkHeader *chunkHead_; //!< Head of the chunk linked-list. Only the head chunk serves allocation. - size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated. - void *userBuffer_; //!< User supplied buffer. - BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks. - BaseAllocator* ownBaseAllocator_; //!< base allocator created by this object. -}; - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_ENCODINGS_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/document.h b/external/rapidjson-1.0.2/include/rapidjson/document.h deleted file mode 100644 index c6acbd9..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/document.h +++ /dev/null @@ -1,2014 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_DOCUMENT_H_ -#define RAPIDJSON_DOCUMENT_H_ - -/*! \file document.h */ - -#include "reader.h" -#include "internal/meta.h" -#include "internal/strfunc.h" -#include // placement new - -#ifdef _MSC_VER -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -#elif defined(__GNUC__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_HAS_STDSTRING - -#ifndef RAPIDJSON_HAS_STDSTRING -#ifdef RAPIDJSON_DOXYGEN_RUNNING -#define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation -#else -#define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default -#endif -/*! \def RAPIDJSON_HAS_STDSTRING - \ingroup RAPIDJSON_CONFIG - \brief Enable RapidJSON support for \c std::string - - By defining this preprocessor symbol to \c 1, several convenience functions for using - \ref rapidjson::GenericValue with \c std::string are enabled, especially - for construction and comparison. - - \hideinitializer -*/ -#endif // !defined(RAPIDJSON_HAS_STDSTRING) - -#if RAPIDJSON_HAS_STDSTRING -#include -#endif // RAPIDJSON_HAS_STDSTRING - -#ifndef RAPIDJSON_NOMEMBERITERATORCLASS -#include // std::iterator, std::random_access_iterator_tag -#endif - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS -#include // std::move -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -// Forward declaration. -template -class GenericValue; - -//! Name-value pair in a JSON object value. -/*! - This class was internal to GenericValue. It used to be a inner struct. - But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct. - https://code.google.com/p/rapidjson/issues/detail?id=64 -*/ -template -struct GenericMember { - GenericValue name; //!< name of member (must be a string) - GenericValue value; //!< value of member. -}; - -/////////////////////////////////////////////////////////////////////////////// -// GenericMemberIterator - -#ifndef RAPIDJSON_NOMEMBERITERATORCLASS - -//! (Constant) member iterator for a JSON object value -/*! - \tparam Const Is this a constant iterator? - \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) - \tparam Allocator Allocator type for allocating memory of object, array and string. - - This class implements a Random Access Iterator for GenericMember elements - of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements]. - - \note This iterator implementation is mainly intended to avoid implicit - conversions from iterator values to \c NULL, - e.g. from GenericValue::FindMember. - - \note Define \c RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a - pointer-based implementation, if your platform doesn't provide - the C++ header. - - \see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator - */ -template -class GenericMemberIterator - : public std::iterator >::Type> { - - friend class GenericValue; - template friend class GenericMemberIterator; - - typedef GenericMember PlainType; - typedef typename internal::MaybeAddConst::Type ValueType; - typedef std::iterator BaseType; - -public: - //! Iterator type itself - typedef GenericMemberIterator Iterator; - //! Constant iterator type - typedef GenericMemberIterator ConstIterator; - //! Non-constant iterator type - typedef GenericMemberIterator NonConstIterator; - - //! Pointer to (const) GenericMember - typedef typename BaseType::pointer Pointer; - //! Reference to (const) GenericMember - typedef typename BaseType::reference Reference; - //! Signed integer type (e.g. \c ptrdiff_t) - typedef typename BaseType::difference_type DifferenceType; - - //! Default constructor (singular value) - /*! Creates an iterator pointing to no element. - \note All operations, except for comparisons, are undefined on such values. - */ - GenericMemberIterator() : ptr_() {} - - //! Iterator conversions to more const - /*! - \param it (Non-const) iterator to copy from - - Allows the creation of an iterator from another GenericMemberIterator - that is "less const". Especially, creating a non-constant iterator - from a constant iterator are disabled: - \li const -> non-const (not ok) - \li const -> const (ok) - \li non-const -> const (ok) - \li non-const -> non-const (ok) - - \note If the \c Const template parameter is already \c false, this - constructor effectively defines a regular copy-constructor. - Otherwise, the copy constructor is implicitly defined. - */ - GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {} - - //! @name stepping - //@{ - Iterator& operator++(){ ++ptr_; return *this; } - Iterator& operator--(){ --ptr_; return *this; } - Iterator operator++(int){ Iterator old(*this); ++ptr_; return old; } - Iterator operator--(int){ Iterator old(*this); --ptr_; return old; } - //@} - - //! @name increment/decrement - //@{ - Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); } - Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); } - - Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; } - Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; } - //@} - - //! @name relations - //@{ - bool operator==(ConstIterator that) const { return ptr_ == that.ptr_; } - bool operator!=(ConstIterator that) const { return ptr_ != that.ptr_; } - bool operator<=(ConstIterator that) const { return ptr_ <= that.ptr_; } - bool operator>=(ConstIterator that) const { return ptr_ >= that.ptr_; } - bool operator< (ConstIterator that) const { return ptr_ < that.ptr_; } - bool operator> (ConstIterator that) const { return ptr_ > that.ptr_; } - //@} - - //! @name dereference - //@{ - Reference operator*() const { return *ptr_; } - Pointer operator->() const { return ptr_; } - Reference operator[](DifferenceType n) const { return ptr_[n]; } - //@} - - //! Distance - DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; } - -private: - //! Internal constructor from plain pointer - explicit GenericMemberIterator(Pointer p) : ptr_(p) {} - - Pointer ptr_; //!< raw pointer -}; - -#else // RAPIDJSON_NOMEMBERITERATORCLASS - -// class-based member iterator implementation disabled, use plain pointers - -template -struct GenericMemberIterator; - -//! non-const GenericMemberIterator -template -struct GenericMemberIterator { - //! use plain pointer as iterator type - typedef GenericMember* Iterator; -}; -//! const GenericMemberIterator -template -struct GenericMemberIterator { - //! use plain const pointer as iterator type - typedef const GenericMember* Iterator; -}; - -#endif // RAPIDJSON_NOMEMBERITERATORCLASS - -/////////////////////////////////////////////////////////////////////////////// -// GenericStringRef - -//! Reference to a constant string (not taking a copy) -/*! - \tparam CharType character type of the string - - This helper class is used to automatically infer constant string - references for string literals, especially from \c const \b (!) - character arrays. - - The main use is for creating JSON string values without copying the - source string via an \ref Allocator. This requires that the referenced - string pointers have a sufficient lifetime, which exceeds the lifetime - of the associated GenericValue. - - \b Example - \code - Value v("foo"); // ok, no need to copy & calculate length - const char foo[] = "foo"; - v.SetString(foo); // ok - - const char* bar = foo; - // Value x(bar); // not ok, can't rely on bar's lifetime - Value x(StringRef(bar)); // lifetime explicitly guaranteed by user - Value y(StringRef(bar, 3)); // ok, explicitly pass length - \endcode - - \see StringRef, GenericValue::SetString -*/ -template -struct GenericStringRef { - typedef CharType Ch; //!< character type of the string - - //! Create string reference from \c const character array - /*! - This constructor implicitly creates a constant string reference from - a \c const character array. It has better performance than - \ref StringRef(const CharType*) by inferring the string \ref length - from the array length, and also supports strings containing null - characters. - - \tparam N length of the string, automatically inferred - - \param str Constant character array, lifetime assumed to be longer - than the use of the string in e.g. a GenericValue - - \post \ref s == str - - \note Constant complexity. - \note There is a hidden, private overload to disallow references to - non-const character arrays to be created via this constructor. - By this, e.g. function-scope arrays used to be filled via - \c snprintf are excluded from consideration. - In such cases, the referenced string should be \b copied to the - GenericValue instead. - */ - template - GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT - : s(str), length(N-1) {} - - //! Explicitly create string reference from \c const character pointer - /*! - This constructor can be used to \b explicitly create a reference to - a constant string pointer. - - \see StringRef(const CharType*) - - \param str Constant character pointer, lifetime assumed to be longer - than the use of the string in e.g. a GenericValue - - \post \ref s == str - - \note There is a hidden, private overload to disallow references to - non-const character arrays to be created via this constructor. - By this, e.g. function-scope arrays used to be filled via - \c snprintf are excluded from consideration. - In such cases, the referenced string should be \b copied to the - GenericValue instead. - */ - explicit GenericStringRef(const CharType* str) - : s(str), length(internal::StrLen(str)){ RAPIDJSON_ASSERT(s != NULL); } - - //! Create constant string reference from pointer and length - /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \param len length of the string, excluding the trailing NULL terminator - - \post \ref s == str && \ref length == len - \note Constant complexity. - */ - GenericStringRef(const CharType* str, SizeType len) - : s(str), length(len) { RAPIDJSON_ASSERT(s != NULL); } - - //! implicit conversion to plain CharType pointer - operator const Ch *() const { return s; } - - const Ch* const s; //!< plain CharType pointer - const SizeType length; //!< length of the string (excluding the trailing NULL terminator) - -private: - //! Disallow copy-assignment - GenericStringRef operator=(const GenericStringRef&); - //! Disallow construction from non-const array - template - GenericStringRef(CharType (&str)[N]) /* = delete */; -}; - -//! Mark a character pointer as constant string -/*! Mark a plain character pointer as a "string literal". This function - can be used to avoid copying a character string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - \tparam CharType Character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \return GenericStringRef string reference object - \relatesalso GenericStringRef - - \see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember -*/ -template -inline GenericStringRef StringRef(const CharType* str) { - return GenericStringRef(str, internal::StrLen(str)); -} - -//! Mark a character pointer as constant string -/*! Mark a plain character pointer as a "string literal". This function - can be used to avoid copying a character string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - - This version has better performance with supplied length, and also - supports string containing null characters. - - \tparam CharType character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \param length The length of source string. - \return GenericStringRef string reference object - \relatesalso GenericStringRef -*/ -template -inline GenericStringRef StringRef(const CharType* str, size_t length) { - return GenericStringRef(str, SizeType(length)); -} - -#if RAPIDJSON_HAS_STDSTRING -//! Mark a string object as constant string -/*! Mark a string object (e.g. \c std::string) as a "string literal". - This function can be used to avoid copying a string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - - \tparam CharType character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \return GenericStringRef string reference object - \relatesalso GenericStringRef - \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. -*/ -template -inline GenericStringRef StringRef(const std::basic_string& str) { - return GenericStringRef(str.data(), SizeType(str.size())); -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// GenericValue type traits -namespace internal { - -template -struct IsGenericValueImpl : FalseType {}; - -// select candidates according to nested encoding and allocator types -template struct IsGenericValueImpl::Type, typename Void::Type> - : IsBaseOf, T>::Type {}; - -// helper to match arbitrary GenericValue instantiations, including derived classes -template struct IsGenericValue : IsGenericValueImpl::Type {}; - -} // namespace internal - -/////////////////////////////////////////////////////////////////////////////// -// GenericValue - -//! Represents a JSON value. Use Value for UTF8 encoding and default allocator. -/*! - A JSON value can be one of 7 types. This class is a variant type supporting - these types. - - Use the Value if UTF8 and default allocator - - \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) - \tparam Allocator Allocator type for allocating memory of object, array and string. -*/ -template > -class GenericValue { -public: - //! Name-value pair in an object. - typedef GenericMember Member; - typedef Encoding EncodingType; //!< Encoding type from template parameter. - typedef Allocator AllocatorType; //!< Allocator type from template parameter. - typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. - typedef GenericStringRef StringRefType; //!< Reference to a constant string - typedef typename GenericMemberIterator::Iterator MemberIterator; //!< Member iterator for iterating in object. - typedef typename GenericMemberIterator::Iterator ConstMemberIterator; //!< Constant member iterator for iterating in object. - typedef GenericValue* ValueIterator; //!< Value iterator for iterating in array. - typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array. - typedef GenericValue ValueType; //!< Value type of itself. - - //!@name Constructors and destructor. - //@{ - - //! Default constructor creates a null value. - GenericValue() RAPIDJSON_NOEXCEPT : data_(), flags_(kNullFlag) {} - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericValue(GenericValue&& rhs) RAPIDJSON_NOEXCEPT : data_(rhs.data_), flags_(rhs.flags_) { - rhs.flags_ = kNullFlag; // give up contents - } -#endif - -private: - //! Copy constructor is not permitted. - GenericValue(const GenericValue& rhs); - -public: - - //! Constructor with JSON value type. - /*! This creates a Value of specified type with default content. - \param type Type of the value. - \note Default content for number is zero. - */ - explicit GenericValue(Type type) RAPIDJSON_NOEXCEPT : data_(), flags_() { - static const unsigned defaultFlags[7] = { - kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag, - kNumberAnyFlag - }; - RAPIDJSON_ASSERT(type <= kNumberType); - flags_ = defaultFlags[type]; - - // Use ShortString to store empty string. - if (type == kStringType) - data_.ss.SetLength(0); - } - - //! Explicit copy constructor (with allocator) - /*! Creates a copy of a Value by using the given Allocator - \tparam SourceAllocator allocator of \c rhs - \param rhs Value to copy from (read-only) - \param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator(). - \see CopyFrom() - */ - template< typename SourceAllocator > - GenericValue(const GenericValue& rhs, Allocator & allocator); - - //! Constructor for boolean value. - /*! \param b Boolean value - \note This constructor is limited to \em real boolean values and rejects - implicitly converted types like arbitrary pointers. Use an explicit cast - to \c bool, if you want to construct a boolean JSON value in such cases. - */ -#ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen - template - explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame))) RAPIDJSON_NOEXCEPT -#else - explicit GenericValue(bool b) RAPIDJSON_NOEXCEPT -#endif - : data_(), flags_(b ? kTrueFlag : kFalseFlag) { - // safe-guard against failing SFINAE - RAPIDJSON_STATIC_ASSERT((internal::IsSame::Value)); - } - - //! Constructor for int value. - explicit GenericValue(int i) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberIntFlag) { - data_.n.i64 = i; - if (i >= 0) - flags_ |= kUintFlag | kUint64Flag; - } - - //! Constructor for unsigned value. - explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberUintFlag) { - data_.n.u64 = u; - if (!(u & 0x80000000)) - flags_ |= kIntFlag | kInt64Flag; - } - - //! Constructor for int64_t value. - explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberInt64Flag) { - data_.n.i64 = i64; - if (i64 >= 0) { - flags_ |= kNumberUint64Flag; - if (!(static_cast(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) - flags_ |= kUintFlag; - if (!(static_cast(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - flags_ |= kIntFlag; - } - else if (i64 >= static_cast(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - flags_ |= kIntFlag; - } - - //! Constructor for uint64_t value. - explicit GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberUint64Flag) { - data_.n.u64 = u64; - if (!(u64 & RAPIDJSON_UINT64_C2(0x80000000, 0x00000000))) - flags_ |= kInt64Flag; - if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) - flags_ |= kUintFlag; - if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - flags_ |= kIntFlag; - } - - //! Constructor for double value. - explicit GenericValue(double d) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberDoubleFlag) { data_.n.d = d; } - - //! Constructor for constant string (i.e. do not make a copy of string) - GenericValue(const Ch* s, SizeType length) RAPIDJSON_NOEXCEPT : data_(), flags_() { SetStringRaw(StringRef(s, length)); } - - //! Constructor for constant string (i.e. do not make a copy of string) - explicit GenericValue(StringRefType s) RAPIDJSON_NOEXCEPT : data_(), flags_() { SetStringRaw(s); } - - //! Constructor for copy-string (i.e. do make a copy of string) - GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s, length), allocator); } - - //! Constructor for copy-string (i.e. do make a copy of string) - GenericValue(const Ch*s, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s), allocator); } - -#if RAPIDJSON_HAS_STDSTRING - //! Constructor for copy-string from a string object (i.e. do make a copy of string) - /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. - */ - GenericValue(const std::basic_string& s, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s), allocator); } -#endif - - //! Destructor. - /*! Need to destruct elements of array, members of object, or copy-string. - */ - ~GenericValue() { - if (Allocator::kNeedFree) { // Shortcut by Allocator's trait - switch(flags_) { - case kArrayFlag: - for (GenericValue* v = data_.a.elements; v != data_.a.elements + data_.a.size; ++v) - v->~GenericValue(); - Allocator::Free(data_.a.elements); - break; - - case kObjectFlag: - for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) - m->~Member(); - Allocator::Free(data_.o.members); - break; - - case kCopyStringFlag: - Allocator::Free(const_cast(data_.s.str)); - break; - - default: - break; // Do nothing for other types. - } - } - } - - //@} - - //!@name Assignment operators - //@{ - - //! Assignment with move semantics. - /*! \param rhs Source of the assignment. It will become a null value after assignment. - */ - GenericValue& operator=(GenericValue& rhs) RAPIDJSON_NOEXCEPT { - RAPIDJSON_ASSERT(this != &rhs); - this->~GenericValue(); - RawAssign(rhs); - return *this; - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move assignment in C++11 - GenericValue& operator=(GenericValue&& rhs) RAPIDJSON_NOEXCEPT { - return *this = rhs.Move(); - } -#endif - - //! Assignment of constant string reference (no copy) - /*! \param str Constant string reference to be assigned - \note This overload is needed to avoid clashes with the generic primitive type assignment overload below. - \see GenericStringRef, operator=(T) - */ - GenericValue& operator=(StringRefType str) RAPIDJSON_NOEXCEPT { - GenericValue s(str); - return *this = s; - } - - //! Assignment with primitive types. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param value The value to be assigned. - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref SetString(const Ch*, Allocator&) (for copying) or - \ref StringRef() (to explicitly mark the pointer as constant) instead. - All other pointer types would implicitly convert to \c bool, - use \ref SetBool() instead. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer), (GenericValue&)) - operator=(T value) { - GenericValue v(value); - return *this = v; - } - - //! Deep-copy assignment from Value - /*! Assigns a \b copy of the Value to the current Value object - \tparam SourceAllocator Allocator type of \c rhs - \param rhs Value to copy from (read-only) - \param allocator Allocator to use for copying - */ - template - GenericValue& CopyFrom(const GenericValue& rhs, Allocator& allocator) { - RAPIDJSON_ASSERT((void*)this != (void const*)&rhs); - this->~GenericValue(); - new (this) GenericValue(rhs, allocator); - return *this; - } - - //! Exchange the contents of this value with those of other. - /*! - \param other Another value. - \note Constant complexity. - */ - GenericValue& Swap(GenericValue& other) RAPIDJSON_NOEXCEPT { - GenericValue temp; - temp.RawAssign(*this); - RawAssign(other); - other.RawAssign(temp); - return *this; - } - - //! Prepare Value for move semantics - /*! \return *this */ - GenericValue& Move() RAPIDJSON_NOEXCEPT { return *this; } - //@} - - //!@name Equal-to and not-equal-to operators - //@{ - //! Equal-to operator - /*! - \note If an object contains duplicated named member, comparing equality with any object is always \c false. - \note Linear time complexity (number of all values in the subtree and total lengths of all strings). - */ - template - bool operator==(const GenericValue& rhs) const { - typedef GenericValue RhsType; - if (GetType() != rhs.GetType()) - return false; - - switch (GetType()) { - case kObjectType: // Warning: O(n^2) inner-loop - if (data_.o.size != rhs.data_.o.size) - return false; - for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) { - typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name); - if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value) - return false; - } - return true; - - case kArrayType: - if (data_.a.size != rhs.data_.a.size) - return false; - for (SizeType i = 0; i < data_.a.size; i++) - if ((*this)[i] != rhs[i]) - return false; - return true; - - case kStringType: - return StringEqual(rhs); - - case kNumberType: - if (IsDouble() || rhs.IsDouble()) { - double a = GetDouble(); // May convert from integer to double. - double b = rhs.GetDouble(); // Ditto - return a >= b && a <= b; // Prevent -Wfloat-equal - } - else - return data_.n.u64 == rhs.data_.n.u64; - - default: // kTrueType, kFalseType, kNullType - return true; - } - } - - //! Equal-to operator with const C-string pointer - bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); } - -#if RAPIDJSON_HAS_STDSTRING - //! Equal-to operator with string object - /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. - */ - bool operator==(const std::basic_string& rhs) const { return *this == GenericValue(StringRef(rhs)); } -#endif - - //! Equal-to operator with primitive types - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false - */ - template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr,internal::IsGenericValue >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); } - - //! Not-equal-to operator - /*! \return !(*this == rhs) - */ - template - bool operator!=(const GenericValue& rhs) const { return !(*this == rhs); } - - //! Not-equal-to operator with const C-string pointer - bool operator!=(const Ch* rhs) const { return !(*this == rhs); } - - //! Not-equal-to operator with arbitrary types - /*! \return !(*this == rhs) - */ - template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } - - //! Equal-to operator with arbitrary types (symmetric version) - /*! \return (rhs == lhs) - */ - template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; } - - //! Not-Equal-to operator with arbitrary types (symmetric version) - /*! \return !(rhs == lhs) - */ - template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); } - //@} - - //!@name Type - //@{ - - Type GetType() const { return static_cast(flags_ & kTypeMask); } - bool IsNull() const { return flags_ == kNullFlag; } - bool IsFalse() const { return flags_ == kFalseFlag; } - bool IsTrue() const { return flags_ == kTrueFlag; } - bool IsBool() const { return (flags_ & kBoolFlag) != 0; } - bool IsObject() const { return flags_ == kObjectFlag; } - bool IsArray() const { return flags_ == kArrayFlag; } - bool IsNumber() const { return (flags_ & kNumberFlag) != 0; } - bool IsInt() const { return (flags_ & kIntFlag) != 0; } - bool IsUint() const { return (flags_ & kUintFlag) != 0; } - bool IsInt64() const { return (flags_ & kInt64Flag) != 0; } - bool IsUint64() const { return (flags_ & kUint64Flag) != 0; } - bool IsDouble() const { return (flags_ & kDoubleFlag) != 0; } - bool IsString() const { return (flags_ & kStringFlag) != 0; } - - //@} - - //!@name Null - //@{ - - GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; } - - //@} - - //!@name Bool - //@{ - - bool GetBool() const { RAPIDJSON_ASSERT(IsBool()); return flags_ == kTrueFlag; } - //!< Set boolean value - /*! \post IsBool() == true */ - GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; } - - //@} - - //!@name Object - //@{ - - //! Set this value as an empty object. - /*! \post IsObject() == true */ - GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; } - - //! Get the number of members in the object. - SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; } - - //! Check whether the object is empty. - bool ObjectEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; } - - //! Get a value from an object associated with the name. - /*! \pre IsObject() == true - \tparam T Either \c Ch or \c const \c Ch (template used for disambiguation with \ref operator[](SizeType)) - \note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7. - Since 0.2, if the name is not correct, it will assert. - If user is unsure whether a member exists, user should use HasMember() first. - A better approach is to use FindMember(). - \note Linear time complexity. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(GenericValue&)) operator[](T* name) { - GenericValue n(StringRef(name)); - return (*this)[n]; - } - template - RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(const GenericValue&)) operator[](T* name) const { return const_cast(*this)[name]; } - - //! Get a value from an object associated with the name. - /*! \pre IsObject() == true - \tparam SourceAllocator Allocator of the \c name value - - \note Compared to \ref operator[](T*), this version is faster because it does not need a StrLen(). - And it can also handle strings with embedded null characters. - - \note Linear time complexity. - */ - template - GenericValue& operator[](const GenericValue& name) { - MemberIterator member = FindMember(name); - if (member != MemberEnd()) - return member->value; - else { - RAPIDJSON_ASSERT(false); // see above note - static GenericValue NullValue; - return NullValue; - } - } - template - const GenericValue& operator[](const GenericValue& name) const { return const_cast(*this)[name]; } - -#if RAPIDJSON_HAS_STDSTRING - //! Get a value from an object associated with name (string object). - GenericValue& operator[](const std::basic_string& name) { return (*this)[GenericValue(StringRef(name))]; } - const GenericValue& operator[](const std::basic_string& name) const { return (*this)[GenericValue(StringRef(name))]; } -#endif - - //! Const member iterator - /*! \pre IsObject() == true */ - ConstMemberIterator MemberBegin() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(data_.o.members); } - //! Const \em past-the-end member iterator - /*! \pre IsObject() == true */ - ConstMemberIterator MemberEnd() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(data_.o.members + data_.o.size); } - //! Member iterator - /*! \pre IsObject() == true */ - MemberIterator MemberBegin() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(data_.o.members); } - //! \em Past-the-end member iterator - /*! \pre IsObject() == true */ - MemberIterator MemberEnd() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(data_.o.members + data_.o.size); } - - //! Check whether a member exists in the object. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); } - -#if RAPIDJSON_HAS_STDSTRING - //! Check whether a member exists in the object with string object. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - bool HasMember(const std::basic_string& name) const { return FindMember(name) != MemberEnd(); } -#endif - - //! Check whether a member exists in the object with GenericValue name. - /*! - This version is faster because it does not need a StrLen(). It can also handle string with null character. - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - template - bool HasMember(const GenericValue& name) const { return FindMember(name) != MemberEnd(); } - - //! Find member by name. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - - \note Earlier versions of Rapidjson returned a \c NULL pointer, in case - the requested member doesn't exist. For consistency with e.g. - \c std::map, this has been changed to MemberEnd() now. - \note Linear time complexity. - */ - MemberIterator FindMember(const Ch* name) { - GenericValue n(StringRef(name)); - return FindMember(n); - } - - ConstMemberIterator FindMember(const Ch* name) const { return const_cast(*this).FindMember(name); } - - //! Find member by name. - /*! - This version is faster because it does not need a StrLen(). It can also handle string with null character. - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - - \note Earlier versions of Rapidjson returned a \c NULL pointer, in case - the requested member doesn't exist. For consistency with e.g. - \c std::map, this has been changed to MemberEnd() now. - \note Linear time complexity. - */ - template - MemberIterator FindMember(const GenericValue& name) { - RAPIDJSON_ASSERT(IsObject()); - RAPIDJSON_ASSERT(name.IsString()); - MemberIterator member = MemberBegin(); - for ( ; member != MemberEnd(); ++member) - if (name.StringEqual(member->name)) - break; - return member; - } - template ConstMemberIterator FindMember(const GenericValue& name) const { return const_cast(*this).FindMember(name); } - -#if RAPIDJSON_HAS_STDSTRING - //! Find member by string object name. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - */ - MemberIterator FindMember(const std::basic_string& name) { return FindMember(StringRef(name)); } - ConstMemberIterator FindMember(const std::basic_string& name) const { return FindMember(StringRef(name)); } -#endif - - //! Add a member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value Value of any type. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note The ownership of \c name and \c value will be transferred to this object on success. - \pre IsObject() && name.IsString() - \post name.IsNull() && value.IsNull() - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) { - RAPIDJSON_ASSERT(IsObject()); - RAPIDJSON_ASSERT(name.IsString()); - - Object& o = data_.o; - if (o.size >= o.capacity) { - if (o.capacity == 0) { - o.capacity = kDefaultObjectCapacity; - o.members = reinterpret_cast(allocator.Malloc(o.capacity * sizeof(Member))); - } - else { - SizeType oldCapacity = o.capacity; - o.capacity += (oldCapacity + 1) / 2; // grow by factor 1.5 - o.members = reinterpret_cast(allocator.Realloc(o.members, oldCapacity * sizeof(Member), o.capacity * sizeof(Member))); - } - } - o.members[o.size].name.RawAssign(name); - o.members[o.size].value.RawAssign(value); - o.size++; - return *this; - } - - //! Add a constant string value as member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, StringRefType value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - -#if RAPIDJSON_HAS_STDSTRING - //! Add a string object as member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, std::basic_string& value, Allocator& allocator) { - GenericValue v(value, allocator); - return AddMember(name, v, allocator); - } -#endif - - //! Add any primitive value as member (name-value pair) to the object. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param name A string value as name of member. - \param value Value of primitive type \c T as value of member - \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref - AddMember(StringRefType, StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized Constant time complexity. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - AddMember(GenericValue& name, T value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } -#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS - - - //! Add a member (name-value pair) to the object. - /*! \param name A constant string reference as name of member. - \param value Value of any type. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note The ownership of \c value will be transferred to this object on success. - \pre IsObject() - \post value.IsNull() - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } - - //! Add a constant string value as member (name-value pair) to the object. - /*! \param name A constant string reference as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - - //! Add any primitive value as member (name-value pair) to the object. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param name A constant string reference as name of member. - \param value Value of primitive type \c T as value of member - \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref - AddMember(StringRefType, StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized Constant time complexity. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - AddMember(StringRefType name, T value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } - - //! Remove all members in the object. - /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged. - \note Linear time complexity. - */ - void RemoveAllMembers() { - RAPIDJSON_ASSERT(IsObject()); - for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) - m->~Member(); - data_.o.size = 0; - } - - //! Remove a member in object by its name. - /*! \param name Name of member to be removed. - \return Whether the member existed. - \note This function may reorder the object members. Use \ref - EraseMember(ConstMemberIterator) if you need to preserve the - relative order of the remaining members. - \note Linear time complexity. - */ - bool RemoveMember(const Ch* name) { - GenericValue n(StringRef(name)); - return RemoveMember(n); - } - -#if RAPIDJSON_HAS_STDSTRING - bool RemoveMember(const std::basic_string& name) { return RemoveMember(GenericValue(StringRef(name))); } -#endif - - template - bool RemoveMember(const GenericValue& name) { - MemberIterator m = FindMember(name); - if (m != MemberEnd()) { - RemoveMember(m); - return true; - } - else - return false; - } - - //! Remove a member in object by iterator. - /*! \param m member iterator (obtained by FindMember() or MemberBegin()). - \return the new iterator after removal. - \note This function may reorder the object members. Use \ref - EraseMember(ConstMemberIterator) if you need to preserve the - relative order of the remaining members. - \note Constant time complexity. - */ - MemberIterator RemoveMember(MemberIterator m) { - RAPIDJSON_ASSERT(IsObject()); - RAPIDJSON_ASSERT(data_.o.size > 0); - RAPIDJSON_ASSERT(data_.o.members != 0); - RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd()); - - MemberIterator last(data_.o.members + (data_.o.size - 1)); - if (data_.o.size > 1 && m != last) { - // Move the last one to this place - *m = *last; - } - else { - // Only one left, just destroy - m->~Member(); - } - --data_.o.size; - return m; - } - - //! Remove a member from an object by iterator. - /*! \param pos iterator to the member to remove - \pre IsObject() == true && \ref MemberBegin() <= \c pos < \ref MemberEnd() - \return Iterator following the removed element. - If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned. - \note This function preserves the relative order of the remaining object - members. If you do not need this, use the more efficient \ref RemoveMember(MemberIterator). - \note Linear time complexity. - */ - MemberIterator EraseMember(ConstMemberIterator pos) { - return EraseMember(pos, pos +1); - } - - //! Remove members in the range [first, last) from an object. - /*! \param first iterator to the first member to remove - \param last iterator following the last member to remove - \pre IsObject() == true && \ref MemberBegin() <= \c first <= \c last <= \ref MemberEnd() - \return Iterator following the last removed element. - \note This function preserves the relative order of the remaining object - members. - \note Linear time complexity. - */ - MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) { - RAPIDJSON_ASSERT(IsObject()); - RAPIDJSON_ASSERT(data_.o.size > 0); - RAPIDJSON_ASSERT(data_.o.members != 0); - RAPIDJSON_ASSERT(first >= MemberBegin()); - RAPIDJSON_ASSERT(first <= last); - RAPIDJSON_ASSERT(last <= MemberEnd()); - - MemberIterator pos = MemberBegin() + (first - MemberBegin()); - for (MemberIterator itr = pos; itr != last; ++itr) - itr->~Member(); - std::memmove(&*pos, &*last, (MemberEnd() - last) * sizeof(Member)); - data_.o.size -= (last - first); - return pos; - } - - //@} - - //!@name Array - //@{ - - //! Set this value as an empty array. - /*! \post IsArray == true */ - GenericValue& SetArray() { this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; } - - //! Get the number of elements in array. - SizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; } - - //! Get the capacity of array. - SizeType Capacity() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; } - - //! Check whether the array is empty. - bool Empty() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; } - - //! Remove all elements in the array. - /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged. - \note Linear time complexity. - */ - void Clear() { - RAPIDJSON_ASSERT(IsArray()); - for (SizeType i = 0; i < data_.a.size; ++i) - data_.a.elements[i].~GenericValue(); - data_.a.size = 0; - } - - //! Get an element from array by index. - /*! \pre IsArray() == true - \param index Zero-based index of element. - \see operator[](T*) - */ - GenericValue& operator[](SizeType index) { - RAPIDJSON_ASSERT(IsArray()); - RAPIDJSON_ASSERT(index < data_.a.size); - return data_.a.elements[index]; - } - const GenericValue& operator[](SizeType index) const { return const_cast(*this)[index]; } - - //! Element iterator - /*! \pre IsArray() == true */ - ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements; } - //! \em Past-the-end element iterator - /*! \pre IsArray() == true */ - ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements + data_.a.size; } - //! Constant element iterator - /*! \pre IsArray() == true */ - ConstValueIterator Begin() const { return const_cast(*this).Begin(); } - //! Constant \em past-the-end element iterator - /*! \pre IsArray() == true */ - ConstValueIterator End() const { return const_cast(*this).End(); } - - //! Request the array to have enough capacity to store elements. - /*! \param newCapacity The capacity that the array at least need to have. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note Linear time complexity. - */ - GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) { - RAPIDJSON_ASSERT(IsArray()); - if (newCapacity > data_.a.capacity) { - data_.a.elements = (GenericValue*)allocator.Realloc(data_.a.elements, data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue)); - data_.a.capacity = newCapacity; - } - return *this; - } - - //! Append a GenericValue at the end of the array. - /*! \param value Value to be appended. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \post value.IsNull() == true - \return The value itself for fluent API. - \note The ownership of \c value will be transferred to this array on success. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - \note Amortized constant time complexity. - */ - GenericValue& PushBack(GenericValue& value, Allocator& allocator) { - RAPIDJSON_ASSERT(IsArray()); - if (data_.a.size >= data_.a.capacity) - Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator); - data_.a.elements[data_.a.size++].RawAssign(value); - return *this; - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericValue& PushBack(GenericValue&& value, Allocator& allocator) { - return PushBack(value, allocator); - } -#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS - - //! Append a constant string reference at the end of the array. - /*! \param value Constant string reference to be appended. - \param allocator Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \return The value itself for fluent API. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - \note Amortized constant time complexity. - \see GenericStringRef - */ - GenericValue& PushBack(StringRefType value, Allocator& allocator) { - return (*this).template PushBack(value, allocator); - } - - //! Append a primitive value at the end of the array. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param value Value of primitive type T to be appended. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \return The value itself for fluent API. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref PushBack(GenericValue&, Allocator&) or \ref - PushBack(StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized constant time complexity. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - PushBack(T value, Allocator& allocator) { - GenericValue v(value); - return PushBack(v, allocator); - } - - //! Remove the last element in the array. - /*! - \note Constant time complexity. - */ - GenericValue& PopBack() { - RAPIDJSON_ASSERT(IsArray()); - RAPIDJSON_ASSERT(!Empty()); - data_.a.elements[--data_.a.size].~GenericValue(); - return *this; - } - - //! Remove an element of array by iterator. - /*! - \param pos iterator to the element to remove - \pre IsArray() == true && \ref Begin() <= \c pos < \ref End() - \return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned. - \note Linear time complexity. - */ - ValueIterator Erase(ConstValueIterator pos) { - return Erase(pos, pos + 1); - } - - //! Remove elements in the range [first, last) of the array. - /*! - \param first iterator to the first element to remove - \param last iterator following the last element to remove - \pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End() - \return Iterator following the last removed element. - \note Linear time complexity. - */ - ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) { - RAPIDJSON_ASSERT(IsArray()); - RAPIDJSON_ASSERT(data_.a.size > 0); - RAPIDJSON_ASSERT(data_.a.elements != 0); - RAPIDJSON_ASSERT(first >= Begin()); - RAPIDJSON_ASSERT(first <= last); - RAPIDJSON_ASSERT(last <= End()); - ValueIterator pos = Begin() + (first - Begin()); - for (ValueIterator itr = pos; itr != last; ++itr) - itr->~GenericValue(); - std::memmove(pos, last, (End() - last) * sizeof(GenericValue)); - data_.a.size -= (last - first); - return pos; - } - - //@} - - //!@name Number - //@{ - - int GetInt() const { RAPIDJSON_ASSERT(flags_ & kIntFlag); return data_.n.i.i; } - unsigned GetUint() const { RAPIDJSON_ASSERT(flags_ & kUintFlag); return data_.n.u.u; } - int64_t GetInt64() const { RAPIDJSON_ASSERT(flags_ & kInt64Flag); return data_.n.i64; } - uint64_t GetUint64() const { RAPIDJSON_ASSERT(flags_ & kUint64Flag); return data_.n.u64; } - - double GetDouble() const { - RAPIDJSON_ASSERT(IsNumber()); - if ((flags_ & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion. - if ((flags_ & kIntFlag) != 0) return data_.n.i.i; // int -> double - if ((flags_ & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double - if ((flags_ & kInt64Flag) != 0) return (double)data_.n.i64; // int64_t -> double (may lose precision) - RAPIDJSON_ASSERT((flags_ & kUint64Flag) != 0); return (double)data_.n.u64; // uint64_t -> double (may lose precision) - } - - GenericValue& SetInt(int i) { this->~GenericValue(); new (this) GenericValue(i); return *this; } - GenericValue& SetUint(unsigned u) { this->~GenericValue(); new (this) GenericValue(u); return *this; } - GenericValue& SetInt64(int64_t i64) { this->~GenericValue(); new (this) GenericValue(i64); return *this; } - GenericValue& SetUint64(uint64_t u64) { this->~GenericValue(); new (this) GenericValue(u64); return *this; } - GenericValue& SetDouble(double d) { this->~GenericValue(); new (this) GenericValue(d); return *this; } - - //@} - - //!@name String - //@{ - - const Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return ((flags_ & kInlineStrFlag) ? data_.ss.str : data_.s.str); } - - //! Get the length of string. - /*! Since rapidjson permits "\\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength(). - */ - SizeType GetStringLength() const { RAPIDJSON_ASSERT(IsString()); return ((flags_ & kInlineStrFlag) ? (data_.ss.GetLength()) : data_.s.length); } - - //! Set this value as a string without copying source string. - /*! This version has better performance with supplied length, and also support string containing null character. - \param s source string pointer. - \param length The length of source string, excluding the trailing null terminator. - \return The value itself for fluent API. - \post IsString() == true && GetString() == s && GetStringLength() == length - \see SetString(StringRefType) - */ - GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); } - - //! Set this value as a string without copying source string. - /*! \param s source string reference - \return The value itself for fluent API. - \post IsString() == true && GetString() == s && GetStringLength() == s.length - */ - GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; } - - //! Set this value as a string by copying from source string. - /*! This version has better performance with supplied length, and also support string containing null character. - \param s source string. - \param length The length of source string, excluding the trailing null terminator. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length - */ - GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { this->~GenericValue(); SetStringRaw(StringRef(s, length), allocator); return *this; } - - //! Set this value as a string by copying from source string. - /*! \param s source string. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length - */ - GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(s, internal::StrLen(s), allocator); } - -#if RAPIDJSON_HAS_STDSTRING - //! Set this value as a string by copying from source string. - /*! \param s source string. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size() - \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. - */ - GenericValue& SetString(const std::basic_string& s, Allocator& allocator) { return SetString(s.data(), SizeType(s.size()), allocator); } -#endif - - //@} - - //! Generate events of this value to a Handler. - /*! This function adopts the GoF visitor pattern. - Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. - It can also be used to deep clone this value via GenericDocument, which is also a Handler. - \tparam Handler type of handler. - \param handler An object implementing concept Handler. - */ - template - bool Accept(Handler& handler) const { - switch(GetType()) { - case kNullType: return handler.Null(); - case kFalseType: return handler.Bool(false); - case kTrueType: return handler.Bool(true); - - case kObjectType: - if (!handler.StartObject()) - return false; - for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) { - RAPIDJSON_ASSERT(m->name.IsString()); // User may change the type of name by MemberIterator. - if (!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.flags_ & kCopyFlag) != 0)) - return false; - if (!m->value.Accept(handler)) - return false; - } - return handler.EndObject(data_.o.size); - - case kArrayType: - if (!handler.StartArray()) - return false; - for (GenericValue* v = data_.a.elements; v != data_.a.elements + data_.a.size; ++v) - if (!v->Accept(handler)) - return false; - return handler.EndArray(data_.a.size); - - case kStringType: - return handler.String(GetString(), GetStringLength(), (flags_ & kCopyFlag) != 0); - - default: - RAPIDJSON_ASSERT(GetType() == kNumberType); - if (IsInt()) return handler.Int(data_.n.i.i); - else if (IsUint()) return handler.Uint(data_.n.u.u); - else if (IsInt64()) return handler.Int64(data_.n.i64); - else if (IsUint64()) return handler.Uint64(data_.n.u64); - else return handler.Double(data_.n.d); - } - } - -private: - template friend class GenericValue; - template friend class GenericDocument; - - enum { - kBoolFlag = 0x100, - kNumberFlag = 0x200, - kIntFlag = 0x400, - kUintFlag = 0x800, - kInt64Flag = 0x1000, - kUint64Flag = 0x2000, - kDoubleFlag = 0x4000, - kStringFlag = 0x100000, - kCopyFlag = 0x200000, - kInlineStrFlag = 0x400000, - - // Initial flags of different types. - kNullFlag = kNullType, - kTrueFlag = kTrueType | kBoolFlag, - kFalseFlag = kFalseType | kBoolFlag, - kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag, - kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag, - kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag, - kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag, - kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag, - kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag, - kConstStringFlag = kStringType | kStringFlag, - kCopyStringFlag = kStringType | kStringFlag | kCopyFlag, - kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag, - kObjectFlag = kObjectType, - kArrayFlag = kArrayType, - - kTypeMask = 0xFF // bitwise-and with mask of 0xFF can be optimized by compiler - }; - - static const SizeType kDefaultArrayCapacity = 16; - static const SizeType kDefaultObjectCapacity = 16; - - struct String { - const Ch* str; - SizeType length; - unsigned hashcode; //!< reserved - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars - // (excluding the terminating zero) and store a value to determine the length of the contained - // string in the last character str[LenPos] by storing "MaxSize - length" there. If the string - // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as - // the string terminator as well. For getting the string length back from that value just use - // "MaxSize - str[LenPos]". - // This allows to store 11-chars strings in 32-bit mode and 15-chars strings in 64-bit mode - // inline (for `UTF8`-encoded strings). - struct ShortString { - enum { MaxChars = sizeof(String) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize }; - Ch str[MaxChars]; - - inline static bool Usable(SizeType len) { return (MaxSize >= len); } - inline void SetLength(SizeType len) { str[LenPos] = (Ch)(MaxSize - len); } - inline SizeType GetLength() const { return (SizeType)(MaxSize - str[LenPos]); } - }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - // By using proper binary layout, retrieval of different integer types do not need conversions. - union Number { -#if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN - struct I { - int i; - char padding[4]; - }i; - struct U { - unsigned u; - char padding2[4]; - }u; -#else - struct I { - char padding[4]; - int i; - }i; - struct U { - char padding2[4]; - unsigned u; - }u; -#endif - int64_t i64; - uint64_t u64; - double d; - }; // 8 bytes - - struct Object { - Member* members; - SizeType size; - SizeType capacity; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - struct Array { - GenericValue* elements; - SizeType size; - SizeType capacity; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - union Data { - String s; - ShortString ss; - Number n; - Object o; - Array a; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - // Initialize this value as array with initial data, without calling destructor. - void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) { - flags_ = kArrayFlag; - if (count) { - data_.a.elements = (GenericValue*)allocator.Malloc(count * sizeof(GenericValue)); - std::memcpy(data_.a.elements, values, count * sizeof(GenericValue)); - } - else - data_.a.elements = NULL; - data_.a.size = data_.a.capacity = count; - } - - //! Initialize this value as object with initial data, without calling destructor. - void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) { - flags_ = kObjectFlag; - if (count) { - data_.o.members = (Member*)allocator.Malloc(count * sizeof(Member)); - std::memcpy(data_.o.members, members, count * sizeof(Member)); - } - else - data_.o.members = NULL; - data_.o.size = data_.o.capacity = count; - } - - //! Initialize this value as constant string, without calling destructor. - void SetStringRaw(StringRefType s) RAPIDJSON_NOEXCEPT { - flags_ = kConstStringFlag; - data_.s.str = s; - data_.s.length = s.length; - } - - //! Initialize this value as copy string with initial data, without calling destructor. - void SetStringRaw(StringRefType s, Allocator& allocator) { - Ch* str = NULL; - if(ShortString::Usable(s.length)) { - flags_ = kShortStringFlag; - data_.ss.SetLength(s.length); - str = data_.ss.str; - } else { - flags_ = kCopyStringFlag; - data_.s.length = s.length; - str = (Ch *)allocator.Malloc((s.length + 1) * sizeof(Ch)); - data_.s.str = str; - } - std::memcpy(str, s, s.length * sizeof(Ch)); - str[s.length] = '\0'; - } - - //! Assignment without calling destructor - void RawAssign(GenericValue& rhs) RAPIDJSON_NOEXCEPT { - data_ = rhs.data_; - flags_ = rhs.flags_; - rhs.flags_ = kNullFlag; - } - - template - bool StringEqual(const GenericValue& rhs) const { - RAPIDJSON_ASSERT(IsString()); - RAPIDJSON_ASSERT(rhs.IsString()); - - const SizeType len1 = GetStringLength(); - const SizeType len2 = rhs.GetStringLength(); - if(len1 != len2) { return false; } - - const Ch* const str1 = GetString(); - const Ch* const str2 = rhs.GetString(); - if(str1 == str2) { return true; } // fast path for constant string - - return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0); - } - - Data data_; - unsigned flags_; -}; - -//! GenericValue with UTF8 encoding -typedef GenericValue > Value; - -/////////////////////////////////////////////////////////////////////////////// -// GenericDocument - -//! A document for parsing JSON text as DOM. -/*! - \note implements Handler concept - \tparam Encoding Encoding for both parsing and string storage. - \tparam Allocator Allocator for allocating memory for the DOM - \tparam StackAllocator Allocator for allocating memory for stack during parsing. - \warning Although GenericDocument inherits from GenericValue, the API does \b not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not \c delete a GenericDocument object via a pointer to a GenericValue. -*/ -template , typename StackAllocator = CrtAllocator> -class GenericDocument : public GenericValue { -public: - typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. - typedef GenericValue ValueType; //!< Value type of the document. - typedef Allocator AllocatorType; //!< Allocator type from template parameter. - - //! Constructor - /*! \param allocator Optional allocator for allocating memory. - \param stackCapacity Optional initial capacity of stack in bytes. - \param stackAllocator Optional allocator for allocating memory for stack. - */ - GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : - allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() - { - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator()); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericDocument(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT - : ValueType(std::move(rhs)), - allocator_(rhs.allocator_), - ownAllocator_(rhs.ownAllocator_), - stack_(std::move(rhs.stack_)), - parseResult_(rhs.parseResult_) - { - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.parseResult_ = ParseResult(); - } -#endif - - ~GenericDocument() { - Destroy(); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move assignment in C++11 - GenericDocument& operator=(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT - { - // The cast to ValueType is necessary here, because otherwise it would - // attempt to call GenericValue's templated assignment operator. - ValueType::operator=(std::forward(rhs)); - - // Calling the destructor here would prematurely call stack_'s destructor - Destroy(); - - allocator_ = rhs.allocator_; - ownAllocator_ = rhs.ownAllocator_; - stack_ = std::move(rhs.stack_); - parseResult_ = rhs.parseResult_; - - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.parseResult_ = ParseResult(); - - return *this; - } -#endif - - //!@name Parse from stream - //!@{ - - //! Parse JSON text from an input stream (with Encoding conversion) - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam SourceEncoding Encoding of input stream - \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - ValueType::SetNull(); // Remove existing root if exist - GenericReader reader(&stack_.GetAllocator()); - ClearStackOnExit scope(*this); - parseResult_ = reader.template Parse(is, *this); - if (parseResult_) { - RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object - this->RawAssign(*stack_.template Pop(1)); // Add this-> to prevent issue 13. - } - return *this; - } - - //! Parse JSON text from an input stream - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - return ParseStream(is); - } - - //! Parse JSON text from an input stream (with \ref kParseDefaultFlags) - /*! \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - return ParseStream(is); - } - //!@} - - //!@name Parse in-place from mutable string - //!@{ - - //! Parse JSON text from a mutable string - /*! \tparam parseFlags Combination of \ref ParseFlag. - \param str Mutable zero-terminated string to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseInsitu(Ch* str) { - GenericInsituStringStream s(str); - return ParseStream(s); - } - - //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags) - /*! \param str Mutable zero-terminated string to be parsed. - \return The document itself for fluent API. - */ - GenericDocument& ParseInsitu(Ch* str) { - return ParseInsitu(str); - } - //!@} - - //!@name Parse from read-only string - //!@{ - - //! Parse JSON text from a read-only string (with Encoding conversion) - /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). - \tparam SourceEncoding Transcoding from input Encoding - \param str Read-only zero-terminated string to be parsed. - */ - template - GenericDocument& Parse(const Ch* str) { - RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); - GenericStringStream s(str); - return ParseStream(s); - } - - //! Parse JSON text from a read-only string - /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). - \param str Read-only zero-terminated string to be parsed. - */ - template - GenericDocument& Parse(const Ch* str) { - return Parse(str); - } - - //! Parse JSON text from a read-only string (with \ref kParseDefaultFlags) - /*! \param str Read-only zero-terminated string to be parsed. - */ - GenericDocument& Parse(const Ch* str) { - return Parse(str); - } - //!@} - - //!@name Handling parse errors - //!@{ - - //! Whether a parse error has occured in the last parsing. - bool HasParseError() const { return parseResult_.IsError(); } - - //! Get the \ref ParseErrorCode of last parsing. - ParseErrorCode GetParseError() const { return parseResult_.Code(); } - - //! Get the position of last parsing error in input, 0 otherwise. - size_t GetErrorOffset() const { return parseResult_.Offset(); } - - //!@} - - //! Get the allocator of this document. - Allocator& GetAllocator() { return *allocator_; } - - //! Get the capacity of stack in bytes. - size_t GetStackCapacity() const { return stack_.GetCapacity(); } - -private: - // clear stack on any exit from ParseStream, e.g. due to exception - struct ClearStackOnExit { - explicit ClearStackOnExit(GenericDocument& d) : d_(d) {} - ~ClearStackOnExit() { d_.ClearStack(); } - private: - ClearStackOnExit(const ClearStackOnExit&); - ClearStackOnExit& operator=(const ClearStackOnExit&); - GenericDocument& d_; - }; - - // callers of the following private Handler functions - template friend class GenericReader; // for parsing - template friend class GenericValue; // for deep copying - - // Implementation of Handler - bool Null() { new (stack_.template Push()) ValueType(); return true; } - bool Bool(bool b) { new (stack_.template Push()) ValueType(b); return true; } - bool Int(int i) { new (stack_.template Push()) ValueType(i); return true; } - bool Uint(unsigned i) { new (stack_.template Push()) ValueType(i); return true; } - bool Int64(int64_t i) { new (stack_.template Push()) ValueType(i); return true; } - bool Uint64(uint64_t i) { new (stack_.template Push()) ValueType(i); return true; } - bool Double(double d) { new (stack_.template Push()) ValueType(d); return true; } - - bool String(const Ch* str, SizeType length, bool copy) { - if (copy) - new (stack_.template Push()) ValueType(str, length, GetAllocator()); - else - new (stack_.template Push()) ValueType(str, length); - return true; - } - - bool StartObject() { new (stack_.template Push()) ValueType(kObjectType); return true; } - - bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); } - - bool EndObject(SizeType memberCount) { - typename ValueType::Member* members = stack_.template Pop(memberCount); - stack_.template Top()->SetObjectRaw(members, (SizeType)memberCount, GetAllocator()); - return true; - } - - bool StartArray() { new (stack_.template Push()) ValueType(kArrayType); return true; } - - bool EndArray(SizeType elementCount) { - ValueType* elements = stack_.template Pop(elementCount); - stack_.template Top()->SetArrayRaw(elements, elementCount, GetAllocator()); - return true; - } - -private: - //! Prohibit copying - GenericDocument(const GenericDocument&); - //! Prohibit assignment - GenericDocument& operator=(const GenericDocument&); - - void ClearStack() { - if (Allocator::kNeedFree) - while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects) - (stack_.template Pop(1))->~ValueType(); - else - stack_.Clear(); - stack_.ShrinkToFit(); - } - - void Destroy() { - RAPIDJSON_DELETE(ownAllocator_); - } - - static const size_t kDefaultStackCapacity = 1024; - Allocator* allocator_; - Allocator* ownAllocator_; - internal::Stack stack_; - ParseResult parseResult_; -}; - -//! GenericDocument with UTF8 encoding -typedef GenericDocument > Document; - -// defined here due to the dependency on GenericDocument -template -template -inline -GenericValue::GenericValue(const GenericValue& rhs, Allocator& allocator) -{ - switch (rhs.GetType()) { - case kObjectType: - case kArrayType: { // perform deep copy via SAX Handler - GenericDocument d(&allocator); - rhs.Accept(d); - RawAssign(*d.stack_.template Pop(1)); - } - break; - case kStringType: - if (rhs.flags_ == kConstStringFlag) { - flags_ = rhs.flags_; - data_ = *reinterpret_cast(&rhs.data_); - } else { - SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator); - } - break; - default: // kNumberType, kTrueType, kFalseType, kNullType - flags_ = rhs.flags_; - data_ = *reinterpret_cast(&rhs.data_); - } -} - -RAPIDJSON_NAMESPACE_END - -#if defined(_MSC_VER) || defined(__GNUC__) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_DOCUMENT_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/encodedstream.h b/external/rapidjson-1.0.2/include/rapidjson/encodedstream.h deleted file mode 100644 index 7c8863f..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/encodedstream.h +++ /dev/null @@ -1,261 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_ENCODEDSTREAM_H_ -#define RAPIDJSON_ENCODEDSTREAM_H_ - -#include "rapidjson.h" - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Input byte stream wrapper with a statically bound encoding. -/*! - \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. - \tparam InputByteStream Type of input byte stream. For example, FileReadStream. -*/ -template -class EncodedInputStream { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); -public: - typedef typename Encoding::Ch Ch; - - EncodedInputStream(InputByteStream& is) : is_(is) { - current_ = Encoding::TakeBOM(is_); - } - - Ch Peek() const { return current_; } - Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; } - size_t Tell() const { return is_.Tell(); } - - // Not implemented - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - EncodedInputStream(const EncodedInputStream&); - EncodedInputStream& operator=(const EncodedInputStream&); - - InputByteStream& is_; - Ch current_; -}; - -//! Output byte stream wrapper with statically bound encoding. -/*! - \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. - \tparam InputByteStream Type of input byte stream. For example, FileWriteStream. -*/ -template -class EncodedOutputStream { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); -public: - typedef typename Encoding::Ch Ch; - - EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) { - if (putBOM) - Encoding::PutBOM(os_); - } - - void Put(Ch c) { Encoding::Put(os_, c); } - void Flush() { os_.Flush(); } - - // Not implemented - Ch Peek() const { RAPIDJSON_ASSERT(false); } - Ch Take() { RAPIDJSON_ASSERT(false); } - size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - EncodedOutputStream(const EncodedOutputStream&); - EncodedOutputStream& operator=(const EncodedOutputStream&); - - OutputByteStream& os_; -}; - -#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x - -//! Input stream wrapper with dynamically bound encoding and automatic encoding detection. -/*! - \tparam CharType Type of character for reading. - \tparam InputByteStream type of input byte stream to be wrapped. -*/ -template -class AutoUTFInputStream { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); -public: - typedef CharType Ch; - - //! Constructor. - /*! - \param is input stream to be wrapped. - \param type UTF encoding type if it is not detected from the stream. - */ - AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) { - RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); - DetectType(); - static const TakeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Take) }; - takeFunc_ = f[type_]; - current_ = takeFunc_(*is_); - } - - UTFType GetType() const { return type_; } - bool HasBOM() const { return hasBOM_; } - - Ch Peek() const { return current_; } - Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; } - size_t Tell() const { return is_->Tell(); } - - // Not implemented - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - AutoUTFInputStream(const AutoUTFInputStream&); - AutoUTFInputStream& operator=(const AutoUTFInputStream&); - - // Detect encoding type with BOM or RFC 4627 - void DetectType() { - // BOM (Byte Order Mark): - // 00 00 FE FF UTF-32BE - // FF FE 00 00 UTF-32LE - // FE FF UTF-16BE - // FF FE UTF-16LE - // EF BB BF UTF-8 - - const unsigned char* c = (const unsigned char *)is_->Peek4(); - if (!c) - return; - - unsigned bom = c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24); - hasBOM_ = false; - if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } - else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } - else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); } - else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); } - else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); } - - // RFC 4627: Section 3 - // "Since the first two characters of a JSON text will always be ASCII - // characters [RFC0020], it is possible to determine whether an octet - // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking - // at the pattern of nulls in the first four octets." - // 00 00 00 xx UTF-32BE - // 00 xx 00 xx UTF-16BE - // xx 00 00 00 UTF-32LE - // xx 00 xx 00 UTF-16LE - // xx xx xx xx UTF-8 - - if (!hasBOM_) { - unsigned pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0); - switch (pattern) { - case 0x08: type_ = kUTF32BE; break; - case 0x0A: type_ = kUTF16BE; break; - case 0x01: type_ = kUTF32LE; break; - case 0x05: type_ = kUTF16LE; break; - case 0x0F: type_ = kUTF8; break; - default: break; // Use type defined by user. - } - } - - // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. - if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); - if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); - } - - typedef Ch (*TakeFunc)(InputByteStream& is); - InputByteStream* is_; - UTFType type_; - Ch current_; - TakeFunc takeFunc_; - bool hasBOM_; -}; - -//! Output stream wrapper with dynamically bound encoding and automatic encoding detection. -/*! - \tparam CharType Type of character for writing. - \tparam InputByteStream type of output byte stream to be wrapped. -*/ -template -class AutoUTFOutputStream { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); -public: - typedef CharType Ch; - - //! Constructor. - /*! - \param os output stream to be wrapped. - \param type UTF encoding type. - \param putBOM Whether to write BOM at the beginning of the stream. - */ - AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) { - RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); - - // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. - if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); - if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); - - static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) }; - putFunc_ = f[type_]; - - if (putBOM) - PutBOM(); - } - - UTFType GetType() const { return type_; } - - void Put(Ch c) { putFunc_(*os_, c); } - void Flush() { os_->Flush(); } - - // Not implemented - Ch Peek() const { RAPIDJSON_ASSERT(false); } - Ch Take() { RAPIDJSON_ASSERT(false); } - size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - AutoUTFOutputStream(const AutoUTFOutputStream&); - AutoUTFOutputStream& operator=(const AutoUTFOutputStream&); - - void PutBOM() { - typedef void (*PutBOMFunc)(OutputByteStream&); - static const PutBOMFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(PutBOM) }; - f[type_](*os_); - } - - typedef void (*PutFunc)(OutputByteStream&, Ch); - - OutputByteStream* os_; - UTFType type_; - PutFunc putFunc_; -}; - -#undef RAPIDJSON_ENCODINGS_FUNC - -RAPIDJSON_NAMESPACE_END - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/encodings.h b/external/rapidjson-1.0.2/include/rapidjson/encodings.h deleted file mode 100644 index 90b46ed..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/encodings.h +++ /dev/null @@ -1,625 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_ENCODINGS_H_ -#define RAPIDJSON_ENCODINGS_H_ - -#include "rapidjson.h" - -#ifdef _MSC_VER -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data -RAPIDJSON_DIAG_OFF(4702) // unreachable code -#elif defined(__GNUC__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -RAPIDJSON_DIAG_OFF(overflow) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Encoding - -/*! \class rapidjson::Encoding - \brief Concept for encoding of Unicode characters. - -\code -concept Encoding { - typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition. - - enum { supportUnicode = 1 }; // or 0 if not supporting unicode - - //! \brief Encode a Unicode codepoint to an output stream. - //! \param os Output stream. - //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively. - template - static void Encode(OutputStream& os, unsigned codepoint); - - //! \brief Decode a Unicode codepoint from an input stream. - //! \param is Input stream. - //! \param codepoint Output of the unicode codepoint. - //! \return true if a valid codepoint can be decoded from the stream. - template - static bool Decode(InputStream& is, unsigned* codepoint); - - //! \brief Validate one Unicode codepoint from an encoded stream. - //! \param is Input stream to obtain codepoint. - //! \param os Output for copying one codepoint. - //! \return true if it is valid. - //! \note This function just validating and copying the codepoint without actually decode it. - template - static bool Validate(InputStream& is, OutputStream& os); - - // The following functions are deal with byte streams. - - //! Take a character from input byte stream, skip BOM if exist. - template - static CharType TakeBOM(InputByteStream& is); - - //! Take a character from input byte stream. - template - static Ch Take(InputByteStream& is); - - //! Put BOM to output byte stream. - template - static void PutBOM(OutputByteStream& os); - - //! Put a character to output byte stream. - template - static void Put(OutputByteStream& os, Ch c); -}; -\endcode -*/ - -/////////////////////////////////////////////////////////////////////////////// -// UTF8 - -//! UTF-8 encoding. -/*! http://en.wikipedia.org/wiki/UTF-8 - http://tools.ietf.org/html/rfc3629 - \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char. - \note implements Encoding concept -*/ -template -struct UTF8 { - typedef CharType Ch; - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - if (codepoint <= 0x7F) - os.Put(static_cast(codepoint & 0xFF)); - else if (codepoint <= 0x7FF) { - os.Put(static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint & 0x3F)))); - } - else if (codepoint <= 0xFFFF) { - os.Put(static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - os.Put(static_cast(0x80 | (codepoint & 0x3F))); - } - else { - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - os.Put(static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint >> 12) & 0x3F))); - os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - os.Put(static_cast(0x80 | (codepoint & 0x3F))); - } - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { -#define COPY() c = is.Take(); *codepoint = (*codepoint << 6) | ((unsigned char)c & 0x3Fu) -#define TRANS(mask) result &= ((GetRange((unsigned char)c) & mask) != 0) -#define TAIL() COPY(); TRANS(0x70) - Ch c = is.Take(); - if (!(c & 0x80)) { - *codepoint = (unsigned char)c; - return true; - } - - unsigned char type = GetRange((unsigned char)c); - *codepoint = (0xFF >> type) & (unsigned char)c; - bool result = true; - switch (type) { - case 2: TAIL(); return result; - case 3: TAIL(); TAIL(); return result; - case 4: COPY(); TRANS(0x50); TAIL(); return result; - case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result; - case 6: TAIL(); TAIL(); TAIL(); return result; - case 10: COPY(); TRANS(0x20); TAIL(); return result; - case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result; - default: return false; - } -#undef COPY -#undef TRANS -#undef TAIL - } - - template - static bool Validate(InputStream& is, OutputStream& os) { -#define COPY() os.Put(c = is.Take()) -#define TRANS(mask) result &= ((GetRange((unsigned char)c) & mask) != 0) -#define TAIL() COPY(); TRANS(0x70) - Ch c; - COPY(); - if (!(c & 0x80)) - return true; - - bool result = true; - switch (GetRange((unsigned char)c)) { - case 2: TAIL(); return result; - case 3: TAIL(); TAIL(); return result; - case 4: COPY(); TRANS(0x50); TAIL(); return result; - case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result; - case 6: TAIL(); TAIL(); TAIL(); return result; - case 10: COPY(); TRANS(0x20); TAIL(); return result; - case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result; - default: return false; - } -#undef COPY -#undef TRANS -#undef TAIL - } - - static unsigned char GetRange(unsigned char c) { - // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ - // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types. - static const unsigned char type[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, - }; - return type[c]; - } - - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - Ch c = Take(is); - if ((unsigned char)c != 0xEFu) return c; - c = is.Take(); - if ((unsigned char)c != 0xBBu) return c; - c = is.Take(); - if ((unsigned char)c != 0xBFu) return c; - c = is.Take(); - return c; - } - - template - static Ch Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - return is.Take(); - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(0xEFu); os.Put(0xBBu); os.Put(0xBFu); - } - - template - static void Put(OutputByteStream& os, Ch c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(c)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// UTF16 - -//! UTF-16 encoding. -/*! http://en.wikipedia.org/wiki/UTF-16 - http://tools.ietf.org/html/rfc2781 - \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead. - \note implements Encoding concept - - \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. - For streaming, use UTF16LE and UTF16BE, which handle endianness. -*/ -template -struct UTF16 { - typedef CharType Ch; - RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2); - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); - if (codepoint <= 0xFFFF) { - RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair - os.Put(static_cast(codepoint)); - } - else { - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - unsigned v = codepoint - 0x10000; - os.Put(static_cast((v >> 10) | 0xD800)); - os.Put((v & 0x3FF) | 0xDC00); - } - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); - Ch c = is.Take(); - if (c < 0xD800 || c > 0xDFFF) { - *codepoint = c; - return true; - } - else if (c <= 0xDBFF) { - *codepoint = (c & 0x3FF) << 10; - c = is.Take(); - *codepoint |= (c & 0x3FF); - *codepoint += 0x10000; - return c >= 0xDC00 && c <= 0xDFFF; - } - return false; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); - Ch c; - os.Put(c = is.Take()); - if (c < 0xD800 || c > 0xDFFF) - return true; - else if (c <= 0xDBFF) { - os.Put(c = is.Take()); - return c >= 0xDC00 && c <= 0xDFFF; - } - return false; - } -}; - -//! UTF-16 little endian encoding. -template -struct UTF16LE : UTF16 { - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return (unsigned short)c == 0xFEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = (unsigned char)is.Take(); - c |= (unsigned char)is.Take() << 8; - return c; - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(0xFFu); os.Put(0xFEu); - } - - template - static void Put(OutputByteStream& os, CharType c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(c & 0xFFu); - os.Put((c >> 8) & 0xFFu); - } -}; - -//! UTF-16 big endian encoding. -template -struct UTF16BE : UTF16 { - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return (unsigned short)c == 0xFEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = (unsigned char)is.Take() << 8; - c |= (unsigned char)is.Take(); - return c; - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(0xFEu); os.Put(0xFFu); - } - - template - static void Put(OutputByteStream& os, CharType c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put((c >> 8) & 0xFFu); - os.Put(c & 0xFFu); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// UTF32 - -//! UTF-32 encoding. -/*! http://en.wikipedia.org/wiki/UTF-32 - \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead. - \note implements Encoding concept - - \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. - For streaming, use UTF32LE and UTF32BE, which handle endianness. -*/ -template -struct UTF32 { - typedef CharType Ch; - RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4); - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - os.Put(codepoint); - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); - Ch c = is.Take(); - *codepoint = c; - return c <= 0x10FFFF; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); - Ch c; - os.Put(c = is.Take()); - return c <= 0x10FFFF; - } -}; - -//! UTF-32 little endian enocoding. -template -struct UTF32LE : UTF32 { - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return (unsigned)c == 0x0000FEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = (unsigned char)is.Take(); - c |= (unsigned char)is.Take() << 8; - c |= (unsigned char)is.Take() << 16; - c |= (unsigned char)is.Take() << 24; - return c; - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(0xFFu); os.Put(0xFEu); os.Put(0x00u); os.Put(0x00u); - } - - template - static void Put(OutputByteStream& os, CharType c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(c & 0xFFu); - os.Put((c >> 8) & 0xFFu); - os.Put((c >> 16) & 0xFFu); - os.Put((c >> 24) & 0xFFu); - } -}; - -//! UTF-32 big endian encoding. -template -struct UTF32BE : UTF32 { - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return (unsigned)c == 0x0000FEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = (unsigned char)is.Take() << 24; - c |= (unsigned char)is.Take() << 16; - c |= (unsigned char)is.Take() << 8; - c |= (unsigned char)is.Take(); - return c; - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(0x00u); os.Put(0x00u); os.Put(0xFEu); os.Put(0xFFu); - } - - template - static void Put(OutputByteStream& os, CharType c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put((c >> 24) & 0xFFu); - os.Put((c >> 16) & 0xFFu); - os.Put((c >> 8) & 0xFFu); - os.Put(c & 0xFFu); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// ASCII - -//! ASCII encoding. -/*! http://en.wikipedia.org/wiki/ASCII - \tparam CharType Code unit for storing 7-bit ASCII data. Default is char. - \note implements Encoding concept -*/ -template -struct ASCII { - typedef CharType Ch; - - enum { supportUnicode = 0 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - RAPIDJSON_ASSERT(codepoint <= 0x7F); - os.Put(static_cast(codepoint & 0xFF)); - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - unsigned char c = static_cast(is.Take()); - *codepoint = c; - return c <= 0X7F; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - unsigned char c = is.Take(); - os.Put(c); - return c <= 0x7F; - } - - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - Ch c = Take(is); - return c; - } - - template - static Ch Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - return is.Take(); - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - (void)os; - } - - template - static void Put(OutputByteStream& os, Ch c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(c)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// AutoUTF - -//! Runtime-specified UTF encoding type of a stream. -enum UTFType { - kUTF8 = 0, //!< UTF-8. - kUTF16LE = 1, //!< UTF-16 little endian. - kUTF16BE = 2, //!< UTF-16 big endian. - kUTF32LE = 3, //!< UTF-32 little endian. - kUTF32BE = 4 //!< UTF-32 big endian. -}; - -//! Dynamically select encoding according to stream's runtime-specified UTF encoding type. -/*! \note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType(). -*/ -template -struct AutoUTF { - typedef CharType Ch; - - enum { supportUnicode = 1 }; - -#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x - - template - RAPIDJSON_FORCEINLINE static void Encode(OutputStream& os, unsigned codepoint) { - typedef void (*EncodeFunc)(OutputStream&, unsigned); - static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) }; - (*f[os.GetType()])(os, codepoint); - } - - template - RAPIDJSON_FORCEINLINE static bool Decode(InputStream& is, unsigned* codepoint) { - typedef bool (*DecodeFunc)(InputStream&, unsigned*); - static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) }; - return (*f[is.GetType()])(is, codepoint); - } - - template - RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) { - typedef bool (*ValidateFunc)(InputStream&, OutputStream&); - static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) }; - return (*f[is.GetType()])(is, os); - } - -#undef RAPIDJSON_ENCODINGS_FUNC -}; - -/////////////////////////////////////////////////////////////////////////////// -// Transcoder - -//! Encoding conversion. -template -struct Transcoder { - //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream. - template - RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) { - unsigned codepoint; - if (!SourceEncoding::Decode(is, &codepoint)) - return false; - TargetEncoding::Encode(os, codepoint); - return true; - } - - //! Validate one Unicode codepoint from an encoded stream. - template - RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) { - return Transcode(is, os); // Since source/target encoding is different, must transcode. - } -}; - -//! Specialization of Transcoder with same source and target encoding. -template -struct Transcoder { - template - RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) { - os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class. - return true; - } - - template - RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) { - return Encoding::Validate(is, os); // source/target encoding are the same - } -}; - -RAPIDJSON_NAMESPACE_END - -#if defined(__GNUC__) || defined(_MSV_VER) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_ENCODINGS_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/error/en.h b/external/rapidjson-1.0.2/include/rapidjson/error/en.h deleted file mode 100644 index d5f9caa..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/error/en.h +++ /dev/null @@ -1,65 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_ERROR_EN_H__ -#define RAPIDJSON_ERROR_EN_H__ - -#include "error.h" - -RAPIDJSON_NAMESPACE_BEGIN - -//! Maps error code of parsing into error message. -/*! - \ingroup RAPIDJSON_ERRORS - \param parseErrorCode Error code obtained in parsing. - \return the error message. - \note User can make a copy of this function for localization. - Using switch-case is safer for future modification of error codes. -*/ -inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) { - switch (parseErrorCode) { - case kParseErrorNone: return RAPIDJSON_ERROR_STRING("No error."); - - case kParseErrorDocumentEmpty: return RAPIDJSON_ERROR_STRING("The document is empty."); - case kParseErrorDocumentRootNotSingular: return RAPIDJSON_ERROR_STRING("The document root must not follow by other values."); - - case kParseErrorValueInvalid: return RAPIDJSON_ERROR_STRING("Invalid value."); - - case kParseErrorObjectMissName: return RAPIDJSON_ERROR_STRING("Missing a name for object member."); - case kParseErrorObjectMissColon: return RAPIDJSON_ERROR_STRING("Missing a colon after a name of object member."); - case kParseErrorObjectMissCommaOrCurlyBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or '}' after an object member."); - - case kParseErrorArrayMissCommaOrSquareBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or ']' after an array element."); - - case kParseErrorStringUnicodeEscapeInvalidHex: return RAPIDJSON_ERROR_STRING("Incorrect hex digit after \\u escape in string."); - case kParseErrorStringUnicodeSurrogateInvalid: return RAPIDJSON_ERROR_STRING("The surrogate pair in string is invalid."); - case kParseErrorStringEscapeInvalid: return RAPIDJSON_ERROR_STRING("Invalid escape character in string."); - case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string."); - case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoding in string."); - - case kParseErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double."); - case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number."); - case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number."); - - case kParseErrorTermination: return RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error."); - case kParseErrorUnspecificSyntaxError: return RAPIDJSON_ERROR_STRING("Unspecific syntax error."); - - default: - return RAPIDJSON_ERROR_STRING("Unknown error."); - } -} - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_ERROR_EN_H__ diff --git a/external/rapidjson-1.0.2/include/rapidjson/error/error.h b/external/rapidjson-1.0.2/include/rapidjson/error/error.h deleted file mode 100644 index f9094fb..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/error/error.h +++ /dev/null @@ -1,146 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_ERROR_ERROR_H__ -#define RAPIDJSON_ERROR_ERROR_H__ - -#include "../rapidjson.h" - -/*! \file error.h */ - -/*! \defgroup RAPIDJSON_ERRORS RapidJSON error handling */ - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ERROR_CHARTYPE - -//! Character type of error messages. -/*! \ingroup RAPIDJSON_ERRORS - The default character type is \c char. - On Windows, user can define this macro as \c TCHAR for supporting both - unicode/non-unicode settings. -*/ -#ifndef RAPIDJSON_ERROR_CHARTYPE -#define RAPIDJSON_ERROR_CHARTYPE char -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ERROR_STRING - -//! Macro for converting string literial to \ref RAPIDJSON_ERROR_CHARTYPE[]. -/*! \ingroup RAPIDJSON_ERRORS - By default this conversion macro does nothing. - On Windows, user can define this macro as \c _T(x) for supporting both - unicode/non-unicode settings. -*/ -#ifndef RAPIDJSON_ERROR_STRING -#define RAPIDJSON_ERROR_STRING(x) x -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// ParseErrorCode - -//! Error code of parsing. -/*! \ingroup RAPIDJSON_ERRORS - \see GenericReader::Parse, GenericReader::GetParseErrorCode -*/ -enum ParseErrorCode { - kParseErrorNone = 0, //!< No error. - - kParseErrorDocumentEmpty, //!< The document is empty. - kParseErrorDocumentRootNotSingular, //!< The document root must not follow by other values. - - kParseErrorValueInvalid, //!< Invalid value. - - kParseErrorObjectMissName, //!< Missing a name for object member. - kParseErrorObjectMissColon, //!< Missing a colon after a name of object member. - kParseErrorObjectMissCommaOrCurlyBracket, //!< Missing a comma or '}' after an object member. - - kParseErrorArrayMissCommaOrSquareBracket, //!< Missing a comma or ']' after an array element. - - kParseErrorStringUnicodeEscapeInvalidHex, //!< Incorrect hex digit after \\u escape in string. - kParseErrorStringUnicodeSurrogateInvalid, //!< The surrogate pair in string is invalid. - kParseErrorStringEscapeInvalid, //!< Invalid escape character in string. - kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string. - kParseErrorStringInvalidEncoding, //!< Invalid encoding in string. - - kParseErrorNumberTooBig, //!< Number too big to be stored in double. - kParseErrorNumberMissFraction, //!< Miss fraction part in number. - kParseErrorNumberMissExponent, //!< Miss exponent in number. - - kParseErrorTermination, //!< Parsing was terminated. - kParseErrorUnspecificSyntaxError //!< Unspecific syntax error. -}; - -//! Result of parsing (wraps ParseErrorCode) -/*! - \ingroup RAPIDJSON_ERRORS - \code - Document doc; - ParseResult ok = doc.Parse("[42]"); - if (!ok) { - fprintf(stderr, "JSON parse error: %s (%u)", - GetParseError_En(ok.Code()), ok.Offset()); - exit(EXIT_FAILURE); - } - \endcode - \see GenericReader::Parse, GenericDocument::Parse -*/ -struct ParseResult { - - //! Default constructor, no error. - ParseResult() : code_(kParseErrorNone), offset_(0) {} - //! Constructor to set an error. - ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {} - - //! Get the error code. - ParseErrorCode Code() const { return code_; } - //! Get the error offset, if \ref IsError(), 0 otherwise. - size_t Offset() const { return offset_; } - - //! Conversion to \c bool, returns \c true, iff !\ref IsError(). - operator bool() const { return !IsError(); } - //! Whether the result is an error. - bool IsError() const { return code_ != kParseErrorNone; } - - bool operator==(const ParseResult& that) const { return code_ == that.code_; } - bool operator==(ParseErrorCode code) const { return code_ == code; } - friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; } - - //! Reset error code. - void Clear() { Set(kParseErrorNone); } - //! Update error code and offset. - void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; } - -private: - ParseErrorCode code_; - size_t offset_; -}; - -//! Function pointer type of GetParseError(). -/*! \ingroup RAPIDJSON_ERRORS - - This is the prototype for \c GetParseError_X(), where \c X is a locale. - User can dynamically change locale in runtime, e.g.: -\code - GetParseErrorFunc GetParseError = GetParseError_En; // or whatever - const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode()); -\endcode -*/ -typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode); - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_ERROR_ERROR_H__ diff --git a/external/rapidjson-1.0.2/include/rapidjson/filereadstream.h b/external/rapidjson-1.0.2/include/rapidjson/filereadstream.h deleted file mode 100644 index 3913eb7..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/filereadstream.h +++ /dev/null @@ -1,88 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_FILEREADSTREAM_H_ -#define RAPIDJSON_FILEREADSTREAM_H_ - -#include "rapidjson.h" -#include - -RAPIDJSON_NAMESPACE_BEGIN - -//! File byte stream for input using fread(). -/*! - \note implements Stream concept -*/ -class FileReadStream { -public: - typedef char Ch; //!< Character type (byte). - - //! Constructor. - /*! - \param fp File pointer opened for read. - \param buffer user-supplied buffer. - \param bufferSize size of buffer in bytes. Must >=4 bytes. - */ - FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { - RAPIDJSON_ASSERT(fp_ != 0); - RAPIDJSON_ASSERT(bufferSize >= 4); - Read(); - } - - Ch Peek() const { return *current_; } - Ch Take() { Ch c = *current_; Read(); return c; } - size_t Tell() const { return count_ + static_cast(current_ - buffer_); } - - // Not implemented - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - - // For encoding detection only. - const Ch* Peek4() const { - return (current_ + 4 <= bufferLast_) ? current_ : 0; - } - -private: - void Read() { - if (current_ < bufferLast_) - ++current_; - else if (!eof_) { - count_ += readCount_; - readCount_ = fread(buffer_, 1, bufferSize_, fp_); - bufferLast_ = buffer_ + readCount_ - 1; - current_ = buffer_; - - if (readCount_ < bufferSize_) { - buffer_[readCount_] = '\0'; - ++bufferLast_; - eof_ = true; - } - } - } - - std::FILE* fp_; - Ch *buffer_; - size_t bufferSize_; - Ch *bufferLast_; - Ch *current_; - size_t readCount_; - size_t count_; //!< Number of characters read - bool eof_; -}; - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/filewritestream.h b/external/rapidjson-1.0.2/include/rapidjson/filewritestream.h deleted file mode 100644 index dfb9cbd..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/filewritestream.h +++ /dev/null @@ -1,91 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_FILEWRITESTREAM_H_ -#define RAPIDJSON_FILEWRITESTREAM_H_ - -#include "rapidjson.h" -#include - -RAPIDJSON_NAMESPACE_BEGIN - -//! Wrapper of C file stream for input using fread(). -/*! - \note implements Stream concept -*/ -class FileWriteStream { -public: - typedef char Ch; //!< Character type. Only support char. - - FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { - RAPIDJSON_ASSERT(fp_ != 0); - } - - void Put(char c) { - if (current_ >= bufferEnd_) - Flush(); - - *current_++ = c; - } - - void PutN(char c, size_t n) { - size_t avail = static_cast(bufferEnd_ - current_); - while (n > avail) { - std::memset(current_, c, avail); - current_ += avail; - Flush(); - n -= avail; - avail = static_cast(bufferEnd_ - current_); - } - - if (n > 0) { - std::memset(current_, c, n); - current_ += n; - } - } - - void Flush() { - if (current_ != buffer_) { - fwrite(buffer_, 1, static_cast(current_ - buffer_), fp_); - current_ = buffer_; - } - } - - // Not implemented - char Peek() const { RAPIDJSON_ASSERT(false); return 0; } - char Take() { RAPIDJSON_ASSERT(false); return 0; } - size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } - char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - // Prohibit copy constructor & assignment operator. - FileWriteStream(const FileWriteStream&); - FileWriteStream& operator=(const FileWriteStream&); - - std::FILE* fp_; - char *buffer_; - char *bufferEnd_; - char *current_; -}; - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(FileWriteStream& stream, char c, size_t n) { - stream.PutN(c, n); -} - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/biginteger.h b/external/rapidjson-1.0.2/include/rapidjson/internal/biginteger.h deleted file mode 100644 index 99a30ac..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/biginteger.h +++ /dev/null @@ -1,280 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_BIGINTEGER_H_ -#define RAPIDJSON_BIGINTEGER_H_ - -#include "../rapidjson.h" - -#if defined(_MSC_VER) && defined(_M_AMD64) -#include // for _umul128 -#endif - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -class BigInteger { -public: - typedef uint64_t Type; - - BigInteger(const BigInteger& rhs) : count_(rhs.count_) { - std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); - } - - explicit BigInteger(uint64_t u) : count_(1) { - digits_[0] = u; - } - - BigInteger(const char* decimals, size_t length) : count_(1) { - RAPIDJSON_ASSERT(length > 0); - digits_[0] = 0; - size_t i = 0; - const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19 - while (length >= kMaxDigitPerIteration) { - AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration); - length -= kMaxDigitPerIteration; - i += kMaxDigitPerIteration; - } - - if (length > 0) - AppendDecimal64(decimals + i, decimals + i + length); - } - - BigInteger& operator=(uint64_t u) { - digits_[0] = u; - count_ = 1; - return *this; - } - - BigInteger& operator+=(uint64_t u) { - Type backup = digits_[0]; - digits_[0] += u; - for (size_t i = 0; i < count_ - 1; i++) { - if (digits_[i] >= backup) - return *this; // no carry - backup = digits_[i + 1]; - digits_[i + 1] += 1; - } - - // Last carry - if (digits_[count_ - 1] < backup) - PushBack(1); - - return *this; - } - - BigInteger& operator*=(uint64_t u) { - if (u == 0) return *this = 0; - if (u == 1) return *this; - if (*this == 1) return *this = u; - - uint64_t k = 0; - for (size_t i = 0; i < count_; i++) { - uint64_t hi; - digits_[i] = MulAdd64(digits_[i], u, k, &hi); - k = hi; - } - - if (k > 0) - PushBack(k); - - return *this; - } - - BigInteger& operator*=(uint32_t u) { - if (u == 0) return *this = 0; - if (u == 1) return *this; - if (*this == 1) return *this = u; - - uint64_t k = 0; - for (size_t i = 0; i < count_; i++) { - const uint64_t c = digits_[i] >> 32; - const uint64_t d = digits_[i] & 0xFFFFFFFF; - const uint64_t uc = u * c; - const uint64_t ud = u * d; - const uint64_t p0 = ud + k; - const uint64_t p1 = uc + (p0 >> 32); - digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32); - k = p1 >> 32; - } - - if (k > 0) - PushBack(k); - - return *this; - } - - BigInteger& operator<<=(size_t shift) { - if (IsZero() || shift == 0) return *this; - - size_t offset = shift / kTypeBit; - size_t interShift = shift % kTypeBit; - RAPIDJSON_ASSERT(count_ + offset <= kCapacity); - - if (interShift == 0) { - std::memmove(&digits_[count_ - 1 + offset], &digits_[count_ - 1], count_ * sizeof(Type)); - count_ += offset; - } - else { - digits_[count_] = 0; - for (size_t i = count_; i > 0; i--) - digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift)); - digits_[offset] = digits_[0] << interShift; - count_ += offset; - if (digits_[count_]) - count_++; - } - - std::memset(digits_, 0, offset * sizeof(Type)); - - return *this; - } - - bool operator==(const BigInteger& rhs) const { - return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0; - } - - bool operator==(const Type rhs) const { - return count_ == 1 && digits_[0] == rhs; - } - - BigInteger& MultiplyPow5(unsigned exp) { - static const uint32_t kPow5[12] = { - 5, - 5 * 5, - 5 * 5 * 5, - 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 - }; - if (exp == 0) return *this; - for (; exp >= 27; exp -= 27) *this *= RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27 - for (; exp >= 13; exp -= 13) *this *= static_cast(1220703125u); // 5^13 - if (exp > 0) *this *= kPow5[exp - 1]; - return *this; - } - - // Compute absolute difference of this and rhs. - // Assume this != rhs - bool Difference(const BigInteger& rhs, BigInteger* out) const { - int cmp = Compare(rhs); - RAPIDJSON_ASSERT(cmp != 0); - const BigInteger *a, *b; // Makes a > b - bool ret; - if (cmp < 0) { a = &rhs; b = this; ret = true; } - else { a = this; b = &rhs; ret = false; } - - Type borrow = 0; - for (size_t i = 0; i < a->count_; i++) { - Type d = a->digits_[i] - borrow; - if (i < b->count_) - d -= b->digits_[i]; - borrow = (d > a->digits_[i]) ? 1 : 0; - out->digits_[i] = d; - if (d != 0) - out->count_ = i + 1; - } - - return ret; - } - - int Compare(const BigInteger& rhs) const { - if (count_ != rhs.count_) - return count_ < rhs.count_ ? -1 : 1; - - for (size_t i = count_; i-- > 0;) - if (digits_[i] != rhs.digits_[i]) - return digits_[i] < rhs.digits_[i] ? -1 : 1; - - return 0; - } - - size_t GetCount() const { return count_; } - Type GetDigit(size_t index) const { RAPIDJSON_ASSERT(index < count_); return digits_[index]; } - bool IsZero() const { return count_ == 1 && digits_[0] == 0; } - -private: - void AppendDecimal64(const char* begin, const char* end) { - uint64_t u = ParseUint64(begin, end); - if (IsZero()) - *this = u; - else { - unsigned exp = static_cast(end - begin); - (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u - } - } - - void PushBack(Type digit) { - RAPIDJSON_ASSERT(count_ < kCapacity); - digits_[count_++] = digit; - } - - static uint64_t ParseUint64(const char* begin, const char* end) { - uint64_t r = 0; - for (const char* p = begin; p != end; ++p) { - RAPIDJSON_ASSERT(*p >= '0' && *p <= '9'); - r = r * 10 + (*p - '0'); - } - return r; - } - - // Assume a * b + k < 2^128 - static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) { -#if defined(_MSC_VER) && defined(_M_AMD64) - uint64_t low = _umul128(a, b, outHigh) + k; - if (low < k) - (*outHigh)++; - return low; -#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) - __extension__ typedef unsigned __int128 uint128; - uint128 p = static_cast(a) * static_cast(b); - p += k; - *outHigh = static_cast(p >> 64); - return static_cast(p); -#else - const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32; - uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1; - x1 += (x0 >> 32); // can't give carry - x1 += x2; - if (x1 < x2) - x3 += (static_cast(1) << 32); - uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF); - uint64_t hi = x3 + (x1 >> 32); - - lo += k; - if (lo < k) - hi++; - *outHigh = hi; - return lo; -#endif - } - - static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000 - static const size_t kCapacity = kBitCount / sizeof(Type); - static const size_t kTypeBit = sizeof(Type) * 8; - - Type digits_[kCapacity]; - size_t count_; -}; - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_BIGINTEGER_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/diyfp.h b/external/rapidjson-1.0.2/include/rapidjson/internal/diyfp.h deleted file mode 100644 index 3b6c423..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/diyfp.h +++ /dev/null @@ -1,247 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -// This is a C++ header-only implementation of Grisu2 algorithm from the publication: -// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with -// integers." ACM Sigplan Notices 45.6 (2010): 233-243. - -#ifndef RAPIDJSON_DIYFP_H_ -#define RAPIDJSON_DIYFP_H_ - -#include "../rapidjson.h" - -#if defined(_MSC_VER) && defined(_M_AMD64) -#include -#pragma intrinsic(_BitScanReverse64) -#endif - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -struct DiyFp { - DiyFp() {} - - DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {} - - explicit DiyFp(double d) { - union { - double d; - uint64_t u64; - } u = { d }; - - int biased_e = static_cast((u.u64 & kDpExponentMask) >> kDpSignificandSize); - uint64_t significand = (u.u64 & kDpSignificandMask); - if (biased_e != 0) { - f = significand + kDpHiddenBit; - e = biased_e - kDpExponentBias; - } - else { - f = significand; - e = kDpMinExponent + 1; - } - } - - DiyFp operator-(const DiyFp& rhs) const { - return DiyFp(f - rhs.f, e); - } - - DiyFp operator*(const DiyFp& rhs) const { -#if defined(_MSC_VER) && defined(_M_AMD64) - uint64_t h; - uint64_t l = _umul128(f, rhs.f, &h); - if (l & (uint64_t(1) << 63)) // rounding - h++; - return DiyFp(h, e + rhs.e + 64); -#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) - __extension__ typedef unsigned __int128 uint128; - uint128 p = static_cast(f) * static_cast(rhs.f); - uint64_t h = static_cast(p >> 64); - uint64_t l = static_cast(p); - if (l & (uint64_t(1) << 63)) // rounding - h++; - return DiyFp(h, e + rhs.e + 64); -#else - const uint64_t M32 = 0xFFFFFFFF; - const uint64_t a = f >> 32; - const uint64_t b = f & M32; - const uint64_t c = rhs.f >> 32; - const uint64_t d = rhs.f & M32; - const uint64_t ac = a * c; - const uint64_t bc = b * c; - const uint64_t ad = a * d; - const uint64_t bd = b * d; - uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32); - tmp += 1U << 31; /// mult_round - return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64); -#endif - } - - DiyFp Normalize() const { -#if defined(_MSC_VER) && defined(_M_AMD64) - unsigned long index; - _BitScanReverse64(&index, f); - return DiyFp(f << (63 - index), e - (63 - index)); -#elif defined(__GNUC__) && __GNUC__ >= 4 - int s = __builtin_clzll(f); - return DiyFp(f << s, e - s); -#else - DiyFp res = *this; - while (!(res.f & (static_cast(1) << 63))) { - res.f <<= 1; - res.e--; - } - return res; -#endif - } - - DiyFp NormalizeBoundary() const { - DiyFp res = *this; - while (!(res.f & (kDpHiddenBit << 1))) { - res.f <<= 1; - res.e--; - } - res.f <<= (kDiySignificandSize - kDpSignificandSize - 2); - res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2); - return res; - } - - void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const { - DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary(); - DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1); - mi.f <<= mi.e - pl.e; - mi.e = pl.e; - *plus = pl; - *minus = mi; - } - - double ToDouble() const { - union { - double d; - uint64_t u64; - }u; - const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 : - static_cast(e + kDpExponentBias); - u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize); - return u.d; - } - - static const int kDiySignificandSize = 64; - static const int kDpSignificandSize = 52; - static const int kDpExponentBias = 0x3FF + kDpSignificandSize; - static const int kDpMaxExponent = 0x7FF - kDpExponentBias; - static const int kDpMinExponent = -kDpExponentBias; - static const int kDpDenormalExponent = -kDpExponentBias + 1; - static const uint64_t kDpExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); - static const uint64_t kDpSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); - static const uint64_t kDpHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); - - uint64_t f; - int e; -}; - -inline DiyFp GetCachedPowerByIndex(size_t index) { - // 10^-348, 10^-340, ..., 10^340 - static const uint64_t kCachedPowers_F[] = { - RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76), - RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea), - RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df), - RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f), - RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c), - RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5), - RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d), - RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637), - RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7), - RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5), - RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b), - RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996), - RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6), - RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8), - RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053), - RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd), - RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94), - RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b), - RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac), - RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3), - RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb), - RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c), - RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000), - RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984), - RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70), - RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245), - RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8), - RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a), - RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea), - RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85), - RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2), - RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3), - RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25), - RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece), - RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5), - RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a), - RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c), - RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a), - RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129), - RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429), - RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d), - RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841), - RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9), - RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b) - }; - static const int16_t kCachedPowers_E[] = { - -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, - -954, -927, -901, -874, -847, -821, -794, -768, -741, -715, - -688, -661, -635, -608, -582, -555, -529, -502, -475, -449, - -422, -396, -369, -343, -316, -289, -263, -236, -210, -183, - -157, -130, -103, -77, -50, -24, 3, 30, 56, 83, - 109, 136, 162, 189, 216, 242, 269, 295, 322, 348, - 375, 402, 428, 455, 481, 508, 534, 561, 588, 614, - 641, 667, 694, 720, 747, 774, 800, 827, 853, 880, - 907, 933, 960, 986, 1013, 1039, 1066 - }; - return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]); -} - -inline DiyFp GetCachedPower(int e, int* K) { - - //int k = static_cast(ceil((-61 - e) * 0.30102999566398114)) + 374; - double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive - int k = static_cast(dk); - if (dk - k > 0.0) - k++; - - unsigned index = static_cast((k >> 3) + 1); - *K = -(-348 + static_cast(index << 3)); // decimal exponent no need lookup table - - return GetCachedPowerByIndex(index); -} - -inline DiyFp GetCachedPower10(int exp, int *outExp) { - unsigned index = (exp + 348) / 8; - *outExp = -348 + index * 8; - return GetCachedPowerByIndex(index); - } - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_DIYFP_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/dtoa.h b/external/rapidjson-1.0.2/include/rapidjson/internal/dtoa.h deleted file mode 100644 index 2d8d2e4..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/dtoa.h +++ /dev/null @@ -1,217 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -// This is a C++ header-only implementation of Grisu2 algorithm from the publication: -// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with -// integers." ACM Sigplan Notices 45.6 (2010): 233-243. - -#ifndef RAPIDJSON_DTOA_ -#define RAPIDJSON_DTOA_ - -#include "itoa.h" // GetDigitsLut() -#include "diyfp.h" -#include "ieee754.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) { - while (rest < wp_w && delta - rest >= ten_kappa && - (rest + ten_kappa < wp_w || /// closer - wp_w - rest > rest + ten_kappa - wp_w)) { - buffer[len - 1]--; - rest += ten_kappa; - } -} - -inline unsigned CountDecimalDigit32(uint32_t n) { - // Simple pure C++ implementation was faster than __builtin_clz version in this situation. - if (n < 10) return 1; - if (n < 100) return 2; - if (n < 1000) return 3; - if (n < 10000) return 4; - if (n < 100000) return 5; - if (n < 1000000) return 6; - if (n < 10000000) return 7; - if (n < 100000000) return 8; - // Will not reach 10 digits in DigitGen() - //if (n < 1000000000) return 9; - //return 10; - return 9; -} - -inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) { - static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; - const DiyFp one(uint64_t(1) << -Mp.e, Mp.e); - const DiyFp wp_w = Mp - W; - uint32_t p1 = static_cast(Mp.f >> -one.e); - uint64_t p2 = Mp.f & (one.f - 1); - int kappa = CountDecimalDigit32(p1); // kappa in [0, 9] - *len = 0; - - while (kappa > 0) { - uint32_t d = 0; - switch (kappa) { - case 9: d = p1 / 100000000; p1 %= 100000000; break; - case 8: d = p1 / 10000000; p1 %= 10000000; break; - case 7: d = p1 / 1000000; p1 %= 1000000; break; - case 6: d = p1 / 100000; p1 %= 100000; break; - case 5: d = p1 / 10000; p1 %= 10000; break; - case 4: d = p1 / 1000; p1 %= 1000; break; - case 3: d = p1 / 100; p1 %= 100; break; - case 2: d = p1 / 10; p1 %= 10; break; - case 1: d = p1; p1 = 0; break; - default:; - } - if (d || *len) - buffer[(*len)++] = static_cast('0' + static_cast(d)); - kappa--; - uint64_t tmp = (static_cast(p1) << -one.e) + p2; - if (tmp <= delta) { - *K += kappa; - GrisuRound(buffer, *len, delta, tmp, static_cast(kPow10[kappa]) << -one.e, wp_w.f); - return; - } - } - - // kappa = 0 - for (;;) { - p2 *= 10; - delta *= 10; - char d = static_cast(p2 >> -one.e); - if (d || *len) - buffer[(*len)++] = static_cast('0' + d); - p2 &= one.f - 1; - kappa--; - if (p2 < delta) { - *K += kappa; - GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * kPow10[-kappa]); - return; - } - } -} - -inline void Grisu2(double value, char* buffer, int* length, int* K) { - const DiyFp v(value); - DiyFp w_m, w_p; - v.NormalizedBoundaries(&w_m, &w_p); - - const DiyFp c_mk = GetCachedPower(w_p.e, K); - const DiyFp W = v.Normalize() * c_mk; - DiyFp Wp = w_p * c_mk; - DiyFp Wm = w_m * c_mk; - Wm.f++; - Wp.f--; - DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); -} - -inline char* WriteExponent(int K, char* buffer) { - if (K < 0) { - *buffer++ = '-'; - K = -K; - } - - if (K >= 100) { - *buffer++ = static_cast('0' + static_cast(K / 100)); - K %= 100; - const char* d = GetDigitsLut() + K * 2; - *buffer++ = d[0]; - *buffer++ = d[1]; - } - else if (K >= 10) { - const char* d = GetDigitsLut() + K * 2; - *buffer++ = d[0]; - *buffer++ = d[1]; - } - else - *buffer++ = static_cast('0' + static_cast(K)); - - return buffer; -} - -inline char* Prettify(char* buffer, int length, int k) { - const int kk = length + k; // 10^(kk-1) <= v < 10^kk - - if (length <= kk && kk <= 21) { - // 1234e7 -> 12340000000 - for (int i = length; i < kk; i++) - buffer[i] = '0'; - buffer[kk] = '.'; - buffer[kk + 1] = '0'; - return &buffer[kk + 2]; - } - else if (0 < kk && kk <= 21) { - // 1234e-2 -> 12.34 - std::memmove(&buffer[kk + 1], &buffer[kk], length - kk); - buffer[kk] = '.'; - return &buffer[length + 1]; - } - else if (-6 < kk && kk <= 0) { - // 1234e-6 -> 0.001234 - const int offset = 2 - kk; - std::memmove(&buffer[offset], &buffer[0], length); - buffer[0] = '0'; - buffer[1] = '.'; - for (int i = 2; i < offset; i++) - buffer[i] = '0'; - return &buffer[length + offset]; - } - else if (length == 1) { - // 1e30 - buffer[1] = 'e'; - return WriteExponent(kk - 1, &buffer[2]); - } - else { - // 1234e30 -> 1.234e33 - std::memmove(&buffer[2], &buffer[1], length - 1); - buffer[1] = '.'; - buffer[length + 1] = 'e'; - return WriteExponent(kk - 1, &buffer[0 + length + 2]); - } -} - -inline char* dtoa(double value, char* buffer) { - Double d(value); - if (d.IsZero()) { - if (d.Sign()) - *buffer++ = '-'; // -0.0, Issue #289 - buffer[0] = '0'; - buffer[1] = '.'; - buffer[2] = '0'; - return &buffer[3]; - } - else { - if (value < 0) { - *buffer++ = '-'; - value = -value; - } - int length, K; - Grisu2(value, buffer, &length, &K); - return Prettify(buffer, length, K); - } -} - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_DTOA_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/ieee754.h b/external/rapidjson-1.0.2/include/rapidjson/internal/ieee754.h deleted file mode 100644 index e3f0336..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/ieee754.h +++ /dev/null @@ -1,77 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_IEEE754_ -#define RAPIDJSON_IEEE754_ - -#include "../rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -class Double { -public: - Double() {} - Double(double d) : d_(d) {} - Double(uint64_t u) : u_(u) {} - - double Value() const { return d_; } - uint64_t Uint64Value() const { return u_; } - - double NextPositiveDouble() const { - RAPIDJSON_ASSERT(!Sign()); - return Double(u_ + 1).Value(); - } - - bool Sign() const { return (u_ & kSignMask) != 0; } - uint64_t Significand() const { return u_ & kSignificandMask; } - int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } - - bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } - bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } - bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } - bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } - - uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } - int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } - uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } - - static unsigned EffectiveSignificandSize(int order) { - if (order >= -1021) - return 53; - else if (order <= -1074) - return 0; - else - return order + 1074; - } - -private: - static const int kSignificandSize = 52; - static const int kExponentBias = 0x3FF; - static const int kDenormalExponent = 1 - kExponentBias; - static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); - static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); - static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); - static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); - - union { - double d_; - uint64_t u_; - }; -}; - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_IEEE754_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/itoa.h b/external/rapidjson-1.0.2/include/rapidjson/internal/itoa.h deleted file mode 100644 index 01a4e7e..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/itoa.h +++ /dev/null @@ -1,304 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_ITOA_ -#define RAPIDJSON_ITOA_ - -#include "../rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -inline const char* GetDigitsLut() { - static const char cDigitsLut[200] = { - '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9', - '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9', - '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9', - '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9', - '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9', - '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9', - '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9', - '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9', - '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9', - '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9' - }; - return cDigitsLut; -} - -inline char* u32toa(uint32_t value, char* buffer) { - const char* cDigitsLut = GetDigitsLut(); - - if (value < 10000) { - const uint32_t d1 = (value / 100) << 1; - const uint32_t d2 = (value % 100) << 1; - - if (value >= 1000) - *buffer++ = cDigitsLut[d1]; - if (value >= 100) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 10) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - } - else if (value < 100000000) { - // value = bbbbcccc - const uint32_t b = value / 10000; - const uint32_t c = value % 10000; - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - if (value >= 10000000) - *buffer++ = cDigitsLut[d1]; - if (value >= 1000000) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 100000) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - else { - // value = aabbbbcccc in decimal - - const uint32_t a = value / 100000000; // 1 to 42 - value %= 100000000; - - if (a >= 10) { - const unsigned i = a << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else - *buffer++ = static_cast('0' + static_cast(a)); - - const uint32_t b = value / 10000; // 0 to 9999 - const uint32_t c = value % 10000; // 0 to 9999 - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - *buffer++ = cDigitsLut[d1]; - *buffer++ = cDigitsLut[d1 + 1]; - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - return buffer; -} - -inline char* i32toa(int32_t value, char* buffer) { - uint32_t u = static_cast(value); - if (value < 0) { - *buffer++ = '-'; - u = ~u + 1; - } - - return u32toa(u, buffer); -} - -inline char* u64toa(uint64_t value, char* buffer) { - const char* cDigitsLut = GetDigitsLut(); - const uint64_t kTen8 = 100000000; - const uint64_t kTen9 = kTen8 * 10; - const uint64_t kTen10 = kTen8 * 100; - const uint64_t kTen11 = kTen8 * 1000; - const uint64_t kTen12 = kTen8 * 10000; - const uint64_t kTen13 = kTen8 * 100000; - const uint64_t kTen14 = kTen8 * 1000000; - const uint64_t kTen15 = kTen8 * 10000000; - const uint64_t kTen16 = kTen8 * kTen8; - - if (value < kTen8) { - uint32_t v = static_cast(value); - if (v < 10000) { - const uint32_t d1 = (v / 100) << 1; - const uint32_t d2 = (v % 100) << 1; - - if (v >= 1000) - *buffer++ = cDigitsLut[d1]; - if (v >= 100) - *buffer++ = cDigitsLut[d1 + 1]; - if (v >= 10) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - } - else { - // value = bbbbcccc - const uint32_t b = v / 10000; - const uint32_t c = v % 10000; - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - if (value >= 10000000) - *buffer++ = cDigitsLut[d1]; - if (value >= 1000000) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 100000) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - } - else if (value < kTen16) { - const uint32_t v0 = static_cast(value / kTen8); - const uint32_t v1 = static_cast(value % kTen8); - - const uint32_t b0 = v0 / 10000; - const uint32_t c0 = v0 % 10000; - - const uint32_t d1 = (b0 / 100) << 1; - const uint32_t d2 = (b0 % 100) << 1; - - const uint32_t d3 = (c0 / 100) << 1; - const uint32_t d4 = (c0 % 100) << 1; - - const uint32_t b1 = v1 / 10000; - const uint32_t c1 = v1 % 10000; - - const uint32_t d5 = (b1 / 100) << 1; - const uint32_t d6 = (b1 % 100) << 1; - - const uint32_t d7 = (c1 / 100) << 1; - const uint32_t d8 = (c1 % 100) << 1; - - if (value >= kTen15) - *buffer++ = cDigitsLut[d1]; - if (value >= kTen14) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= kTen13) - *buffer++ = cDigitsLut[d2]; - if (value >= kTen12) - *buffer++ = cDigitsLut[d2 + 1]; - if (value >= kTen11) - *buffer++ = cDigitsLut[d3]; - if (value >= kTen10) - *buffer++ = cDigitsLut[d3 + 1]; - if (value >= kTen9) - *buffer++ = cDigitsLut[d4]; - if (value >= kTen8) - *buffer++ = cDigitsLut[d4 + 1]; - - *buffer++ = cDigitsLut[d5]; - *buffer++ = cDigitsLut[d5 + 1]; - *buffer++ = cDigitsLut[d6]; - *buffer++ = cDigitsLut[d6 + 1]; - *buffer++ = cDigitsLut[d7]; - *buffer++ = cDigitsLut[d7 + 1]; - *buffer++ = cDigitsLut[d8]; - *buffer++ = cDigitsLut[d8 + 1]; - } - else { - const uint32_t a = static_cast(value / kTen16); // 1 to 1844 - value %= kTen16; - - if (a < 10) - *buffer++ = static_cast('0' + static_cast(a)); - else if (a < 100) { - const uint32_t i = a << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else if (a < 1000) { - *buffer++ = static_cast('0' + static_cast(a / 100)); - - const uint32_t i = (a % 100) << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else { - const uint32_t i = (a / 100) << 1; - const uint32_t j = (a % 100) << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - *buffer++ = cDigitsLut[j]; - *buffer++ = cDigitsLut[j + 1]; - } - - const uint32_t v0 = static_cast(value / kTen8); - const uint32_t v1 = static_cast(value % kTen8); - - const uint32_t b0 = v0 / 10000; - const uint32_t c0 = v0 % 10000; - - const uint32_t d1 = (b0 / 100) << 1; - const uint32_t d2 = (b0 % 100) << 1; - - const uint32_t d3 = (c0 / 100) << 1; - const uint32_t d4 = (c0 % 100) << 1; - - const uint32_t b1 = v1 / 10000; - const uint32_t c1 = v1 % 10000; - - const uint32_t d5 = (b1 / 100) << 1; - const uint32_t d6 = (b1 % 100) << 1; - - const uint32_t d7 = (c1 / 100) << 1; - const uint32_t d8 = (c1 % 100) << 1; - - *buffer++ = cDigitsLut[d1]; - *buffer++ = cDigitsLut[d1 + 1]; - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - *buffer++ = cDigitsLut[d5]; - *buffer++ = cDigitsLut[d5 + 1]; - *buffer++ = cDigitsLut[d6]; - *buffer++ = cDigitsLut[d6 + 1]; - *buffer++ = cDigitsLut[d7]; - *buffer++ = cDigitsLut[d7 + 1]; - *buffer++ = cDigitsLut[d8]; - *buffer++ = cDigitsLut[d8 + 1]; - } - - return buffer; -} - -inline char* i64toa(int64_t value, char* buffer) { - uint64_t u = static_cast(value); - if (value < 0) { - *buffer++ = '-'; - u = ~u + 1; - } - - return u64toa(u, buffer); -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_ITOA_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/meta.h b/external/rapidjson-1.0.2/include/rapidjson/internal/meta.h deleted file mode 100644 index 5a9aaa4..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/meta.h +++ /dev/null @@ -1,181 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_INTERNAL_META_H_ -#define RAPIDJSON_INTERNAL_META_H_ - -#include "../rapidjson.h" - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif -#if defined(_MSC_VER) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(6334) -#endif - -#if RAPIDJSON_HAS_CXX11_TYPETRAITS -#include -#endif - -//@cond RAPIDJSON_INTERNAL -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching -template struct Void { typedef void Type; }; - -/////////////////////////////////////////////////////////////////////////////// -// BoolType, TrueType, FalseType -// -template struct BoolType { - static const bool Value = Cond; - typedef BoolType Type; -}; -typedef BoolType TrueType; -typedef BoolType FalseType; - - -/////////////////////////////////////////////////////////////////////////////// -// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr -// - -template struct SelectIfImpl { template struct Apply { typedef T1 Type; }; }; -template <> struct SelectIfImpl { template struct Apply { typedef T2 Type; }; }; -template struct SelectIfCond : SelectIfImpl::template Apply {}; -template struct SelectIf : SelectIfCond {}; - -template struct AndExprCond : FalseType {}; -template <> struct AndExprCond : TrueType {}; -template struct OrExprCond : TrueType {}; -template <> struct OrExprCond : FalseType {}; - -template struct BoolExpr : SelectIf::Type {}; -template struct NotExpr : SelectIf::Type {}; -template struct AndExpr : AndExprCond::Type {}; -template struct OrExpr : OrExprCond::Type {}; - - -/////////////////////////////////////////////////////////////////////////////// -// AddConst, MaybeAddConst, RemoveConst -template struct AddConst { typedef const T Type; }; -template struct MaybeAddConst : SelectIfCond {}; -template struct RemoveConst { typedef T Type; }; -template struct RemoveConst { typedef T Type; }; - - -/////////////////////////////////////////////////////////////////////////////// -// IsSame, IsConst, IsMoreConst, IsPointer -// -template struct IsSame : FalseType {}; -template struct IsSame : TrueType {}; - -template struct IsConst : FalseType {}; -template struct IsConst : TrueType {}; - -template -struct IsMoreConst - : AndExpr::Type, typename RemoveConst::Type>, - BoolType::Value >= IsConst::Value> >::Type {}; - -template struct IsPointer : FalseType {}; -template struct IsPointer : TrueType {}; - -/////////////////////////////////////////////////////////////////////////////// -// IsBaseOf -// -#if RAPIDJSON_HAS_CXX11_TYPETRAITS - -template struct IsBaseOf - : BoolType< ::std::is_base_of::value> {}; - -#else // simplified version adopted from Boost - -template struct IsBaseOfImpl { - RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0); - RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0); - - typedef char (&Yes)[1]; - typedef char (&No) [2]; - - template - static Yes Check(const D*, T); - static No Check(const B*, int); - - struct Host { - operator const B*() const; - operator const D*(); - }; - - enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) }; -}; - -template struct IsBaseOf - : OrExpr, BoolExpr > >::Type {}; - -#endif // RAPIDJSON_HAS_CXX11_TYPETRAITS - - -////////////////////////////////////////////////////////////////////////// -// EnableIf / DisableIf -// -template struct EnableIfCond { typedef T Type; }; -template struct EnableIfCond { /* empty */ }; - -template struct DisableIfCond { typedef T Type; }; -template struct DisableIfCond { /* empty */ }; - -template -struct EnableIf : EnableIfCond {}; - -template -struct DisableIf : DisableIfCond {}; - -// SFINAE helpers -struct SfinaeTag {}; -template struct RemoveSfinaeTag; -template struct RemoveSfinaeTag { typedef T Type; }; - -#define RAPIDJSON_REMOVEFPTR_(type) \ - typename ::RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \ - < ::RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type - -#define RAPIDJSON_ENABLEIF(cond) \ - typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ - ::Type * = NULL - -#define RAPIDJSON_DISABLEIF(cond) \ - typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ - ::Type * = NULL - -#define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \ - typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ - ::Type - -#define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \ - typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ - ::Type - -} // namespace internal -RAPIDJSON_NAMESPACE_END -//@endcond - -#if defined(__GNUC__) || defined(_MSC_VER) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_INTERNAL_META_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/pow10.h b/external/rapidjson-1.0.2/include/rapidjson/internal/pow10.h deleted file mode 100644 index 02f475d..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/pow10.h +++ /dev/null @@ -1,55 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_POW10_ -#define RAPIDJSON_POW10_ - -#include "../rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -//! Computes integer powers of 10 in double (10.0^n). -/*! This function uses lookup table for fast and accurate results. - \param n non-negative exponent. Must <= 308. - \return 10.0^n -*/ -inline double Pow10(int n) { - static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes - 1e+0, - 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, - 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40, - 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60, - 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80, - 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100, - 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120, - 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140, - 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160, - 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180, - 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200, - 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220, - 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240, - 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260, - 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280, - 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300, - 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308 - }; - RAPIDJSON_ASSERT(n >= 0 && n <= 308); - return e[n]; -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_POW10_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/stack.h b/external/rapidjson-1.0.2/include/rapidjson/internal/stack.h deleted file mode 100644 index 722d569..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/stack.h +++ /dev/null @@ -1,179 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_INTERNAL_STACK_H_ -#define RAPIDJSON_INTERNAL_STACK_H_ - -#include "../rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -/////////////////////////////////////////////////////////////////////////////// -// Stack - -//! A type-unsafe stack for storing different types of data. -/*! \tparam Allocator Allocator for allocating stack memory. -*/ -template -class Stack { -public: - // Optimization note: Do not allocate memory for stack_ in constructor. - // Do it lazily when first Push() -> Expand() -> Resize(). - Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) { - RAPIDJSON_ASSERT(stackCapacity > 0); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - Stack(Stack&& rhs) - : allocator_(rhs.allocator_), - ownAllocator_(rhs.ownAllocator_), - stack_(rhs.stack_), - stackTop_(rhs.stackTop_), - stackEnd_(rhs.stackEnd_), - initialCapacity_(rhs.initialCapacity_) - { - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.stack_ = 0; - rhs.stackTop_ = 0; - rhs.stackEnd_ = 0; - rhs.initialCapacity_ = 0; - } -#endif - - ~Stack() { - Destroy(); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - Stack& operator=(Stack&& rhs) { - if (&rhs != this) - { - Destroy(); - - allocator_ = rhs.allocator_; - ownAllocator_ = rhs.ownAllocator_; - stack_ = rhs.stack_; - stackTop_ = rhs.stackTop_; - stackEnd_ = rhs.stackEnd_; - initialCapacity_ = rhs.initialCapacity_; - - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.stack_ = 0; - rhs.stackTop_ = 0; - rhs.stackEnd_ = 0; - rhs.initialCapacity_ = 0; - } - return *this; - } -#endif - - void Clear() { stackTop_ = stack_; } - - void ShrinkToFit() { - if (Empty()) { - // If the stack is empty, completely deallocate the memory. - Allocator::Free(stack_); - stack_ = 0; - stackTop_ = 0; - stackEnd_ = 0; - } - else - Resize(GetSize()); - } - - // Optimization note: try to minimize the size of this function for force inline. - // Expansion is run very infrequently, so it is moved to another (probably non-inline) function. - template - RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) { - // Expand the stack if needed - if (stackTop_ + sizeof(T) * count >= stackEnd_) - Expand(count); - - T* ret = reinterpret_cast(stackTop_); - stackTop_ += sizeof(T) * count; - return ret; - } - - template - T* Pop(size_t count) { - RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T)); - stackTop_ -= count * sizeof(T); - return reinterpret_cast(stackTop_); - } - - template - T* Top() { - RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); - return reinterpret_cast(stackTop_ - sizeof(T)); - } - - template - T* Bottom() { return (T*)stack_; } - - Allocator& GetAllocator() { return *allocator_; } - bool Empty() const { return stackTop_ == stack_; } - size_t GetSize() const { return static_cast(stackTop_ - stack_); } - size_t GetCapacity() const { return static_cast(stackEnd_ - stack_); } - -private: - template - void Expand(size_t count) { - // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity. - size_t newCapacity; - if (stack_ == 0) { - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator()); - newCapacity = initialCapacity_; - } else { - newCapacity = GetCapacity(); - newCapacity += (newCapacity + 1) / 2; - } - size_t newSize = GetSize() + sizeof(T) * count; - if (newCapacity < newSize) - newCapacity = newSize; - - Resize(newCapacity); - } - - void Resize(size_t newCapacity) { - const size_t size = GetSize(); // Backup the current size - stack_ = (char*)allocator_->Realloc(stack_, GetCapacity(), newCapacity); - stackTop_ = stack_ + size; - stackEnd_ = stack_ + newCapacity; - } - - void Destroy() { - Allocator::Free(stack_); - RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack - } - - // Prohibit copy constructor & assignment operator. - Stack(const Stack&); - Stack& operator=(const Stack&); - - Allocator* allocator_; - Allocator* ownAllocator_; - char *stack_; - char *stackTop_; - char *stackEnd_; - size_t initialCapacity_; -}; - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_STACK_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/strfunc.h b/external/rapidjson-1.0.2/include/rapidjson/internal/strfunc.h deleted file mode 100644 index 8440506..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/strfunc.h +++ /dev/null @@ -1,39 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ -#define RAPIDJSON_INTERNAL_STRFUNC_H_ - -#include "../rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -//! Custom strlen() which works on different character types. -/*! \tparam Ch Character type (e.g. char, wchar_t, short) - \param s Null-terminated input string. - \return Number of characters in the string. - \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. -*/ -template -inline SizeType StrLen(const Ch* s) { - const Ch* p = s; - while (*p) ++p; - return SizeType(p - s); -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_INTERNAL_STRFUNC_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/internal/strtod.h b/external/rapidjson-1.0.2/include/rapidjson/internal/strtod.h deleted file mode 100644 index ace65f6..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/internal/strtod.h +++ /dev/null @@ -1,270 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_STRTOD_ -#define RAPIDJSON_STRTOD_ - -#include "../rapidjson.h" -#include "ieee754.h" -#include "biginteger.h" -#include "diyfp.h" -#include "pow10.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -inline double FastPath(double significand, int exp) { - if (exp < -308) - return 0.0; - else if (exp >= 0) - return significand * internal::Pow10(exp); - else - return significand / internal::Pow10(-exp); -} - -inline double StrtodNormalPrecision(double d, int p) { - if (p < -308) { - // Prevent expSum < -308, making Pow10(p) = 0 - d = FastPath(d, -308); - d = FastPath(d, p + 308); - } - else - d = FastPath(d, p); - return d; -} - -template -inline T Min3(T a, T b, T c) { - T m = a; - if (m > b) m = b; - if (m > c) m = c; - return m; -} - -inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) { - const Double db(b); - const uint64_t bInt = db.IntegerSignificand(); - const int bExp = db.IntegerExponent(); - const int hExp = bExp - 1; - - int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0; - - // Adjust for decimal exponent - if (dExp >= 0) { - dS_Exp2 += dExp; - dS_Exp5 += dExp; - } - else { - bS_Exp2 -= dExp; - bS_Exp5 -= dExp; - hS_Exp2 -= dExp; - hS_Exp5 -= dExp; - } - - // Adjust for binary exponent - if (bExp >= 0) - bS_Exp2 += bExp; - else { - dS_Exp2 -= bExp; - hS_Exp2 -= bExp; - } - - // Adjust for half ulp exponent - if (hExp >= 0) - hS_Exp2 += hExp; - else { - dS_Exp2 -= hExp; - bS_Exp2 -= hExp; - } - - // Remove common power of two factor from all three scaled values - int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2); - dS_Exp2 -= common_Exp2; - bS_Exp2 -= common_Exp2; - hS_Exp2 -= common_Exp2; - - BigInteger dS = d; - dS.MultiplyPow5(dS_Exp5) <<= dS_Exp2; - - BigInteger bS(bInt); - bS.MultiplyPow5(bS_Exp5) <<= bS_Exp2; - - BigInteger hS(1); - hS.MultiplyPow5(hS_Exp5) <<= hS_Exp2; - - BigInteger delta(0); - dS.Difference(bS, &delta); - - return delta.Compare(hS); -} - -inline bool StrtodFast(double d, int p, double* result) { - // Use fast path for string-to-double conversion if possible - // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ - if (p > 22 && p < 22 + 16) { - // Fast Path Cases In Disguise - d *= internal::Pow10(p - 22); - p = 22; - } - - if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1 - *result = FastPath(d, p); - return true; - } - else - return false; -} - -// Compute an approximation and see if it is within 1/2 ULP -inline bool StrtodDiyFp(const char* decimals, size_t length, size_t decimalPosition, int exp, double* result) { - uint64_t significand = 0; - size_t i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999 - for (; i < length; i++) { - if (significand > RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || - (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > '5')) - break; - significand = significand * 10 + (decimals[i] - '0'); - } - - if (i < length && decimals[i] >= '5') // Rounding - significand++; - - size_t remaining = length - i; - const unsigned kUlpShift = 3; - const unsigned kUlp = 1 << kUlpShift; - int error = (remaining == 0) ? 0 : kUlp / 2; - - DiyFp v(significand, 0); - v = v.Normalize(); - error <<= -v.e; - - const int dExp = (int)decimalPosition - (int)i + exp; - - int actualExp; - DiyFp cachedPower = GetCachedPower10(dExp, &actualExp); - if (actualExp != dExp) { - static const DiyFp kPow10[] = { - DiyFp(RAPIDJSON_UINT64_C2(0xa0000000, 00000000), -60), // 10^1 - DiyFp(RAPIDJSON_UINT64_C2(0xc8000000, 00000000), -57), // 10^2 - DiyFp(RAPIDJSON_UINT64_C2(0xfa000000, 00000000), -54), // 10^3 - DiyFp(RAPIDJSON_UINT64_C2(0x9c400000, 00000000), -50), // 10^4 - DiyFp(RAPIDJSON_UINT64_C2(0xc3500000, 00000000), -47), // 10^5 - DiyFp(RAPIDJSON_UINT64_C2(0xf4240000, 00000000), -44), // 10^6 - DiyFp(RAPIDJSON_UINT64_C2(0x98968000, 00000000), -40) // 10^7 - }; - int adjustment = dExp - actualExp - 1; - RAPIDJSON_ASSERT(adjustment >= 0 && adjustment < 7); - v = v * kPow10[adjustment]; - if (length + adjustment > 19) // has more digits than decimal digits in 64-bit - error += kUlp / 2; - } - - v = v * cachedPower; - - error += kUlp + (error == 0 ? 0 : 1); - - const int oldExp = v.e; - v = v.Normalize(); - error <<= oldExp - v.e; - - const unsigned effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e); - unsigned precisionSize = 64 - effectiveSignificandSize; - if (precisionSize + kUlpShift >= 64) { - unsigned scaleExp = (precisionSize + kUlpShift) - 63; - v.f >>= scaleExp; - v.e += scaleExp; - error = (error >> scaleExp) + 1 + kUlp; - precisionSize -= scaleExp; - } - - DiyFp rounded(v.f >> precisionSize, v.e + precisionSize); - const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp; - const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp; - if (precisionBits >= halfWay + error) { - rounded.f++; - if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340) - rounded.f >>= 1; - rounded.e++; - } - } - - *result = rounded.ToDouble(); - - return halfWay - error >= precisionBits || precisionBits >= halfWay + error; -} - -inline double StrtodBigInteger(double approx, const char* decimals, size_t length, size_t decimalPosition, int exp) { - const BigInteger dInt(decimals, length); - const int dExp = (int)decimalPosition - (int)length + exp; - Double a(approx); - int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp); - if (cmp < 0) - return a.Value(); // within half ULP - else if (cmp == 0) { - // Round towards even - if (a.Significand() & 1) - return a.NextPositiveDouble(); - else - return a.Value(); - } - else // adjustment - return a.NextPositiveDouble(); -} - -inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t length, size_t decimalPosition, int exp) { - RAPIDJSON_ASSERT(d >= 0.0); - RAPIDJSON_ASSERT(length >= 1); - - double result; - if (StrtodFast(d, p, &result)) - return result; - - // Trim leading zeros - while (*decimals == '0' && length > 1) { - length--; - decimals++; - decimalPosition--; - } - - // Trim trailing zeros - while (decimals[length - 1] == '0' && length > 1) { - length--; - decimalPosition--; - exp++; - } - - // Trim right-most digits - const int kMaxDecimalDigit = 780; - if ((int)length > kMaxDecimalDigit) { - int delta = (int(length) - kMaxDecimalDigit); - exp += delta; - decimalPosition -= delta; - length = kMaxDecimalDigit; - } - - // If too small, underflow to zero - if (int(length) + exp < -324) - return 0.0; - - if (StrtodDiyFp(decimals, length, decimalPosition, exp, &result)) - return result; - - // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison - return StrtodBigInteger(result, decimals, length, decimalPosition, exp); -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_STRTOD_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/memorybuffer.h b/external/rapidjson-1.0.2/include/rapidjson/memorybuffer.h deleted file mode 100644 index 2484b21..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/memorybuffer.h +++ /dev/null @@ -1,70 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_MEMORYBUFFER_H_ -#define RAPIDJSON_MEMORYBUFFER_H_ - -#include "rapidjson.h" -#include "internal/stack.h" - -RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory output byte stream. -/*! - This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. - - It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. - - Differences between MemoryBuffer and StringBuffer: - 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. - 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. - - \tparam Allocator type for allocating memory buffer. - \note implements Stream concept -*/ -template -struct GenericMemoryBuffer { - typedef char Ch; // byte - - GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} - - void Put(Ch c) { *stack_.template Push() = c; } - void Flush() {} - - void Clear() { stack_.Clear(); } - void ShrinkToFit() { stack_.ShrinkToFit(); } - Ch* Push(size_t count) { return stack_.template Push(count); } - void Pop(size_t count) { stack_.template Pop(count); } - - const Ch* GetBuffer() const { - return stack_.template Bottom(); - } - - size_t GetSize() const { return stack_.GetSize(); } - - static const size_t kDefaultCapacity = 256; - mutable internal::Stack stack_; -}; - -typedef GenericMemoryBuffer<> MemoryBuffer; - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { - std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); -} - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_MEMORYBUFFER_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/memorystream.h b/external/rapidjson-1.0.2/include/rapidjson/memorystream.h deleted file mode 100644 index 99feae5..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/memorystream.h +++ /dev/null @@ -1,61 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_MEMORYSTREAM_H_ -#define RAPIDJSON_MEMORYSTREAM_H_ - -#include "rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory input byte stream. -/*! - This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. - - It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. - - Differences between MemoryStream and StringStream: - 1. StringStream has encoding but MemoryStream is a byte stream. - 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. - 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). - \note implements Stream concept -*/ -struct MemoryStream { - typedef char Ch; // byte - - MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} - - Ch Peek() const { return (src_ == end_) ? '\0' : *src_; } - Ch Take() { return (src_ == end_) ? '\0' : *src_++; } - size_t Tell() const { return static_cast(src_ - begin_); } - - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - - // For encoding detection only. - const Ch* Peek4() const { - return Tell() + 4 <= size_ ? src_ : 0; - } - - const Ch* src_; //!< Current read position. - const Ch* begin_; //!< Original head of the string. - const Ch* end_; //!< End of stream. - size_t size_; //!< Size of the stream. -}; - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_MEMORYBUFFER_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/msinttypes/inttypes.h b/external/rapidjson-1.0.2/include/rapidjson/msinttypes/inttypes.h deleted file mode 100644 index 1811128..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/msinttypes/inttypes.h +++ /dev/null @@ -1,316 +0,0 @@ -// ISO C9x compliant inttypes.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2013 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the product nor the names of its contributors may -// be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -// The above software in this distribution may have been modified by -// THL A29 Limited ("Tencent Modifications"). -// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_INTTYPES_H_ // [ -#define _MSC_INTTYPES_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include "stdint.h" - -// miloyip: VC supports inttypes.h since VC2013 -#if _MSC_VER >= 1800 -#include -#else - -// 7.8 Format conversion of integer types - -typedef struct { - intmax_t quot; - intmax_t rem; -} imaxdiv_t; - -// 7.8.1 Macros for format specifiers - -#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 - -// The fprintf macros for signed integers are: -#define PRId8 "d" -#define PRIi8 "i" -#define PRIdLEAST8 "d" -#define PRIiLEAST8 "i" -#define PRIdFAST8 "d" -#define PRIiFAST8 "i" - -#define PRId16 "hd" -#define PRIi16 "hi" -#define PRIdLEAST16 "hd" -#define PRIiLEAST16 "hi" -#define PRIdFAST16 "hd" -#define PRIiFAST16 "hi" - -#define PRId32 "I32d" -#define PRIi32 "I32i" -#define PRIdLEAST32 "I32d" -#define PRIiLEAST32 "I32i" -#define PRIdFAST32 "I32d" -#define PRIiFAST32 "I32i" - -#define PRId64 "I64d" -#define PRIi64 "I64i" -#define PRIdLEAST64 "I64d" -#define PRIiLEAST64 "I64i" -#define PRIdFAST64 "I64d" -#define PRIiFAST64 "I64i" - -#define PRIdMAX "I64d" -#define PRIiMAX "I64i" - -#define PRIdPTR "Id" -#define PRIiPTR "Ii" - -// The fprintf macros for unsigned integers are: -#define PRIo8 "o" -#define PRIu8 "u" -#define PRIx8 "x" -#define PRIX8 "X" -#define PRIoLEAST8 "o" -#define PRIuLEAST8 "u" -#define PRIxLEAST8 "x" -#define PRIXLEAST8 "X" -#define PRIoFAST8 "o" -#define PRIuFAST8 "u" -#define PRIxFAST8 "x" -#define PRIXFAST8 "X" - -#define PRIo16 "ho" -#define PRIu16 "hu" -#define PRIx16 "hx" -#define PRIX16 "hX" -#define PRIoLEAST16 "ho" -#define PRIuLEAST16 "hu" -#define PRIxLEAST16 "hx" -#define PRIXLEAST16 "hX" -#define PRIoFAST16 "ho" -#define PRIuFAST16 "hu" -#define PRIxFAST16 "hx" -#define PRIXFAST16 "hX" - -#define PRIo32 "I32o" -#define PRIu32 "I32u" -#define PRIx32 "I32x" -#define PRIX32 "I32X" -#define PRIoLEAST32 "I32o" -#define PRIuLEAST32 "I32u" -#define PRIxLEAST32 "I32x" -#define PRIXLEAST32 "I32X" -#define PRIoFAST32 "I32o" -#define PRIuFAST32 "I32u" -#define PRIxFAST32 "I32x" -#define PRIXFAST32 "I32X" - -#define PRIo64 "I64o" -#define PRIu64 "I64u" -#define PRIx64 "I64x" -#define PRIX64 "I64X" -#define PRIoLEAST64 "I64o" -#define PRIuLEAST64 "I64u" -#define PRIxLEAST64 "I64x" -#define PRIXLEAST64 "I64X" -#define PRIoFAST64 "I64o" -#define PRIuFAST64 "I64u" -#define PRIxFAST64 "I64x" -#define PRIXFAST64 "I64X" - -#define PRIoMAX "I64o" -#define PRIuMAX "I64u" -#define PRIxMAX "I64x" -#define PRIXMAX "I64X" - -#define PRIoPTR "Io" -#define PRIuPTR "Iu" -#define PRIxPTR "Ix" -#define PRIXPTR "IX" - -// The fscanf macros for signed integers are: -#define SCNd8 "d" -#define SCNi8 "i" -#define SCNdLEAST8 "d" -#define SCNiLEAST8 "i" -#define SCNdFAST8 "d" -#define SCNiFAST8 "i" - -#define SCNd16 "hd" -#define SCNi16 "hi" -#define SCNdLEAST16 "hd" -#define SCNiLEAST16 "hi" -#define SCNdFAST16 "hd" -#define SCNiFAST16 "hi" - -#define SCNd32 "ld" -#define SCNi32 "li" -#define SCNdLEAST32 "ld" -#define SCNiLEAST32 "li" -#define SCNdFAST32 "ld" -#define SCNiFAST32 "li" - -#define SCNd64 "I64d" -#define SCNi64 "I64i" -#define SCNdLEAST64 "I64d" -#define SCNiLEAST64 "I64i" -#define SCNdFAST64 "I64d" -#define SCNiFAST64 "I64i" - -#define SCNdMAX "I64d" -#define SCNiMAX "I64i" - -#ifdef _WIN64 // [ -# define SCNdPTR "I64d" -# define SCNiPTR "I64i" -#else // _WIN64 ][ -# define SCNdPTR "ld" -# define SCNiPTR "li" -#endif // _WIN64 ] - -// The fscanf macros for unsigned integers are: -#define SCNo8 "o" -#define SCNu8 "u" -#define SCNx8 "x" -#define SCNX8 "X" -#define SCNoLEAST8 "o" -#define SCNuLEAST8 "u" -#define SCNxLEAST8 "x" -#define SCNXLEAST8 "X" -#define SCNoFAST8 "o" -#define SCNuFAST8 "u" -#define SCNxFAST8 "x" -#define SCNXFAST8 "X" - -#define SCNo16 "ho" -#define SCNu16 "hu" -#define SCNx16 "hx" -#define SCNX16 "hX" -#define SCNoLEAST16 "ho" -#define SCNuLEAST16 "hu" -#define SCNxLEAST16 "hx" -#define SCNXLEAST16 "hX" -#define SCNoFAST16 "ho" -#define SCNuFAST16 "hu" -#define SCNxFAST16 "hx" -#define SCNXFAST16 "hX" - -#define SCNo32 "lo" -#define SCNu32 "lu" -#define SCNx32 "lx" -#define SCNX32 "lX" -#define SCNoLEAST32 "lo" -#define SCNuLEAST32 "lu" -#define SCNxLEAST32 "lx" -#define SCNXLEAST32 "lX" -#define SCNoFAST32 "lo" -#define SCNuFAST32 "lu" -#define SCNxFAST32 "lx" -#define SCNXFAST32 "lX" - -#define SCNo64 "I64o" -#define SCNu64 "I64u" -#define SCNx64 "I64x" -#define SCNX64 "I64X" -#define SCNoLEAST64 "I64o" -#define SCNuLEAST64 "I64u" -#define SCNxLEAST64 "I64x" -#define SCNXLEAST64 "I64X" -#define SCNoFAST64 "I64o" -#define SCNuFAST64 "I64u" -#define SCNxFAST64 "I64x" -#define SCNXFAST64 "I64X" - -#define SCNoMAX "I64o" -#define SCNuMAX "I64u" -#define SCNxMAX "I64x" -#define SCNXMAX "I64X" - -#ifdef _WIN64 // [ -# define SCNoPTR "I64o" -# define SCNuPTR "I64u" -# define SCNxPTR "I64x" -# define SCNXPTR "I64X" -#else // _WIN64 ][ -# define SCNoPTR "lo" -# define SCNuPTR "lu" -# define SCNxPTR "lx" -# define SCNXPTR "lX" -#endif // _WIN64 ] - -#endif // __STDC_FORMAT_MACROS ] - -// 7.8.2 Functions for greatest-width integer types - -// 7.8.2.1 The imaxabs function -#define imaxabs _abs64 - -// 7.8.2.2 The imaxdiv function - -// This is modified version of div() function from Microsoft's div.c found -// in %MSVC.NET%\crt\src\div.c -#ifdef STATIC_IMAXDIV // [ -static -#else // STATIC_IMAXDIV ][ -_inline -#endif // STATIC_IMAXDIV ] -imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) -{ - imaxdiv_t result; - - result.quot = numer / denom; - result.rem = numer % denom; - - if (numer < 0 && result.rem > 0) { - // did division wrong; must fix up - ++result.quot; - result.rem -= denom; - } - - return result; -} - -// 7.8.2.3 The strtoimax and strtoumax functions -#define strtoimax _strtoi64 -#define strtoumax _strtoui64 - -// 7.8.2.4 The wcstoimax and wcstoumax functions -#define wcstoimax _wcstoi64 -#define wcstoumax _wcstoui64 - -#endif // _MSC_VER >= 1800 - -#endif // _MSC_INTTYPES_H_ ] diff --git a/external/rapidjson-1.0.2/include/rapidjson/msinttypes/stdint.h b/external/rapidjson-1.0.2/include/rapidjson/msinttypes/stdint.h deleted file mode 100644 index a26fff4..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/msinttypes/stdint.h +++ /dev/null @@ -1,300 +0,0 @@ -// ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2013 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the product nor the names of its contributors may -// be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -// The above software in this distribution may have been modified by -// THL A29 Limited ("Tencent Modifications"). -// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_STDINT_H_ // [ -#define _MSC_STDINT_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010. -#if _MSC_VER >= 1600 // [ -#include - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -#undef INT8_C -#undef INT16_C -#undef INT32_C -#undef INT64_C -#undef UINT8_C -#undef UINT16_C -#undef UINT32_C -#undef UINT64_C - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -// These #ifndef's are needed to prevent collisions with . -// Check out Issue 9 for the details. -#ifndef INTMAX_C // [ -# define INTMAX_C INT64_C -#endif // INTMAX_C ] -#ifndef UINTMAX_C // [ -# define UINTMAX_C UINT64_C -#endif // UINTMAX_C ] - -#endif // __STDC_CONSTANT_MACROS ] - -#else // ] _MSC_VER >= 1700 [ - -#include - -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when -// compiling for ARM we should wrap include with 'extern "C++" {}' -// or compiler give many errors like this: -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed -#ifdef __cplusplus -extern "C" { -#endif -# include -#ifdef __cplusplus -} -#endif - -// Define _W64 macros to mark types changing their size, like intptr_t. -#ifndef _W64 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif - - -// 7.18.1 Integer types - -// 7.18.1.1 Exact-width integer types - -// Visual Studio 6 and Embedded Visual C++ 4 doesn't -// realize that, e.g. char has the same size as __int8 -// so we give up on __intX for them. -#if (_MSC_VER < 1300) - typedef signed char int8_t; - typedef signed short int16_t; - typedef signed int int32_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -#else - typedef signed __int8 int8_t; - typedef signed __int16 int16_t; - typedef signed __int32 int32_t; - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; -#endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - - -// 7.18.1.2 Minimum-width integer types -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -typedef int64_t int_least64_t; -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -typedef uint64_t uint_least64_t; - -// 7.18.1.3 Fastest minimum-width integer types -typedef int8_t int_fast8_t; -typedef int16_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef int64_t int_fast64_t; -typedef uint8_t uint_fast8_t; -typedef uint16_t uint_fast16_t; -typedef uint32_t uint_fast32_t; -typedef uint64_t uint_fast64_t; - -// 7.18.1.4 Integer types capable of holding object pointers -#ifdef _WIN64 // [ - typedef signed __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ - typedef _W64 signed int intptr_t; - typedef _W64 unsigned int uintptr_t; -#endif // _WIN64 ] - -// 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - - -// 7.18.2 Limits of specified-width integer types - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 - -// 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX - -// 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -// 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -// 7.18.2.4 Limits of integer types capable of holding object pointers -#ifdef _WIN64 // [ -# define INTPTR_MIN INT64_MIN -# define INTPTR_MAX INT64_MAX -# define UINTPTR_MAX UINT64_MAX -#else // _WIN64 ][ -# define INTPTR_MIN INT32_MIN -# define INTPTR_MAX INT32_MAX -# define UINTPTR_MAX UINT32_MAX -#endif // _WIN64 ] - -// 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -// 7.18.3 Limits of other integer types - -#ifdef _WIN64 // [ -# define PTRDIFF_MIN _I64_MIN -# define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -# define PTRDIFF_MIN _I32_MIN -# define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] - -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX - -#ifndef SIZE_MAX // [ -# ifdef _WIN64 // [ -# define SIZE_MAX _UI64_MAX -# else // _WIN64 ][ -# define SIZE_MAX _UI32_MAX -# endif // _WIN64 ] -#endif // SIZE_MAX ] - -// WCHAR_MIN and WCHAR_MAX are also defined in -#ifndef WCHAR_MIN // [ -# define WCHAR_MIN 0 -#endif // WCHAR_MIN ] -#ifndef WCHAR_MAX // [ -# define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] - -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX - -#endif // __STDC_LIMIT_MACROS ] - - -// 7.18.4 Limits of other integer types - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -// These #ifndef's are needed to prevent collisions with . -// Check out Issue 9 for the details. -#ifndef INTMAX_C // [ -# define INTMAX_C INT64_C -#endif // INTMAX_C ] -#ifndef UINTMAX_C // [ -# define UINTMAX_C UINT64_C -#endif // UINTMAX_C ] - -#endif // __STDC_CONSTANT_MACROS ] - -#endif // _MSC_VER >= 1600 ] - -#endif // _MSC_STDINT_H_ ] diff --git a/external/rapidjson-1.0.2/include/rapidjson/prettywriter.h b/external/rapidjson-1.0.2/include/rapidjson/prettywriter.h deleted file mode 100644 index 416dd49..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/prettywriter.h +++ /dev/null @@ -1,207 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_PRETTYWRITER_H_ -#define RAPIDJSON_PRETTYWRITER_H_ - -#include "writer.h" - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Writer with indentation and spacing. -/*! - \tparam OutputStream Type of ouptut os. - \tparam SourceEncoding Encoding of source string. - \tparam TargetEncoding Encoding of output stream. - \tparam StackAllocator Type of allocator for allocating memory of stack. -*/ -template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator> -class PrettyWriter : public Writer { -public: - typedef Writer Base; - typedef typename Base::Ch Ch; - - //! Constructor - /*! \param os Output stream. - \param allocator User supplied allocator. If it is null, it will create a private one. - \param levelDepth Initial capacity of stack. - */ - PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : - Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {} - - //! Set custom indentation. - /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r'). - \param indentCharCount Number of indent characters for each indentation level. - \note The default indentation is 4 spaces. - */ - PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) { - RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r'); - indentChar_ = indentChar; - indentCharCount_ = indentCharCount; - return *this; - } - - /*! @name Implementation of Handler - \see Handler - */ - //@{ - - bool Null() { PrettyPrefix(kNullType); return Base::WriteNull(); } - bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::WriteBool(b); } - bool Int(int i) { PrettyPrefix(kNumberType); return Base::WriteInt(i); } - bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::WriteUint(u); } - bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::WriteInt64(i64); } - bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::WriteUint64(u64); } - bool Double(double d) { PrettyPrefix(kNumberType); return Base::WriteDouble(d); } - - bool String(const Ch* str, SizeType length, bool copy = false) { - (void)copy; - PrettyPrefix(kStringType); - return Base::WriteString(str, length); - } - -#if RAPIDJSON_HAS_STDSTRING - bool String(const std::basic_string& str) { - return String(str.data(), SizeType(str.size())); - } -#endif - - bool StartObject() { - PrettyPrefix(kObjectType); - new (Base::level_stack_.template Push()) typename Base::Level(false); - return Base::WriteStartObject(); - } - - bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } - - bool EndObject(SizeType memberCount = 0) { - (void)memberCount; - RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); - RAPIDJSON_ASSERT(!Base::level_stack_.template Top()->inArray); - bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; - - if (!empty) { - Base::os_->Put('\n'); - WriteIndent(); - } - bool ret = Base::WriteEndObject(); - (void)ret; - RAPIDJSON_ASSERT(ret == true); - if (Base::level_stack_.Empty()) // end of json text - Base::os_->Flush(); - return true; - } - - bool StartArray() { - PrettyPrefix(kArrayType); - new (Base::level_stack_.template Push()) typename Base::Level(true); - return Base::WriteStartArray(); - } - - bool EndArray(SizeType memberCount = 0) { - (void)memberCount; - RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); - RAPIDJSON_ASSERT(Base::level_stack_.template Top()->inArray); - bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; - - if (!empty) { - Base::os_->Put('\n'); - WriteIndent(); - } - bool ret = Base::WriteEndArray(); - (void)ret; - RAPIDJSON_ASSERT(ret == true); - if (Base::level_stack_.Empty()) // end of json text - Base::os_->Flush(); - return true; - } - - //@} - - /*! @name Convenience extensions */ - //@{ - - //! Simpler but slower overload. - bool String(const Ch* str) { return String(str, internal::StrLen(str)); } - bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); } - - //@} -protected: - void PrettyPrefix(Type type) { - (void)type; - if (Base::level_stack_.GetSize() != 0) { // this value is not at root - typename Base::Level* level = Base::level_stack_.template Top(); - - if (level->inArray) { - if (level->valueCount > 0) { - Base::os_->Put(','); // add comma if it is not the first element in array - Base::os_->Put('\n'); - } - else - Base::os_->Put('\n'); - WriteIndent(); - } - else { // in object - if (level->valueCount > 0) { - if (level->valueCount % 2 == 0) { - Base::os_->Put(','); - Base::os_->Put('\n'); - } - else { - Base::os_->Put(':'); - Base::os_->Put(' '); - } - } - else - Base::os_->Put('\n'); - - if (level->valueCount % 2 == 0) - WriteIndent(); - } - if (!level->inArray && level->valueCount % 2 == 0) - RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name - level->valueCount++; - } - else { - RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root. - Base::hasRoot_ = true; - } - } - - void WriteIndent() { - size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_; - PutN(*Base::os_, indentChar_, count); - } - - Ch indentChar_; - unsigned indentCharCount_; - -private: - // Prohibit copy constructor & assignment operator. - PrettyWriter(const PrettyWriter&); - PrettyWriter& operator=(const PrettyWriter&); -}; - -RAPIDJSON_NAMESPACE_END - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/rapidjson.h b/external/rapidjson-1.0.2/include/rapidjson/rapidjson.h deleted file mode 100644 index f22130d..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/rapidjson.h +++ /dev/null @@ -1,654 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_RAPIDJSON_H_ -#define RAPIDJSON_RAPIDJSON_H_ - -/*!\file rapidjson.h - \brief common definitions and configuration - - \see RAPIDJSON_CONFIG - */ - -/*! \defgroup RAPIDJSON_CONFIG RapidJSON configuration - \brief Configuration macros for library features - - Some RapidJSON features are configurable to adapt the library to a wide - variety of platforms, environments and usage scenarios. Most of the - features can be configured in terms of overriden or predefined - preprocessor macros at compile-time. - - Some additional customization is available in the \ref RAPIDJSON_ERRORS APIs. - - \note These macros should be given on the compiler command-line - (where applicable) to avoid inconsistent values when compiling - different translation units of a single application. - */ - -#include // malloc(), realloc(), free(), size_t -#include // memset(), memcpy(), memmove(), memcmp() - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_VERSION_STRING -// -// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt. -// - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -// token stringification -#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x) -#define RAPIDJSON_DO_STRINGIFY(x) #x -//!@endcond - -/*! \def RAPIDJSON_MAJOR_VERSION - \ingroup RAPIDJSON_CONFIG - \brief Major version of RapidJSON in integer. -*/ -/*! \def RAPIDJSON_MINOR_VERSION - \ingroup RAPIDJSON_CONFIG - \brief Minor version of RapidJSON in integer. -*/ -/*! \def RAPIDJSON_PATCH_VERSION - \ingroup RAPIDJSON_CONFIG - \brief Patch version of RapidJSON in integer. -*/ -/*! \def RAPIDJSON_VERSION_STRING - \ingroup RAPIDJSON_CONFIG - \brief Version of RapidJSON in ".." string format. -*/ -#define RAPIDJSON_MAJOR_VERSION 1 -#define RAPIDJSON_MINOR_VERSION 0 -#define RAPIDJSON_PATCH_VERSION 2 -#define RAPIDJSON_VERSION_STRING \ - RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION) - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_NAMESPACE_(BEGIN|END) -/*! \def RAPIDJSON_NAMESPACE - \ingroup RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace - - In order to avoid symbol clashes and/or "One Definition Rule" errors - between multiple inclusions of (different versions of) RapidJSON in - a single binary, users can customize the name of the main RapidJSON - namespace. - - In case of a single nesting level, defining \c RAPIDJSON_NAMESPACE - to a custom name (e.g. \c MyRapidJSON) is sufficient. If multiple - levels are needed, both \ref RAPIDJSON_NAMESPACE_BEGIN and \ref - RAPIDJSON_NAMESPACE_END need to be defined as well: - - \code - // in some .cpp file - #define RAPIDJSON_NAMESPACE my::rapidjson - #define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson { - #define RAPIDJSON_NAMESPACE_END } } - #include "rapidjson/..." - \endcode - - \see rapidjson - */ -/*! \def RAPIDJSON_NAMESPACE_BEGIN - \ingroup RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace (opening expression) - \see RAPIDJSON_NAMESPACE -*/ -/*! \def RAPIDJSON_NAMESPACE_END - \ingroup RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace (closing expression) - \see RAPIDJSON_NAMESPACE -*/ -#ifndef RAPIDJSON_NAMESPACE -#define RAPIDJSON_NAMESPACE rapidjson -#endif -#ifndef RAPIDJSON_NAMESPACE_BEGIN -#define RAPIDJSON_NAMESPACE_BEGIN namespace RAPIDJSON_NAMESPACE { -#endif -#ifndef RAPIDJSON_NAMESPACE_END -#define RAPIDJSON_NAMESPACE_END } -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_NO_INT64DEFINE - -/*! \def RAPIDJSON_NO_INT64DEFINE - \ingroup RAPIDJSON_CONFIG - \brief Use external 64-bit integer types. - - RapidJSON requires the 64-bit integer types \c int64_t and \c uint64_t types - to be available at global scope. - - If users have their own definition, define RAPIDJSON_NO_INT64DEFINE to - prevent RapidJSON from defining its own types. -*/ -#ifndef RAPIDJSON_NO_INT64DEFINE -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#ifdef _MSC_VER -#include "msinttypes/stdint.h" -#include "msinttypes/inttypes.h" -#else -// Other compilers should have this. -#include -#include -#endif -//!@endcond -#ifdef RAPIDJSON_DOXYGEN_RUNNING -#define RAPIDJSON_NO_INT64DEFINE -#endif -#endif // RAPIDJSON_NO_INT64TYPEDEF - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_FORCEINLINE - -#ifndef RAPIDJSON_FORCEINLINE -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#if defined(_MSC_VER) && !defined(NDEBUG) -#define RAPIDJSON_FORCEINLINE __forceinline -#elif defined(__GNUC__) && __GNUC__ >= 4 && !defined(NDEBUG) -#define RAPIDJSON_FORCEINLINE __attribute__((always_inline)) -#else -#define RAPIDJSON_FORCEINLINE -#endif -//!@endcond -#endif // RAPIDJSON_FORCEINLINE - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ENDIAN -#define RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine -#define RAPIDJSON_BIGENDIAN 1 //!< Big endian machine - -//! Endianness of the machine. -/*! - \def RAPIDJSON_ENDIAN - \ingroup RAPIDJSON_CONFIG - - GCC 4.6 provided macro for detecting endianness of the target machine. But other - compilers may not have this. User can define RAPIDJSON_ENDIAN to either - \ref RAPIDJSON_LITTLEENDIAN or \ref RAPIDJSON_BIGENDIAN. - - Default detection implemented with reference to - \li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html - \li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp -*/ -#ifndef RAPIDJSON_ENDIAN -// Detect with GCC 4.6's macro -# ifdef __BYTE_ORDER__ -# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -# else -# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN. -# endif // __BYTE_ORDER__ -// Detect with GLIBC's endian.h -# elif defined(__GLIBC__) -# include -# if (__BYTE_ORDER == __LITTLE_ENDIAN) -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif (__BYTE_ORDER == __BIG_ENDIAN) -# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -# else -# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN. -# endif // __GLIBC__ -// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro -# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) -# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -// Detect with architecture macros -# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) -# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif defined(RAPIDJSON_DOXYGEN_RUNNING) -# define RAPIDJSON_ENDIAN -# else -# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN. -# endif -#endif // RAPIDJSON_ENDIAN - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_64BIT - -//! Whether using 64-bit architecture -#ifndef RAPIDJSON_64BIT -#if defined(__LP64__) || defined(_WIN64) -#define RAPIDJSON_64BIT 1 -#else -#define RAPIDJSON_64BIT 0 -#endif -#endif // RAPIDJSON_64BIT - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ALIGN - -//! Data alignment of the machine. -/*! \ingroup RAPIDJSON_CONFIG - \param x pointer to align - - Some machines require strict data alignment. Currently the default uses 4 bytes - alignment. User can customize by defining the RAPIDJSON_ALIGN function macro., -*/ -#ifndef RAPIDJSON_ALIGN -#if RAPIDJSON_64BIT == 1 -#define RAPIDJSON_ALIGN(x) ((x + 7u) & ~7u) -#else -#define RAPIDJSON_ALIGN(x) ((x + 3u) & ~3u) -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_UINT64_C2 - -//! Construct a 64-bit literal by a pair of 32-bit integer. -/*! - 64-bit literal with or without ULL suffix is prone to compiler warnings. - UINT64_C() is C macro which cause compilation problems. - Use this macro to define 64-bit constants by a pair of 32-bit integer. -*/ -#ifndef RAPIDJSON_UINT64_C2 -#define RAPIDJSON_UINT64_C2(high32, low32) ((static_cast(high32) << 32) | static_cast(low32)) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_SIMD - -/*! \def RAPIDJSON_SIMD - \ingroup RAPIDJSON_CONFIG - \brief Enable SSE2/SSE4.2 optimization. - - RapidJSON supports optimized implementations for some parsing operations - based on the SSE2 or SSE4.2 SIMD extensions on modern Intel-compatible - processors. - - To enable these optimizations, two different symbols can be defined; - \code - // Enable SSE2 optimization. - #define RAPIDJSON_SSE2 - - // Enable SSE4.2 optimization. - #define RAPIDJSON_SSE42 - \endcode - - \c RAPIDJSON_SSE42 takes precedence, if both are defined. - - If any of these symbols is defined, RapidJSON defines the macro - \c RAPIDJSON_SIMD to indicate the availability of the optimized code. -*/ -#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) \ - || defined(RAPIDJSON_DOXYGEN_RUNNING) -#define RAPIDJSON_SIMD -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_NO_SIZETYPEDEFINE - -#ifndef RAPIDJSON_NO_SIZETYPEDEFINE -/*! \def RAPIDJSON_NO_SIZETYPEDEFINE - \ingroup RAPIDJSON_CONFIG - \brief User-provided \c SizeType definition. - - In order to avoid using 32-bit size types for indexing strings and arrays, - define this preprocessor symbol and provide the type rapidjson::SizeType - before including RapidJSON: - \code - #define RAPIDJSON_NO_SIZETYPEDEFINE - namespace rapidjson { typedef ::std::size_t SizeType; } - #include "rapidjson/..." - \endcode - - \see rapidjson::SizeType -*/ -#ifdef RAPIDJSON_DOXYGEN_RUNNING -#define RAPIDJSON_NO_SIZETYPEDEFINE -#endif -RAPIDJSON_NAMESPACE_BEGIN -//! Size type (for string lengths, array sizes, etc.) -/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms, - instead of using \c size_t. Users may override the SizeType by defining - \ref RAPIDJSON_NO_SIZETYPEDEFINE. -*/ -typedef unsigned SizeType; -RAPIDJSON_NAMESPACE_END -#endif - -// always import std::size_t to rapidjson namespace -RAPIDJSON_NAMESPACE_BEGIN -using std::size_t; -RAPIDJSON_NAMESPACE_END - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ASSERT - -//! Assertion. -/*! \ingroup RAPIDJSON_CONFIG - By default, rapidjson uses C \c assert() for internal assertions. - User can override it by defining RAPIDJSON_ASSERT(x) macro. - - \note Parsing errors are handled and can be customized by the - \ref RAPIDJSON_ERRORS APIs. -*/ -#ifndef RAPIDJSON_ASSERT -#include -#define RAPIDJSON_ASSERT(x) assert(x) -#endif // RAPIDJSON_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_STATIC_ASSERT - -// Adopt from boost -#ifndef RAPIDJSON_STATIC_ASSERT -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -RAPIDJSON_NAMESPACE_BEGIN -template struct STATIC_ASSERTION_FAILURE; -template <> struct STATIC_ASSERTION_FAILURE { enum { value = 1 }; }; -template struct StaticAssertTest {}; -RAPIDJSON_NAMESPACE_END - -#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y) -#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y) -#define RAPIDJSON_DO_JOIN2(X, Y) X##Y - -#if defined(__GNUC__) -#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) -#else -#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE -#endif -//!@endcond - -/*! \def RAPIDJSON_STATIC_ASSERT - \brief (Internal) macro to check for conditions at compile-time - \param x compile-time condition - \hideinitializer - */ -#define RAPIDJSON_STATIC_ASSERT(x) \ - typedef ::RAPIDJSON_NAMESPACE::StaticAssertTest< \ - sizeof(::RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE)> \ - RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE -#endif - -/////////////////////////////////////////////////////////////////////////////// -// Helpers - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN - -#define RAPIDJSON_MULTILINEMACRO_BEGIN do { -#define RAPIDJSON_MULTILINEMACRO_END \ -} while((void)0, 0) - -// adopted from Boost -#define RAPIDJSON_VERSION_CODE(x,y,z) \ - (((x)*100000) + ((y)*100) + (z)) - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF - -#if defined(__GNUC__) -#define RAPIDJSON_GNUC \ - RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) -#endif - -#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,2,0)) - -#define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x)) -#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x) -#define RAPIDJSON_DIAG_OFF(x) \ - RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W,x))) - -// push/pop support in Clang and GCC>=4.6 -#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) -#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push) -#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop) -#else // GCC >= 4.2, < 4.6 -#define RAPIDJSON_DIAG_PUSH /* ignored */ -#define RAPIDJSON_DIAG_POP /* ignored */ -#endif - -#elif defined(_MSC_VER) - -// pragma (MSVC specific) -#define RAPIDJSON_PRAGMA(x) __pragma(x) -#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(warning(x)) - -#define RAPIDJSON_DIAG_OFF(x) RAPIDJSON_DIAG_PRAGMA(disable: x) -#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push) -#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop) - -#else - -#define RAPIDJSON_DIAG_OFF(x) /* ignored */ -#define RAPIDJSON_DIAG_PUSH /* ignored */ -#define RAPIDJSON_DIAG_POP /* ignored */ - -#endif // RAPIDJSON_DIAG_* - -/////////////////////////////////////////////////////////////////////////////// -// C++11 features - -#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS -#if defined(__clang__) -#define RAPIDJSON_HAS_CXX11_RVALUE_REFS __has_feature(cxx_rvalue_references) && \ - (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306) -#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ - (defined(_MSC_VER) && _MSC_VER >= 1600) - -#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 -#else -#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 -#endif -#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS - -#ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT -#if defined(__clang__) -#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept) -#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) -// (defined(_MSC_VER) && _MSC_VER >= ????) // not yet supported -#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1 -#else -#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0 -#endif -#endif -#if RAPIDJSON_HAS_CXX11_NOEXCEPT -#define RAPIDJSON_NOEXCEPT noexcept -#else -#define RAPIDJSON_NOEXCEPT /* noexcept */ -#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT - -// no automatic detection, yet -#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS -#define RAPIDJSON_HAS_CXX11_TYPETRAITS 0 -#endif - -//!@endcond - -/////////////////////////////////////////////////////////////////////////////// -// new/delete - -#ifndef RAPIDJSON_NEW -///! customization point for global \c new -#define RAPIDJSON_NEW(x) new x -#endif -#ifndef RAPIDJSON_DELETE -///! customization point for global \c delete -#define RAPIDJSON_DELETE(x) delete x -#endif - -/////////////////////////////////////////////////////////////////////////////// -// Allocators and Encodings - -#include "allocators.h" -#include "encodings.h" - -/*! \namespace rapidjson - \brief main RapidJSON namespace - \see RAPIDJSON_NAMESPACE -*/ -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Stream - -/*! \class rapidjson::Stream - \brief Concept for reading and writing characters. - - For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd(). - - For write-only stream, only need to implement Put() and Flush(). - -\code -concept Stream { - typename Ch; //!< Character type of the stream. - - //! Read the current character from stream without moving the read cursor. - Ch Peek() const; - - //! Read the current character from stream and moving the read cursor to next character. - Ch Take(); - - //! Get the current read cursor. - //! \return Number of characters read from start. - size_t Tell(); - - //! Begin writing operation at the current read pointer. - //! \return The begin writer pointer. - Ch* PutBegin(); - - //! Write a character. - void Put(Ch c); - - //! Flush the buffer. - void Flush(); - - //! End the writing operation. - //! \param begin The begin write pointer returned by PutBegin(). - //! \return Number of characters written. - size_t PutEnd(Ch* begin); -} -\endcode -*/ - -//! Provides additional information for stream. -/*! - By using traits pattern, this type provides a default configuration for stream. - For custom stream, this type can be specialized for other configuration. - See TEST(Reader, CustomStringStream) in readertest.cpp for example. -*/ -template -struct StreamTraits { - //! Whether to make local copy of stream for optimization during parsing. - /*! - By default, for safety, streams do not use local copy optimization. - Stream that can be copied fast should specialize this, like StreamTraits. - */ - enum { copyOptimization = 0 }; -}; - -//! Put N copies of a character to a stream. -template -inline void PutN(Stream& stream, Ch c, size_t n) { - for (size_t i = 0; i < n; i++) - stream.Put(c); -} - -/////////////////////////////////////////////////////////////////////////////// -// StringStream - -//! Read-only string stream. -/*! \note implements Stream concept -*/ -template -struct GenericStringStream { - typedef typename Encoding::Ch Ch; - - GenericStringStream(const Ch *src) : src_(src), head_(src) {} - - Ch Peek() const { return *src_; } - Ch Take() { return *src_++; } - size_t Tell() const { return static_cast(src_ - head_); } - - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - - const Ch* src_; //!< Current read position. - const Ch* head_; //!< Original head of the string. -}; - -template -struct StreamTraits > { - enum { copyOptimization = 1 }; -}; - -//! String stream with UTF8 encoding. -typedef GenericStringStream > StringStream; - -/////////////////////////////////////////////////////////////////////////////// -// InsituStringStream - -//! A read-write string stream. -/*! This string stream is particularly designed for in-situ parsing. - \note implements Stream concept -*/ -template -struct GenericInsituStringStream { - typedef typename Encoding::Ch Ch; - - GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {} - - // Read - Ch Peek() { return *src_; } - Ch Take() { return *src_++; } - size_t Tell() { return static_cast(src_ - head_); } - - // Write - void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; } - - Ch* PutBegin() { return dst_ = src_; } - size_t PutEnd(Ch* begin) { return static_cast(dst_ - begin); } - void Flush() {} - - Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; } - void Pop(size_t count) { dst_ -= count; } - - Ch* src_; - Ch* dst_; - Ch* head_; -}; - -template -struct StreamTraits > { - enum { copyOptimization = 1 }; -}; - -//! Insitu string stream with UTF8 encoding. -typedef GenericInsituStringStream > InsituStringStream; - -/////////////////////////////////////////////////////////////////////////////// -// Type - -//! Type of JSON value -enum Type { - kNullType = 0, //!< null - kFalseType = 1, //!< false - kTrueType = 2, //!< true - kObjectType = 3, //!< object - kArrayType = 4, //!< array - kStringType = 5, //!< string - kNumberType = 6 //!< number -}; - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/reader.h b/external/rapidjson-1.0.2/include/rapidjson/reader.h deleted file mode 100644 index c5ecf4b..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/reader.h +++ /dev/null @@ -1,1452 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_READER_H_ -#define RAPIDJSON_READER_H_ - -/*! \file reader.h */ - -#include "rapidjson.h" -#include "encodings.h" -#include "internal/meta.h" -#include "internal/stack.h" -#include "internal/strtod.h" - -#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER) -#include -#pragma intrinsic(_BitScanForward) -#endif -#ifdef RAPIDJSON_SSE42 -#include -#elif defined(RAPIDJSON_SSE2) -#include -#endif - -#ifdef _MSC_VER -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -RAPIDJSON_DIAG_OFF(4702) // unreachable code -#endif - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define RAPIDJSON_NOTHING /* deliberately empty */ -#ifndef RAPIDJSON_PARSE_ERROR_EARLY_RETURN -#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \ - RAPIDJSON_MULTILINEMACRO_BEGIN \ - if (HasParseError()) { return value; } \ - RAPIDJSON_MULTILINEMACRO_END -#endif -#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \ - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(RAPIDJSON_NOTHING) -//!@endcond - -/*! \def RAPIDJSON_PARSE_ERROR_NORETURN - \ingroup RAPIDJSON_ERRORS - \brief Macro to indicate a parse error. - \param parseErrorCode \ref rapidjson::ParseErrorCode of the error - \param offset position of the error in JSON input (\c size_t) - - This macros can be used as a customization point for the internal - error handling mechanism of RapidJSON. - - A common usage model is to throw an exception instead of requiring the - caller to explicitly check the \ref rapidjson::GenericReader::Parse's - return value: - - \code - #define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \ - throw ParseException(parseErrorCode, #parseErrorCode, offset) - - #include // std::runtime_error - #include "rapidjson/error/error.h" // rapidjson::ParseResult - - struct ParseException : std::runtime_error, rapidjson::ParseResult { - ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset) - : std::runtime_error(msg), ParseResult(code, offset) {} - }; - - #include "rapidjson/reader.h" - \endcode - - \see RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse - */ -#ifndef RAPIDJSON_PARSE_ERROR_NORETURN -#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \ - RAPIDJSON_MULTILINEMACRO_BEGIN \ - RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \ - SetParseError(parseErrorCode, offset); \ - RAPIDJSON_MULTILINEMACRO_END -#endif - -/*! \def RAPIDJSON_PARSE_ERROR - \ingroup RAPIDJSON_ERRORS - \brief (Internal) macro to indicate and handle a parse error. - \param parseErrorCode \ref rapidjson::ParseErrorCode of the error - \param offset position of the error in JSON input (\c size_t) - - Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing. - - \see RAPIDJSON_PARSE_ERROR_NORETURN - \hideinitializer - */ -#ifndef RAPIDJSON_PARSE_ERROR -#define RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \ - RAPIDJSON_MULTILINEMACRO_BEGIN \ - RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \ - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \ - RAPIDJSON_MULTILINEMACRO_END -#endif - -#include "error/error.h" // ParseErrorCode, ParseResult - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// ParseFlag - -/*! \def RAPIDJSON_PARSE_DEFAULT_FLAGS - \ingroup RAPIDJSON_CONFIG - \brief User-defined kParseDefaultFlags definition. - - User can define this as any \c ParseFlag combinations. -*/ -#ifndef RAPIDJSON_PARSE_DEFAULT_FLAGS -#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags -#endif - -//! Combination of parseFlags -/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream - */ -enum ParseFlag { - kParseNoFlags = 0, //!< No flags are set. - kParseInsituFlag = 1, //!< In-situ(destructive) parsing. - kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings. - kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing. - kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error. - kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower). - kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS -}; - -/////////////////////////////////////////////////////////////////////////////// -// Handler - -/*! \class rapidjson::Handler - \brief Concept for receiving events from GenericReader upon parsing. - The functions return true if no error occurs. If they return false, - the event publisher should terminate the process. -\code -concept Handler { - typename Ch; - - bool Null(); - bool Bool(bool b); - bool Int(int i); - bool Uint(unsigned i); - bool Int64(int64_t i); - bool Uint64(uint64_t i); - bool Double(double d); - bool String(const Ch* str, SizeType length, bool copy); - bool StartObject(); - bool Key(const Ch* str, SizeType length, bool copy); - bool EndObject(SizeType memberCount); - bool StartArray(); - bool EndArray(SizeType elementCount); -}; -\endcode -*/ -/////////////////////////////////////////////////////////////////////////////// -// BaseReaderHandler - -//! Default implementation of Handler. -/*! This can be used as base class of any reader handler. - \note implements Handler concept -*/ -template, typename Derived = void> -struct BaseReaderHandler { - typedef typename Encoding::Ch Ch; - - typedef typename internal::SelectIf, BaseReaderHandler, Derived>::Type Override; - - bool Default() { return true; } - bool Null() { return static_cast(*this).Default(); } - bool Bool(bool) { return static_cast(*this).Default(); } - bool Int(int) { return static_cast(*this).Default(); } - bool Uint(unsigned) { return static_cast(*this).Default(); } - bool Int64(int64_t) { return static_cast(*this).Default(); } - bool Uint64(uint64_t) { return static_cast(*this).Default(); } - bool Double(double) { return static_cast(*this).Default(); } - bool String(const Ch*, SizeType, bool) { return static_cast(*this).Default(); } - bool StartObject() { return static_cast(*this).Default(); } - bool Key(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } - bool EndObject(SizeType) { return static_cast(*this).Default(); } - bool StartArray() { return static_cast(*this).Default(); } - bool EndArray(SizeType) { return static_cast(*this).Default(); } -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamLocalCopy - -namespace internal { - -template::copyOptimization> -class StreamLocalCopy; - -//! Do copy optimization. -template -class StreamLocalCopy { -public: - StreamLocalCopy(Stream& original) : s(original), original_(original) {} - ~StreamLocalCopy() { original_ = s; } - - Stream s; - -private: - StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; - - Stream& original_; -}; - -//! Keep reference. -template -class StreamLocalCopy { -public: - StreamLocalCopy(Stream& original) : s(original) {} - - Stream& s; - -private: - StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; -}; - -} // namespace internal - -/////////////////////////////////////////////////////////////////////////////// -// SkipWhitespace - -//! Skip the JSON white spaces in a stream. -/*! \param is A input stream for skipping white spaces. - \note This function has SSE2/SSE4.2 specialization. -*/ -template -void SkipWhitespace(InputStream& is) { - internal::StreamLocalCopy copy(is); - InputStream& s(copy.s); - - while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t') - s.Take(); -} - -#ifdef RAPIDJSON_SSE42 -//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once. -inline const char *SkipWhitespace_SIMD(const char* p) { - // Fast return for single non-whitespace - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // 16-byte align to the next boundary - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & ~15); - while (p != nextAligned) - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // The rest of string using SIMD - static const char whitespace[16] = " \n\r\t"; - const __m128i w = _mm_load_si128((const __m128i *)&whitespace[0]); - - for (;; p += 16) { - const __m128i s = _mm_load_si128((const __m128i *)p); - const unsigned r = _mm_cvtsi128_si32(_mm_cmpistrm(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_BIT_MASK | _SIDD_NEGATIVE_POLARITY)); - if (r != 0) { // some of characters is non-whitespace -#ifdef _MSC_VER // Find the index of first non-whitespace - unsigned long offset; - _BitScanForward(&offset, r); - return p + offset; -#else - return p + __builtin_ffs(r) - 1; -#endif - } - } -} - -#elif defined(RAPIDJSON_SSE2) - -//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once. -inline const char *SkipWhitespace_SIMD(const char* p) { - // Fast return for single non-whitespace - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // 16-byte align to the next boundary - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & ~15); - while (p != nextAligned) - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // The rest of string - static const char whitespaces[4][17] = { - " ", - "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", - "\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r", - "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"}; - - const __m128i w0 = _mm_loadu_si128((const __m128i *)&whitespaces[0][0]); - const __m128i w1 = _mm_loadu_si128((const __m128i *)&whitespaces[1][0]); - const __m128i w2 = _mm_loadu_si128((const __m128i *)&whitespaces[2][0]); - const __m128i w3 = _mm_loadu_si128((const __m128i *)&whitespaces[3][0]); - - for (;; p += 16) { - const __m128i s = _mm_load_si128((const __m128i *)p); - __m128i x = _mm_cmpeq_epi8(s, w0); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); - unsigned short r = (unsigned short)~_mm_movemask_epi8(x); - if (r != 0) { // some of characters may be non-whitespace -#ifdef _MSC_VER // Find the index of first non-whitespace - unsigned long offset; - _BitScanForward(&offset, r); - return p + offset; -#else - return p + __builtin_ffs(r) - 1; -#endif - } - } -} - -#endif // RAPIDJSON_SSE2 - -#ifdef RAPIDJSON_SIMD -//! Template function specialization for InsituStringStream -template<> inline void SkipWhitespace(InsituStringStream& is) { - is.src_ = const_cast(SkipWhitespace_SIMD(is.src_)); -} - -//! Template function specialization for StringStream -template<> inline void SkipWhitespace(StringStream& is) { - is.src_ = SkipWhitespace_SIMD(is.src_); -} -#endif // RAPIDJSON_SIMD - -/////////////////////////////////////////////////////////////////////////////// -// GenericReader - -//! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator. -/*! GenericReader parses JSON text from a stream, and send events synchronously to an - object implementing Handler concept. - - It needs to allocate a stack for storing a single decoded string during - non-destructive parsing. - - For in-situ parsing, the decoded string is directly written to the source - text string, no temporary buffer is required. - - A GenericReader object can be reused for parsing multiple JSON text. - - \tparam SourceEncoding Encoding of the input stream. - \tparam TargetEncoding Encoding of the parse output. - \tparam StackAllocator Allocator type for stack. -*/ -template -class GenericReader { -public: - typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type - - //! Constructor. - /*! \param stackAllocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing) - \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing) - */ - GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(stackAllocator, stackCapacity), parseResult_() {} - - //! Parse JSON text. - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam InputStream Type of input stream, implementing Stream concept. - \tparam Handler Type of handler, implementing Handler concept. - \param is Input stream to be parsed. - \param handler The handler to receive events. - \return Whether the parsing is successful. - */ - template - ParseResult Parse(InputStream& is, Handler& handler) { - if (parseFlags & kParseIterativeFlag) - return IterativeParse(is, handler); - - parseResult_.Clear(); - - ClearStackOnExit scope(*this); - - SkipWhitespace(is); - - if (is.Peek() == '\0') { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell()); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - } - else { - ParseValue(is, handler); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - - if (!(parseFlags & kParseStopWhenDoneFlag)) { - SkipWhitespace(is); - - if (is.Peek() != '\0') { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell()); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - } - } - } - - return parseResult_; - } - - //! Parse JSON text (with \ref kParseDefaultFlags) - /*! \tparam InputStream Type of input stream, implementing Stream concept - \tparam Handler Type of handler, implementing Handler concept. - \param is Input stream to be parsed. - \param handler The handler to receive events. - \return Whether the parsing is successful. - */ - template - ParseResult Parse(InputStream& is, Handler& handler) { - return Parse(is, handler); - } - - //! Whether a parse error has occured in the last parsing. - bool HasParseError() const { return parseResult_.IsError(); } - - //! Get the \ref ParseErrorCode of last parsing. - ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); } - - //! Get the position of last parsing error in input, 0 otherwise. - size_t GetErrorOffset() const { return parseResult_.Offset(); } - -protected: - void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); } - -private: - // Prohibit copy constructor & assignment operator. - GenericReader(const GenericReader&); - GenericReader& operator=(const GenericReader&); - - void ClearStack() { stack_.Clear(); } - - // clear stack on any exit from ParseStream, e.g. due to exception - struct ClearStackOnExit { - explicit ClearStackOnExit(GenericReader& r) : r_(r) {} - ~ClearStackOnExit() { r_.ClearStack(); } - private: - GenericReader& r_; - ClearStackOnExit(const ClearStackOnExit&); - ClearStackOnExit& operator=(const ClearStackOnExit&); - }; - - // Parse object: { string : value, ... } - template - void ParseObject(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == '{'); - is.Take(); // Skip '{' - - if (!handler.StartObject()) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - - SkipWhitespace(is); - - if (is.Peek() == '}') { - is.Take(); - if (!handler.EndObject(0)) // empty object - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - } - - for (SizeType memberCount = 0;;) { - if (is.Peek() != '"') - RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); - - ParseString(is, handler, true); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - SkipWhitespace(is); - - if (is.Take() != ':') - RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); - - SkipWhitespace(is); - - ParseValue(is, handler); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - SkipWhitespace(is); - - ++memberCount; - - switch (is.Take()) { - case ',': SkipWhitespace(is); break; - case '}': - if (!handler.EndObject(memberCount)) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - default: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); - } - } - } - - // Parse array: [ value, ... ] - template - void ParseArray(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == '['); - is.Take(); // Skip '[' - - if (!handler.StartArray()) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - - SkipWhitespace(is); - - if (is.Peek() == ']') { - is.Take(); - if (!handler.EndArray(0)) // empty array - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - } - - for (SizeType elementCount = 0;;) { - ParseValue(is, handler); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - ++elementCount; - SkipWhitespace(is); - - switch (is.Take()) { - case ',': SkipWhitespace(is); break; - case ']': - if (!handler.EndArray(elementCount)) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - default: RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); - } - } - } - - template - void ParseNull(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == 'n'); - is.Take(); - - if (is.Take() == 'u' && is.Take() == 'l' && is.Take() == 'l') { - if (!handler.Null()) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell() - 1); - } - - template - void ParseTrue(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == 't'); - is.Take(); - - if (is.Take() == 'r' && is.Take() == 'u' && is.Take() == 'e') { - if (!handler.Bool(true)) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell() - 1); - } - - template - void ParseFalse(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == 'f'); - is.Take(); - - if (is.Take() == 'a' && is.Take() == 'l' && is.Take() == 's' && is.Take() == 'e') { - if (!handler.Bool(false)) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell() - 1); - } - - // Helper function to parse four hexidecimal digits in \uXXXX in ParseString(). - template - unsigned ParseHex4(InputStream& is) { - unsigned codepoint = 0; - for (int i = 0; i < 4; i++) { - Ch c = is.Take(); - codepoint <<= 4; - codepoint += static_cast(c); - if (c >= '0' && c <= '9') - codepoint -= '0'; - else if (c >= 'A' && c <= 'F') - codepoint -= 'A' - 10; - else if (c >= 'a' && c <= 'f') - codepoint -= 'a' - 10; - else { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, is.Tell() - 1); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0); - } - } - return codepoint; - } - - template - class StackStream { - public: - typedef CharType Ch; - - StackStream(internal::Stack& stack) : stack_(stack), length_(0) {} - RAPIDJSON_FORCEINLINE void Put(Ch c) { - *stack_.template Push() = c; - ++length_; - } - size_t Length() const { return length_; } - Ch* Pop() { - return stack_.template Pop(length_); - } - - private: - StackStream(const StackStream&); - StackStream& operator=(const StackStream&); - - internal::Stack& stack_; - SizeType length_; - }; - - // Parse string and generate String event. Different code paths for kParseInsituFlag. - template - void ParseString(InputStream& is, Handler& handler, bool isKey = false) { - internal::StreamLocalCopy copy(is); - InputStream& s(copy.s); - - bool success = false; - if (parseFlags & kParseInsituFlag) { - typename InputStream::Ch *head = s.PutBegin(); - ParseStringToStream(s, s); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - size_t length = s.PutEnd(head) - 1; - RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); - const typename TargetEncoding::Ch* const str = (typename TargetEncoding::Ch*)head; - success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false)); - } - else { - StackStream stackStream(stack_); - ParseStringToStream(s, stackStream); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - SizeType length = static_cast(stackStream.Length()) - 1; - const typename TargetEncoding::Ch* const str = stackStream.Pop(); - success = (isKey ? handler.Key(str, length, true) : handler.String(str, length, true)); - } - if (!success) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell()); - } - - // Parse string to an output is - // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation. - template - RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) { -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - static const char escape[256] = { - Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'/', - Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, - 0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0, - 0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 - }; -#undef Z16 -//!@endcond - - RAPIDJSON_ASSERT(is.Peek() == '\"'); - is.Take(); // Skip '\"' - - for (;;) { - Ch c = is.Peek(); - if (c == '\\') { // Escape - is.Take(); - Ch e = is.Take(); - if ((sizeof(Ch) == 1 || unsigned(e) < 256) && escape[(unsigned char)e]) { - os.Put(escape[(unsigned char)e]); - } - else if (e == 'u') { // Unicode - unsigned codepoint = ParseHex4(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - if (codepoint >= 0xD800 && codepoint <= 0xDBFF) { - // Handle UTF-16 surrogate pair - if (is.Take() != '\\' || is.Take() != 'u') - RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, is.Tell() - 2); - unsigned codepoint2 = ParseHex4(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - if (codepoint2 < 0xDC00 || codepoint2 > 0xDFFF) - RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, is.Tell() - 2); - codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000; - } - TEncoding::Encode(os, codepoint); - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, is.Tell() - 1); - } - else if (c == '"') { // Closing double quote - is.Take(); - os.Put('\0'); // null-terminate the string - return; - } - else if (c == '\0') - RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell() - 1); - else if ((unsigned)c < 0x20) // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF - RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, is.Tell() - 1); - else { - if (parseFlags & kParseValidateEncodingFlag ? - !Transcoder::Validate(is, os) : - !Transcoder::Transcode(is, os)) - RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, is.Tell()); - } - } - } - - template - class NumberStream; - - template - class NumberStream { - public: - NumberStream(GenericReader& reader, InputStream& s) : is(s) { (void)reader; } - ~NumberStream() {} - - RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); } - RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); } - RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); } - size_t Tell() { return is.Tell(); } - size_t Length() { return 0; } - const char* Pop() { return 0; } - - protected: - NumberStream& operator=(const NumberStream&); - - InputStream& is; - }; - - template - class NumberStream : public NumberStream { - typedef NumberStream Base; - public: - NumberStream(GenericReader& reader, InputStream& is) : NumberStream(reader, is), stackStream(reader.stack_) {} - ~NumberStream() {} - - RAPIDJSON_FORCEINLINE Ch TakePush() { - stackStream.Put((char)Base::is.Peek()); - return Base::is.Take(); - } - - size_t Length() { return stackStream.Length(); } - - const char* Pop() { - stackStream.Put('\0'); - return stackStream.Pop(); - } - - private: - StackStream stackStream; - }; - - template - void ParseNumber(InputStream& is, Handler& handler) { - internal::StreamLocalCopy copy(is); - NumberStream s(*this, copy.s); - - // Parse minus - bool minus = false; - if (s.Peek() == '-') { - minus = true; - s.Take(); - } - - // Parse int: zero / ( digit1-9 *DIGIT ) - unsigned i = 0; - uint64_t i64 = 0; - bool use64bit = false; - int significandDigit = 0; - if (s.Peek() == '0') { - i = 0; - s.TakePush(); - } - else if (s.Peek() >= '1' && s.Peek() <= '9') { - i = static_cast(s.TakePush() - '0'); - - if (minus) - while (s.Peek() >= '0' && s.Peek() <= '9') { - if (i >= 214748364) { // 2^31 = 2147483648 - if (i != 214748364 || s.Peek() > '8') { - i64 = i; - use64bit = true; - break; - } - } - i = i * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - else - while (s.Peek() >= '0' && s.Peek() <= '9') { - if (i >= 429496729) { // 2^32 - 1 = 4294967295 - if (i != 429496729 || s.Peek() > '5') { - i64 = i; - use64bit = true; - break; - } - } - i = i * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); - - // Parse 64bit int - bool useDouble = false; - double d = 0.0; - if (use64bit) { - if (minus) - while (s.Peek() >= '0' && s.Peek() <= '9') { - if (i64 >= RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC)) // 2^63 = 9223372036854775808 - if (i64 != RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8') { - d = i64; - useDouble = true; - break; - } - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - else - while (s.Peek() >= '0' && s.Peek() <= '9') { - if (i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999)) // 2^64 - 1 = 18446744073709551615 - if (i64 != RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5') { - d = i64; - useDouble = true; - break; - } - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - } - - // Force double for big integer - if (useDouble) { - while (s.Peek() >= '0' && s.Peek() <= '9') { - if (d >= 1.7976931348623157e307) // DBL_MAX / 10.0 - RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, s.Tell()); - d = d * 10 + (s.TakePush() - '0'); - } - } - - // Parse frac = decimal-point 1*DIGIT - int expFrac = 0; - size_t decimalPosition; - if (s.Peek() == '.') { - s.Take(); - decimalPosition = s.Length(); - - if (!(s.Peek() >= '0' && s.Peek() <= '9')) - RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell()); - - if (!useDouble) { -#if RAPIDJSON_64BIT - // Use i64 to store significand in 64-bit architecture - if (!use64bit) - i64 = i; - - while (s.Peek() >= '0' && s.Peek() <= '9') { - if (i64 > RAPIDJSON_UINT64_C2(0x1FFFFF, 0xFFFFFFFF)) // 2^53 - 1 for fast path - break; - else { - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - --expFrac; - if (i64 != 0) - significandDigit++; - } - } - - d = (double)i64; -#else - // Use double to store significand in 32-bit architecture - d = use64bit ? (double)i64 : (double)i; -#endif - useDouble = true; - } - - while (s.Peek() >= '0' && s.Peek() <= '9') { - if (significandDigit < 17) { - d = d * 10.0 + (s.TakePush() - '0'); - --expFrac; - if (d > 0.0) - significandDigit++; - } - else - s.TakePush(); - } - } - else - decimalPosition = s.Length(); // decimal position at the end of integer. - - // Parse exp = e [ minus / plus ] 1*DIGIT - int exp = 0; - if (s.Peek() == 'e' || s.Peek() == 'E') { - if (!useDouble) { - d = use64bit ? i64 : i; - useDouble = true; - } - s.Take(); - - bool expMinus = false; - if (s.Peek() == '+') - s.Take(); - else if (s.Peek() == '-') { - s.Take(); - expMinus = true; - } - - if (s.Peek() >= '0' && s.Peek() <= '9') { - exp = s.Take() - '0'; - if (expMinus) { - while (s.Peek() >= '0' && s.Peek() <= '9') { - exp = exp * 10 + (s.Take() - '0'); - if (exp >= 214748364) { // Issue #313: prevent overflow exponent - while (s.Peek() >= '0' && s.Peek() <= '9') // Consume the rest of exponent - s.Take(); - } - } - } - else { // positive exp - int maxExp = 308 - expFrac; - while (s.Peek() >= '0' && s.Peek() <= '9') { - exp = exp * 10 + (s.Take() - '0'); - if (exp > maxExp) - RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, s.Tell()); - } - } - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell()); - - if (expMinus) - exp = -exp; - } - - // Finish parsing, call event according to the type of number. - bool cont = true; - size_t length = s.Length(); - const char* decimal = s.Pop(); // Pop stack no matter if it will be used or not. - - if (useDouble) { - int p = exp + expFrac; - if (parseFlags & kParseFullPrecisionFlag) - d = internal::StrtodFullPrecision(d, p, decimal, length, decimalPosition, exp); - else - d = internal::StrtodNormalPrecision(d, p); - - cont = handler.Double(minus ? -d : d); - } - else { - if (use64bit) { - if (minus) - cont = handler.Int64(-(int64_t)i64); - else - cont = handler.Uint64(i64); - } - else { - if (minus) - cont = handler.Int(-(int)i); - else - cont = handler.Uint(i); - } - } - if (!cont) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell()); - } - - // Parse any JSON value - template - void ParseValue(InputStream& is, Handler& handler) { - switch (is.Peek()) { - case 'n': ParseNull (is, handler); break; - case 't': ParseTrue (is, handler); break; - case 'f': ParseFalse (is, handler); break; - case '"': ParseString(is, handler); break; - case '{': ParseObject(is, handler); break; - case '[': ParseArray (is, handler); break; - default : ParseNumber(is, handler); - } - } - - // Iterative Parsing - - // States - enum IterativeParsingState { - IterativeParsingStartState = 0, - IterativeParsingFinishState, - IterativeParsingErrorState, - - // Object states - IterativeParsingObjectInitialState, - IterativeParsingMemberKeyState, - IterativeParsingKeyValueDelimiterState, - IterativeParsingMemberValueState, - IterativeParsingMemberDelimiterState, - IterativeParsingObjectFinishState, - - // Array states - IterativeParsingArrayInitialState, - IterativeParsingElementState, - IterativeParsingElementDelimiterState, - IterativeParsingArrayFinishState, - - // Single value state - IterativeParsingValueState, - - cIterativeParsingStateCount - }; - - // Tokens - enum Token { - LeftBracketToken = 0, - RightBracketToken, - - LeftCurlyBracketToken, - RightCurlyBracketToken, - - CommaToken, - ColonToken, - - StringToken, - FalseToken, - TrueToken, - NullToken, - NumberToken, - - kTokenCount - }; - - RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) { - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define N NumberToken -#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N - // Maps from ASCII to Token - static const unsigned char tokenMap[256] = { - N16, // 00~0F - N16, // 10~1F - N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F - N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F - N16, // 40~4F - N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F - N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F - N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F - N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF - }; -#undef N -#undef N16 -//!@endcond - - if (sizeof(Ch) == 1 || unsigned(c) < 256) - return (Token)tokenMap[(unsigned char)c]; - else - return NumberToken; - } - - RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) { - // current state x one lookahead token -> new state - static const char G[cIterativeParsingStateCount][kTokenCount] = { - // Start - { - IterativeParsingArrayInitialState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingValueState, // String - IterativeParsingValueState, // False - IterativeParsingValueState, // True - IterativeParsingValueState, // Null - IterativeParsingValueState // Number - }, - // Finish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // Error(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // ObjectInitial - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingObjectFinishState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberKeyState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // MemberKey - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingKeyValueDelimiterState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // KeyValueDelimiter - { - IterativeParsingArrayInitialState, // Left bracket(push MemberValue state) - IterativeParsingErrorState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push MemberValue state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberValueState, // String - IterativeParsingMemberValueState, // False - IterativeParsingMemberValueState, // True - IterativeParsingMemberValueState, // Null - IterativeParsingMemberValueState // Number - }, - // MemberValue - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingObjectFinishState, // Right curly bracket - IterativeParsingMemberDelimiterState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // MemberDelimiter - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberKeyState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // ObjectFinish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // ArrayInitial - { - IterativeParsingArrayInitialState, // Left bracket(push Element state) - IterativeParsingArrayFinishState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push Element state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingElementState, // String - IterativeParsingElementState, // False - IterativeParsingElementState, // True - IterativeParsingElementState, // Null - IterativeParsingElementState // Number - }, - // Element - { - IterativeParsingErrorState, // Left bracket - IterativeParsingArrayFinishState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingElementDelimiterState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // ElementDelimiter - { - IterativeParsingArrayInitialState, // Left bracket(push Element state) - IterativeParsingErrorState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push Element state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingElementState, // String - IterativeParsingElementState, // False - IterativeParsingElementState, // True - IterativeParsingElementState, // Null - IterativeParsingElementState // Number - }, - // ArrayFinish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // Single Value (sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - } - }; // End of G - - return (IterativeParsingState)G[state][token]; - } - - // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit(). - // May return a new state on state pop. - template - RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) { - (void)token; - - switch (dst) { - case IterativeParsingErrorState: - return dst; - - case IterativeParsingObjectInitialState: - case IterativeParsingArrayInitialState: - { - // Push the state(Element or MemeberValue) if we are nested in another array or value of member. - // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop. - IterativeParsingState n = src; - if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState) - n = IterativeParsingElementState; - else if (src == IterativeParsingKeyValueDelimiterState) - n = IterativeParsingMemberValueState; - // Push current state. - *stack_.template Push(1) = n; - // Initialize and push the member/element count. - *stack_.template Push(1) = 0; - // Call handler - bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray(); - // On handler short circuits the parsing. - if (!hr) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return dst; - } - } - - case IterativeParsingMemberKeyState: - ParseString(is, handler, true); - if (HasParseError()) - return IterativeParsingErrorState; - else - return dst; - - case IterativeParsingKeyValueDelimiterState: - RAPIDJSON_ASSERT(token == ColonToken); - is.Take(); - return dst; - - case IterativeParsingMemberValueState: - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return dst; - - case IterativeParsingElementState: - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return dst; - - case IterativeParsingMemberDelimiterState: - case IterativeParsingElementDelimiterState: - is.Take(); - // Update member/element count. - *stack_.template Top() = *stack_.template Top() + 1; - return dst; - - case IterativeParsingObjectFinishState: - { - // Get member count. - SizeType c = *stack_.template Pop(1); - // If the object is not empty, count the last member. - if (src == IterativeParsingMemberValueState) - ++c; - // Restore the state. - IterativeParsingState n = static_cast(*stack_.template Pop(1)); - // Transit to Finish state if this is the topmost scope. - if (n == IterativeParsingStartState) - n = IterativeParsingFinishState; - // Call handler - bool hr = handler.EndObject(c); - // On handler short circuits the parsing. - if (!hr) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return n; - } - } - - case IterativeParsingArrayFinishState: - { - // Get element count. - SizeType c = *stack_.template Pop(1); - // If the array is not empty, count the last element. - if (src == IterativeParsingElementState) - ++c; - // Restore the state. - IterativeParsingState n = static_cast(*stack_.template Pop(1)); - // Transit to Finish state if this is the topmost scope. - if (n == IterativeParsingStartState) - n = IterativeParsingFinishState; - // Call handler - bool hr = handler.EndArray(c); - // On handler short circuits the parsing. - if (!hr) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return n; - } - } - - default: - // This branch is for IterativeParsingValueState actually. - // Use `default:` rather than - // `case IterativeParsingValueState:` is for code coverage. - - // The IterativeParsingStartState is not enumerated in this switch-case. - // It is impossible for that case. And it can be caught by following assertion. - - // The IterativeParsingFinishState is not enumerated in this switch-case either. - // It is a "derivative" state which cannot triggered from Predict() directly. - // Therefore it cannot happen here. And it can be caught by following assertion. - RAPIDJSON_ASSERT(dst == IterativeParsingValueState); - - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return IterativeParsingFinishState; - } - } - - template - void HandleError(IterativeParsingState src, InputStream& is) { - if (HasParseError()) { - // Error flag has been set. - return; - } - - switch (src) { - case IterativeParsingStartState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell()); - case IterativeParsingFinishState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell()); - case IterativeParsingObjectInitialState: - case IterativeParsingMemberDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); - case IterativeParsingMemberKeyState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); - case IterativeParsingMemberValueState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); - case IterativeParsingElementState: RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); - default: RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); - } - } - - template - ParseResult IterativeParse(InputStream& is, Handler& handler) { - parseResult_.Clear(); - ClearStackOnExit scope(*this); - IterativeParsingState state = IterativeParsingStartState; - - SkipWhitespace(is); - while (is.Peek() != '\0') { - Token t = Tokenize(is.Peek()); - IterativeParsingState n = Predict(state, t); - IterativeParsingState d = Transit(state, t, n, is, handler); - - if (d == IterativeParsingErrorState) { - HandleError(state, is); - break; - } - - state = d; - - // Do not further consume streams if a root JSON has been parsed. - if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState) - break; - - SkipWhitespace(is); - } - - // Handle the end of file. - if (state != IterativeParsingFinishState) - HandleError(state, is); - - return parseResult_; - } - - static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string. - internal::Stack stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing. - ParseResult parseResult_; -}; // class GenericReader - -//! Reader with UTF8 encoding and default allocator. -typedef GenericReader, UTF8<> > Reader; - -RAPIDJSON_NAMESPACE_END - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#ifdef _MSC_VER -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_READER_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/stringbuffer.h b/external/rapidjson-1.0.2/include/rapidjson/stringbuffer.h deleted file mode 100644 index 1c9c80b..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/stringbuffer.h +++ /dev/null @@ -1,93 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_STRINGBUFFER_H_ -#define RAPIDJSON_STRINGBUFFER_H_ - -#include "rapidjson.h" - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS -#include // std::move -#endif - -#include "internal/stack.h" - -RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory output stream. -/*! - \tparam Encoding Encoding of the stream. - \tparam Allocator type for allocating memory buffer. - \note implements Stream concept -*/ -template -class GenericStringBuffer { -public: - typedef typename Encoding::Ch Ch; - - GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} - GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { - if (&rhs != this) - stack_ = std::move(rhs.stack_); - return *this; - } -#endif - - void Put(Ch c) { *stack_.template Push() = c; } - void Flush() {} - - void Clear() { stack_.Clear(); } - void ShrinkToFit() { - // Push and pop a null terminator. This is safe. - *stack_.template Push() = '\0'; - stack_.ShrinkToFit(); - stack_.template Pop(1); - } - Ch* Push(size_t count) { return stack_.template Push(count); } - void Pop(size_t count) { stack_.template Pop(count); } - - const Ch* GetString() const { - // Push and pop a null terminator. This is safe. - *stack_.template Push() = '\0'; - stack_.template Pop(1); - - return stack_.template Bottom(); - } - - size_t GetSize() const { return stack_.GetSize(); } - - static const size_t kDefaultCapacity = 256; - mutable internal::Stack stack_; - -private: - // Prohibit copy constructor & assignment operator. - GenericStringBuffer(const GenericStringBuffer&); - GenericStringBuffer& operator=(const GenericStringBuffer&); -}; - -//! String buffer with UTF8 encoding -typedef GenericStringBuffer > StringBuffer; - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { - std::memset(stream.stack_.Push(n), c, n * sizeof(c)); -} - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_STRINGBUFFER_H_ diff --git a/external/rapidjson-1.0.2/include/rapidjson/writer.h b/external/rapidjson-1.0.2/include/rapidjson/writer.h deleted file mode 100644 index e1eea38..0000000 --- a/external/rapidjson-1.0.2/include/rapidjson/writer.h +++ /dev/null @@ -1,395 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -#ifndef RAPIDJSON_WRITER_H_ -#define RAPIDJSON_WRITER_H_ - -#include "rapidjson.h" -#include "internal/stack.h" -#include "internal/strfunc.h" -#include "internal/dtoa.h" -#include "internal/itoa.h" -#include "stringbuffer.h" -#include // placement new - -#if RAPIDJSON_HAS_STDSTRING -#include -#endif - -#ifdef _MSC_VER -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! JSON writer -/*! Writer implements the concept Handler. - It generates JSON text by events to an output os. - - User may programmatically calls the functions of a writer to generate JSON text. - - On the other side, a writer can also be passed to objects that generates events, - - for example Reader::Parse() and Document::Accept(). - - \tparam OutputStream Type of output stream. - \tparam SourceEncoding Encoding of source string. - \tparam TargetEncoding Encoding of output stream. - \tparam StackAllocator Type of allocator for allocating memory of stack. - \note implements Handler concept -*/ -template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator> -class Writer { -public: - typedef typename SourceEncoding::Ch Ch; - - //! Constructor - /*! \param os Output stream. - \param stackAllocator User supplied allocator. If it is null, it will create a private one. - \param levelDepth Initial capacity of stack. - */ - explicit - Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) : - os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), hasRoot_(false) {} - - explicit - Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : - os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), hasRoot_(false) {} - - //! Reset the writer with a new stream. - /*! - This function reset the writer with a new stream and default settings, - in order to make a Writer object reusable for output multiple JSONs. - - \param os New output stream. - \code - Writer writer(os1); - writer.StartObject(); - // ... - writer.EndObject(); - - writer.Reset(os2); - writer.StartObject(); - // ... - writer.EndObject(); - \endcode - */ - void Reset(OutputStream& os) { - os_ = &os; - hasRoot_ = false; - level_stack_.Clear(); - } - - //! Checks whether the output is a complete JSON. - /*! - A complete JSON has a complete root object or array. - */ - bool IsComplete() const { - return hasRoot_ && level_stack_.Empty(); - } - - /*!@name Implementation of Handler - \see Handler - */ - //@{ - - bool Null() { Prefix(kNullType); return WriteNull(); } - bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return WriteBool(b); } - bool Int(int i) { Prefix(kNumberType); return WriteInt(i); } - bool Uint(unsigned u) { Prefix(kNumberType); return WriteUint(u); } - bool Int64(int64_t i64) { Prefix(kNumberType); return WriteInt64(i64); } - bool Uint64(uint64_t u64) { Prefix(kNumberType); return WriteUint64(u64); } - - //! Writes the given \c double value to the stream - /*! - \param d The value to be written. - \return Whether it is succeed. - */ - bool Double(double d) { Prefix(kNumberType); return WriteDouble(d); } - - bool String(const Ch* str, SizeType length, bool copy = false) { - (void)copy; - Prefix(kStringType); - return WriteString(str, length); - } - -#if RAPIDJSON_HAS_STDSTRING - bool String(const std::basic_string& str) { - return String(str.data(), SizeType(str.size())); - } -#endif - - bool StartObject() { - Prefix(kObjectType); - new (level_stack_.template Push()) Level(false); - return WriteStartObject(); - } - - bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } - - bool EndObject(SizeType memberCount = 0) { - (void)memberCount; - RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); - RAPIDJSON_ASSERT(!level_stack_.template Top()->inArray); - level_stack_.template Pop(1); - bool ret = WriteEndObject(); - if (level_stack_.Empty()) // end of json text - os_->Flush(); - return ret; - } - - bool StartArray() { - Prefix(kArrayType); - new (level_stack_.template Push()) Level(true); - return WriteStartArray(); - } - - bool EndArray(SizeType elementCount = 0) { - (void)elementCount; - RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); - RAPIDJSON_ASSERT(level_stack_.template Top()->inArray); - level_stack_.template Pop(1); - bool ret = WriteEndArray(); - if (level_stack_.Empty()) // end of json text - os_->Flush(); - return ret; - } - //@} - - /*! @name Convenience extensions */ - //@{ - - //! Simpler but slower overload. - bool String(const Ch* str) { return String(str, internal::StrLen(str)); } - bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); } - - //@} - -protected: - //! Information for each nested level - struct Level { - Level(bool inArray_) : valueCount(0), inArray(inArray_) {} - size_t valueCount; //!< number of values in this level - bool inArray; //!< true if in array, otherwise in object - }; - - static const size_t kDefaultLevelDepth = 32; - - bool WriteNull() { - os_->Put('n'); os_->Put('u'); os_->Put('l'); os_->Put('l'); return true; - } - - bool WriteBool(bool b) { - if (b) { - os_->Put('t'); os_->Put('r'); os_->Put('u'); os_->Put('e'); - } - else { - os_->Put('f'); os_->Put('a'); os_->Put('l'); os_->Put('s'); os_->Put('e'); - } - return true; - } - - bool WriteInt(int i) { - char buffer[11]; - const char* end = internal::i32toa(i, buffer); - for (const char* p = buffer; p != end; ++p) - os_->Put(*p); - return true; - } - - bool WriteUint(unsigned u) { - char buffer[10]; - const char* end = internal::u32toa(u, buffer); - for (const char* p = buffer; p != end; ++p) - os_->Put(*p); - return true; - } - - bool WriteInt64(int64_t i64) { - char buffer[21]; - const char* end = internal::i64toa(i64, buffer); - for (const char* p = buffer; p != end; ++p) - os_->Put(*p); - return true; - } - - bool WriteUint64(uint64_t u64) { - char buffer[20]; - char* end = internal::u64toa(u64, buffer); - for (char* p = buffer; p != end; ++p) - os_->Put(*p); - return true; - } - - bool WriteDouble(double d) { - char buffer[25]; - char* end = internal::dtoa(d, buffer); - for (char* p = buffer; p != end; ++p) - os_->Put(*p); - return true; - } - - bool WriteString(const Ch* str, SizeType length) { - static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; - static const char escape[256] = { -#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - //0 1 2 3 4 5 6 7 8 9 A B C D E F - 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00 - 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10 - 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - Z16, Z16, // 30~4F - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50 - Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF -#undef Z16 - }; - - os_->Put('\"'); - GenericStringStream is(str); - while (is.Tell() < length) { - const Ch c = is.Peek(); - if (!TargetEncoding::supportUnicode && (unsigned)c >= 0x80) { - // Unicode escaping - unsigned codepoint; - if (!SourceEncoding::Decode(is, &codepoint)) - return false; - os_->Put('\\'); - os_->Put('u'); - if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) { - os_->Put(hexDigits[(codepoint >> 12) & 15]); - os_->Put(hexDigits[(codepoint >> 8) & 15]); - os_->Put(hexDigits[(codepoint >> 4) & 15]); - os_->Put(hexDigits[(codepoint ) & 15]); - } - else { - RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF); - // Surrogate pair - unsigned s = codepoint - 0x010000; - unsigned lead = (s >> 10) + 0xD800; - unsigned trail = (s & 0x3FF) + 0xDC00; - os_->Put(hexDigits[(lead >> 12) & 15]); - os_->Put(hexDigits[(lead >> 8) & 15]); - os_->Put(hexDigits[(lead >> 4) & 15]); - os_->Put(hexDigits[(lead ) & 15]); - os_->Put('\\'); - os_->Put('u'); - os_->Put(hexDigits[(trail >> 12) & 15]); - os_->Put(hexDigits[(trail >> 8) & 15]); - os_->Put(hexDigits[(trail >> 4) & 15]); - os_->Put(hexDigits[(trail ) & 15]); - } - } - else if ((sizeof(Ch) == 1 || (unsigned)c < 256) && escape[(unsigned char)c]) { - is.Take(); - os_->Put('\\'); - os_->Put(escape[(unsigned char)c]); - if (escape[(unsigned char)c] == 'u') { - os_->Put('0'); - os_->Put('0'); - os_->Put(hexDigits[(unsigned char)c >> 4]); - os_->Put(hexDigits[(unsigned char)c & 0xF]); - } - } - else - if (!Transcoder::Transcode(is, *os_)) - return false; - } - os_->Put('\"'); - return true; - } - - bool WriteStartObject() { os_->Put('{'); return true; } - bool WriteEndObject() { os_->Put('}'); return true; } - bool WriteStartArray() { os_->Put('['); return true; } - bool WriteEndArray() { os_->Put(']'); return true; } - - void Prefix(Type type) { - (void)type; - if (level_stack_.GetSize() != 0) { // this value is not at root - Level* level = level_stack_.template Top(); - if (level->valueCount > 0) { - if (level->inArray) - os_->Put(','); // add comma if it is not the first element in array - else // in object - os_->Put((level->valueCount % 2 == 0) ? ',' : ':'); - } - if (!level->inArray && level->valueCount % 2 == 0) - RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name - level->valueCount++; - } - else { - RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root. - hasRoot_ = true; - } - } - - OutputStream* os_; - internal::Stack level_stack_; - bool hasRoot_; - -private: - // Prohibit copy constructor & assignment operator. - Writer(const Writer&); - Writer& operator=(const Writer&); -}; - -// Full specialization for StringStream to prevent memory copying - -template<> -inline bool Writer::WriteInt(int i) { - char *buffer = os_->Push(11); - const char* end = internal::i32toa(i, buffer); - os_->Pop(11 - (end - buffer)); - return true; -} - -template<> -inline bool Writer::WriteUint(unsigned u) { - char *buffer = os_->Push(10); - const char* end = internal::u32toa(u, buffer); - os_->Pop(10 - (end - buffer)); - return true; -} - -template<> -inline bool Writer::WriteInt64(int64_t i64) { - char *buffer = os_->Push(21); - const char* end = internal::i64toa(i64, buffer); - os_->Pop(21 - (end - buffer)); - return true; -} - -template<> -inline bool Writer::WriteUint64(uint64_t u) { - char *buffer = os_->Push(20); - const char* end = internal::u64toa(u, buffer); - os_->Pop(20 - (end - buffer)); - return true; -} - -template<> -inline bool Writer::WriteDouble(double d) { - char *buffer = os_->Push(25); - char* end = internal::dtoa(d, buffer); - os_->Pop(25 - (end - buffer)); - return true; -} - -RAPIDJSON_NAMESPACE_END - -#ifdef _MSC_VER -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/external/rapidjson-1.0.2/license.txt b/external/rapidjson-1.0.2/license.txt deleted file mode 100644 index 879293a..0000000 --- a/external/rapidjson-1.0.2/license.txt +++ /dev/null @@ -1,57 +0,0 @@ -Tencent is pleased to support the open source community by making RapidJSON available. - -Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. - -If you have downloaded a copy of the RapidJSON binary from Tencent, please note that the RapidJSON binary is licensed under the MIT License. -If you have downloaded a copy of the RapidJSON source code from Tencent, please note that RapidJSON source code is licensed under the MIT License, except for the third-party components listed below which are subject to different license terms. Your integration of RapidJSON into your own projects may require compliance with the MIT License, as well as the other licenses applicable to the third-party components included within RapidJSON. -A copy of the MIT License is included in this file. - -Other dependencies and licenses: - -Open Source Software Licensed Under the BSD License: --------------------------------------------------------------------- - -The msinttypes r29 -Copyright (c) 2006-2013 Alexander Chemeris -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -* Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Open Source Software Licensed Under the JSON License: --------------------------------------------------------------------- - -json.org -Copyright (c) 2002 JSON.org -All Rights Reserved. - -JSON_checker -Copyright (c) 2002 JSON.org -All Rights Reserved. - - -Terms of the JSON License: ---------------------------------------------------- - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -The Software shall be used for Good, not Evil. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -Terms of the MIT License: --------------------------------------------------------------------- - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/external/rapidjson-1.0.2/readme.md b/external/rapidjson-1.0.2/readme.md deleted file mode 100644 index 19da386..0000000 --- a/external/rapidjson-1.0.2/readme.md +++ /dev/null @@ -1,129 +0,0 @@ -![](doc/logo/rapidjson.png) - -![](https://img.shields.io/badge/release-v1.0.2-blue.png) - -## A fast JSON parser/generator for C++ with both SAX/DOM style API - -Tencent is pleased to support the open source community by making RapidJSON available. - -Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. - -* [RapidJSON GitHub](https://github.com/miloyip/rapidjson/) -* RapidJSON Documentation - * [English](http://miloyip.github.io/rapidjson/) - * [简体中文](http://miloyip.github.io/rapidjson/zh-cn/) - * [GitBook](https://www.gitbook.com/book/miloyip/rapidjson/) with downloadable PDF/EPUB/MOBI, without API reference. - -## Build status - -| [Linux][lin-link] | [Windows][win-link] | [Coveralls][cov-link] | -| :---------------: | :-----------------: | :-------------------: | -| ![lin-badge] | ![win-badge] | ![cov-badge] | - -[lin-badge]: https://travis-ci.org/miloyip/rapidjson.png?branch=master "Travis build status" -[lin-link]: https://travis-ci.org/miloyip/rapidjson "Travis build status" -[win-badge]: https://ci.appveyor.com/api/projects/status/u658dcuwxo14a8m9/branch/master "AppVeyor build status" -[win-link]: https://ci.appveyor.com/project/miloyip/rapidjson/branch/master "AppVeyor build status" -[cov-badge]: https://coveralls.io/repos/miloyip/rapidjson/badge.png?branch=master -[cov-link]: https://coveralls.io/r/miloyip/rapidjson?branch=master - -## Introduction - -RapidJSON is a JSON parser and generator for C++. It was inspired by [RapidXml](http://rapidxml.sourceforge.net/). - -* RapidJSON is small but complete. It supports both SAX and DOM style API. The SAX parser is only a half thousand lines of code. - -* RapidJSON is fast. Its performance can be comparable to `strlen()`. It also optionally supports SSE2/SSE4.2 for acceleration. - -* RapidJSON is self-contained. It does not depend on external libraries such as BOOST. It even does not depend on STL. - -* RapidJSON is memory friendly. Each JSON value occupies exactly 16/20 bytes for most 32/64-bit machines (excluding text string). By default it uses a fast memory allocator, and the parser allocates memory compactly during parsing. - -* RapidJSON is Unicode friendly. It supports UTF-8, UTF-16, UTF-32 (LE & BE), and their detection, validation and transcoding internally. For example, you can read a UTF-8 file and let RapidJSON transcode the JSON strings into UTF-16 in the DOM. It also supports surrogates and "\u0000" (null character). - -More features can be read [here](doc/features.md). - -JSON(JavaScript Object Notation) is a light-weight data exchange format. RapidJSON should be in fully compliance with RFC7159/ECMA-404. More information about JSON can be obtained at -* [Introducing JSON](http://json.org/) -* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange Format](http://www.ietf.org/rfc/rfc7159.txt) -* [Standard ECMA-404: The JSON Data Interchange Format](http://www.ecma-international.org/publications/standards/Ecma-404.htm) - -## Compatibility - -RapidJSON is cross-platform. Some platform/compiler combinations which have been tested are shown as follows. -* Visual C++ 2008/2010/2013 on Windows (32/64-bit) -* GNU C++ 3.8.x on Cygwin -* Clang 3.4 on Mac OS X (32/64-bit) and iOS -* Clang 3.4 on Android NDK - -Users can build and run the unit tests on their platform/compiler. - -## Installation - -RapidJSON is a header-only C++ library. Just copy the `include/rapidjson` folder to system or project's include path. - -RapidJSON uses following software as its dependencies: -* [CMake](http://www.cmake.org) as a general build tool -* (optional)[Doxygen](http://www.doxygen.org) to build documentation -* (optional)[googletest](https://code.google.com/p/googletest/) for unit and performance testing - -To generate user documentation and run tests please proceed with the steps below: - -1. Execute `git submodule update --init` to get the files of thirdparty submodules (google test). -2. Create directory called `build` in rapidjson source directory. -3. Change to `build` directory and run `cmake ..` command to configure your build. Windows users can do the same with cmake-gui application. -4. On Windows, build the solution found in the build directory. On Linux, run `make` from the build directory. - -On successfull build you will find compiled test and example binaries in `bin` -directory. The generated documentation will be available in `doc/html` -directory of the build tree. To run tests after finished build please run `make -test` or `ctest` from your build tree. You can get detailed output using `ctest --V` command. - -It is possible to install library system-wide by running `make install` command -from the build tree with administrative privileges. This will install all files -according to system preferences. Once RapidJSON is installed, it is possible -to use it from other CMake projects by adding `find_package(RapidJSON)` line to -your CMakeLists.txt. - -## Usage at a glance - -This simple example parses a JSON string into a document (DOM), make a simple modification of the DOM, and finally stringify the DOM to a JSON string. - -~~~~~~~~~~cpp -// rapidjson/example/simpledom/simpledom.cpp` -#include "rapidjson/document.h" -#include "rapidjson/writer.h" -#include "rapidjson/stringbuffer.h" -#include - -using namespace rapidjson; - -int main() { - // 1. Parse a JSON string into DOM. - const char* json = "{\"project\":\"rapidjson\",\"stars\":10}"; - Document d; - d.Parse(json); - - // 2. Modify it by DOM. - Value& s = d["stars"]; - s.SetInt(s.GetInt() + 1); - - // 3. Stringify the DOM - StringBuffer buffer; - Writer writer(buffer); - d.Accept(writer); - - // Output {"project":"rapidjson","stars":11} - std::cout << buffer.GetString() << std::endl; - return 0; -} -~~~~~~~~~~ - -Note that this example did not handle potential errors. - -The following diagram shows the process. - -![simpledom](doc/diagram/simpledom.png) - -More [examples](https://github.com/miloyip/rapidjson/tree/master/example) are available. diff --git a/external/snappy-1.1.3/INSTALL b/external/snappy-1.1.3/INSTALL deleted file mode 100644 index 2099840..0000000 --- a/external/snappy-1.1.3/INSTALL +++ /dev/null @@ -1,370 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell command `./configure && make && make install' -should configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf limitation. Until the limitation is lifted, you can use -this workaround: - - CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. diff --git a/external/snappy-1.1.3/snappy-internal.h b/external/snappy-1.1.3/snappy-internal.h deleted file mode 100644 index 0653dc6..0000000 --- a/external/snappy-1.1.3/snappy-internal.h +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2008 Google Inc. All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Internals shared between the Snappy implementation and its unittest. - -#ifndef THIRD_PARTY_SNAPPY_SNAPPY_INTERNAL_H_ -#define THIRD_PARTY_SNAPPY_SNAPPY_INTERNAL_H_ - -#include "snappy-stubs-internal.h" - -namespace snappy { -namespace internal { - -class WorkingMemory { - public: - WorkingMemory() : large_table_(NULL) { } - ~WorkingMemory() { delete[] large_table_; } - - // Allocates and clears a hash table using memory in "*this", - // stores the number of buckets in "*table_size" and returns a pointer to - // the base of the hash table. - uint16* GetHashTable(size_t input_size, int* table_size); - - private: - uint16 small_table_[1<<10]; // 2KB - uint16* large_table_; // Allocated only when needed - - DISALLOW_COPY_AND_ASSIGN(WorkingMemory); -}; - -// Flat array compression that does not emit the "uncompressed length" -// prefix. Compresses "input" string to the "*op" buffer. -// -// REQUIRES: "input_length <= kBlockSize" -// REQUIRES: "op" points to an array of memory that is at least -// "MaxCompressedLength(input_length)" in size. -// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero. -// REQUIRES: "table_size" is a power of two -// -// Returns an "end" pointer into "op" buffer. -// "end - op" is the compressed size of "input". -char* CompressFragment(const char* input, - size_t input_length, - char* op, - uint16* table, - const int table_size); - -// Return the largest n such that -// -// s1[0,n-1] == s2[0,n-1] -// and n <= (s2_limit - s2). -// -// Does not read *s2_limit or beyond. -// Does not read *(s1 + (s2_limit - s2)) or beyond. -// Requires that s2_limit >= s2. -// -// Separate implementation for x86_64, for speed. Uses the fact that -// x86_64 is little endian. -#if defined(ARCH_K8) -static inline int FindMatchLength(const char* s1, - const char* s2, - const char* s2_limit) { - assert(s2_limit >= s2); - int matched = 0; - - // Find out how long the match is. We loop over the data 64 bits at a - // time until we find a 64-bit block that doesn't match; then we find - // the first non-matching bit and use that to calculate the total - // length of the match. - while (PREDICT_TRUE(s2 <= s2_limit - 8)) { - if (UNALIGNED_LOAD64(s2) == UNALIGNED_LOAD64(s1 + matched)) { - s2 += 8; - matched += 8; - } else { - // On current (mid-2008) Opteron models there is a 3% more - // efficient code sequence to find the first non-matching byte. - // However, what follows is ~10% better on Intel Core 2 and newer, - // and we expect AMD's bsf instruction to improve. - uint64 x = UNALIGNED_LOAD64(s2) ^ UNALIGNED_LOAD64(s1 + matched); - int matching_bits = Bits::FindLSBSetNonZero64(x); - matched += matching_bits >> 3; - return matched; - } - } - while (PREDICT_TRUE(s2 < s2_limit)) { - if (s1[matched] == *s2) { - ++s2; - ++matched; - } else { - return matched; - } - } - return matched; -} -#else -static inline int FindMatchLength(const char* s1, - const char* s2, - const char* s2_limit) { - // Implementation based on the x86-64 version, above. - assert(s2_limit >= s2); - int matched = 0; - - while (s2 <= s2_limit - 4 && - UNALIGNED_LOAD32(s2) == UNALIGNED_LOAD32(s1 + matched)) { - s2 += 4; - matched += 4; - } - if (LittleEndian::IsLittleEndian() && s2 <= s2_limit - 4) { - uint32 x = UNALIGNED_LOAD32(s2) ^ UNALIGNED_LOAD32(s1 + matched); - int matching_bits = Bits::FindLSBSetNonZero(x); - matched += matching_bits >> 3; - } else { - while ((s2 < s2_limit) && (s1[matched] == *s2)) { - ++s2; - ++matched; - } - } - return matched; -} -#endif - -} // end namespace internal -} // end namespace snappy - -#endif // THIRD_PARTY_SNAPPY_SNAPPY_INTERNAL_H_ diff --git a/external/snappy-1.1.3/snappy-stubs-internal.h b/external/snappy-1.1.3/snappy-stubs-internal.h deleted file mode 100644 index d344b6b..0000000 --- a/external/snappy-1.1.3/snappy-stubs-internal.h +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Various stubs for the open-source version of Snappy. - -#ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ -#define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include - -#ifdef HAVE_SYS_MMAN_H -#include -#endif - -#include "snappy/snappy-stubs-public.h" - -#if defined(__x86_64__) - -// Enable 64-bit optimized versions of some routines. -#define ARCH_K8 1 - -#endif - -// Needed by OS X, among others. -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif - -// Pull in std::min, std::ostream, and the likes. This is safe because this -// header file is never used from any public header files. -using namespace std; - -// The size of an array, if known at compile-time. -// Will give unexpected results if used on a pointer. -// We undefine it first, since some compilers already have a definition. -#ifdef ARRAYSIZE -#undef ARRAYSIZE -#endif -#define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a))) - -// Static prediction hints. -#ifdef HAVE_BUILTIN_EXPECT -#define PREDICT_FALSE(x) (__builtin_expect(x, 0)) -#define PREDICT_TRUE(x) (__builtin_expect(!!(x), 1)) -#else -#define PREDICT_FALSE(x) x -#define PREDICT_TRUE(x) x -#endif - -// This is only used for recomputing the tag byte table used during -// decompression; for simplicity we just remove it from the open-source -// version (anyone who wants to regenerate it can just do the call -// themselves within main()). -#define DEFINE_bool(flag_name, default_value, description) \ - bool FLAGS_ ## flag_name = default_value -#define DECLARE_bool(flag_name) \ - extern bool FLAGS_ ## flag_name - -namespace snappy { - -static const uint32 kuint32max = static_cast(0xFFFFFFFF); -static const int64 kint64max = static_cast(0x7FFFFFFFFFFFFFFFLL); - -// Potentially unaligned loads and stores. - -// x86 and PowerPC can simply do these loads and stores native. - -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) - -#define UNALIGNED_LOAD16(_p) (*reinterpret_cast(_p)) -#define UNALIGNED_LOAD32(_p) (*reinterpret_cast(_p)) -#define UNALIGNED_LOAD64(_p) (*reinterpret_cast(_p)) - -#define UNALIGNED_STORE16(_p, _val) (*reinterpret_cast(_p) = (_val)) -#define UNALIGNED_STORE32(_p, _val) (*reinterpret_cast(_p) = (_val)) -#define UNALIGNED_STORE64(_p, _val) (*reinterpret_cast(_p) = (_val)) - -// ARMv7 and newer support native unaligned accesses, but only of 16-bit -// and 32-bit values (not 64-bit); older versions either raise a fatal signal, -// do an unaligned read and rotate the words around a bit, or do the reads very -// slowly (trip through kernel mode). There's no simple #define that says just -// “ARMv7 or higherâ€, so we have to filter away all ARMv5 and ARMv6 -// sub-architectures. -// -// This is a mess, but there's not much we can do about it. - -#elif defined(__arm__) && \ - !defined(__ARM_ARCH_4__) && \ - !defined(__ARM_ARCH_4T__) && \ - !defined(__ARM_ARCH_5__) && \ - !defined(__ARM_ARCH_5T__) && \ - !defined(__ARM_ARCH_5TE__) && \ - !defined(__ARM_ARCH_5TEJ__) && \ - !defined(__ARM_ARCH_6__) && \ - !defined(__ARM_ARCH_6J__) && \ - !defined(__ARM_ARCH_6K__) && \ - !defined(__ARM_ARCH_6Z__) && \ - !defined(__ARM_ARCH_6ZK__) && \ - !defined(__ARM_ARCH_6T2__) - -#define UNALIGNED_LOAD16(_p) (*reinterpret_cast(_p)) -#define UNALIGNED_LOAD32(_p) (*reinterpret_cast(_p)) - -#define UNALIGNED_STORE16(_p, _val) (*reinterpret_cast(_p) = (_val)) -#define UNALIGNED_STORE32(_p, _val) (*reinterpret_cast(_p) = (_val)) - -// TODO(user): NEON supports unaligned 64-bit loads and stores. -// See if that would be more efficient on platforms supporting it, -// at least for copies. - -inline uint64 UNALIGNED_LOAD64(const void *p) { - uint64 t; - memcpy(&t, p, sizeof t); - return t; -} - -inline void UNALIGNED_STORE64(void *p, uint64 v) { - memcpy(p, &v, sizeof v); -} - -#else - -// These functions are provided for architectures that don't support -// unaligned loads and stores. - -inline uint16 UNALIGNED_LOAD16(const void *p) { - uint16 t; - memcpy(&t, p, sizeof t); - return t; -} - -inline uint32 UNALIGNED_LOAD32(const void *p) { - uint32 t; - memcpy(&t, p, sizeof t); - return t; -} - -inline uint64 UNALIGNED_LOAD64(const void *p) { - uint64 t; - memcpy(&t, p, sizeof t); - return t; -} - -inline void UNALIGNED_STORE16(void *p, uint16 v) { - memcpy(p, &v, sizeof v); -} - -inline void UNALIGNED_STORE32(void *p, uint32 v) { - memcpy(p, &v, sizeof v); -} - -inline void UNALIGNED_STORE64(void *p, uint64 v) { - memcpy(p, &v, sizeof v); -} - -#endif - -// This can be more efficient than UNALIGNED_LOAD64 + UNALIGNED_STORE64 -// on some platforms, in particular ARM. -inline void UnalignedCopy64(const void *src, void *dst) { - if (sizeof(void *) == 8) { - UNALIGNED_STORE64(dst, UNALIGNED_LOAD64(src)); - } else { - const char *src_char = reinterpret_cast(src); - char *dst_char = reinterpret_cast(dst); - - UNALIGNED_STORE32(dst_char, UNALIGNED_LOAD32(src_char)); - UNALIGNED_STORE32(dst_char + 4, UNALIGNED_LOAD32(src_char + 4)); - } -} - -// The following guarantees declaration of the byte swap functions. -#ifdef WORDS_BIGENDIAN - -#ifdef HAVE_SYS_BYTEORDER_H -#include -#endif - -#ifdef HAVE_SYS_ENDIAN_H -#include -#endif - -#ifdef _MSC_VER -#include -#define bswap_16(x) _byteswap_ushort(x) -#define bswap_32(x) _byteswap_ulong(x) -#define bswap_64(x) _byteswap_uint64(x) - -#elif defined(__APPLE__) -// Mac OS X / Darwin features -#include -#define bswap_16(x) OSSwapInt16(x) -#define bswap_32(x) OSSwapInt32(x) -#define bswap_64(x) OSSwapInt64(x) - -#elif defined(HAVE_BYTESWAP_H) -#include - -#elif defined(bswap32) -// FreeBSD defines bswap{16,32,64} in (already #included). -#define bswap_16(x) bswap16(x) -#define bswap_32(x) bswap32(x) -#define bswap_64(x) bswap64(x) - -#elif defined(BSWAP_64) -// Solaris 10 defines BSWAP_{16,32,64} in (already #included). -#define bswap_16(x) BSWAP_16(x) -#define bswap_32(x) BSWAP_32(x) -#define bswap_64(x) BSWAP_64(x) - -#else - -inline uint16 bswap_16(uint16 x) { - return (x << 8) | (x >> 8); -} - -inline uint32 bswap_32(uint32 x) { - x = ((x & 0xff00ff00UL) >> 8) | ((x & 0x00ff00ffUL) << 8); - return (x >> 16) | (x << 16); -} - -inline uint64 bswap_64(uint64 x) { - x = ((x & 0xff00ff00ff00ff00ULL) >> 8) | ((x & 0x00ff00ff00ff00ffULL) << 8); - x = ((x & 0xffff0000ffff0000ULL) >> 16) | ((x & 0x0000ffff0000ffffULL) << 16); - return (x >> 32) | (x << 32); -} - -#endif - -#endif // WORDS_BIGENDIAN - -// Convert to little-endian storage, opposite of network format. -// Convert x from host to little endian: x = LittleEndian.FromHost(x); -// convert x from little endian to host: x = LittleEndian.ToHost(x); -// -// Store values into unaligned memory converting to little endian order: -// LittleEndian.Store16(p, x); -// -// Load unaligned values stored in little endian converting to host order: -// x = LittleEndian.Load16(p); -class LittleEndian { - public: - // Conversion functions. -#ifdef WORDS_BIGENDIAN - - static uint16 FromHost16(uint16 x) { return bswap_16(x); } - static uint16 ToHost16(uint16 x) { return bswap_16(x); } - - static uint32 FromHost32(uint32 x) { return bswap_32(x); } - static uint32 ToHost32(uint32 x) { return bswap_32(x); } - - static bool IsLittleEndian() { return false; } - -#else // !defined(WORDS_BIGENDIAN) - - static uint16 FromHost16(uint16 x) { return x; } - static uint16 ToHost16(uint16 x) { return x; } - - static uint32 FromHost32(uint32 x) { return x; } - static uint32 ToHost32(uint32 x) { return x; } - - static bool IsLittleEndian() { return true; } - -#endif // !defined(WORDS_BIGENDIAN) - - // Functions to do unaligned loads and stores in little-endian order. - static uint16 Load16(const void *p) { - return ToHost16(UNALIGNED_LOAD16(p)); - } - - static void Store16(void *p, uint16 v) { - UNALIGNED_STORE16(p, FromHost16(v)); - } - - static uint32 Load32(const void *p) { - return ToHost32(UNALIGNED_LOAD32(p)); - } - - static void Store32(void *p, uint32 v) { - UNALIGNED_STORE32(p, FromHost32(v)); - } -}; - -// Some bit-manipulation functions. -class Bits { - public: - // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. - static int Log2Floor(uint32 n); - - // Return the first set least / most significant bit, 0-indexed. Returns an - // undefined value if n == 0. FindLSBSetNonZero() is similar to ffs() except - // that it's 0-indexed. - static int FindLSBSetNonZero(uint32 n); - static int FindLSBSetNonZero64(uint64 n); - - private: - DISALLOW_COPY_AND_ASSIGN(Bits); -}; - -#ifdef HAVE_BUILTIN_CTZ - -inline int Bits::Log2Floor(uint32 n) { - return n == 0 ? -1 : 31 ^ __builtin_clz(n); -} - -inline int Bits::FindLSBSetNonZero(uint32 n) { - return __builtin_ctz(n); -} - -inline int Bits::FindLSBSetNonZero64(uint64 n) { - return __builtin_ctzll(n); -} - -#else // Portable versions. - -inline int Bits::Log2Floor(uint32 n) { - if (n == 0) - return -1; - int log = 0; - uint32 value = n; - for (int i = 4; i >= 0; --i) { - int shift = (1 << i); - uint32 x = value >> shift; - if (x != 0) { - value = x; - log += shift; - } - } - assert(value == 1); - return log; -} - -inline int Bits::FindLSBSetNonZero(uint32 n) { - int rc = 31; - for (int i = 4, shift = 1 << 4; i >= 0; --i) { - const uint32 x = n << shift; - if (x != 0) { - n = x; - rc -= shift; - } - shift >>= 1; - } - return rc; -} - -// FindLSBSetNonZero64() is defined in terms of FindLSBSetNonZero(). -inline int Bits::FindLSBSetNonZero64(uint64 n) { - const uint32 bottombits = static_cast(n); - if (bottombits == 0) { - // Bottom bits are zero, so scan in top bits - return 32 + FindLSBSetNonZero(static_cast(n >> 32)); - } else { - return FindLSBSetNonZero(bottombits); - } -} - -#endif // End portable versions. - -// Variable-length integer encoding. -class Varint { - public: - // Maximum lengths of varint encoding of uint32. - static const int kMax32 = 5; - - // Attempts to parse a varint32 from a prefix of the bytes in [ptr,limit-1]. - // Never reads a character at or beyond limit. If a valid/terminated varint32 - // was found in the range, stores it in *OUTPUT and returns a pointer just - // past the last byte of the varint32. Else returns NULL. On success, - // "result <= limit". - static const char* Parse32WithLimit(const char* ptr, const char* limit, - uint32* OUTPUT); - - // REQUIRES "ptr" points to a buffer of length sufficient to hold "v". - // EFFECTS Encodes "v" into "ptr" and returns a pointer to the - // byte just past the last encoded byte. - static char* Encode32(char* ptr, uint32 v); - - // EFFECTS Appends the varint representation of "value" to "*s". - static void Append32(string* s, uint32 value); -}; - -inline const char* Varint::Parse32WithLimit(const char* p, - const char* l, - uint32* OUTPUT) { - const unsigned char* ptr = reinterpret_cast(p); - const unsigned char* limit = reinterpret_cast(l); - uint32 b, result; - if (ptr >= limit) return NULL; - b = *(ptr++); result = b & 127; if (b < 128) goto done; - if (ptr >= limit) return NULL; - b = *(ptr++); result |= (b & 127) << 7; if (b < 128) goto done; - if (ptr >= limit) return NULL; - b = *(ptr++); result |= (b & 127) << 14; if (b < 128) goto done; - if (ptr >= limit) return NULL; - b = *(ptr++); result |= (b & 127) << 21; if (b < 128) goto done; - if (ptr >= limit) return NULL; - b = *(ptr++); result |= (b & 127) << 28; if (b < 16) goto done; - return NULL; // Value is too long to be a varint32 - done: - *OUTPUT = result; - return reinterpret_cast(ptr); -} - -inline char* Varint::Encode32(char* sptr, uint32 v) { - // Operate on characters as unsigneds - unsigned char* ptr = reinterpret_cast(sptr); - static const int B = 128; - if (v < (1<<7)) { - *(ptr++) = v; - } else if (v < (1<<14)) { - *(ptr++) = v | B; - *(ptr++) = v>>7; - } else if (v < (1<<21)) { - *(ptr++) = v | B; - *(ptr++) = (v>>7) | B; - *(ptr++) = v>>14; - } else if (v < (1<<28)) { - *(ptr++) = v | B; - *(ptr++) = (v>>7) | B; - *(ptr++) = (v>>14) | B; - *(ptr++) = v>>21; - } else { - *(ptr++) = v | B; - *(ptr++) = (v>>7) | B; - *(ptr++) = (v>>14) | B; - *(ptr++) = (v>>21) | B; - *(ptr++) = v>>28; - } - return reinterpret_cast(ptr); -} - -// If you know the internal layout of the std::string in use, you can -// replace this function with one that resizes the string without -// filling the new space with zeros (if applicable) -- -// it will be non-portable but faster. -inline void STLStringResizeUninitialized(string* s, size_t new_size) { - s->resize(new_size); -} - -// Return a mutable char* pointing to a string's internal buffer, -// which may not be null-terminated. Writing through this pointer will -// modify the string. -// -// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the -// next call to a string method that invalidates iterators. -// -// As of 2006-04, there is no standard-blessed way of getting a -// mutable reference to a string's internal buffer. However, issue 530 -// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-defects.html#530) -// proposes this as the method. It will officially be part of the standard -// for C++0x. This should already work on all current implementations. -inline char* string_as_array(string* str) { - return str->empty() ? NULL : &*str->begin(); -} - -} // namespace snappy - -#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ diff --git a/external/snappy-1.1.3/snappy.cc b/external/snappy-1.1.3/snappy.cc deleted file mode 100644 index a04c1ac..0000000 --- a/external/snappy-1.1.3/snappy.cc +++ /dev/null @@ -1,1553 +0,0 @@ -// Copyright 2005 Google Inc. All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "snappy/snappy.h" -#include "snappy-internal.h" -#include "snappy-sinksource.h" - -#include - -#include -#include -#include - - -namespace snappy { - -// Any hash function will produce a valid compressed bitstream, but a good -// hash function reduces the number of collisions and thus yields better -// compression for compressible input, and more speed for incompressible -// input. Of course, it doesn't hurt if the hash function is reasonably fast -// either, as it gets called a lot. -static inline uint32 HashBytes(uint32 bytes, int shift) { - uint32 kMul = 0x1e35a7bd; - return (bytes * kMul) >> shift; -} -static inline uint32 Hash(const char* p, int shift) { - return HashBytes(UNALIGNED_LOAD32(p), shift); -} - -size_t MaxCompressedLength(size_t source_len) { - // Compressed data can be defined as: - // compressed := item* literal* - // item := literal* copy - // - // The trailing literal sequence has a space blowup of at most 62/60 - // since a literal of length 60 needs one tag byte + one extra byte - // for length information. - // - // Item blowup is trickier to measure. Suppose the "copy" op copies - // 4 bytes of data. Because of a special check in the encoding code, - // we produce a 4-byte copy only if the offset is < 65536. Therefore - // the copy op takes 3 bytes to encode, and this type of item leads - // to at most the 62/60 blowup for representing literals. - // - // Suppose the "copy" op copies 5 bytes of data. If the offset is big - // enough, it will take 5 bytes to encode the copy op. Therefore the - // worst case here is a one-byte literal followed by a five-byte copy. - // I.e., 6 bytes of input turn into 7 bytes of "compressed" data. - // - // This last factor dominates the blowup, so the final estimate is: - return 32 + source_len + source_len/6; -} - -enum { - LITERAL = 0, - COPY_1_BYTE_OFFSET = 1, // 3 bit length + 3 bits of offset in opcode - COPY_2_BYTE_OFFSET = 2, - COPY_4_BYTE_OFFSET = 3 -}; -static const int kMaximumTagLength = 5; // COPY_4_BYTE_OFFSET plus the actual offset. - -// Copy "len" bytes from "src" to "op", one byte at a time. Used for -// handling COPY operations where the input and output regions may -// overlap. For example, suppose: -// src == "ab" -// op == src + 2 -// len == 20 -// After IncrementalCopy(src, op, len), the result will have -// eleven copies of "ab" -// ababababababababababab -// Note that this does not match the semantics of either memcpy() -// or memmove(). -static inline void IncrementalCopy(const char* src, char* op, ssize_t len) { - assert(len > 0); - do { - *op++ = *src++; - } while (--len > 0); -} - -// Equivalent to IncrementalCopy except that it can write up to ten extra -// bytes after the end of the copy, and that it is faster. -// -// The main part of this loop is a simple copy of eight bytes at a time until -// we've copied (at least) the requested amount of bytes. However, if op and -// src are less than eight bytes apart (indicating a repeating pattern of -// length < 8), we first need to expand the pattern in order to get the correct -// results. For instance, if the buffer looks like this, with the eight-byte -// and patterns marked as intervals: -// -// abxxxxxxxxxxxx -// [------] src -// [------] op -// -// a single eight-byte copy from to will repeat the pattern once, -// after which we can move two bytes without moving : -// -// ababxxxxxxxxxx -// [------] src -// [------] op -// -// and repeat the exercise until the two no longer overlap. -// -// This allows us to do very well in the special case of one single byte -// repeated many times, without taking a big hit for more general cases. -// -// The worst case of extra writing past the end of the match occurs when -// op - src == 1 and len == 1; the last copy will read from byte positions -// [0..7] and write to [4..11], whereas it was only supposed to write to -// position 1. Thus, ten excess bytes. - -namespace { - -const int kMaxIncrementCopyOverflow = 10; - -inline void IncrementalCopyFastPath(const char* src, char* op, ssize_t len) { - while (PREDICT_FALSE(op - src < 8)) { - UnalignedCopy64(src, op); - len -= op - src; - op += op - src; - } - while (len > 0) { - UnalignedCopy64(src, op); - src += 8; - op += 8; - len -= 8; - } -} - -} // namespace - -static inline char* EmitLiteral(char* op, - const char* literal, - int len, - bool allow_fast_path) { - int n = len - 1; // Zero-length literals are disallowed - if (n < 60) { - // Fits in tag byte - *op++ = LITERAL | (n << 2); - - // The vast majority of copies are below 16 bytes, for which a - // call to memcpy is overkill. This fast path can sometimes - // copy up to 15 bytes too much, but that is okay in the - // main loop, since we have a bit to go on for both sides: - // - // - The input will always have kInputMarginBytes = 15 extra - // available bytes, as long as we're in the main loop, and - // if not, allow_fast_path = false. - // - The output will always have 32 spare bytes (see - // MaxCompressedLength). - if (allow_fast_path && len <= 16) { - UnalignedCopy64(literal, op); - UnalignedCopy64(literal + 8, op + 8); - return op + len; - } - } else { - // Encode in upcoming bytes - char* base = op; - int count = 0; - op++; - while (n > 0) { - *op++ = n & 0xff; - n >>= 8; - count++; - } - assert(count >= 1); - assert(count <= 4); - *base = LITERAL | ((59+count) << 2); - } - memcpy(op, literal, len); - return op + len; -} - -static inline char* EmitCopyLessThan64(char* op, size_t offset, int len) { - assert(len <= 64); - assert(len >= 4); - assert(offset < 65536); - - if ((len < 12) && (offset < 2048)) { - size_t len_minus_4 = len - 4; - assert(len_minus_4 < 8); // Must fit in 3 bits - *op++ = COPY_1_BYTE_OFFSET + ((len_minus_4) << 2) + ((offset >> 8) << 5); - *op++ = offset & 0xff; - } else { - *op++ = COPY_2_BYTE_OFFSET + ((len-1) << 2); - LittleEndian::Store16(op, offset); - op += 2; - } - return op; -} - -static inline char* EmitCopy(char* op, size_t offset, int len) { - // Emit 64 byte copies but make sure to keep at least four bytes reserved - while (PREDICT_FALSE(len >= 68)) { - op = EmitCopyLessThan64(op, offset, 64); - len -= 64; - } - - // Emit an extra 60 byte copy if have too much data to fit in one copy - if (len > 64) { - op = EmitCopyLessThan64(op, offset, 60); - len -= 60; - } - - // Emit remainder - op = EmitCopyLessThan64(op, offset, len); - return op; -} - - -bool GetUncompressedLength(const char* start, size_t n, size_t* result) { - uint32 v = 0; - const char* limit = start + n; - if (Varint::Parse32WithLimit(start, limit, &v) != NULL) { - *result = v; - return true; - } else { - return false; - } -} - -namespace internal { -uint16* WorkingMemory::GetHashTable(size_t input_size, int* table_size) { - // Use smaller hash table when input.size() is smaller, since we - // fill the table, incurring O(hash table size) overhead for - // compression, and if the input is short, we won't need that - // many hash table entries anyway. - assert(kMaxHashTableSize >= 256); - size_t htsize = 256; - while (htsize < kMaxHashTableSize && htsize < input_size) { - htsize <<= 1; - } - - uint16* table; - if (htsize <= ARRAYSIZE(small_table_)) { - table = small_table_; - } else { - if (large_table_ == NULL) { - large_table_ = new uint16[kMaxHashTableSize]; - } - table = large_table_; - } - - *table_size = htsize; - memset(table, 0, htsize * sizeof(*table)); - return table; -} -} // end namespace internal - -// For 0 <= offset <= 4, GetUint32AtOffset(GetEightBytesAt(p), offset) will -// equal UNALIGNED_LOAD32(p + offset). Motivation: On x86-64 hardware we have -// empirically found that overlapping loads such as -// UNALIGNED_LOAD32(p) ... UNALIGNED_LOAD32(p+1) ... UNALIGNED_LOAD32(p+2) -// are slower than UNALIGNED_LOAD64(p) followed by shifts and casts to uint32. -// -// We have different versions for 64- and 32-bit; ideally we would avoid the -// two functions and just inline the UNALIGNED_LOAD64 call into -// GetUint32AtOffset, but GCC (at least not as of 4.6) is seemingly not clever -// enough to avoid loading the value multiple times then. For 64-bit, the load -// is done when GetEightBytesAt() is called, whereas for 32-bit, the load is -// done at GetUint32AtOffset() time. - -#ifdef ARCH_K8 - -typedef uint64 EightBytesReference; - -static inline EightBytesReference GetEightBytesAt(const char* ptr) { - return UNALIGNED_LOAD64(ptr); -} - -static inline uint32 GetUint32AtOffset(uint64 v, int offset) { - assert(offset >= 0); - assert(offset <= 4); - return v >> (LittleEndian::IsLittleEndian() ? 8 * offset : 32 - 8 * offset); -} - -#else - -typedef const char* EightBytesReference; - -static inline EightBytesReference GetEightBytesAt(const char* ptr) { - return ptr; -} - -static inline uint32 GetUint32AtOffset(const char* v, int offset) { - assert(offset >= 0); - assert(offset <= 4); - return UNALIGNED_LOAD32(v + offset); -} - -#endif - -// Flat array compression that does not emit the "uncompressed length" -// prefix. Compresses "input" string to the "*op" buffer. -// -// REQUIRES: "input" is at most "kBlockSize" bytes long. -// REQUIRES: "op" points to an array of memory that is at least -// "MaxCompressedLength(input.size())" in size. -// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero. -// REQUIRES: "table_size" is a power of two -// -// Returns an "end" pointer into "op" buffer. -// "end - op" is the compressed size of "input". -namespace internal { -char* CompressFragment(const char* input, - size_t input_size, - char* op, - uint16* table, - const int table_size) { - // "ip" is the input pointer, and "op" is the output pointer. - const char* ip = input; - assert(input_size <= kBlockSize); - assert((table_size & (table_size - 1)) == 0); // table must be power of two - const int shift = 32 - Bits::Log2Floor(table_size); - assert(static_cast(kuint32max >> shift) == table_size - 1); - const char* ip_end = input + input_size; - const char* base_ip = ip; - // Bytes in [next_emit, ip) will be emitted as literal bytes. Or - // [next_emit, ip_end) after the main loop. - const char* next_emit = ip; - - const size_t kInputMarginBytes = 15; - if (PREDICT_TRUE(input_size >= kInputMarginBytes)) { - const char* ip_limit = input + input_size - kInputMarginBytes; - - for (uint32 next_hash = Hash(++ip, shift); ; ) { - assert(next_emit < ip); - // The body of this loop calls EmitLiteral once and then EmitCopy one or - // more times. (The exception is that when we're close to exhausting - // the input we goto emit_remainder.) - // - // In the first iteration of this loop we're just starting, so - // there's nothing to copy, so calling EmitLiteral once is - // necessary. And we only start a new iteration when the - // current iteration has determined that a call to EmitLiteral will - // precede the next call to EmitCopy (if any). - // - // Step 1: Scan forward in the input looking for a 4-byte-long match. - // If we get close to exhausting the input then goto emit_remainder. - // - // Heuristic match skipping: If 32 bytes are scanned with no matches - // found, start looking only at every other byte. If 32 more bytes are - // scanned, look at every third byte, etc.. When a match is found, - // immediately go back to looking at every byte. This is a small loss - // (~5% performance, ~0.1% density) for compressible data due to more - // bookkeeping, but for non-compressible data (such as JPEG) it's a huge - // win since the compressor quickly "realizes" the data is incompressible - // and doesn't bother looking for matches everywhere. - // - // The "skip" variable keeps track of how many bytes there are since the - // last match; dividing it by 32 (ie. right-shifting by five) gives the - // number of bytes to move ahead for each iteration. - uint32 skip = 32; - - const char* next_ip = ip; - const char* candidate; - do { - ip = next_ip; - uint32 hash = next_hash; - assert(hash == Hash(ip, shift)); - uint32 bytes_between_hash_lookups = skip++ >> 5; - next_ip = ip + bytes_between_hash_lookups; - if (PREDICT_FALSE(next_ip > ip_limit)) { - goto emit_remainder; - } - next_hash = Hash(next_ip, shift); - candidate = base_ip + table[hash]; - assert(candidate >= base_ip); - assert(candidate < ip); - - table[hash] = ip - base_ip; - } while (PREDICT_TRUE(UNALIGNED_LOAD32(ip) != - UNALIGNED_LOAD32(candidate))); - - // Step 2: A 4-byte match has been found. We'll later see if more - // than 4 bytes match. But, prior to the match, input - // bytes [next_emit, ip) are unmatched. Emit them as "literal bytes." - assert(next_emit + 16 <= ip_end); - op = EmitLiteral(op, next_emit, ip - next_emit, true); - - // Step 3: Call EmitCopy, and then see if another EmitCopy could - // be our next move. Repeat until we find no match for the - // input immediately after what was consumed by the last EmitCopy call. - // - // If we exit this loop normally then we need to call EmitLiteral next, - // though we don't yet know how big the literal will be. We handle that - // by proceeding to the next iteration of the main loop. We also can exit - // this loop via goto if we get close to exhausting the input. - EightBytesReference input_bytes; - uint32 candidate_bytes = 0; - - do { - // We have a 4-byte match at ip, and no need to emit any - // "literal bytes" prior to ip. - const char* base = ip; - int matched = 4 + FindMatchLength(candidate + 4, ip + 4, ip_end); - ip += matched; - size_t offset = base - candidate; - assert(0 == memcmp(base, candidate, matched)); - op = EmitCopy(op, offset, matched); - // We could immediately start working at ip now, but to improve - // compression we first update table[Hash(ip - 1, ...)]. - const char* insert_tail = ip - 1; - next_emit = ip; - if (PREDICT_FALSE(ip >= ip_limit)) { - goto emit_remainder; - } - input_bytes = GetEightBytesAt(insert_tail); - uint32 prev_hash = HashBytes(GetUint32AtOffset(input_bytes, 0), shift); - table[prev_hash] = ip - base_ip - 1; - uint32 cur_hash = HashBytes(GetUint32AtOffset(input_bytes, 1), shift); - candidate = base_ip + table[cur_hash]; - candidate_bytes = UNALIGNED_LOAD32(candidate); - table[cur_hash] = ip - base_ip; - } while (GetUint32AtOffset(input_bytes, 1) == candidate_bytes); - - next_hash = HashBytes(GetUint32AtOffset(input_bytes, 2), shift); - ++ip; - } - } - - emit_remainder: - // Emit the remaining bytes as a literal - if (next_emit < ip_end) { - op = EmitLiteral(op, next_emit, ip_end - next_emit, false); - } - - return op; -} -} // end namespace internal - -// Signature of output types needed by decompression code. -// The decompression code is templatized on a type that obeys this -// signature so that we do not pay virtual function call overhead in -// the middle of a tight decompression loop. -// -// class DecompressionWriter { -// public: -// // Called before decompression -// void SetExpectedLength(size_t length); -// -// // Called after decompression -// bool CheckLength() const; -// -// // Called repeatedly during decompression -// bool Append(const char* ip, size_t length); -// bool AppendFromSelf(uint32 offset, size_t length); -// -// // The rules for how TryFastAppend differs from Append are somewhat -// // convoluted: -// // -// // - TryFastAppend is allowed to decline (return false) at any -// // time, for any reason -- just "return false" would be -// // a perfectly legal implementation of TryFastAppend. -// // The intention is for TryFastAppend to allow a fast path -// // in the common case of a small append. -// // - TryFastAppend is allowed to read up to bytes -// // from the input buffer, whereas Append is allowed to read -// // . However, if it returns true, it must leave -// // at least five (kMaximumTagLength) bytes in the input buffer -// // afterwards, so that there is always enough space to read the -// // next tag without checking for a refill. -// // - TryFastAppend must always return decline (return false) -// // if is 61 or more, as in this case the literal length is not -// // decoded fully. In practice, this should not be a big problem, -// // as it is unlikely that one would implement a fast path accepting -// // this much data. -// // -// bool TryFastAppend(const char* ip, size_t available, size_t length); -// }; - -// ----------------------------------------------------------------------- -// Lookup table for decompression code. Generated by ComputeTable() below. -// ----------------------------------------------------------------------- - -// Mapping from i in range [0,4] to a mask to extract the bottom 8*i bits -static const uint32 wordmask[] = { - 0u, 0xffu, 0xffffu, 0xffffffu, 0xffffffffu -}; - -// Data stored per entry in lookup table: -// Range Bits-used Description -// ------------------------------------ -// 1..64 0..7 Literal/copy length encoded in opcode byte -// 0..7 8..10 Copy offset encoded in opcode byte / 256 -// 0..4 11..13 Extra bytes after opcode -// -// We use eight bits for the length even though 7 would have sufficed -// because of efficiency reasons: -// (1) Extracting a byte is faster than a bit-field -// (2) It properly aligns copy offset so we do not need a <<8 -static const uint16 char_table[256] = { - 0x0001, 0x0804, 0x1001, 0x2001, 0x0002, 0x0805, 0x1002, 0x2002, - 0x0003, 0x0806, 0x1003, 0x2003, 0x0004, 0x0807, 0x1004, 0x2004, - 0x0005, 0x0808, 0x1005, 0x2005, 0x0006, 0x0809, 0x1006, 0x2006, - 0x0007, 0x080a, 0x1007, 0x2007, 0x0008, 0x080b, 0x1008, 0x2008, - 0x0009, 0x0904, 0x1009, 0x2009, 0x000a, 0x0905, 0x100a, 0x200a, - 0x000b, 0x0906, 0x100b, 0x200b, 0x000c, 0x0907, 0x100c, 0x200c, - 0x000d, 0x0908, 0x100d, 0x200d, 0x000e, 0x0909, 0x100e, 0x200e, - 0x000f, 0x090a, 0x100f, 0x200f, 0x0010, 0x090b, 0x1010, 0x2010, - 0x0011, 0x0a04, 0x1011, 0x2011, 0x0012, 0x0a05, 0x1012, 0x2012, - 0x0013, 0x0a06, 0x1013, 0x2013, 0x0014, 0x0a07, 0x1014, 0x2014, - 0x0015, 0x0a08, 0x1015, 0x2015, 0x0016, 0x0a09, 0x1016, 0x2016, - 0x0017, 0x0a0a, 0x1017, 0x2017, 0x0018, 0x0a0b, 0x1018, 0x2018, - 0x0019, 0x0b04, 0x1019, 0x2019, 0x001a, 0x0b05, 0x101a, 0x201a, - 0x001b, 0x0b06, 0x101b, 0x201b, 0x001c, 0x0b07, 0x101c, 0x201c, - 0x001d, 0x0b08, 0x101d, 0x201d, 0x001e, 0x0b09, 0x101e, 0x201e, - 0x001f, 0x0b0a, 0x101f, 0x201f, 0x0020, 0x0b0b, 0x1020, 0x2020, - 0x0021, 0x0c04, 0x1021, 0x2021, 0x0022, 0x0c05, 0x1022, 0x2022, - 0x0023, 0x0c06, 0x1023, 0x2023, 0x0024, 0x0c07, 0x1024, 0x2024, - 0x0025, 0x0c08, 0x1025, 0x2025, 0x0026, 0x0c09, 0x1026, 0x2026, - 0x0027, 0x0c0a, 0x1027, 0x2027, 0x0028, 0x0c0b, 0x1028, 0x2028, - 0x0029, 0x0d04, 0x1029, 0x2029, 0x002a, 0x0d05, 0x102a, 0x202a, - 0x002b, 0x0d06, 0x102b, 0x202b, 0x002c, 0x0d07, 0x102c, 0x202c, - 0x002d, 0x0d08, 0x102d, 0x202d, 0x002e, 0x0d09, 0x102e, 0x202e, - 0x002f, 0x0d0a, 0x102f, 0x202f, 0x0030, 0x0d0b, 0x1030, 0x2030, - 0x0031, 0x0e04, 0x1031, 0x2031, 0x0032, 0x0e05, 0x1032, 0x2032, - 0x0033, 0x0e06, 0x1033, 0x2033, 0x0034, 0x0e07, 0x1034, 0x2034, - 0x0035, 0x0e08, 0x1035, 0x2035, 0x0036, 0x0e09, 0x1036, 0x2036, - 0x0037, 0x0e0a, 0x1037, 0x2037, 0x0038, 0x0e0b, 0x1038, 0x2038, - 0x0039, 0x0f04, 0x1039, 0x2039, 0x003a, 0x0f05, 0x103a, 0x203a, - 0x003b, 0x0f06, 0x103b, 0x203b, 0x003c, 0x0f07, 0x103c, 0x203c, - 0x0801, 0x0f08, 0x103d, 0x203d, 0x1001, 0x0f09, 0x103e, 0x203e, - 0x1801, 0x0f0a, 0x103f, 0x203f, 0x2001, 0x0f0b, 0x1040, 0x2040 -}; - -// In debug mode, allow optional computation of the table at startup. -// Also, check that the decompression table is correct. -#ifndef NDEBUG -DEFINE_bool(snappy_dump_decompression_table, false, - "If true, we print the decompression table at startup."); - -static uint16 MakeEntry(unsigned int extra, - unsigned int len, - unsigned int copy_offset) { - // Check that all of the fields fit within the allocated space - assert(extra == (extra & 0x7)); // At most 3 bits - assert(copy_offset == (copy_offset & 0x7)); // At most 3 bits - assert(len == (len & 0x7f)); // At most 7 bits - return len | (copy_offset << 8) | (extra << 11); -} - -static void ComputeTable() { - uint16 dst[256]; - - // Place invalid entries in all places to detect missing initialization - int assigned = 0; - for (int i = 0; i < 256; i++) { - dst[i] = 0xffff; - } - - // Small LITERAL entries. We store (len-1) in the top 6 bits. - for (unsigned int len = 1; len <= 60; len++) { - dst[LITERAL | ((len-1) << 2)] = MakeEntry(0, len, 0); - assigned++; - } - - // Large LITERAL entries. We use 60..63 in the high 6 bits to - // encode the number of bytes of length info that follow the opcode. - for (unsigned int extra_bytes = 1; extra_bytes <= 4; extra_bytes++) { - // We set the length field in the lookup table to 1 because extra - // bytes encode len-1. - dst[LITERAL | ((extra_bytes+59) << 2)] = MakeEntry(extra_bytes, 1, 0); - assigned++; - } - - // COPY_1_BYTE_OFFSET. - // - // The tag byte in the compressed data stores len-4 in 3 bits, and - // offset/256 in 5 bits. offset%256 is stored in the next byte. - // - // This format is used for length in range [4..11] and offset in - // range [0..2047] - for (unsigned int len = 4; len < 12; len++) { - for (unsigned int offset = 0; offset < 2048; offset += 256) { - dst[COPY_1_BYTE_OFFSET | ((len-4)<<2) | ((offset>>8)<<5)] = - MakeEntry(1, len, offset>>8); - assigned++; - } - } - - // COPY_2_BYTE_OFFSET. - // Tag contains len-1 in top 6 bits, and offset in next two bytes. - for (unsigned int len = 1; len <= 64; len++) { - dst[COPY_2_BYTE_OFFSET | ((len-1)<<2)] = MakeEntry(2, len, 0); - assigned++; - } - - // COPY_4_BYTE_OFFSET. - // Tag contents len-1 in top 6 bits, and offset in next four bytes. - for (unsigned int len = 1; len <= 64; len++) { - dst[COPY_4_BYTE_OFFSET | ((len-1)<<2)] = MakeEntry(4, len, 0); - assigned++; - } - - // Check that each entry was initialized exactly once. - if (assigned != 256) { - fprintf(stderr, "ComputeTable: assigned only %d of 256\n", assigned); - abort(); - } - for (int i = 0; i < 256; i++) { - if (dst[i] == 0xffff) { - fprintf(stderr, "ComputeTable: did not assign byte %d\n", i); - abort(); - } - } - - if (FLAGS_snappy_dump_decompression_table) { - printf("static const uint16 char_table[256] = {\n "); - for (int i = 0; i < 256; i++) { - printf("0x%04x%s", - dst[i], - ((i == 255) ? "\n" : (((i%8) == 7) ? ",\n " : ", "))); - } - printf("};\n"); - } - - // Check that computed table matched recorded table - for (int i = 0; i < 256; i++) { - if (dst[i] != char_table[i]) { - fprintf(stderr, "ComputeTable: byte %d: computed (%x), expect (%x)\n", - i, static_cast(dst[i]), static_cast(char_table[i])); - abort(); - } - } -} -#endif /* !NDEBUG */ - -// Helper class for decompression -class SnappyDecompressor { - private: - Source* reader_; // Underlying source of bytes to decompress - const char* ip_; // Points to next buffered byte - const char* ip_limit_; // Points just past buffered bytes - uint32 peeked_; // Bytes peeked from reader (need to skip) - bool eof_; // Hit end of input without an error? - char scratch_[kMaximumTagLength]; // See RefillTag(). - - // Ensure that all of the tag metadata for the next tag is available - // in [ip_..ip_limit_-1]. Also ensures that [ip,ip+4] is readable even - // if (ip_limit_ - ip_ < 5). - // - // Returns true on success, false on error or end of input. - bool RefillTag(); - - public: - explicit SnappyDecompressor(Source* reader) - : reader_(reader), - ip_(NULL), - ip_limit_(NULL), - peeked_(0), - eof_(false) { - } - - ~SnappyDecompressor() { - // Advance past any bytes we peeked at from the reader - reader_->Skip(peeked_); - } - - // Returns true iff we have hit the end of the input without an error. - bool eof() const { - return eof_; - } - - // Read the uncompressed length stored at the start of the compressed data. - // On succcess, stores the length in *result and returns true. - // On failure, returns false. - bool ReadUncompressedLength(uint32* result) { - assert(ip_ == NULL); // Must not have read anything yet - // Length is encoded in 1..5 bytes - *result = 0; - uint32 shift = 0; - while (true) { - if (shift >= 32) return false; - size_t n; - const char* ip = reader_->Peek(&n); - if (n == 0) return false; - const unsigned char c = *(reinterpret_cast(ip)); - reader_->Skip(1); - *result |= static_cast(c & 0x7f) << shift; - if (c < 128) { - break; - } - shift += 7; - } - return true; - } - - // Process the next item found in the input. - // Returns true if successful, false on error or end of input. - template - void DecompressAllTags(Writer* writer) { - const char* ip = ip_; - - // We could have put this refill fragment only at the beginning of the loop. - // However, duplicating it at the end of each branch gives the compiler more - // scope to optimize the expression based on the local - // context, which overall increases speed. - #define MAYBE_REFILL() \ - if (ip_limit_ - ip < kMaximumTagLength) { \ - ip_ = ip; \ - if (!RefillTag()) return; \ - ip = ip_; \ - } - - MAYBE_REFILL(); - for ( ;; ) { - const unsigned char c = *(reinterpret_cast(ip++)); - - if ((c & 0x3) == LITERAL) { - size_t literal_length = (c >> 2) + 1u; - if (writer->TryFastAppend(ip, ip_limit_ - ip, literal_length)) { - assert(literal_length < 61); - ip += literal_length; - // NOTE(user): There is no MAYBE_REFILL() here, as TryFastAppend() - // will not return true unless there's already at least five spare - // bytes in addition to the literal. - continue; - } - if (PREDICT_FALSE(literal_length >= 61)) { - // Long literal. - const size_t literal_length_length = literal_length - 60; - literal_length = - (LittleEndian::Load32(ip) & wordmask[literal_length_length]) + 1; - ip += literal_length_length; - } - - size_t avail = ip_limit_ - ip; - while (avail < literal_length) { - if (!writer->Append(ip, avail)) return; - literal_length -= avail; - reader_->Skip(peeked_); - size_t n; - ip = reader_->Peek(&n); - avail = n; - peeked_ = avail; - if (avail == 0) return; // Premature end of input - ip_limit_ = ip + avail; - } - if (!writer->Append(ip, literal_length)) { - return; - } - ip += literal_length; - MAYBE_REFILL(); - } else { - const uint32 entry = char_table[c]; - const uint32 trailer = LittleEndian::Load32(ip) & wordmask[entry >> 11]; - const uint32 length = entry & 0xff; - ip += entry >> 11; - - // copy_offset/256 is encoded in bits 8..10. By just fetching - // those bits, we get copy_offset (since the bit-field starts at - // bit 8). - const uint32 copy_offset = entry & 0x700; - if (!writer->AppendFromSelf(copy_offset + trailer, length)) { - return; - } - MAYBE_REFILL(); - } - } - -#undef MAYBE_REFILL - } -}; - -bool SnappyDecompressor::RefillTag() { - const char* ip = ip_; - if (ip == ip_limit_) { - // Fetch a new fragment from the reader - reader_->Skip(peeked_); // All peeked bytes are used up - size_t n; - ip = reader_->Peek(&n); - peeked_ = n; - if (n == 0) { - eof_ = true; - return false; - } - ip_limit_ = ip + n; - } - - // Read the tag character - assert(ip < ip_limit_); - const unsigned char c = *(reinterpret_cast(ip)); - const uint32 entry = char_table[c]; - const uint32 needed = (entry >> 11) + 1; // +1 byte for 'c' - assert(needed <= sizeof(scratch_)); - - // Read more bytes from reader if needed - uint32 nbuf = ip_limit_ - ip; - if (nbuf < needed) { - // Stitch together bytes from ip and reader to form the word - // contents. We store the needed bytes in "scratch_". They - // will be consumed immediately by the caller since we do not - // read more than we need. - memmove(scratch_, ip, nbuf); - reader_->Skip(peeked_); // All peeked bytes are used up - peeked_ = 0; - while (nbuf < needed) { - size_t length; - const char* src = reader_->Peek(&length); - if (length == 0) return false; - uint32 to_add = min(needed - nbuf, length); - memcpy(scratch_ + nbuf, src, to_add); - nbuf += to_add; - reader_->Skip(to_add); - } - assert(nbuf == needed); - ip_ = scratch_; - ip_limit_ = scratch_ + needed; - } else if (nbuf < kMaximumTagLength) { - // Have enough bytes, but move into scratch_ so that we do not - // read past end of input - memmove(scratch_, ip, nbuf); - reader_->Skip(peeked_); // All peeked bytes are used up - peeked_ = 0; - ip_ = scratch_; - ip_limit_ = scratch_ + nbuf; - } else { - // Pass pointer to buffer returned by reader_. - ip_ = ip; - } - return true; -} - -template -static bool InternalUncompress(Source* r, Writer* writer) { - // Read the uncompressed length from the front of the compressed input - SnappyDecompressor decompressor(r); - uint32 uncompressed_len = 0; - if (!decompressor.ReadUncompressedLength(&uncompressed_len)) return false; - return InternalUncompressAllTags(&decompressor, writer, uncompressed_len); -} - -template -static bool InternalUncompressAllTags(SnappyDecompressor* decompressor, - Writer* writer, - uint32 uncompressed_len) { - writer->SetExpectedLength(uncompressed_len); - - // Process the entire input - decompressor->DecompressAllTags(writer); - writer->Flush(); - return (decompressor->eof() && writer->CheckLength()); -} - -bool GetUncompressedLength(Source* source, uint32* result) { - SnappyDecompressor decompressor(source); - return decompressor.ReadUncompressedLength(result); -} - -size_t Compress(Source* reader, Sink* writer) { - size_t written = 0; - size_t N = reader->Available(); - char ulength[Varint::kMax32]; - char* p = Varint::Encode32(ulength, N); - writer->Append(ulength, p-ulength); - written += (p - ulength); - - internal::WorkingMemory wmem; - char* scratch = NULL; - char* scratch_output = NULL; - - while (N > 0) { - // Get next block to compress (without copying if possible) - size_t fragment_size; - const char* fragment = reader->Peek(&fragment_size); - assert(fragment_size != 0); // premature end of input - const size_t num_to_read = min(N, kBlockSize); - size_t bytes_read = fragment_size; - - size_t pending_advance = 0; - if (bytes_read >= num_to_read) { - // Buffer returned by reader is large enough - pending_advance = num_to_read; - fragment_size = num_to_read; - } else { - // Read into scratch buffer - if (scratch == NULL) { - // If this is the last iteration, we want to allocate N bytes - // of space, otherwise the max possible kBlockSize space. - // num_to_read contains exactly the correct value - scratch = new char[num_to_read]; - } - memcpy(scratch, fragment, bytes_read); - reader->Skip(bytes_read); - - while (bytes_read < num_to_read) { - fragment = reader->Peek(&fragment_size); - size_t n = min(fragment_size, num_to_read - bytes_read); - memcpy(scratch + bytes_read, fragment, n); - bytes_read += n; - reader->Skip(n); - } - assert(bytes_read == num_to_read); - fragment = scratch; - fragment_size = num_to_read; - } - assert(fragment_size == num_to_read); - - // Get encoding table for compression - int table_size; - uint16* table = wmem.GetHashTable(num_to_read, &table_size); - - // Compress input_fragment and append to dest - const int max_output = MaxCompressedLength(num_to_read); - - // Need a scratch buffer for the output, in case the byte sink doesn't - // have room for us directly. - if (scratch_output == NULL) { - scratch_output = new char[max_output]; - } else { - // Since we encode kBlockSize regions followed by a region - // which is <= kBlockSize in length, a previously allocated - // scratch_output[] region is big enough for this iteration. - } - char* dest = writer->GetAppendBuffer(max_output, scratch_output); - char* end = internal::CompressFragment(fragment, fragment_size, - dest, table, table_size); - writer->Append(dest, end - dest); - written += (end - dest); - - N -= num_to_read; - reader->Skip(pending_advance); - } - - delete[] scratch; - delete[] scratch_output; - - return written; -} - -// ----------------------------------------------------------------------- -// IOVec interfaces -// ----------------------------------------------------------------------- - -// A type that writes to an iovec. -// Note that this is not a "ByteSink", but a type that matches the -// Writer template argument to SnappyDecompressor::DecompressAllTags(). -class SnappyIOVecWriter { - private: - const struct iovec* output_iov_; - const size_t output_iov_count_; - - // We are currently writing into output_iov_[curr_iov_index_]. - int curr_iov_index_; - - // Bytes written to output_iov_[curr_iov_index_] so far. - size_t curr_iov_written_; - - // Total bytes decompressed into output_iov_ so far. - size_t total_written_; - - // Maximum number of bytes that will be decompressed into output_iov_. - size_t output_limit_; - - inline char* GetIOVecPointer(int index, size_t offset) { - return reinterpret_cast(output_iov_[index].iov_base) + - offset; - } - - public: - // Does not take ownership of iov. iov must be valid during the - // entire lifetime of the SnappyIOVecWriter. - inline SnappyIOVecWriter(const struct iovec* iov, size_t iov_count) - : output_iov_(iov), - output_iov_count_(iov_count), - curr_iov_index_(0), - curr_iov_written_(0), - total_written_(0), - output_limit_(-1) { - } - - inline void SetExpectedLength(size_t len) { - output_limit_ = len; - } - - inline bool CheckLength() const { - return total_written_ == output_limit_; - } - - inline bool Append(const char* ip, size_t len) { - if (total_written_ + len > output_limit_) { - return false; - } - - while (len > 0) { - assert(curr_iov_written_ <= output_iov_[curr_iov_index_].iov_len); - if (curr_iov_written_ >= output_iov_[curr_iov_index_].iov_len) { - // This iovec is full. Go to the next one. - if (curr_iov_index_ + 1 >= output_iov_count_) { - return false; - } - curr_iov_written_ = 0; - ++curr_iov_index_; - } - - const size_t to_write = std::min( - len, output_iov_[curr_iov_index_].iov_len - curr_iov_written_); - memcpy(GetIOVecPointer(curr_iov_index_, curr_iov_written_), - ip, - to_write); - curr_iov_written_ += to_write; - total_written_ += to_write; - ip += to_write; - len -= to_write; - } - - return true; - } - - inline bool TryFastAppend(const char* ip, size_t available, size_t len) { - const size_t space_left = output_limit_ - total_written_; - if (len <= 16 && available >= 16 + kMaximumTagLength && space_left >= 16 && - output_iov_[curr_iov_index_].iov_len - curr_iov_written_ >= 16) { - // Fast path, used for the majority (about 95%) of invocations. - char* ptr = GetIOVecPointer(curr_iov_index_, curr_iov_written_); - UnalignedCopy64(ip, ptr); - UnalignedCopy64(ip + 8, ptr + 8); - curr_iov_written_ += len; - total_written_ += len; - return true; - } - - return false; - } - - inline bool AppendFromSelf(size_t offset, size_t len) { - if (offset > total_written_ || offset == 0) { - return false; - } - const size_t space_left = output_limit_ - total_written_; - if (len > space_left) { - return false; - } - - // Locate the iovec from which we need to start the copy. - int from_iov_index = curr_iov_index_; - size_t from_iov_offset = curr_iov_written_; - while (offset > 0) { - if (from_iov_offset >= offset) { - from_iov_offset -= offset; - break; - } - - offset -= from_iov_offset; - --from_iov_index; - assert(from_iov_index >= 0); - from_iov_offset = output_iov_[from_iov_index].iov_len; - } - - // Copy bytes starting from the iovec pointed to by from_iov_index to - // the current iovec. - while (len > 0) { - assert(from_iov_index <= curr_iov_index_); - if (from_iov_index != curr_iov_index_) { - const size_t to_copy = std::min( - output_iov_[from_iov_index].iov_len - from_iov_offset, - len); - Append(GetIOVecPointer(from_iov_index, from_iov_offset), to_copy); - len -= to_copy; - if (len > 0) { - ++from_iov_index; - from_iov_offset = 0; - } - } else { - assert(curr_iov_written_ <= output_iov_[curr_iov_index_].iov_len); - size_t to_copy = std::min(output_iov_[curr_iov_index_].iov_len - - curr_iov_written_, - len); - if (to_copy == 0) { - // This iovec is full. Go to the next one. - if (curr_iov_index_ + 1 >= output_iov_count_) { - return false; - } - ++curr_iov_index_; - curr_iov_written_ = 0; - continue; - } - if (to_copy > len) { - to_copy = len; - } - IncrementalCopy(GetIOVecPointer(from_iov_index, from_iov_offset), - GetIOVecPointer(curr_iov_index_, curr_iov_written_), - to_copy); - curr_iov_written_ += to_copy; - from_iov_offset += to_copy; - total_written_ += to_copy; - len -= to_copy; - } - } - - return true; - } - - inline void Flush() {} -}; - -bool RawUncompressToIOVec(const char* compressed, size_t compressed_length, - const struct iovec* iov, size_t iov_cnt) { - ByteArraySource reader(compressed, compressed_length); - return RawUncompressToIOVec(&reader, iov, iov_cnt); -} - -bool RawUncompressToIOVec(Source* compressed, const struct iovec* iov, - size_t iov_cnt) { - SnappyIOVecWriter output(iov, iov_cnt); - return InternalUncompress(compressed, &output); -} - -// ----------------------------------------------------------------------- -// Flat array interfaces -// ----------------------------------------------------------------------- - -// A type that writes to a flat array. -// Note that this is not a "ByteSink", but a type that matches the -// Writer template argument to SnappyDecompressor::DecompressAllTags(). -class SnappyArrayWriter { - private: - char* base_; - char* op_; - char* op_limit_; - - public: - inline explicit SnappyArrayWriter(char* dst) - : base_(dst), - op_(dst), - op_limit_(dst) { - } - - inline void SetExpectedLength(size_t len) { - op_limit_ = op_ + len; - } - - inline bool CheckLength() const { - return op_ == op_limit_; - } - - inline bool Append(const char* ip, size_t len) { - char* op = op_; - const size_t space_left = op_limit_ - op; - if (space_left < len) { - return false; - } - memcpy(op, ip, len); - op_ = op + len; - return true; - } - - inline bool TryFastAppend(const char* ip, size_t available, size_t len) { - char* op = op_; - const size_t space_left = op_limit_ - op; - if (len <= 16 && available >= 16 + kMaximumTagLength && space_left >= 16) { - // Fast path, used for the majority (about 95%) of invocations. - UnalignedCopy64(ip, op); - UnalignedCopy64(ip + 8, op + 8); - op_ = op + len; - return true; - } else { - return false; - } - } - - inline bool AppendFromSelf(size_t offset, size_t len) { - char* op = op_; - const size_t space_left = op_limit_ - op; - - // Check if we try to append from before the start of the buffer. - // Normally this would just be a check for "produced < offset", - // but "produced <= offset - 1u" is equivalent for every case - // except the one where offset==0, where the right side will wrap around - // to a very big number. This is convenient, as offset==0 is another - // invalid case that we also want to catch, so that we do not go - // into an infinite loop. - assert(op >= base_); - size_t produced = op - base_; - if (produced <= offset - 1u) { - return false; - } - if (len <= 16 && offset >= 8 && space_left >= 16) { - // Fast path, used for the majority (70-80%) of dynamic invocations. - UnalignedCopy64(op - offset, op); - UnalignedCopy64(op - offset + 8, op + 8); - } else { - if (space_left >= len + kMaxIncrementCopyOverflow) { - IncrementalCopyFastPath(op - offset, op, len); - } else { - if (space_left < len) { - return false; - } - IncrementalCopy(op - offset, op, len); - } - } - - op_ = op + len; - return true; - } - inline size_t Produced() const { - return op_ - base_; - } - inline void Flush() {} -}; - -bool RawUncompress(const char* compressed, size_t n, char* uncompressed) { - ByteArraySource reader(compressed, n); - return RawUncompress(&reader, uncompressed); -} - -bool RawUncompress(Source* compressed, char* uncompressed) { - SnappyArrayWriter output(uncompressed); - return InternalUncompress(compressed, &output); -} - -bool Uncompress(const char* compressed, size_t n, string* uncompressed) { - size_t ulength; - if (!GetUncompressedLength(compressed, n, &ulength)) { - return false; - } - // On 32-bit builds: max_size() < kuint32max. Check for that instead - // of crashing (e.g., consider externally specified compressed data). - if (ulength > uncompressed->max_size()) { - return false; - } - STLStringResizeUninitialized(uncompressed, ulength); - return RawUncompress(compressed, n, string_as_array(uncompressed)); -} - -// A Writer that drops everything on the floor and just does validation -class SnappyDecompressionValidator { - private: - size_t expected_; - size_t produced_; - - public: - inline SnappyDecompressionValidator() : expected_(0), produced_(0) { } - inline void SetExpectedLength(size_t len) { - expected_ = len; - } - inline bool CheckLength() const { - return expected_ == produced_; - } - inline bool Append(const char* ip, size_t len) { - produced_ += len; - return produced_ <= expected_; - } - inline bool TryFastAppend(const char* ip, size_t available, size_t length) { - return false; - } - inline bool AppendFromSelf(size_t offset, size_t len) { - // See SnappyArrayWriter::AppendFromSelf for an explanation of - // the "offset - 1u" trick. - if (produced_ <= offset - 1u) return false; - produced_ += len; - return produced_ <= expected_; - } - inline void Flush() {} -}; - -bool IsValidCompressedBuffer(const char* compressed, size_t n) { - ByteArraySource reader(compressed, n); - SnappyDecompressionValidator writer; - return InternalUncompress(&reader, &writer); -} - -bool IsValidCompressed(Source* compressed) { - SnappyDecompressionValidator writer; - return InternalUncompress(compressed, &writer); -} - -void RawCompress(const char* input, - size_t input_length, - char* compressed, - size_t* compressed_length) { - ByteArraySource reader(input, input_length); - UncheckedByteArraySink writer(compressed); - Compress(&reader, &writer); - - // Compute how many bytes were added - *compressed_length = (writer.CurrentDestination() - compressed); -} - -size_t Compress(const char* input, size_t input_length, string* compressed) { - // Pre-grow the buffer to the max length of the compressed output - compressed->resize(MaxCompressedLength(input_length)); - - size_t compressed_length; - RawCompress(input, input_length, string_as_array(compressed), - &compressed_length); - compressed->resize(compressed_length); - return compressed_length; -} - -// ----------------------------------------------------------------------- -// Sink interface -// ----------------------------------------------------------------------- - -// A type that decompresses into a Sink. The template parameter -// Allocator must export one method "char* Allocate(int size);", which -// allocates a buffer of "size" and appends that to the destination. -template -class SnappyScatteredWriter { - Allocator allocator_; - - // We need random access into the data generated so far. Therefore - // we keep track of all of the generated data as an array of blocks. - // All of the blocks except the last have length kBlockSize. - vector blocks_; - size_t expected_; - - // Total size of all fully generated blocks so far - size_t full_size_; - - // Pointer into current output block - char* op_base_; // Base of output block - char* op_ptr_; // Pointer to next unfilled byte in block - char* op_limit_; // Pointer just past block - - inline size_t Size() const { - return full_size_ + (op_ptr_ - op_base_); - } - - bool SlowAppend(const char* ip, size_t len); - bool SlowAppendFromSelf(size_t offset, size_t len); - - public: - inline explicit SnappyScatteredWriter(const Allocator& allocator) - : allocator_(allocator), - full_size_(0), - op_base_(NULL), - op_ptr_(NULL), - op_limit_(NULL) { - } - - inline void SetExpectedLength(size_t len) { - assert(blocks_.empty()); - expected_ = len; - } - - inline bool CheckLength() const { - return Size() == expected_; - } - - // Return the number of bytes actually uncompressed so far - inline size_t Produced() const { - return Size(); - } - - inline bool Append(const char* ip, size_t len) { - size_t avail = op_limit_ - op_ptr_; - if (len <= avail) { - // Fast path - memcpy(op_ptr_, ip, len); - op_ptr_ += len; - return true; - } else { - return SlowAppend(ip, len); - } - } - - inline bool TryFastAppend(const char* ip, size_t available, size_t length) { - char* op = op_ptr_; - const int space_left = op_limit_ - op; - if (length <= 16 && available >= 16 + kMaximumTagLength && - space_left >= 16) { - // Fast path, used for the majority (about 95%) of invocations. - UNALIGNED_STORE64(op, UNALIGNED_LOAD64(ip)); - UNALIGNED_STORE64(op + 8, UNALIGNED_LOAD64(ip + 8)); - op_ptr_ = op + length; - return true; - } else { - return false; - } - } - - inline bool AppendFromSelf(size_t offset, size_t len) { - // See SnappyArrayWriter::AppendFromSelf for an explanation of - // the "offset - 1u" trick. - if (offset - 1u < op_ptr_ - op_base_) { - const size_t space_left = op_limit_ - op_ptr_; - if (space_left >= len + kMaxIncrementCopyOverflow) { - // Fast path: src and dst in current block. - IncrementalCopyFastPath(op_ptr_ - offset, op_ptr_, len); - op_ptr_ += len; - return true; - } - } - return SlowAppendFromSelf(offset, len); - } - - // Called at the end of the decompress. We ask the allocator - // write all blocks to the sink. - inline void Flush() { allocator_.Flush(Produced()); } -}; - -template -bool SnappyScatteredWriter::SlowAppend(const char* ip, size_t len) { - size_t avail = op_limit_ - op_ptr_; - while (len > avail) { - // Completely fill this block - memcpy(op_ptr_, ip, avail); - op_ptr_ += avail; - assert(op_limit_ - op_ptr_ == 0); - full_size_ += (op_ptr_ - op_base_); - len -= avail; - ip += avail; - - // Bounds check - if (full_size_ + len > expected_) { - return false; - } - - // Make new block - size_t bsize = min(kBlockSize, expected_ - full_size_); - op_base_ = allocator_.Allocate(bsize); - op_ptr_ = op_base_; - op_limit_ = op_base_ + bsize; - blocks_.push_back(op_base_); - avail = bsize; - } - - memcpy(op_ptr_, ip, len); - op_ptr_ += len; - return true; -} - -template -bool SnappyScatteredWriter::SlowAppendFromSelf(size_t offset, - size_t len) { - // Overflow check - // See SnappyArrayWriter::AppendFromSelf for an explanation of - // the "offset - 1u" trick. - const size_t cur = Size(); - if (offset - 1u >= cur) return false; - if (expected_ - cur < len) return false; - - // Currently we shouldn't ever hit this path because Compress() chops the - // input into blocks and does not create cross-block copies. However, it is - // nice if we do not rely on that, since we can get better compression if we - // allow cross-block copies and thus might want to change the compressor in - // the future. - size_t src = cur - offset; - while (len-- > 0) { - char c = blocks_[src >> kBlockLog][src & (kBlockSize-1)]; - Append(&c, 1); - src++; - } - return true; -} - -class SnappySinkAllocator { - public: - explicit SnappySinkAllocator(Sink* dest): dest_(dest) {} - ~SnappySinkAllocator() {} - - char* Allocate(int size) { - Datablock block(new char[size], size); - blocks_.push_back(block); - return block.data; - } - - // We flush only at the end, because the writer wants - // random access to the blocks and once we hand the - // block over to the sink, we can't access it anymore. - // Also we don't write more than has been actually written - // to the blocks. - void Flush(size_t size) { - size_t size_written = 0; - size_t block_size; - for (int i = 0; i < blocks_.size(); ++i) { - block_size = min(blocks_[i].size, size - size_written); - dest_->AppendAndTakeOwnership(blocks_[i].data, block_size, - &SnappySinkAllocator::Deleter, NULL); - size_written += block_size; - } - blocks_.clear(); - } - - private: - struct Datablock { - char* data; - size_t size; - Datablock(char* p, size_t s) : data(p), size(s) {} - }; - - static void Deleter(void* arg, const char* bytes, size_t size) { - delete[] bytes; - } - - Sink* dest_; - vector blocks_; - - // Note: copying this object is allowed -}; - -size_t UncompressAsMuchAsPossible(Source* compressed, Sink* uncompressed) { - SnappySinkAllocator allocator(uncompressed); - SnappyScatteredWriter writer(allocator); - InternalUncompress(compressed, &writer); - return writer.Produced(); -} - -bool Uncompress(Source* compressed, Sink* uncompressed) { - // Read the uncompressed length from the front of the compressed input - SnappyDecompressor decompressor(compressed); - uint32 uncompressed_len = 0; - if (!decompressor.ReadUncompressedLength(&uncompressed_len)) { - return false; - } - - char c; - size_t allocated_size; - char* buf = uncompressed->GetAppendBufferVariable( - 1, uncompressed_len, &c, 1, &allocated_size); - - // If we can get a flat buffer, then use it, otherwise do block by block - // uncompression - if (allocated_size >= uncompressed_len) { - SnappyArrayWriter writer(buf); - bool result = InternalUncompressAllTags( - &decompressor, &writer, uncompressed_len); - uncompressed->Append(buf, writer.Produced()); - return result; - } else { - SnappySinkAllocator allocator(uncompressed); - SnappyScatteredWriter writer(allocator); - return InternalUncompressAllTags(&decompressor, &writer, uncompressed_len); - } -} - -} // end namespace snappy diff --git a/external/snappy-1.1.9/.appveyor.yml b/external/snappy-1.1.9/.appveyor.yml new file mode 100644 index 0000000..7229a25 --- /dev/null +++ b/external/snappy-1.1.9/.appveyor.yml @@ -0,0 +1,37 @@ +# Build matrix / environment variables are explained on: +# https://www.appveyor.com/docs/appveyor-yml/ +# This file can be validated on: https://ci.appveyor.com/tools/validate-yaml + +version: "{build}" + +environment: + matrix: + # AppVeyor currently has no custom job name feature. + # http://help.appveyor.com/discussions/questions/1623-can-i-provide-a-friendly-name-for-jobs + - JOB: Visual Studio 2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + CMAKE_GENERATOR: Visual Studio 16 2019 + +platform: + - x86 + - x64 + +configuration: + - RelWithDebInfo + - Debug + +build_script: + - git submodule update --init --recursive + - mkdir build + - cd build + - if "%platform%"=="x86" (set CMAKE_GENERATOR_PLATFORM="Win32") + else (set CMAKE_GENERATOR_PLATFORM="%platform%") + - cmake --version + - cmake .. -G "%CMAKE_GENERATOR%" -A "%CMAKE_GENERATOR_PLATFORM%" + -DCMAKE_CONFIGURATION_TYPES="%CONFIGURATION%" -DSNAPPY_REQUIRE_AVX2=ON + - cmake --build . --config %CONFIGURATION% + - cd .. + +test_script: + - build\%CONFIGURATION%\snappy_unittest + - build\%CONFIGURATION%\snappy_benchmark diff --git a/external/snappy-1.1.9/.gitignore b/external/snappy-1.1.9/.gitignore new file mode 100644 index 0000000..c4b2425 --- /dev/null +++ b/external/snappy-1.1.9/.gitignore @@ -0,0 +1,8 @@ +# Editors. +*.sw* +.vscode +.DS_Store + +# Build directory. +build/ +out/ diff --git a/external/snappy-1.1.9/.gitmodules b/external/snappy-1.1.9/.gitmodules new file mode 100644 index 0000000..06c3fd3 --- /dev/null +++ b/external/snappy-1.1.9/.gitmodules @@ -0,0 +1,6 @@ +[submodule "third_party/benchmark"] + path = third_party/benchmark + url = https://github.com/google/benchmark.git +[submodule "third_party/googletest"] + path = third_party/googletest + url = https://github.com/google/googletest.git diff --git a/external/snappy-1.1.9/.travis.yml b/external/snappy-1.1.9/.travis.yml new file mode 100644 index 0000000..975899a --- /dev/null +++ b/external/snappy-1.1.9/.travis.yml @@ -0,0 +1,100 @@ +# Build matrix / environment variables are explained on: +# http://about.travis-ci.org/docs/user/build-configuration/ +# This file can be validated on: http://lint.travis-ci.org/ + +language: cpp +dist: bionic +osx_image: xcode12.2 + +compiler: +- gcc +- clang +os: +- linux +- osx + +env: +- BUILD_TYPE=Debug CPU_LEVEL=AVX +- BUILD_TYPE=Debug CPU_LEVEL=AVX2 +- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX +- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2 + +jobs: + exclude: + # Travis OSX servers seem to run on pre-Haswell CPUs. Attempting to use AVX2 + # results in crashes. + - env: BUILD_TYPE=Debug CPU_LEVEL=AVX2 + os: osx + - env: BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2 + os: osx + allow_failures: + # Homebrew's GCC is currently broken on XCode 11. + - compiler: gcc + os: osx + +addons: + apt: + sources: + - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + - sourceline: 'ppa:ubuntu-toolchain-r/test' + packages: + - clang-10 + - cmake + - gcc-10 + - g++-10 + - ninja-build + homebrew: + packages: + - cmake + - gcc@10 + - llvm@10 + - ninja + update: true + +install: +# The following Homebrew packages aren't linked by default, and need to be +# prepended to the path explicitly. +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then + export PATH="$(brew --prefix llvm)/bin:$PATH"; + fi +# Fuzzing is only supported on Clang. Perform fuzzing on Debug builds. +# LibFuzzer doesn't ship with CommandLineTools on osx. +- if [ "$CXX" = "clang++" ] && [ "$BUILD_TYPE" = "Debug" ] && [ "$TRAVIS_OS_NAME" != "osx" ]; then + export FUZZING=1; + else + export FUZZING=0; + fi +# /usr/bin/gcc points to an older compiler on both Linux and macOS. +- if [ "$CXX" = "g++" ]; then export CXX="g++-10" CC="gcc-10"; fi +# /usr/bin/clang points to an older compiler on both Linux and macOS. +# +# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values +# below don't work on macOS. Fortunately, the path change above makes the +# default values (clang and clang++) resolve to the correct compiler on macOS. +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then + if [ "$CXX" = "clang++" ]; then export CXX="clang++-10" CC="clang-10"; fi; + fi +- echo ${CC} +- echo ${CXX} +- ${CXX} --version +- cmake --version + +before_script: +- mkdir -p build && cd build +- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE + -DSNAPPY_REQUIRE_${CPU_LEVEL}=ON -DSNAPPY_FUZZING_BUILD=${FUZZING} + -DCMAKE_INSTALL_PREFIX=$HOME/.local +- cmake --build . +- cd .. + +script: +- build/snappy_unittest +- build/snappy_benchmark +- if [ -f build/snappy_compress_fuzzer ]; then + build/snappy_compress_fuzzer -runs=1000 -close_fd_mask=3; + fi +- if [ -f build/snappy_uncompress_fuzzer ]; then + build/snappy_uncompress_fuzzer -runs=1000 -close_fd_mask=3; + fi +- cd build && cmake --build . --target install diff --git a/external/snappy-1.1.3/AUTHORS b/external/snappy-1.1.9/AUTHORS similarity index 100% rename from external/snappy-1.1.3/AUTHORS rename to external/snappy-1.1.9/AUTHORS diff --git a/external/snappy-1.1.9/CMakeLists.txt b/external/snappy-1.1.9/CMakeLists.txt new file mode 100644 index 0000000..672561e --- /dev/null +++ b/external/snappy-1.1.9/CMakeLists.txt @@ -0,0 +1,398 @@ +# Copyright 2019 Google Inc. All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cmake_minimum_required(VERSION 3.1) +project(Snappy VERSION 1.1.9 LANGUAGES C CXX) + +# C++ standard can be overridden when this is used as a sub-project. +if(NOT CMAKE_CXX_STANDARD) + # This project requires C++11. + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) +endif(NOT CMAKE_CXX_STANDARD) + +# https://github.com/izenecloud/cmake/blob/master/SetCompilerWarningAll.cmake +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use the highest warning level for Visual Studio. + set(CMAKE_CXX_WARNING_LEVEL 4) + if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + + # Disable C++ exceptions. + string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-") + add_definitions(-D_HAS_EXCEPTIONS=0) + + # Disable RTTI. + string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") + + # Use -Wextra for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra") + + # Use -Werror for clang only. + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror") + endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + + # Disable C++ exceptions. + string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + + # Disable RTTI. + string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") +endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + +# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make +# it prominent in the GUI. +option(BUILD_SHARED_LIBS "Build shared libraries(DLLs)." OFF) + +option(SNAPPY_BUILD_TESTS "Build Snappy's own tests." ON) + +option(SNAPPY_BUILD_BENCHMARKS "Build Snappy's benchmarks" ON) + +option(SNAPPY_FUZZING_BUILD "Build Snappy for fuzzing." OFF) + +option(SNAPPY_REQUIRE_AVX "Target processors with AVX support." OFF) + +option(SNAPPY_REQUIRE_AVX2 "Target processors with AVX2 support." OFF) + +option(SNAPPY_INSTALL "Install Snappy's header and library" ON) + +include(TestBigEndian) +test_big_endian(SNAPPY_IS_BIG_ENDIAN) + +include(CheckIncludeFile) +check_include_file("sys/mman.h" HAVE_SYS_MMAN_H) +check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H) +check_include_file("sys/time.h" HAVE_SYS_TIME_H) +check_include_file("sys/uio.h" HAVE_SYS_UIO_H) +check_include_file("unistd.h" HAVE_UNISTD_H) +check_include_file("windows.h" HAVE_WINDOWS_H) + +include(CheckLibraryExists) +check_library_exists(z zlibVersion "" HAVE_LIBZ) +check_library_exists(lzo2 lzo1x_1_15_compress "" HAVE_LIBLZO2) +check_library_exists(lz4 LZ4_compress_default "" HAVE_LIBLZ4) + +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("/arch:AVX" HAVE_VISUAL_STUDIO_ARCH_AVX) +CHECK_CXX_COMPILER_FLAG("/arch:AVX2" HAVE_VISUAL_STUDIO_ARCH_AVX2) +CHECK_CXX_COMPILER_FLAG("-mavx" HAVE_CLANG_MAVX) +CHECK_CXX_COMPILER_FLAG("-mbmi2" HAVE_CLANG_MBMI2) +if(SNAPPY_REQUIRE_AVX2) + if(HAVE_VISUAL_STUDIO_ARCH_AVX2) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2") + endif(HAVE_VISUAL_STUDIO_ARCH_AVX2) + if(HAVE_CLANG_MAVX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") + endif(HAVE_CLANG_MAVX) + if(HAVE_CLANG_MBMI2) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mbmi2") + endif(HAVE_CLANG_MBMI2) +elseif (SNAPPY_REQUIRE_AVX) + if(HAVE_VISUAL_STUDIO_ARCH_AVX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX") + endif(HAVE_VISUAL_STUDIO_ARCH_AVX) + if(HAVE_CLANG_MAVX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") + endif(HAVE_CLANG_MAVX) +endif(SNAPPY_REQUIRE_AVX2) + +# Used by googletest. +check_cxx_compiler_flag(-Wno-missing-field-initializers + SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS) + +include(CheckCXXSourceCompiles) +check_cxx_source_compiles(" +int main() { + return __builtin_expect(0, 1); +}" HAVE_BUILTIN_EXPECT) + +check_cxx_source_compiles(" +int main() { + return __builtin_ctzll(0); +}" HAVE_BUILTIN_CTZ) + +check_cxx_source_compiles(" +__attribute__((always_inline)) int zero() { return 0; } + +int main() { + return zero(); +}" HAVE_ATTRIBUTE_ALWAYS_INLINE) + +check_cxx_source_compiles(" +#include + +int main() { + const __m128i *src = 0; + __m128i dest; + const __m128i shuffle_mask = _mm_load_si128(src); + const __m128i pattern = _mm_shuffle_epi8(_mm_loadl_epi64(src), shuffle_mask); + _mm_storeu_si128(&dest, pattern); + return 0; +}" SNAPPY_HAVE_SSSE3) + +check_cxx_source_compiles(" +#include +int main() { + return _bzhi_u32(0, 1); +}" SNAPPY_HAVE_BMI2) + +include(CheckSymbolExists) +check_symbol_exists("mmap" "sys/mman.h" HAVE_FUNC_MMAP) +check_symbol_exists("sysconf" "unistd.h" HAVE_FUNC_SYSCONF) + +configure_file( + "cmake/config.h.in" + "${PROJECT_BINARY_DIR}/config.h" +) + +# We don't want to define HAVE_ macros in public headers. Instead, we use +# CMake's variable substitution with 0/1 variables, which will be seen by the +# preprocessor as constants. +set(HAVE_SYS_UIO_H_01 ${HAVE_SYS_UIO_H}) +if(NOT HAVE_SYS_UIO_H_01) + set(HAVE_SYS_UIO_H_01 0) +endif(NOT HAVE_SYS_UIO_H_01) + +if (SNAPPY_FUZZING_BUILD) + if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + message(WARNING "Fuzzing builds are only supported with Clang") + endif (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + + if(NOT CMAKE_CXX_FLAGS MATCHES "-fsanitize=address") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-fsanitize=address") + + if(NOT CMAKE_CXX_FLAGS MATCHES "-fsanitize=fuzzer-no-link") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer-no-link") + endif(NOT CMAKE_CXX_FLAGS MATCHES "-fsanitize=fuzzer-no-link") +endif (SNAPPY_FUZZING_BUILD) + +configure_file( + "snappy-stubs-public.h.in" + "${PROJECT_BINARY_DIR}/snappy-stubs-public.h") + +add_library(snappy "") +target_sources(snappy + PRIVATE + "snappy-internal.h" + "snappy-stubs-internal.h" + "snappy-c.cc" + "snappy-sinksource.cc" + "snappy-stubs-internal.cc" + "snappy.cc" + "${PROJECT_BINARY_DIR}/config.h" + + # Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". + $<$:PUBLIC> + $ + $ + $ + $ + $ + $ + $ + $ +) +target_include_directories(snappy + PUBLIC + $ + $ + $ +) +set_target_properties(snappy + PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) + +target_compile_definitions(snappy PRIVATE -DHAVE_CONFIG_H) +if(BUILD_SHARED_LIBS) + set_target_properties(snappy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif(BUILD_SHARED_LIBS) + +if(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS) + add_library(snappy_test_support "") + target_sources(snappy_test_support + PRIVATE + "snappy-test.cc" + "snappy-test.h" + "snappy_test_data.cc" + "snappy_test_data.h" + "${PROJECT_BINARY_DIR}/config.h" + ) + + # Test files include snappy-test.h, HAVE_CONFIG_H must be defined. + target_compile_definitions(snappy_test_support PUBLIC -DHAVE_CONFIG_H) + + target_link_libraries(snappy_test_support snappy) + + if(HAVE_LIBZ) + target_link_libraries(snappy_test_support z) + endif(HAVE_LIBZ) + if(HAVE_LIBLZO2) + target_link_libraries(snappy_test_support lzo2) + endif(HAVE_LIBLZO2) + if(HAVE_LIBLZ4) + target_link_libraries(snappy_test_support lz4) + endif(HAVE_LIBLZ4) + + target_include_directories(snappy_test_support + BEFORE PUBLIC + "${PROJECT_SOURCE_DIR}" + ) +endif(SNAPPY_BUILD_TESTS OR SNAPPY_BUILD_BENCHMARKS) + +if(SNAPPY_BUILD_TESTS) + enable_testing() + + # Prevent overriding the parent project's compiler/linker settings on Windows. + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + set(install_gtest OFF) + set(install_gmock OFF) + set(build_gmock ON) + + # This project is tested using GoogleTest. + add_subdirectory("third_party/googletest") + + # GoogleTest triggers a missing field initializers warning. + if(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS) + set_property(TARGET gtest + APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) + set_property(TARGET gmock + APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) + endif(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS) + + add_executable(snappy_unittest "") + target_sources(snappy_unittest + PRIVATE + "snappy_unittest.cc" + ) + target_link_libraries(snappy_unittest snappy_test_support gmock_main gtest) + + add_test( + NAME snappy_unittest + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" + COMMAND "${PROJECT_BINARY_DIR}/snappy_unittest") + + add_executable(snappy_test_tool "") + target_sources(snappy_test_tool + PRIVATE + "snappy_test_tool.cc" + ) + target_link_libraries(snappy_test_tool snappy_test_support) +endif(SNAPPY_BUILD_TESTS) + +if(SNAPPY_BUILD_BENCHMARKS) + add_executable(snappy_benchmark "") + target_sources(snappy_benchmark + PRIVATE + "snappy_benchmark.cc" + ) + target_link_libraries(snappy_benchmark snappy_test_support benchmark_main) + + # This project uses Google benchmark for benchmarking. + set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE) + set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE) + add_subdirectory("third_party/benchmark") +endif(SNAPPY_BUILD_BENCHMARKS) + +if(SNAPPY_FUZZING_BUILD) + add_executable(snappy_compress_fuzzer "") + target_sources(snappy_compress_fuzzer + PRIVATE "snappy_compress_fuzzer.cc" + ) + target_link_libraries(snappy_compress_fuzzer snappy) + set_target_properties(snappy_compress_fuzzer + PROPERTIES LINK_FLAGS "-fsanitize=fuzzer" + ) + + add_executable(snappy_uncompress_fuzzer "") + target_sources(snappy_uncompress_fuzzer + PRIVATE "snappy_uncompress_fuzzer.cc" + ) + target_link_libraries(snappy_uncompress_fuzzer snappy) + set_target_properties(snappy_uncompress_fuzzer + PROPERTIES LINK_FLAGS "-fsanitize=fuzzer" + ) +endif(SNAPPY_FUZZING_BUILD) + +# Must be included before CMAKE_INSTALL_INCLUDEDIR is used. +include(GNUInstallDirs) + +if(SNAPPY_INSTALL) + install(TARGETS snappy + EXPORT SnappyTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + install( + FILES + "snappy-c.h" + "snappy-sinksource.h" + "snappy.h" + "${PROJECT_BINARY_DIR}/snappy-stubs-public.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + ) + + include(CMakePackageConfigHelpers) + configure_package_config_file( + "cmake/${PROJECT_NAME}Config.cmake.in" + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" + ) + write_basic_package_version_file( + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" + COMPATIBILITY SameMajorVersion + ) + install( + EXPORT SnappyTargets + NAMESPACE Snappy:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" + ) + install( + FILES + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" + ) +endif(SNAPPY_INSTALL) diff --git a/external/snappy-1.1.9/CONTRIBUTING.md b/external/snappy-1.1.9/CONTRIBUTING.md new file mode 100644 index 0000000..d0ce551 --- /dev/null +++ b/external/snappy-1.1.9/CONTRIBUTING.md @@ -0,0 +1,46 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Project Goals + +In addition to the aims listed at the top of the [README](README.md) Snappy +explicitly supports the following: + +1. C++11 +2. Clang (gcc and MSVC are best-effort). +3. Low level optimizations (e.g. assembly or equivalent intrinsics) for: + 1. [x86](https://en.wikipedia.org/wiki/X86) + 2. [x86-64](https://en.wikipedia.org/wiki/X86-64) + 3. ARMv7 (32-bit) + 4. ARMv8 (AArch64) +4. Supports only the Snappy compression scheme as described in + [format_description.txt](format_description.txt). +5. CMake for building + +Changes adding features or dependencies outside of the core area of focus listed +above might not be accepted. If in doubt post a message to the +[Snappy discussion mailing list](https://groups.google.com/g/snappy-compression). + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution, +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +Please make sure that all the automated checks (CLA, AppVeyor, Travis) pass for +your pull requests. Pull requests whose checks fail may be ignored. diff --git a/external/snappy-1.1.3/COPYING b/external/snappy-1.1.9/COPYING similarity index 100% rename from external/snappy-1.1.3/COPYING rename to external/snappy-1.1.9/COPYING diff --git a/external/snappy-1.1.3/NEWS b/external/snappy-1.1.9/NEWS similarity index 71% rename from external/snappy-1.1.3/NEWS rename to external/snappy-1.1.9/NEWS index 4eb7a1d..931a5e1 100644 --- a/external/snappy-1.1.3/NEWS +++ b/external/snappy-1.1.9/NEWS @@ -1,3 +1,57 @@ +Snappy v1.1.9, May 4th 2021: + + * Performance improvements. + + * Google Test and Google Benchmark are now bundled in third_party/. + +Snappy v1.1.8, January 15th 2020: + + * Small performance improvements. + + * Removed snappy::string alias for std::string. + + * Improved CMake configuration. + +Snappy v1.1.7, August 24th 2017: + + * Improved CMake build support for 64-bit Linux distributions. + + * MSVC builds now use MSVC-specific intrinsics that map to clzll. + + * ARM64 (AArch64) builds use the code paths optimized for 64-bit processors. + +Snappy v1.1.6, July 12th 2017: + +This is a re-release of v1.1.5 with proper SONAME / SOVERSION values. + +Snappy v1.1.5, June 28th 2017: + +This release has broken SONAME / SOVERSION values. Users of snappy as a shared +library should avoid 1.1.5 and use 1.1.6 instead. SONAME / SOVERSION errors will +manifest as the dynamic library loader complaining that it cannot find snappy's +shared library file (libsnappy.so / libsnappy.dylib), or that the library it +found does not have the required version. 1.1.6 has the same code as 1.1.5, but +carries build configuration fixes for the issues above. + + * Add CMake build support. The autoconf build support is now deprecated, and + will be removed in the next release. + + * Add AppVeyor configuration, for Windows CI coverage. + + * Small performance improvement on little-endian PowerPC. + + * Small performance improvement on LLVM with position-independent executables. + + * Fix a few issues with various build environments. + +Snappy v1.1.4, January 25th 2017: + + * Fix a 1% performance regression when snappy is used in PIE executables. + + * Improve compression performance by 5%. + + * Improve decompression performance by 20%. + Snappy v1.1.3, July 6th 2015: This is the first release to be done from GitHub, which means that diff --git a/external/snappy-1.1.3/README b/external/snappy-1.1.9/README.md similarity index 59% rename from external/snappy-1.1.3/README rename to external/snappy-1.1.9/README.md index 3bc8888..7917d1b 100644 --- a/external/snappy-1.1.3/README +++ b/external/snappy-1.1.9/README.md @@ -1,5 +1,7 @@ Snappy, a fast compressor/decompressor. +[![Build Status](https://travis-ci.org/google/snappy.svg?branch=master)](https://travis-ci.org/google/snappy) +[![Build status](https://ci.appveyor.com/api/projects/status/t9nubcqkwo8rw8yn/branch/master?svg=true)](https://ci.appveyor.com/project/pwnall/leveldb) Introduction ============ @@ -29,12 +31,12 @@ and the like. Performance =========== - + Snappy is intended to be fast. On a single core of a Core i7 processor in 64-bit mode, it compresses at about 250 MB/sec or more and decompresses at about 500 MB/sec or more. (These numbers are for the slowest inputs in our benchmark suite; others are much faster.) In our tests, Snappy usually -is faster than algorithms in the same class (e.g. LZO, LZF, FastLZ, QuickLZ, +is faster than algorithms in the same class (e.g. LZO, LZF, QuickLZ, etc.) while achieving comparable compression ratios. Typical compression ratios (based on the benchmark suite) are about 1.5-1.7x @@ -51,8 +53,8 @@ In particular: - Snappy uses 64-bit operations in several places to process more data at once than would otherwise be possible. - - Snappy assumes unaligned 32- and 64-bit loads and stores are cheap. - On some platforms, these must be emulated with single-byte loads + - Snappy assumes unaligned 32 and 64-bit loads and stores are cheap. + On some platforms, these must be emulated with single-byte loads and stores, which is much slower. - Snappy assumes little-endian throughout, and needs to byte-swap data in several places if running on a big-endian platform. @@ -62,25 +64,41 @@ Performance optimizations, whether for 64-bit x86 or other platforms, are of course most welcome; see "Contact", below. +Building +======== + +You need the CMake version specified in [CMakeLists.txt](./CMakeLists.txt) +or later to build: + +```bash +git submodule update --init +mkdir build +cd build && cmake ../ && make +``` + Usage ===== Note that Snappy, both the implementation and the main interface, is written in C++. However, several third-party bindings to other languages -are available; see the Google Code page at http://code.google.com/p/snappy/ -for more information. Also, if you want to use Snappy from C code, you can -use the included C bindings in snappy-c.h. +are available; see the [home page](docs/README.md) for more information. +Also, if you want to use Snappy from C code, you can use the included C +bindings in snappy-c.h. To use Snappy from your own C++ program, include the file "snappy.h" from your calling file, and link against the compiled library. There are many ways to call Snappy, but the simplest possible is - snappy::Compress(input.data(), input.size(), &output); +```c++ +snappy::Compress(input.data(), input.size(), &output); +``` and similarly - snappy::Uncompress(input.data(), input.size(), &output); +```c++ +snappy::Uncompress(input.data(), input.size(), &output); +``` where "input" and "output" are both instances of std::string. @@ -92,44 +110,31 @@ information. Tests and benchmarks ==================== -When you compile Snappy, snappy_unittest is compiled in addition to the -library itself. You do not need it to use the compressor from your own library, -but it contains several useful components for Snappy development. +When you compile Snappy, the following binaries are compiled in addition to the +library itself. You do not need them to use the compressor from your own +library, but they are useful for Snappy development. -First of all, it contains unit tests, verifying correctness on your machine in -various scenarios. If you want to change or optimize Snappy, please run the -tests to verify you have not broken anything. Note that if you have the -Google Test library installed, unit test behavior (especially failures) will be -significantly more user-friendly. You can find Google Test at +* `snappy_benchmark` contains microbenchmarks used to tune compression and + decompression performance. +* `snappy_unittests` contains unit tests, verifying correctness on your machine + in various scenarios. +* `snappy_test_tool` can benchmark Snappy against a few other compression + libraries (zlib, LZO, LZF, and QuickLZ), if they were detected at configure + time. To benchmark using a given file, give the compression algorithm you want + to test Snappy against (e.g. --zlib) and then a list of one or more file names + on the command line. - http://code.google.com/p/googletest/ +If you want to change or optimize Snappy, please run the tests and benchmarks to +verify you have not broken anything. -You probably also want the gflags library for handling of command-line flags; -you can find it at - - http://code.google.com/p/google-gflags/ - -In addition to the unit tests, snappy contains microbenchmarks used to -tune compression and decompression performance. These are automatically run -before the unit tests, but you can disable them using the flag ---run_microbenchmarks=false if you have gflags installed (otherwise you will -need to edit the source). - -Finally, snappy can benchmark Snappy against a few other compression libraries -(zlib, LZO, LZF, FastLZ and QuickLZ), if they were detected at configure time. -To benchmark using a given file, give the compression algorithm you want to test -Snappy against (e.g. --zlib) and then a list of one or more file names on the -command line. The testdata/ directory contains the files used by the -microbenchmark, which should provide a reasonably balanced starting point for -benchmarking. (Note that baddata[1-3].snappy are not intended as benchmarks; they -are used to verify correctness in the presence of corrupted data in the unit -test.) +The testdata/ directory contains the files used by the microbenchmarks, which +should provide a reasonably balanced starting point for benchmarking. (Note that +baddata[1-3].snappy are not intended as benchmarks; they are used to verify +correctness in the presence of corrupted data in the unit test.) Contact ======= -Snappy is distributed through Google Code. For the latest version, a bug tracker, -and other information, see - - http://code.google.com/p/snappy/ +Snappy is distributed through GitHub. For the latest version and other +information, see https://github.com/google/snappy. diff --git a/external/snappy-1.1.9/cmake/SnappyConfig.cmake.in b/external/snappy-1.1.9/cmake/SnappyConfig.cmake.in new file mode 100644 index 0000000..9e7d134 --- /dev/null +++ b/external/snappy-1.1.9/cmake/SnappyConfig.cmake.in @@ -0,0 +1,33 @@ +# Copyright 2019 Google Inc. All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/SnappyTargets.cmake") + +check_required_components(Snappy) \ No newline at end of file diff --git a/external/snappy-1.1.9/cmake/config.h.in b/external/snappy-1.1.9/cmake/config.h.in new file mode 100644 index 0000000..872bd3c --- /dev/null +++ b/external/snappy-1.1.9/cmake/config.h.in @@ -0,0 +1,56 @@ +#ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_ +#define THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_ + +/* Define to 1 if the compiler supports __attribute__((always_inline)). */ +#cmakedefine HAVE_ATTRIBUTE_ALWAYS_INLINE 1 + +/* Define to 1 if the compiler supports __builtin_ctz and friends. */ +#cmakedefine HAVE_BUILTIN_CTZ 1 + +/* Define to 1 if the compiler supports __builtin_expect. */ +#cmakedefine HAVE_BUILTIN_EXPECT 1 + +/* Define to 1 if you have a definition for mmap() in . */ +#cmakedefine HAVE_FUNC_MMAP 1 + +/* Define to 1 if you have a definition for sysconf() in . */ +#cmakedefine HAVE_FUNC_SYSCONF 1 + +/* Define to 1 if you have the `lzo2' library (-llzo2). */ +#cmakedefine HAVE_LIBLZO2 1 + +/* Define to 1 if you have the `z' library (-lz). */ +#cmakedefine HAVE_LIBZ 1 + +/* Define to 1 if you have the `lz4' library (-llz4). */ +#cmakedefine HAVE_LIBLZ4 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_WINDOWS_H 1 + +/* Define to 1 if you target processors with SSSE3+ and have . */ +#cmakedefine01 SNAPPY_HAVE_SSSE3 + +/* Define to 1 if you target processors with BMI2+ and have . */ +#cmakedefine01 SNAPPY_HAVE_BMI2 + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#cmakedefine SNAPPY_IS_BIG_ENDIAN 1 + +#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_ diff --git a/external/snappy-1.1.9/docs/README.md b/external/snappy-1.1.9/docs/README.md new file mode 100644 index 0000000..d5e0e63 --- /dev/null +++ b/external/snappy-1.1.9/docs/README.md @@ -0,0 +1,72 @@ +Snappy is a compression/decompression library. It does not aim for maximum +compression, or compatibility with any other compression library; instead, it +aims for very high speeds and reasonable compression. For instance, compared +to the fastest mode of zlib, Snappy is an order of magnitude faster for most +inputs, but the resulting compressed files are anywhere from 20% to 100% +bigger. On a single core of a Core i7 processor in 64-bit mode, Snappy +compresses at about 250 MB/sec or more and decompresses at about 500 MB/sec +or more. + +Snappy is widely used inside Google, in everything from BigTable and MapReduce +to our internal RPC systems. (Snappy has previously been referred to as "Zippy" +in some presentations and the likes.) + +For more information, please see the [README](../README.md). Benchmarks against +a few other compression libraries (zlib, LZO, LZF, FastLZ, and QuickLZ) are +included in the source code distribution. The source code also contains a +[formal format specification](../format_description.txt), as well +as a specification for a [framing format](../framing_format.txt) useful for +higher-level framing and encapsulation of Snappy data, e.g. for transporting +Snappy-compressed data across HTTP in a streaming fashion. Note that the Snappy +distribution currently has no code implementing the latter, but some of the +ports do (see below). + +Snappy is written in C++, but C bindings are included, and several bindings to +other languages are maintained by third parties: + +* C#: [Snappy for .NET](http://snappy4net.codeplex.com/) (P/Invoke wrapper), + [Snappy.NET](http://snappy.angeloflogic.com/) (P/Invoke wrapper), + [Snappy.Sharp](https://github.com/jeffesp/Snappy.Sharp) (native + reimplementation) +* [C port](http://github.com/andikleen/snappy-c) +* [C++ MSVC packaging](http://snappy.angeloflogic.com/) (plus Windows binaries, + NuGet packages and command-line tool) +* Common Lisp: [Library bindings](http://flambard.github.com/thnappy/), + [native reimplementation](https://github.com/brown/snappy) +* Erlang: [esnappy](https://github.com/thekvs/esnappy), + [snappy-erlang-nif](https://github.com/fdmanana/snappy-erlang-nif) +* [Go](https://github.com/golang/snappy/) +* [Haskell](http://hackage.haskell.org/package/snappy) +* [Haxe](https://github.com/MaddinXx/hxsnappy) (C++/Neko) +* [iOS packaging](https://github.com/ideawu/snappy-ios) +* Java: [JNI wrapper](https://github.com/xerial/snappy-java) (including the + framing format), [native reimplementation](http://code.google.com/p/jsnappy/), + [other native reimplementation](https://github.com/dain/snappy) (including + the framing format) +* [Lua](https://github.com/forhappy/lua-snappy) +* [Node.js](https://github.com/kesla/node-snappy) (including the [framing + format](https://github.com/kesla/node-snappy-stream)) +* [Perl](http://search.cpan.org/dist/Compress-Snappy/) +* [PHP](https://github.com/kjdev/php-ext-snappy) +* [Python](http://pypi.python.org/pypi/python-snappy) (including a command-line + tool for the framing format) +* [R](https://github.com/lulyon/R-snappy) +* [Ruby](https://github.com/miyucy/snappy) +* [Rust](https://github.com/BurntSushi/rust-snappy) +* [Smalltalk](https://github.com/mumez/sqnappy) (including the framing format) + +Snappy is used or is available as an alternative in software such as + +* [MongoDB](https://www.mongodb.com/) +* [Cassandra](http://cassandra.apache.org/) +* [Couchbase](http://www.couchbase.com/) +* [Hadoop](http://hadoop.apache.org/) +* [LessFS](http://www.lessfs.com/wordpress/) +* [LevelDB](https://github.com/google/leveldb) (which is in turn used by + [Google Chrome](http://chrome.google.com/)) +* [Lucene](http://lucene.apache.org/) +* [VoltDB](http://voltdb.com/) + +If you know of more, do not hesitate to let us know. The easiest way to get in +touch is via the +[Snappy discussion mailing list](http://groups.google.com/group/snappy-compression). diff --git a/external/snappy-1.1.9/format_description.txt b/external/snappy-1.1.9/format_description.txt new file mode 100644 index 0000000..20db66c --- /dev/null +++ b/external/snappy-1.1.9/format_description.txt @@ -0,0 +1,110 @@ +Snappy compressed format description +Last revised: 2011-10-05 + + +This is not a formal specification, but should suffice to explain most +relevant parts of how the Snappy format works. It is originally based on +text by Zeev Tarantov. + +Snappy is a LZ77-type compressor with a fixed, byte-oriented encoding. +There is no entropy encoder backend nor framing layer -- the latter is +assumed to be handled by other parts of the system. + +This document only describes the format, not how the Snappy compressor nor +decompressor actually works. The correctness of the decompressor should not +depend on implementation details of the compressor, and vice versa. + + +1. Preamble + +The stream starts with the uncompressed length (up to a maximum of 2^32 - 1), +stored as a little-endian varint. Varints consist of a series of bytes, +where the lower 7 bits are data and the upper bit is set iff there are +more bytes to be read. In other words, an uncompressed length of 64 would +be stored as 0x40, and an uncompressed length of 2097150 (0x1FFFFE) +would be stored as 0xFE 0xFF 0x7F. + + +2. The compressed stream itself + +There are two types of elements in a Snappy stream: Literals and +copies (backreferences). There is no restriction on the order of elements, +except that the stream naturally cannot start with a copy. (Having +two literals in a row is never optimal from a compression point of +view, but nevertheless fully permitted.) Each element starts with a tag byte, +and the lower two bits of this tag byte signal what type of element will +follow: + + 00: Literal + 01: Copy with 1-byte offset + 10: Copy with 2-byte offset + 11: Copy with 4-byte offset + +The interpretation of the upper six bits are element-dependent. + + +2.1. Literals (00) + +Literals are uncompressed data stored directly in the byte stream. +The literal length is stored differently depending on the length +of the literal: + + - For literals up to and including 60 bytes in length, the upper + six bits of the tag byte contain (len-1). The literal follows + immediately thereafter in the bytestream. + - For longer literals, the (len-1) value is stored after the tag byte, + little-endian. The upper six bits of the tag byte describe how + many bytes are used for the length; 60, 61, 62 or 63 for + 1-4 bytes, respectively. The literal itself follows after the + length. + + +2.2. Copies + +Copies are references back into previous decompressed data, telling +the decompressor to reuse data it has previously decoded. +They encode two values: The _offset_, saying how many bytes back +from the current position to read, and the _length_, how many bytes +to copy. Offsets of zero can be encoded, but are not legal; +similarly, it is possible to encode backreferences that would +go past the end of the block (offset > current decompressed position), +which is also nonsensical and thus not allowed. + +As in most LZ77-based compressors, the length can be larger than the offset, +yielding a form of run-length encoding (RLE). For instance, +"xababab" could be encoded as + + + +Note that since the current Snappy compressor works in 32 kB +blocks and does not do matching across blocks, it will never produce +a bitstream with offsets larger than about 32768. However, the +decompressor should not rely on this, as it may change in the future. + +There are several different kinds of copy elements, depending on +the amount of bytes to be copied (length), and how far back the +data to be copied is (offset). + + +2.2.1. Copy with 1-byte offset (01) + +These elements can encode lengths between [4..11] bytes and offsets +between [0..2047] bytes. (len-4) occupies three bits and is stored +in bits [2..4] of the tag byte. The offset occupies 11 bits, of which the +upper three are stored in the upper three bits ([5..7]) of the tag byte, +and the lower eight are stored in a byte following the tag byte. + + +2.2.2. Copy with 2-byte offset (10) + +These elements can encode lengths between [1..64] and offsets from +[0..65535]. (len-1) occupies six bits and is stored in the upper +six bits ([2..7]) of the tag byte. The offset is stored as a +little-endian 16-bit integer in the two bytes following the tag byte. + + +2.2.3. Copy with 4-byte offset (11) + +These are like the copies with 2-byte offsets (see previous subsection), +except that the offset is stored as a 32-bit integer instead of a +16-bit integer (and thus will occupy four bytes). diff --git a/external/snappy-1.1.9/framing_format.txt b/external/snappy-1.1.9/framing_format.txt new file mode 100644 index 0000000..9764e83 --- /dev/null +++ b/external/snappy-1.1.9/framing_format.txt @@ -0,0 +1,135 @@ +Snappy framing format description +Last revised: 2013-10-25 + +This format decribes a framing format for Snappy, allowing compressing to +files or streams that can then more easily be decompressed without having +to hold the entire stream in memory. It also provides data checksums to +help verify integrity. It does not provide metadata checksums, so it does +not protect against e.g. all forms of truncations. + +Implementation of the framing format is optional for Snappy compressors and +decompressor; it is not part of the Snappy core specification. + + +1. General structure + +The file consists solely of chunks, lying back-to-back with no padding +in between. Each chunk consists first a single byte of chunk identifier, +then a three-byte little-endian length of the chunk in bytes (from 0 to +16777215, inclusive), and then the data if any. The four bytes of chunk +header is not counted in the data length. + +The different chunk types are listed below. The first chunk must always +be the stream identifier chunk (see section 4.1, below). The stream +ends when the file ends -- there is no explicit end-of-file marker. + + +2. File type identification + +The following identifiers for this format are recommended where appropriate. +However, note that none have been registered officially, so this is only to +be taken as a guideline. We use "Snappy framed" to distinguish between this +format and raw Snappy data. + + File extension: .sz + MIME type: application/x-snappy-framed + HTTP Content-Encoding: x-snappy-framed + + +3. Checksum format + +Some chunks have data protected by a checksum (the ones that do will say so +explicitly). The checksums are always masked CRC-32Cs. + +A description of CRC-32C can be found in RFC 3720, section 12.1, with +examples in section B.4. + +Checksums are not stored directly, but masked, as checksumming data and +then its own checksum can be problematic. The masking is the same as used +in Apache Hadoop: Rotate the checksum by 15 bits, then add the constant +0xa282ead8 (using wraparound as normal for unsigned integers). This is +equivalent to the following C code: + + uint32_t mask_checksum(uint32_t x) { + return ((x >> 15) | (x << 17)) + 0xa282ead8; + } + +Note that the masking is reversible. + +The checksum is always stored as a four bytes long integer, in little-endian. + + +4. Chunk types + +The currently supported chunk types are described below. The list may +be extended in the future. + + +4.1. Stream identifier (chunk type 0xff) + +The stream identifier is always the first element in the stream. +It is exactly six bytes long and contains "sNaPpY" in ASCII. This means that +a valid Snappy framed stream always starts with the bytes + + 0xff 0x06 0x00 0x00 0x73 0x4e 0x61 0x50 0x70 0x59 + +The stream identifier chunk can come multiple times in the stream besides +the first; if such a chunk shows up, it should simply be ignored, assuming +it has the right length and contents. This allows for easy concatenation of +compressed files without the need for re-framing. + + +4.2. Compressed data (chunk type 0x00) + +Compressed data chunks contain a normal Snappy compressed bitstream; +see the compressed format specification. The compressed data is preceded by +the CRC-32C (see section 3) of the _uncompressed_ data. + +Note that the data portion of the chunk, i.e., the compressed contents, +can be at most 16777211 bytes (2^24 - 1, minus the checksum). +However, we place an additional restriction that the uncompressed data +in a chunk must be no longer than 65536 bytes. This allows consumers to +easily use small fixed-size buffers. + + +4.3. Uncompressed data (chunk type 0x01) + +Uncompressed data chunks allow a compressor to send uncompressed, +raw data; this is useful if, for instance, uncompressible or +near-incompressible data is detected, and faster decompression is desired. + +As in the compressed chunks, the data is preceded by its own masked +CRC-32C (see section 3). + +An uncompressed data chunk, like compressed data chunks, should contain +no more than 65536 data bytes, so the maximum legal chunk length with the +checksum is 65540. + + +4.4. Padding (chunk type 0xfe) + +Padding chunks allow a compressor to increase the size of the data stream +so that it complies with external demands, e.g. that the total number of +bytes is a multiple of some value. + +All bytes of the padding chunk, except the chunk byte itself and the length, +should be zero, but decompressors must not try to interpret or verify the +padding data in any way. + + +4.5. Reserved unskippable chunks (chunk types 0x02-0x7f) + +These are reserved for future expansion. A decoder that sees such a chunk +should immediately return an error, as it must assume it cannot decode the +stream correctly. + +Future versions of this specification may define meanings for these chunks. + + +4.6. Reserved skippable chunks (chunk types 0x80-0xfd) + +These are also reserved for future expansion, but unlike the chunks +described in 4.5, a decoder seeing these must skip them and continue +decoding. + +Future versions of this specification may define meanings for these chunks. diff --git a/external/snappy-1.1.3/snappy-c.cc b/external/snappy-1.1.9/snappy-c.cc similarity index 98% rename from external/snappy-1.1.3/snappy-c.cc rename to external/snappy-1.1.9/snappy-c.cc index 016f0d5..473a0b0 100644 --- a/external/snappy-1.1.3/snappy-c.cc +++ b/external/snappy-1.1.9/snappy-c.cc @@ -26,8 +26,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "snappy/snappy.h" -#include "snappy/snappy-c.h" +#include "snappy.h" +#include "snappy-c.h" extern "C" { diff --git a/external/snappy-1.1.3/include/snappy/snappy-c.h b/external/snappy-1.1.9/snappy-c.h similarity index 100% rename from external/snappy-1.1.3/include/snappy/snappy-c.h rename to external/snappy-1.1.9/snappy-c.h diff --git a/external/snappy-1.1.9/snappy-internal.h b/external/snappy-1.1.9/snappy-internal.h new file mode 100644 index 0000000..720ccd8 --- /dev/null +++ b/external/snappy-1.1.9/snappy-internal.h @@ -0,0 +1,317 @@ +// Copyright 2008 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Internals shared between the Snappy implementation and its unittest. + +#ifndef THIRD_PARTY_SNAPPY_SNAPPY_INTERNAL_H_ +#define THIRD_PARTY_SNAPPY_SNAPPY_INTERNAL_H_ + +#include "snappy-stubs-internal.h" + +namespace snappy { +namespace internal { + +// Working memory performs a single allocation to hold all scratch space +// required for compression. +class WorkingMemory { + public: + explicit WorkingMemory(size_t input_size); + ~WorkingMemory(); + + // Allocates and clears a hash table using memory in "*this", + // stores the number of buckets in "*table_size" and returns a pointer to + // the base of the hash table. + uint16_t* GetHashTable(size_t fragment_size, int* table_size) const; + char* GetScratchInput() const { return input_; } + char* GetScratchOutput() const { return output_; } + + private: + char* mem_; // the allocated memory, never nullptr + size_t size_; // the size of the allocated memory, never 0 + uint16_t* table_; // the pointer to the hashtable + char* input_; // the pointer to the input scratch buffer + char* output_; // the pointer to the output scratch buffer + + // No copying + WorkingMemory(const WorkingMemory&); + void operator=(const WorkingMemory&); +}; + +// Flat array compression that does not emit the "uncompressed length" +// prefix. Compresses "input" string to the "*op" buffer. +// +// REQUIRES: "input_length <= kBlockSize" +// REQUIRES: "op" points to an array of memory that is at least +// "MaxCompressedLength(input_length)" in size. +// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero. +// REQUIRES: "table_size" is a power of two +// +// Returns an "end" pointer into "op" buffer. +// "end - op" is the compressed size of "input". +char* CompressFragment(const char* input, + size_t input_length, + char* op, + uint16_t* table, + const int table_size); + +// Find the largest n such that +// +// s1[0,n-1] == s2[0,n-1] +// and n <= (s2_limit - s2). +// +// Return make_pair(n, n < 8). +// Does not read *s2_limit or beyond. +// Does not read *(s1 + (s2_limit - s2)) or beyond. +// Requires that s2_limit >= s2. +// +// In addition populate *data with the next 5 bytes from the end of the match. +// This is only done if 8 bytes are available (s2_limit - s2 >= 8). The point is +// that on some arch's this can be done faster in this routine than subsequent +// loading from s2 + n. +// +// Separate implementation for 64-bit, little-endian cpus. +#if !defined(SNAPPY_IS_BIG_ENDIAN) && \ + (defined(__x86_64__) || defined(_M_X64) || defined(ARCH_PPC) || defined(ARCH_ARM)) +static inline std::pair FindMatchLength(const char* s1, + const char* s2, + const char* s2_limit, + uint64_t* data) { + assert(s2_limit >= s2); + size_t matched = 0; + + // This block isn't necessary for correctness; we could just start looping + // immediately. As an optimization though, it is useful. It creates some not + // uncommon code paths that determine, without extra effort, whether the match + // length is less than 8. In short, we are hoping to avoid a conditional + // branch, and perhaps get better code layout from the C++ compiler. + if (SNAPPY_PREDICT_TRUE(s2 <= s2_limit - 16)) { + uint64_t a1 = UNALIGNED_LOAD64(s1); + uint64_t a2 = UNALIGNED_LOAD64(s2); + if (SNAPPY_PREDICT_TRUE(a1 != a2)) { + // This code is critical for performance. The reason is that it determines + // how much to advance `ip` (s2). This obviously depends on both the loads + // from the `candidate` (s1) and `ip`. Furthermore the next `candidate` + // depends on the advanced `ip` calculated here through a load, hash and + // new candidate hash lookup (a lot of cycles). This makes s1 (ie. + // `candidate`) the variable that limits throughput. This is the reason we + // go through hoops to have this function update `data` for the next iter. + // The straightforward code would use *data, given by + // + // *data = UNALIGNED_LOAD64(s2 + matched_bytes) (Latency of 5 cycles), + // + // as input for the hash table lookup to find next candidate. However + // this forces the load on the data dependency chain of s1, because + // matched_bytes directly depends on s1. However matched_bytes is 0..7, so + // we can also calculate *data by + // + // *data = AlignRight(UNALIGNED_LOAD64(s2), UNALIGNED_LOAD64(s2 + 8), + // matched_bytes); + // + // The loads do not depend on s1 anymore and are thus off the bottleneck. + // The straightforward implementation on x86_64 would be to use + // + // shrd rax, rdx, cl (cl being matched_bytes * 8) + // + // unfortunately shrd with a variable shift has a 4 cycle latency. So this + // only wins 1 cycle. The BMI2 shrx instruction is a 1 cycle variable + // shift instruction but can only shift 64 bits. If we focus on just + // obtaining the least significant 4 bytes, we can obtain this by + // + // *data = ConditionalMove(matched_bytes < 4, UNALIGNED_LOAD64(s2), + // UNALIGNED_LOAD64(s2 + 4) >> ((matched_bytes & 3) * 8); + // + // Writen like above this is not a big win, the conditional move would be + // a cmp followed by a cmov (2 cycles) followed by a shift (1 cycle). + // However matched_bytes < 4 is equal to + // static_cast(xorval) != 0. Writen that way, the conditional + // move (2 cycles) can execute in parallel with FindLSBSetNonZero64 + // (tzcnt), which takes 3 cycles. + uint64_t xorval = a1 ^ a2; + int shift = Bits::FindLSBSetNonZero64(xorval); + size_t matched_bytes = shift >> 3; +#ifndef __x86_64__ + *data = UNALIGNED_LOAD64(s2 + matched_bytes); +#else + // Ideally this would just be + // + // a2 = static_cast(xorval) == 0 ? a3 : a2; + // + // However clang correctly infers that the above statement participates on + // a critical data dependency chain and thus, unfortunately, refuses to + // use a conditional move (it's tuned to cut data dependencies). In this + // case there is a longer parallel chain anyway AND this will be fairly + // unpredictable. + uint64_t a3 = UNALIGNED_LOAD64(s2 + 4); + asm("testl %k2, %k2\n\t" + "cmovzq %1, %0\n\t" + : "+r"(a2) + : "r"(a3), "r"(xorval)); + *data = a2 >> (shift & (3 * 8)); +#endif + return std::pair(matched_bytes, true); + } else { + matched = 8; + s2 += 8; + } + } + + // Find out how long the match is. We loop over the data 64 bits at a + // time until we find a 64-bit block that doesn't match; then we find + // the first non-matching bit and use that to calculate the total + // length of the match. + while (SNAPPY_PREDICT_TRUE(s2 <= s2_limit - 16)) { + uint64_t a1 = UNALIGNED_LOAD64(s1 + matched); + uint64_t a2 = UNALIGNED_LOAD64(s2); + if (a1 == a2) { + s2 += 8; + matched += 8; + } else { + uint64_t xorval = a1 ^ a2; + int shift = Bits::FindLSBSetNonZero64(xorval); + size_t matched_bytes = shift >> 3; +#ifndef __x86_64__ + *data = UNALIGNED_LOAD64(s2 + matched_bytes); +#else + uint64_t a3 = UNALIGNED_LOAD64(s2 + 4); + asm("testl %k2, %k2\n\t" + "cmovzq %1, %0\n\t" + : "+r"(a2) + : "r"(a3), "r"(xorval)); + *data = a2 >> (shift & (3 * 8)); +#endif + matched += matched_bytes; + assert(matched >= 8); + return std::pair(matched, false); + } + } + while (SNAPPY_PREDICT_TRUE(s2 < s2_limit)) { + if (s1[matched] == *s2) { + ++s2; + ++matched; + } else { + if (s2 <= s2_limit - 8) { + *data = UNALIGNED_LOAD64(s2); + } + return std::pair(matched, matched < 8); + } + } + return std::pair(matched, matched < 8); +} +#else +static inline std::pair FindMatchLength(const char* s1, + const char* s2, + const char* s2_limit, + uint64_t* data) { + // Implementation based on the x86-64 version, above. + assert(s2_limit >= s2); + int matched = 0; + + while (s2 <= s2_limit - 4 && + UNALIGNED_LOAD32(s2) == UNALIGNED_LOAD32(s1 + matched)) { + s2 += 4; + matched += 4; + } + if (LittleEndian::IsLittleEndian() && s2 <= s2_limit - 4) { + uint32_t x = UNALIGNED_LOAD32(s2) ^ UNALIGNED_LOAD32(s1 + matched); + int matching_bits = Bits::FindLSBSetNonZero(x); + matched += matching_bits >> 3; + s2 += matching_bits >> 3; + } else { + while ((s2 < s2_limit) && (s1[matched] == *s2)) { + ++s2; + ++matched; + } + } + if (s2 <= s2_limit - 8) *data = LittleEndian::Load64(s2); + return std::pair(matched, matched < 8); +} +#endif + +// Lookup tables for decompression code. Give --snappy_dump_decompression_table +// to the unit test to recompute char_table. + +enum { + LITERAL = 0, + COPY_1_BYTE_OFFSET = 1, // 3 bit length + 3 bits of offset in opcode + COPY_2_BYTE_OFFSET = 2, + COPY_4_BYTE_OFFSET = 3 +}; +static const int kMaximumTagLength = 5; // COPY_4_BYTE_OFFSET plus the actual offset. + +// Data stored per entry in lookup table: +// Range Bits-used Description +// ------------------------------------ +// 1..64 0..7 Literal/copy length encoded in opcode byte +// 0..7 8..10 Copy offset encoded in opcode byte / 256 +// 0..4 11..13 Extra bytes after opcode +// +// We use eight bits for the length even though 7 would have sufficed +// because of efficiency reasons: +// (1) Extracting a byte is faster than a bit-field +// (2) It properly aligns copy offset so we do not need a <<8 +static constexpr uint16_t char_table[256] = { + // clang-format off + 0x0001, 0x0804, 0x1001, 0x2001, 0x0002, 0x0805, 0x1002, 0x2002, + 0x0003, 0x0806, 0x1003, 0x2003, 0x0004, 0x0807, 0x1004, 0x2004, + 0x0005, 0x0808, 0x1005, 0x2005, 0x0006, 0x0809, 0x1006, 0x2006, + 0x0007, 0x080a, 0x1007, 0x2007, 0x0008, 0x080b, 0x1008, 0x2008, + 0x0009, 0x0904, 0x1009, 0x2009, 0x000a, 0x0905, 0x100a, 0x200a, + 0x000b, 0x0906, 0x100b, 0x200b, 0x000c, 0x0907, 0x100c, 0x200c, + 0x000d, 0x0908, 0x100d, 0x200d, 0x000e, 0x0909, 0x100e, 0x200e, + 0x000f, 0x090a, 0x100f, 0x200f, 0x0010, 0x090b, 0x1010, 0x2010, + 0x0011, 0x0a04, 0x1011, 0x2011, 0x0012, 0x0a05, 0x1012, 0x2012, + 0x0013, 0x0a06, 0x1013, 0x2013, 0x0014, 0x0a07, 0x1014, 0x2014, + 0x0015, 0x0a08, 0x1015, 0x2015, 0x0016, 0x0a09, 0x1016, 0x2016, + 0x0017, 0x0a0a, 0x1017, 0x2017, 0x0018, 0x0a0b, 0x1018, 0x2018, + 0x0019, 0x0b04, 0x1019, 0x2019, 0x001a, 0x0b05, 0x101a, 0x201a, + 0x001b, 0x0b06, 0x101b, 0x201b, 0x001c, 0x0b07, 0x101c, 0x201c, + 0x001d, 0x0b08, 0x101d, 0x201d, 0x001e, 0x0b09, 0x101e, 0x201e, + 0x001f, 0x0b0a, 0x101f, 0x201f, 0x0020, 0x0b0b, 0x1020, 0x2020, + 0x0021, 0x0c04, 0x1021, 0x2021, 0x0022, 0x0c05, 0x1022, 0x2022, + 0x0023, 0x0c06, 0x1023, 0x2023, 0x0024, 0x0c07, 0x1024, 0x2024, + 0x0025, 0x0c08, 0x1025, 0x2025, 0x0026, 0x0c09, 0x1026, 0x2026, + 0x0027, 0x0c0a, 0x1027, 0x2027, 0x0028, 0x0c0b, 0x1028, 0x2028, + 0x0029, 0x0d04, 0x1029, 0x2029, 0x002a, 0x0d05, 0x102a, 0x202a, + 0x002b, 0x0d06, 0x102b, 0x202b, 0x002c, 0x0d07, 0x102c, 0x202c, + 0x002d, 0x0d08, 0x102d, 0x202d, 0x002e, 0x0d09, 0x102e, 0x202e, + 0x002f, 0x0d0a, 0x102f, 0x202f, 0x0030, 0x0d0b, 0x1030, 0x2030, + 0x0031, 0x0e04, 0x1031, 0x2031, 0x0032, 0x0e05, 0x1032, 0x2032, + 0x0033, 0x0e06, 0x1033, 0x2033, 0x0034, 0x0e07, 0x1034, 0x2034, + 0x0035, 0x0e08, 0x1035, 0x2035, 0x0036, 0x0e09, 0x1036, 0x2036, + 0x0037, 0x0e0a, 0x1037, 0x2037, 0x0038, 0x0e0b, 0x1038, 0x2038, + 0x0039, 0x0f04, 0x1039, 0x2039, 0x003a, 0x0f05, 0x103a, 0x203a, + 0x003b, 0x0f06, 0x103b, 0x203b, 0x003c, 0x0f07, 0x103c, 0x203c, + 0x0801, 0x0f08, 0x103d, 0x203d, 0x1001, 0x0f09, 0x103e, 0x203e, + 0x1801, 0x0f0a, 0x103f, 0x203f, 0x2001, 0x0f0b, 0x1040, 0x2040, + // clang-format on +}; + +} // end namespace internal +} // end namespace snappy + +#endif // THIRD_PARTY_SNAPPY_SNAPPY_INTERNAL_H_ diff --git a/external/snappy-1.1.3/snappy-sinksource.cc b/external/snappy-1.1.9/snappy-sinksource.cc similarity index 81% rename from external/snappy-1.1.3/snappy-sinksource.cc rename to external/snappy-1.1.9/snappy-sinksource.cc index 369a132..8214964 100644 --- a/external/snappy-1.1.3/snappy-sinksource.cc +++ b/external/snappy-1.1.9/snappy-sinksource.cc @@ -26,23 +26,31 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include +#include +#include #include "snappy-sinksource.h" namespace snappy { -Source::~Source() { } +Source::~Source() = default; -Sink::~Sink() { } +Sink::~Sink() = default; char* Sink::GetAppendBuffer(size_t length, char* scratch) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)length; + return scratch; } char* Sink::GetAppendBufferVariable( size_t min_size, size_t desired_size_hint, char* scratch, size_t scratch_size, size_t* allocated_size) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)min_size; + (void)desired_size_hint; + *allocated_size = scratch_size; return scratch; } @@ -55,7 +63,7 @@ void Sink::AppendAndTakeOwnership( (*deleter)(deleter_arg, bytes, n); } -ByteArraySource::~ByteArraySource() { } +ByteArraySource::~ByteArraySource() = default; size_t ByteArraySource::Available() const { return left_; } @@ -74,22 +82,26 @@ UncheckedByteArraySink::~UncheckedByteArraySink() { } void UncheckedByteArraySink::Append(const char* data, size_t n) { // Do no copying if the caller filled in the result of GetAppendBuffer() if (data != dest_) { - memcpy(dest_, data, n); + std::memcpy(dest_, data, n); } dest_ += n; } char* UncheckedByteArraySink::GetAppendBuffer(size_t len, char* scratch) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)len; + (void)scratch; + return dest_; } void UncheckedByteArraySink::AppendAndTakeOwnership( - char* data, size_t n, + char* bytes, size_t n, void (*deleter)(void*, const char*, size_t), void *deleter_arg) { - if (data != dest_) { - memcpy(dest_, data, n); - (*deleter)(deleter_arg, data, n); + if (bytes != dest_) { + std::memcpy(dest_, bytes, n); + (*deleter)(deleter_arg, bytes, n); } dest_ += n; } @@ -97,6 +109,11 @@ void UncheckedByteArraySink::AppendAndTakeOwnership( char* UncheckedByteArraySink::GetAppendBufferVariable( size_t min_size, size_t desired_size_hint, char* scratch, size_t scratch_size, size_t* allocated_size) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)min_size; + (void)scratch; + (void)scratch_size; + *allocated_size = desired_size_hint; return dest_; } diff --git a/external/snappy-1.1.3/snappy-sinksource.h b/external/snappy-1.1.9/snappy-sinksource.h similarity index 93% rename from external/snappy-1.1.3/snappy-sinksource.h rename to external/snappy-1.1.9/snappy-sinksource.h index 8afcdaa..3c74e1b 100644 --- a/external/snappy-1.1.3/snappy-sinksource.h +++ b/external/snappy-1.1.9/snappy-sinksource.h @@ -146,10 +146,10 @@ class Source { class ByteArraySource : public Source { public: ByteArraySource(const char* p, size_t n) : ptr_(p), left_(n) { } - virtual ~ByteArraySource(); - virtual size_t Available() const; - virtual const char* Peek(size_t* len); - virtual void Skip(size_t n); + ~ByteArraySource() override; + size_t Available() const override; + const char* Peek(size_t* len) override; + void Skip(size_t n) override; private: const char* ptr_; size_t left_; @@ -159,15 +159,15 @@ class ByteArraySource : public Source { class UncheckedByteArraySink : public Sink { public: explicit UncheckedByteArraySink(char* dest) : dest_(dest) { } - virtual ~UncheckedByteArraySink(); - virtual void Append(const char* data, size_t n); - virtual char* GetAppendBuffer(size_t len, char* scratch); - virtual char* GetAppendBufferVariable( + ~UncheckedByteArraySink() override; + void Append(const char* data, size_t n) override; + char* GetAppendBuffer(size_t len, char* scratch) override; + char* GetAppendBufferVariable( size_t min_size, size_t desired_size_hint, char* scratch, - size_t scratch_size, size_t* allocated_size); - virtual void AppendAndTakeOwnership( + size_t scratch_size, size_t* allocated_size) override; + void AppendAndTakeOwnership( char* bytes, size_t n, void (*deleter)(void*, const char*, size_t), - void *deleter_arg); + void *deleter_arg) override; // Return the current output pointer so that a caller can see how // many bytes were produced. diff --git a/external/snappy-1.1.3/snappy-stubs-internal.cc b/external/snappy-1.1.9/snappy-stubs-internal.cc similarity index 96% rename from external/snappy-1.1.3/snappy-stubs-internal.cc rename to external/snappy-1.1.9/snappy-stubs-internal.cc index 6ed3343..0bc8c2d 100644 --- a/external/snappy-1.1.3/snappy-stubs-internal.cc +++ b/external/snappy-1.1.9/snappy-stubs-internal.cc @@ -33,7 +33,7 @@ namespace snappy { -void Varint::Append32(string* s, uint32 value) { +void Varint::Append32(std::string* s, uint32_t value) { char buf[Varint::kMax32]; const char* p = Varint::Encode32(buf, value); s->append(buf, p - buf); diff --git a/external/snappy-1.1.9/snappy-stubs-internal.h b/external/snappy-1.1.9/snappy-stubs-internal.h new file mode 100644 index 0000000..c2a838f --- /dev/null +++ b/external/snappy-1.1.9/snappy-stubs-internal.h @@ -0,0 +1,492 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various stubs for the open-source version of Snappy. + +#ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ +#define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#if defined(_MSC_VER) +#include +#endif // defined(_MSC_VER) + +#ifndef __has_feature +#define __has_feature(x) 0 +#endif + +#if __has_feature(memory_sanitizer) +#include +#define SNAPPY_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \ + __msan_unpoison((address), (size)) +#else +#define SNAPPY_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) /* empty */ +#endif // __has_feature(memory_sanitizer) + +#include "snappy-stubs-public.h" + +// Used to enable 64-bit optimized versions of some routines. +#if defined(__PPC64__) || defined(__powerpc64__) +#define ARCH_PPC 1 +#elif defined(__aarch64__) || defined(_M_ARM64) +#define ARCH_ARM 1 +#endif + +// Needed by OS X, among others. +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif + +// The size of an array, if known at compile-time. +// Will give unexpected results if used on a pointer. +// We undefine it first, since some compilers already have a definition. +#ifdef ARRAYSIZE +#undef ARRAYSIZE +#endif +#define ARRAYSIZE(a) int{sizeof(a) / sizeof(*(a))} + +// Static prediction hints. +#ifdef HAVE_BUILTIN_EXPECT +#define SNAPPY_PREDICT_FALSE(x) (__builtin_expect(x, 0)) +#define SNAPPY_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1)) +#else +#define SNAPPY_PREDICT_FALSE(x) x +#define SNAPPY_PREDICT_TRUE(x) x +#endif + +// Inlining hints. +#ifdef HAVE_ATTRIBUTE_ALWAYS_INLINE +#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) +#else +#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE +#endif + +// Stubbed version of ABSL_FLAG. +// +// In the open source version, flags can only be changed at compile time. +#define SNAPPY_FLAG(flag_type, flag_name, default_value, help) \ + flag_type FLAGS_ ## flag_name = default_value + +namespace snappy { + +// Stubbed version of absl::GetFlag(). +template +inline T GetFlag(T flag) { return flag; } + +static const uint32_t kuint32max = std::numeric_limits::max(); +static const int64_t kint64max = std::numeric_limits::max(); + +// Potentially unaligned loads and stores. + +inline uint16_t UNALIGNED_LOAD16(const void *p) { + // Compiles to a single movzx/ldrh on clang/gcc/msvc. + uint16_t v; + std::memcpy(&v, p, sizeof(v)); + return v; +} + +inline uint32_t UNALIGNED_LOAD32(const void *p) { + // Compiles to a single mov/ldr on clang/gcc/msvc. + uint32_t v; + std::memcpy(&v, p, sizeof(v)); + return v; +} + +inline uint64_t UNALIGNED_LOAD64(const void *p) { + // Compiles to a single mov/ldr on clang/gcc/msvc. + uint64_t v; + std::memcpy(&v, p, sizeof(v)); + return v; +} + +inline void UNALIGNED_STORE16(void *p, uint16_t v) { + // Compiles to a single mov/strh on clang/gcc/msvc. + std::memcpy(p, &v, sizeof(v)); +} + +inline void UNALIGNED_STORE32(void *p, uint32_t v) { + // Compiles to a single mov/str on clang/gcc/msvc. + std::memcpy(p, &v, sizeof(v)); +} + +inline void UNALIGNED_STORE64(void *p, uint64_t v) { + // Compiles to a single mov/str on clang/gcc/msvc. + std::memcpy(p, &v, sizeof(v)); +} + +// Convert to little-endian storage, opposite of network format. +// Convert x from host to little endian: x = LittleEndian.FromHost(x); +// convert x from little endian to host: x = LittleEndian.ToHost(x); +// +// Store values into unaligned memory converting to little endian order: +// LittleEndian.Store16(p, x); +// +// Load unaligned values stored in little endian converting to host order: +// x = LittleEndian.Load16(p); +class LittleEndian { + public: + // Functions to do unaligned loads and stores in little-endian order. + static inline uint16_t Load16(const void *ptr) { + const uint8_t* const buffer = reinterpret_cast(ptr); + + // Compiles to a single mov/str on recent clang and gcc. + return (static_cast(buffer[0])) | + (static_cast(buffer[1]) << 8); + } + + static inline uint32_t Load32(const void *ptr) { + const uint8_t* const buffer = reinterpret_cast(ptr); + + // Compiles to a single mov/str on recent clang and gcc. + return (static_cast(buffer[0])) | + (static_cast(buffer[1]) << 8) | + (static_cast(buffer[2]) << 16) | + (static_cast(buffer[3]) << 24); + } + + static inline uint64_t Load64(const void *ptr) { + const uint8_t* const buffer = reinterpret_cast(ptr); + + // Compiles to a single mov/str on recent clang and gcc. + return (static_cast(buffer[0])) | + (static_cast(buffer[1]) << 8) | + (static_cast(buffer[2]) << 16) | + (static_cast(buffer[3]) << 24) | + (static_cast(buffer[4]) << 32) | + (static_cast(buffer[5]) << 40) | + (static_cast(buffer[6]) << 48) | + (static_cast(buffer[7]) << 56); + } + + static inline void Store16(void *dst, uint16_t value) { + uint8_t* const buffer = reinterpret_cast(dst); + + // Compiles to a single mov/str on recent clang and gcc. + buffer[0] = static_cast(value); + buffer[1] = static_cast(value >> 8); + } + + static void Store32(void *dst, uint32_t value) { + uint8_t* const buffer = reinterpret_cast(dst); + + // Compiles to a single mov/str on recent clang and gcc. + buffer[0] = static_cast(value); + buffer[1] = static_cast(value >> 8); + buffer[2] = static_cast(value >> 16); + buffer[3] = static_cast(value >> 24); + } + + static void Store64(void* dst, uint64_t value) { + uint8_t* const buffer = reinterpret_cast(dst); + + // Compiles to a single mov/str on recent clang and gcc. + buffer[0] = static_cast(value); + buffer[1] = static_cast(value >> 8); + buffer[2] = static_cast(value >> 16); + buffer[3] = static_cast(value >> 24); + buffer[4] = static_cast(value >> 32); + buffer[5] = static_cast(value >> 40); + buffer[6] = static_cast(value >> 48); + buffer[7] = static_cast(value >> 56); + } + + static inline constexpr bool IsLittleEndian() { +#if defined(SNAPPY_IS_BIG_ENDIAN) + return false; +#else + return true; +#endif // defined(SNAPPY_IS_BIG_ENDIAN) + } +}; + +// Some bit-manipulation functions. +class Bits { + public: + // Return floor(log2(n)) for positive integer n. + static int Log2FloorNonZero(uint32_t n); + + // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. + static int Log2Floor(uint32_t n); + + // Return the first set least / most significant bit, 0-indexed. Returns an + // undefined value if n == 0. FindLSBSetNonZero() is similar to ffs() except + // that it's 0-indexed. + static int FindLSBSetNonZero(uint32_t n); + + static int FindLSBSetNonZero64(uint64_t n); + + private: + // No copying + Bits(const Bits&); + void operator=(const Bits&); +}; + +#if defined(HAVE_BUILTIN_CTZ) + +inline int Bits::Log2FloorNonZero(uint32_t n) { + assert(n != 0); + // (31 ^ x) is equivalent to (31 - x) for x in [0, 31]. An easy proof + // represents subtraction in base 2 and observes that there's no carry. + // + // GCC and Clang represent __builtin_clz on x86 as 31 ^ _bit_scan_reverse(x). + // Using "31 ^" here instead of "31 -" allows the optimizer to strip the + // function body down to _bit_scan_reverse(x). + return 31 ^ __builtin_clz(n); +} + +inline int Bits::Log2Floor(uint32_t n) { + return (n == 0) ? -1 : Bits::Log2FloorNonZero(n); +} + +inline int Bits::FindLSBSetNonZero(uint32_t n) { + assert(n != 0); + return __builtin_ctz(n); +} + +#elif defined(_MSC_VER) + +inline int Bits::Log2FloorNonZero(uint32_t n) { + assert(n != 0); + // NOLINTNEXTLINE(runtime/int): The MSVC intrinsic demands unsigned long. + unsigned long where; + _BitScanReverse(&where, n); + return static_cast(where); +} + +inline int Bits::Log2Floor(uint32_t n) { + // NOLINTNEXTLINE(runtime/int): The MSVC intrinsic demands unsigned long. + unsigned long where; + if (_BitScanReverse(&where, n)) + return static_cast(where); + return -1; +} + +inline int Bits::FindLSBSetNonZero(uint32_t n) { + assert(n != 0); + // NOLINTNEXTLINE(runtime/int): The MSVC intrinsic demands unsigned long. + unsigned long where; + if (_BitScanForward(&where, n)) + return static_cast(where); + return 32; +} + +#else // Portable versions. + +inline int Bits::Log2FloorNonZero(uint32_t n) { + assert(n != 0); + + int log = 0; + uint32_t value = n; + for (int i = 4; i >= 0; --i) { + int shift = (1 << i); + uint32_t x = value >> shift; + if (x != 0) { + value = x; + log += shift; + } + } + assert(value == 1); + return log; +} + +inline int Bits::Log2Floor(uint32_t n) { + return (n == 0) ? -1 : Bits::Log2FloorNonZero(n); +} + +inline int Bits::FindLSBSetNonZero(uint32_t n) { + assert(n != 0); + + int rc = 31; + for (int i = 4, shift = 1 << 4; i >= 0; --i) { + const uint32_t x = n << shift; + if (x != 0) { + n = x; + rc -= shift; + } + shift >>= 1; + } + return rc; +} + +#endif // End portable versions. + +#if defined(HAVE_BUILTIN_CTZ) + +inline int Bits::FindLSBSetNonZero64(uint64_t n) { + assert(n != 0); + return __builtin_ctzll(n); +} + +#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) +// _BitScanForward64() is only available on x64 and ARM64. + +inline int Bits::FindLSBSetNonZero64(uint64_t n) { + assert(n != 0); + // NOLINTNEXTLINE(runtime/int): The MSVC intrinsic demands unsigned long. + unsigned long where; + if (_BitScanForward64(&where, n)) + return static_cast(where); + return 64; +} + +#else // Portable version. + +// FindLSBSetNonZero64() is defined in terms of FindLSBSetNonZero(). +inline int Bits::FindLSBSetNonZero64(uint64_t n) { + assert(n != 0); + + const uint32_t bottombits = static_cast(n); + if (bottombits == 0) { + // Bottom bits are zero, so scan the top bits. + return 32 + FindLSBSetNonZero(static_cast(n >> 32)); + } else { + return FindLSBSetNonZero(bottombits); + } +} + +#endif // End portable version. + +// Variable-length integer encoding. +class Varint { + public: + // Maximum lengths of varint encoding of uint32_t. + static const int kMax32 = 5; + + // Attempts to parse a varint32 from a prefix of the bytes in [ptr,limit-1]. + // Never reads a character at or beyond limit. If a valid/terminated varint32 + // was found in the range, stores it in *OUTPUT and returns a pointer just + // past the last byte of the varint32. Else returns NULL. On success, + // "result <= limit". + static const char* Parse32WithLimit(const char* ptr, const char* limit, + uint32_t* OUTPUT); + + // REQUIRES "ptr" points to a buffer of length sufficient to hold "v". + // EFFECTS Encodes "v" into "ptr" and returns a pointer to the + // byte just past the last encoded byte. + static char* Encode32(char* ptr, uint32_t v); + + // EFFECTS Appends the varint representation of "value" to "*s". + static void Append32(std::string* s, uint32_t value); +}; + +inline const char* Varint::Parse32WithLimit(const char* p, + const char* l, + uint32_t* OUTPUT) { + const unsigned char* ptr = reinterpret_cast(p); + const unsigned char* limit = reinterpret_cast(l); + uint32_t b, result; + if (ptr >= limit) return NULL; + b = *(ptr++); result = b & 127; if (b < 128) goto done; + if (ptr >= limit) return NULL; + b = *(ptr++); result |= (b & 127) << 7; if (b < 128) goto done; + if (ptr >= limit) return NULL; + b = *(ptr++); result |= (b & 127) << 14; if (b < 128) goto done; + if (ptr >= limit) return NULL; + b = *(ptr++); result |= (b & 127) << 21; if (b < 128) goto done; + if (ptr >= limit) return NULL; + b = *(ptr++); result |= (b & 127) << 28; if (b < 16) goto done; + return NULL; // Value is too long to be a varint32 + done: + *OUTPUT = result; + return reinterpret_cast(ptr); +} + +inline char* Varint::Encode32(char* sptr, uint32_t v) { + // Operate on characters as unsigneds + uint8_t* ptr = reinterpret_cast(sptr); + static const uint8_t B = 128; + if (v < (1 << 7)) { + *(ptr++) = static_cast(v); + } else if (v < (1 << 14)) { + *(ptr++) = static_cast(v | B); + *(ptr++) = static_cast(v >> 7); + } else if (v < (1 << 21)) { + *(ptr++) = static_cast(v | B); + *(ptr++) = static_cast((v >> 7) | B); + *(ptr++) = static_cast(v >> 14); + } else if (v < (1 << 28)) { + *(ptr++) = static_cast(v | B); + *(ptr++) = static_cast((v >> 7) | B); + *(ptr++) = static_cast((v >> 14) | B); + *(ptr++) = static_cast(v >> 21); + } else { + *(ptr++) = static_cast(v | B); + *(ptr++) = static_cast((v>>7) | B); + *(ptr++) = static_cast((v>>14) | B); + *(ptr++) = static_cast((v>>21) | B); + *(ptr++) = static_cast(v >> 28); + } + return reinterpret_cast(ptr); +} + +// If you know the internal layout of the std::string in use, you can +// replace this function with one that resizes the string without +// filling the new space with zeros (if applicable) -- +// it will be non-portable but faster. +inline void STLStringResizeUninitialized(std::string* s, size_t new_size) { + s->resize(new_size); +} + +// Return a mutable char* pointing to a string's internal buffer, +// which may not be null-terminated. Writing through this pointer will +// modify the string. +// +// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the +// next call to a string method that invalidates iterators. +// +// As of 2006-04, there is no standard-blessed way of getting a +// mutable reference to a string's internal buffer. However, issue 530 +// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-defects.html#530) +// proposes this as the method. It will officially be part of the standard +// for C++0x. This should already work on all current implementations. +inline char* string_as_array(std::string* str) { + return str->empty() ? NULL : &*str->begin(); +} + +} // namespace snappy + +#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_INTERNAL_H_ diff --git a/external/snappy-1.1.3/include/snappy/snappy-stubs-public.h b/external/snappy-1.1.9/snappy-stubs-public.h.in similarity index 71% rename from external/snappy-1.1.3/include/snappy/snappy-stubs-public.h rename to external/snappy-1.1.9/snappy-stubs-public.h.in index fb376e7..02947fa 100644 --- a/external/snappy-1.1.3/include/snappy/snappy-stubs-public.h +++ b/external/snappy-1.1.9/snappy-stubs-public.h.in @@ -1,5 +1,4 @@ // Copyright 2011 Google Inc. All Rights Reserved. -// Author: sesse@google.com (Steinar H. Gunderson) // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -36,67 +35,28 @@ #ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ #define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ -#if 1 -#include -#endif +#include -#if 1 -#include -#endif - -#if defined(_MSC_VER) -#include -typedef SSIZE_T ssize_t; -#endif - -#if 0 +#if ${HAVE_SYS_UIO_H_01} // HAVE_SYS_UIO_H #include -#endif +#endif // HAVE_SYS_UIO_H -#define SNAPPY_MAJOR 1 -#define SNAPPY_MINOR 1 -#define SNAPPY_PATCHLEVEL 3 +#define SNAPPY_MAJOR ${PROJECT_VERSION_MAJOR} +#define SNAPPY_MINOR ${PROJECT_VERSION_MINOR} +#define SNAPPY_PATCHLEVEL ${PROJECT_VERSION_PATCH} #define SNAPPY_VERSION \ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) -#include - namespace snappy { -#if 1 -typedef int8_t int8; -typedef uint8_t uint8; -typedef int16_t int16; -typedef uint16_t uint16; -typedef int32_t int32; -typedef uint32_t uint32; -typedef int64_t int64; -typedef uint64_t uint64; -#else -typedef signed char int8; -typedef unsigned char uint8; -typedef short int16; -typedef unsigned short uint16; -typedef int int32; -typedef unsigned int uint32; -typedef long long int64; -typedef unsigned long long uint64; -#endif - -typedef std::string string; - -#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - void operator=(const TypeName&) - -#if !0 +#if !${HAVE_SYS_UIO_H_01} // !HAVE_SYS_UIO_H // Windows does not have an iovec type, yet the concept is universally useful. // It is simple to define it ourselves, so we put it inside our own namespace. struct iovec { - void* iov_base; - size_t iov_len; + void* iov_base; + size_t iov_len; }; -#endif +#endif // !HAVE_SYS_UIO_H } // namespace snappy diff --git a/external/snappy-1.1.9/snappy-test.cc b/external/snappy-1.1.9/snappy-test.cc new file mode 100644 index 0000000..7eb490a --- /dev/null +++ b/external/snappy-1.1.9/snappy-test.cc @@ -0,0 +1,503 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various stubs for the unit tests for the open-source version of Snappy. + +#include "snappy-test.h" + +#include +#include +#include +#include +#include +#include + +namespace file { + +OptionsStub::OptionsStub() = default; +OptionsStub::~OptionsStub() = default; + +const OptionsStub &Defaults() { + static OptionsStub defaults; + return defaults; +} + +StatusStub::StatusStub() = default; +StatusStub::StatusStub(const StatusStub &) = default; +StatusStub &StatusStub::operator=(const StatusStub &) = default; +StatusStub::~StatusStub() = default; + +bool StatusStub::ok() { return true; } + +StatusStub GetContents(const std::string &filename, std::string *output, + const OptionsStub & /* options */) { + std::FILE *fp = std::fopen(filename.c_str(), "rb"); + if (fp == nullptr) { + std::perror(filename.c_str()); + std::exit(1); + } + + output->clear(); + while (!std::feof(fp)) { + char buffer[4096]; + size_t bytes_read = std::fread(buffer, 1, sizeof(buffer), fp); + if (bytes_read == 0 && std::ferror(fp)) { + std::perror("fread"); + std::exit(1); + } + output->append(buffer, bytes_read); + } + + std::fclose(fp); + return StatusStub(); +} + +StatusStub SetContents(const std::string &file_name, const std::string &content, + const OptionsStub & /* options */) { + std::FILE *fp = std::fopen(file_name.c_str(), "wb"); + if (fp == nullptr) { + std::perror(file_name.c_str()); + std::exit(1); + } + + size_t bytes_written = std::fwrite(content.data(), 1, content.size(), fp); + if (bytes_written != content.size()) { + std::perror("fwrite"); + std::exit(1); + } + + std::fclose(fp); + return StatusStub(); +} + +} // namespace file + +namespace snappy { + +std::string ReadTestDataFile(const std::string& base, size_t size_limit) { + std::string contents; + const char* srcdir = getenv("srcdir"); // This is set by Automake. + std::string prefix; + if (srcdir) { + prefix = std::string(srcdir) + "/"; + } + file::GetContents(prefix + "testdata/" + base, &contents, file::Defaults() + ).ok(); + if (size_limit > 0) { + contents = contents.substr(0, size_limit); + } + return contents; +} + +std::string StrFormat(const char* format, ...) { + char buffer[4096]; + std::va_list ap; + va_start(ap, format); + std::vsnprintf(buffer, sizeof(buffer), format, ap); + va_end(ap); + return buffer; +} + +LogMessage::~LogMessage() { std::cerr << std::endl; } + +LogMessage &LogMessage::operator<<(const std::string &message) { + std::cerr << message; + return *this; +} + +LogMessage &LogMessage::operator<<(int number) { + std::cerr << number; + return *this; +} + +#ifdef _MSC_VER +// ~LogMessageCrash calls std::abort() and therefore never exits. This is by +// design, so temporarily disable warning C4722. +#pragma warning(push) +#pragma warning(disable : 4722) +#endif + +LogMessageCrash::~LogMessageCrash() { + std::cerr << std::endl; + std::abort(); +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#ifdef HAVE_LIBZ + +ZLib::ZLib() + : comp_init_(false), + uncomp_init_(false) { + Reinit(); +} + +ZLib::~ZLib() { + if (comp_init_) { deflateEnd(&comp_stream_); } + if (uncomp_init_) { inflateEnd(&uncomp_stream_); } +} + +void ZLib::Reinit() { + compression_level_ = Z_DEFAULT_COMPRESSION; + window_bits_ = MAX_WBITS; + mem_level_ = 8; // DEF_MEM_LEVEL + if (comp_init_) { + deflateEnd(&comp_stream_); + comp_init_ = false; + } + if (uncomp_init_) { + inflateEnd(&uncomp_stream_); + uncomp_init_ = false; + } + first_chunk_ = true; +} + +void ZLib::Reset() { + first_chunk_ = true; +} + +// --------- COMPRESS MODE + +// Initialization method to be called if we hit an error while +// compressing. On hitting an error, call this method before returning +// the error. +void ZLib::CompressErrorInit() { + deflateEnd(&comp_stream_); + comp_init_ = false; + Reset(); +} + +int ZLib::DeflateInit() { + return deflateInit2(&comp_stream_, + compression_level_, + Z_DEFLATED, + window_bits_, + mem_level_, + Z_DEFAULT_STRATEGY); +} + +int ZLib::CompressInit(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen) { + int err; + + comp_stream_.next_in = (Bytef*)source; + comp_stream_.avail_in = (uInt)*sourceLen; + if ((uLong)comp_stream_.avail_in != *sourceLen) return Z_BUF_ERROR; + comp_stream_.next_out = dest; + comp_stream_.avail_out = (uInt)*destLen; + if ((uLong)comp_stream_.avail_out != *destLen) return Z_BUF_ERROR; + + if ( !first_chunk_ ) // only need to set up stream the first time through + return Z_OK; + + if (comp_init_) { // we've already initted it + err = deflateReset(&comp_stream_); + if (err != Z_OK) { + LOG(WARNING) << "ERROR: Can't reset compress object; creating a new one"; + deflateEnd(&comp_stream_); + comp_init_ = false; + } + } + if (!comp_init_) { // first use + comp_stream_.zalloc = (alloc_func)0; + comp_stream_.zfree = (free_func)0; + comp_stream_.opaque = (voidpf)0; + err = DeflateInit(); + if (err != Z_OK) return err; + comp_init_ = true; + } + return Z_OK; +} + +// In a perfect world we'd always have the full buffer to compress +// when the time came, and we could just call Compress(). Alas, we +// want to do chunked compression on our webserver. In this +// application, we compress the header, send it off, then compress the +// results, send them off, then compress the footer. Thus we need to +// use the chunked compression features of zlib. +int ZLib::CompressAtMostOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen, + int flush_mode) { // Z_FULL_FLUSH or Z_FINISH + int err; + + if ( (err=CompressInit(dest, destLen, source, sourceLen)) != Z_OK ) + return err; + + // This is used to figure out how many bytes we wrote *this chunk* + int compressed_size = comp_stream_.total_out; + + // Some setup happens only for the first chunk we compress in a run + if ( first_chunk_ ) { + first_chunk_ = false; + } + + // flush_mode is Z_FINISH for all mode, Z_SYNC_FLUSH for incremental + // compression. + err = deflate(&comp_stream_, flush_mode); + + *sourceLen = comp_stream_.avail_in; + + if ((err == Z_STREAM_END || err == Z_OK) + && comp_stream_.avail_in == 0 + && comp_stream_.avail_out != 0 ) { + // we processed everything ok and the output buffer was large enough. + ; + } else if (err == Z_STREAM_END && comp_stream_.avail_in > 0) { + return Z_BUF_ERROR; // should never happen + } else if (err != Z_OK && err != Z_STREAM_END && err != Z_BUF_ERROR) { + // an error happened + CompressErrorInit(); + return err; + } else if (comp_stream_.avail_out == 0) { // not enough space + err = Z_BUF_ERROR; + } + + assert(err == Z_OK || err == Z_STREAM_END || err == Z_BUF_ERROR); + if (err == Z_STREAM_END) + err = Z_OK; + + // update the crc and other metadata + compressed_size = comp_stream_.total_out - compressed_size; // delta + *destLen = compressed_size; + + return err; +} + +int ZLib::CompressChunkOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int flush_mode) { // Z_FULL_FLUSH or Z_FINISH + const int ret = + CompressAtMostOrAll(dest, destLen, source, &sourceLen, flush_mode); + if (ret == Z_BUF_ERROR) + CompressErrorInit(); + return ret; +} + +// This routine only initializes the compression stream once. Thereafter, it +// just does a deflateReset on the stream, which should be faster. +int ZLib::Compress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen) { + int err; + if ( (err=CompressChunkOrAll(dest, destLen, source, sourceLen, + Z_FINISH)) != Z_OK ) + return err; + Reset(); // reset for next call to Compress + + return Z_OK; +} + + +// --------- UNCOMPRESS MODE + +int ZLib::InflateInit() { + return inflateInit2(&uncomp_stream_, MAX_WBITS); +} + +// Initialization method to be called if we hit an error while +// uncompressing. On hitting an error, call this method before +// returning the error. +void ZLib::UncompressErrorInit() { + inflateEnd(&uncomp_stream_); + uncomp_init_ = false; + Reset(); +} + +int ZLib::UncompressInit(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen) { + int err; + + uncomp_stream_.next_in = (Bytef*)source; + uncomp_stream_.avail_in = (uInt)*sourceLen; + // Check for source > 64K on 16-bit machine: + if ((uLong)uncomp_stream_.avail_in != *sourceLen) return Z_BUF_ERROR; + + uncomp_stream_.next_out = dest; + uncomp_stream_.avail_out = (uInt)*destLen; + if ((uLong)uncomp_stream_.avail_out != *destLen) return Z_BUF_ERROR; + + if ( !first_chunk_ ) // only need to set up stream the first time through + return Z_OK; + + if (uncomp_init_) { // we've already initted it + err = inflateReset(&uncomp_stream_); + if (err != Z_OK) { + LOG(WARNING) + << "ERROR: Can't reset uncompress object; creating a new one"; + UncompressErrorInit(); + } + } + if (!uncomp_init_) { + uncomp_stream_.zalloc = (alloc_func)0; + uncomp_stream_.zfree = (free_func)0; + uncomp_stream_.opaque = (voidpf)0; + err = InflateInit(); + if (err != Z_OK) return err; + uncomp_init_ = true; + } + return Z_OK; +} + +// If you compressed your data a chunk at a time, with CompressChunk, +// you can uncompress it a chunk at a time with UncompressChunk. +// Only difference bewteen chunked and unchunked uncompression +// is the flush mode we use: Z_SYNC_FLUSH (chunked) or Z_FINISH (unchunked). +int ZLib::UncompressAtMostOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen, + int flush_mode) { // Z_SYNC_FLUSH or Z_FINISH + int err = Z_OK; + + if ( (err=UncompressInit(dest, destLen, source, sourceLen)) != Z_OK ) { + LOG(WARNING) << "UncompressInit: Error: " << err << " SourceLen: " + << *sourceLen; + return err; + } + + // This is used to figure out how many output bytes we wrote *this chunk*: + const uLong old_total_out = uncomp_stream_.total_out; + + // This is used to figure out how many input bytes we read *this chunk*: + const uLong old_total_in = uncomp_stream_.total_in; + + // Some setup happens only for the first chunk we compress in a run + if ( first_chunk_ ) { + first_chunk_ = false; // so we don't do this again + + // For the first chunk *only* (to avoid infinite troubles), we let + // there be no actual data to uncompress. This sometimes triggers + // when the input is only the gzip header, say. + if ( *sourceLen == 0 ) { + *destLen = 0; + return Z_OK; + } + } + + // We'll uncompress as much as we can. If we end OK great, otherwise + // if we get an error that seems to be the gzip footer, we store the + // gzip footer and return OK, otherwise we return the error. + + // flush_mode is Z_SYNC_FLUSH for chunked mode, Z_FINISH for all mode. + err = inflate(&uncomp_stream_, flush_mode); + + // Figure out how many bytes of the input zlib slurped up: + const uLong bytes_read = uncomp_stream_.total_in - old_total_in; + CHECK_LE(source + bytes_read, source + *sourceLen); + *sourceLen = uncomp_stream_.avail_in; + + if ((err == Z_STREAM_END || err == Z_OK) // everything went ok + && uncomp_stream_.avail_in == 0) { // and we read it all + ; + } else if (err == Z_STREAM_END && uncomp_stream_.avail_in > 0) { + LOG(WARNING) + << "UncompressChunkOrAll: Received some extra data, bytes total: " + << uncomp_stream_.avail_in << " bytes: " + << std::string(reinterpret_cast(uncomp_stream_.next_in), + std::min(int(uncomp_stream_.avail_in), 20)); + UncompressErrorInit(); + return Z_DATA_ERROR; // what's the extra data for? + } else if (err != Z_OK && err != Z_STREAM_END && err != Z_BUF_ERROR) { + // an error happened + LOG(WARNING) << "UncompressChunkOrAll: Error: " << err + << " avail_out: " << uncomp_stream_.avail_out; + UncompressErrorInit(); + return err; + } else if (uncomp_stream_.avail_out == 0) { + err = Z_BUF_ERROR; + } + + assert(err == Z_OK || err == Z_BUF_ERROR || err == Z_STREAM_END); + if (err == Z_STREAM_END) + err = Z_OK; + + *destLen = uncomp_stream_.total_out - old_total_out; // size for this call + + return err; +} + +int ZLib::UncompressChunkOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int flush_mode) { // Z_SYNC_FLUSH or Z_FINISH + const int ret = + UncompressAtMostOrAll(dest, destLen, source, &sourceLen, flush_mode); + if (ret == Z_BUF_ERROR) + UncompressErrorInit(); + return ret; +} + +int ZLib::UncompressAtMost(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen) { + return UncompressAtMostOrAll(dest, destLen, source, sourceLen, Z_SYNC_FLUSH); +} + +// We make sure we've uncompressed everything, that is, the current +// uncompress stream is at a compressed-buffer-EOF boundary. In gzip +// mode, we also check the gzip footer to make sure we pass the gzip +// consistency checks. We RETURN true iff both types of checks pass. +bool ZLib::UncompressChunkDone() { + assert(!first_chunk_ && uncomp_init_); + // Make sure we're at the end-of-compressed-data point. This means + // if we call inflate with Z_FINISH we won't consume any input or + // write any output + Bytef dummyin, dummyout; + uLongf dummylen = 0; + if ( UncompressChunkOrAll(&dummyout, &dummylen, &dummyin, 0, Z_FINISH) + != Z_OK ) { + return false; + } + + // Make sure that when we exit, we can start a new round of chunks later + Reset(); + + return true; +} + +// Uncompresses the source buffer into the destination buffer. +// The destination buffer must be long enough to hold the entire +// decompressed contents. +// +// We only initialize the uncomp_stream once. Thereafter, we use +// inflateReset, which should be faster. +// +// Returns Z_OK on success, otherwise, it returns a zlib error code. +int ZLib::Uncompress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen) { + int err; + if ( (err=UncompressChunkOrAll(dest, destLen, source, sourceLen, + Z_FINISH)) != Z_OK ) { + Reset(); // let us try to compress again + return err; + } + if ( !UncompressChunkDone() ) // calls Reset() + return Z_DATA_ERROR; + return Z_OK; // stream_end is ok +} + +#endif // HAVE_LIBZ + +} // namespace snappy diff --git a/external/snappy-1.1.9/snappy-test.h b/external/snappy-1.1.9/snappy-test.h new file mode 100644 index 0000000..f80d343 --- /dev/null +++ b/external/snappy-1.1.9/snappy-test.h @@ -0,0 +1,342 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Various stubs for the unit tests for the open-source version of Snappy. + +#ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_ +#define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "snappy-stubs-internal.h" + +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#ifdef HAVE_WINDOWS_H +// Needed to be able to use std::max without workarounds in the source code. +// https://support.microsoft.com/en-us/help/143208/prb-using-stl-in-windows-program-can-cause-min-max-conflicts +#define NOMINMAX +#include +#endif + +#define InitGoogle(argv0, argc, argv, remove_flags) ((void)(0)) + +#ifdef HAVE_LIBZ +#include "zlib.h" +#endif + +#ifdef HAVE_LIBLZO2 +#include "lzo/lzo1x.h" +#endif + +#ifdef HAVE_LIBLZ4 +#include "lz4.h" +#endif + +namespace file { + +// Stubs the class file::Options. +// +// This class should not be instantiated explicitly. It should only be used by +// passing file::Defaults() to file::GetContents() / file::SetContents(). +class OptionsStub { + public: + OptionsStub(); + OptionsStub(const OptionsStub &) = delete; + OptionsStub &operator=(const OptionsStub &) = delete; + ~OptionsStub(); +}; + +const OptionsStub &Defaults(); + +// Stubs the class absl::Status. +// +// This class should not be instantiated explicitly. It should only be used by +// passing the result of file::GetContents() / file::SetContents() to +// CHECK_OK(). +class StatusStub { + public: + StatusStub(); + StatusStub(const StatusStub &); + StatusStub &operator=(const StatusStub &); + ~StatusStub(); + + bool ok(); +}; + +StatusStub GetContents(const std::string &file_name, std::string *output, + const OptionsStub & /* options */); + +StatusStub SetContents(const std::string &file_name, const std::string &content, + const OptionsStub & /* options */); + +} // namespace file + +namespace snappy { + +#define FLAGS_test_random_seed 301 + +std::string ReadTestDataFile(const std::string& base, size_t size_limit); + +// A std::sprintf() variant that returns a std::string. +// Not safe for general use due to truncation issues. +std::string StrFormat(const char* format, ...); + +// A wall-time clock. This stub is not super-accurate, nor resistant to the +// system time changing. +class CycleTimer { + public: + inline CycleTimer() : real_time_us_(0) {} + inline ~CycleTimer() = default; + + inline void Start() { +#ifdef WIN32 + QueryPerformanceCounter(&start_); +#else + ::gettimeofday(&start_, nullptr); +#endif + } + + inline void Stop() { +#ifdef WIN32 + LARGE_INTEGER stop; + LARGE_INTEGER frequency; + QueryPerformanceCounter(&stop); + QueryPerformanceFrequency(&frequency); + + double elapsed = static_cast(stop.QuadPart - start_.QuadPart) / + frequency.QuadPart; + real_time_us_ += elapsed * 1e6 + 0.5; +#else + struct ::timeval stop; + ::gettimeofday(&stop, nullptr); + + real_time_us_ += 1000000 * (stop.tv_sec - start_.tv_sec); + real_time_us_ += (stop.tv_usec - start_.tv_usec); +#endif + } + + inline double Get() { return real_time_us_ * 1e-6; } + + private: + int64_t real_time_us_; +#ifdef WIN32 + LARGE_INTEGER start_; +#else + struct ::timeval start_; +#endif +}; + +// Logging. + +class LogMessage { + public: + inline LogMessage() = default; + ~LogMessage(); + + LogMessage &operator<<(const std::string &message); + LogMessage &operator<<(int number); +}; + +class LogMessageCrash : public LogMessage { + public: + inline LogMessageCrash() = default; + ~LogMessageCrash(); +}; + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". + +class LogMessageVoidify { + public: + inline LogMessageVoidify() = default; + inline ~LogMessageVoidify() = default; + + // This has to be an operator with a precedence lower than << but + // higher than ?: + inline void operator&(const LogMessage &) {} +}; + +// Asserts, both versions activated in debug mode only, +// and ones that are always active. + +#define CRASH_UNLESS(condition) \ + SNAPPY_PREDICT_TRUE(condition) \ + ? (void)0 \ + : snappy::LogMessageVoidify() & snappy::LogMessageCrash() + +#define LOG(level) LogMessage() +#define VLOG(level) \ + true ? (void)0 : snappy::LogMessageVoidify() & snappy::LogMessage() + +#define CHECK(cond) CRASH_UNLESS(cond) +#define CHECK_LE(a, b) CRASH_UNLESS((a) <= (b)) +#define CHECK_GE(a, b) CRASH_UNLESS((a) >= (b)) +#define CHECK_EQ(a, b) CRASH_UNLESS((a) == (b)) +#define CHECK_NE(a, b) CRASH_UNLESS((a) != (b)) +#define CHECK_LT(a, b) CRASH_UNLESS((a) < (b)) +#define CHECK_GT(a, b) CRASH_UNLESS((a) > (b)) +#define CHECK_OK(cond) (cond).ok() + +#ifdef HAVE_LIBZ + +// Object-oriented wrapper around zlib. +class ZLib { + public: + ZLib(); + ~ZLib(); + + // Wipe a ZLib object to a virgin state. This differs from Reset() + // in that it also breaks any state. + void Reinit(); + + // Call this to make a zlib buffer as good as new. Here's the only + // case where they differ: + // CompressChunk(a); CompressChunk(b); CompressChunkDone(); vs + // CompressChunk(a); Reset(); CompressChunk(b); CompressChunkDone(); + // You'll want to use Reset(), then, when you interrupt a compress + // (or uncompress) in the middle of a chunk and want to start over. + void Reset(); + + // According to the zlib manual, when you Compress, the destination + // buffer must have size at least src + .1%*src + 12. This function + // helps you calculate that. Augment this to account for a potential + // gzip header and footer, plus a few bytes of slack. + static int MinCompressbufSize(int uncompress_size) { + return uncompress_size + uncompress_size/1000 + 40; + } + + // Compresses the source buffer into the destination buffer. + // sourceLen is the byte length of the source buffer. + // Upon entry, destLen is the total size of the destination buffer, + // which must be of size at least MinCompressbufSize(sourceLen). + // Upon exit, destLen is the actual size of the compressed buffer. + // + // This function can be used to compress a whole file at once if the + // input file is mmap'ed. + // + // Returns Z_OK if success, Z_MEM_ERROR if there was not + // enough memory, Z_BUF_ERROR if there was not enough room in the + // output buffer. Note that if the output buffer is exactly the same + // size as the compressed result, we still return Z_BUF_ERROR. + // (check CL#1936076) + int Compress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); + + // Uncompresses the source buffer into the destination buffer. + // The destination buffer must be long enough to hold the entire + // decompressed contents. + // + // Returns Z_OK on success, otherwise, it returns a zlib error code. + int Uncompress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); + + // Uncompress data one chunk at a time -- ie you can call this + // more than once. To get this to work you need to call per-chunk + // and "done" routines. + // + // Returns Z_OK if success, Z_MEM_ERROR if there was not + // enough memory, Z_BUF_ERROR if there was not enough room in the + // output buffer. + + int UncompressAtMost(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); + + // Checks gzip footer information, as needed. Mostly this just + // makes sure the checksums match. Whenever you call this, it + // will assume the last 8 bytes from the previous UncompressChunk + // call are the footer. Returns true iff everything looks ok. + bool UncompressChunkDone(); + + private: + int InflateInit(); // sets up the zlib inflate structure + int DeflateInit(); // sets up the zlib deflate structure + + // These init the zlib data structures for compressing/uncompressing + int CompressInit(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); + int UncompressInit(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); + // Initialization method to be called if we hit an error while + // uncompressing. On hitting an error, call this method before + // returning the error. + void UncompressErrorInit(); + + // Helper function for Compress + int CompressChunkOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int flush_mode); + int CompressAtMostOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen, + int flush_mode); + + // Likewise for UncompressAndUncompressChunk + int UncompressChunkOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int flush_mode); + + int UncompressAtMostOrAll(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen, + int flush_mode); + + // Initialization method to be called if we hit an error while + // compressing. On hitting an error, call this method before + // returning the error. + void CompressErrorInit(); + + int compression_level_; // compression level + int window_bits_; // log base 2 of the window size used in compression + int mem_level_; // specifies the amount of memory to be used by + // compressor (1-9) + z_stream comp_stream_; // Zlib stream data structure + bool comp_init_; // True if we have initialized comp_stream_ + z_stream uncomp_stream_; // Zlib stream data structure + bool uncomp_init_; // True if we have initialized uncomp_stream_ + + // These are used only with chunked compression. + bool first_chunk_; // true if we need to emit headers with this chunk +}; + +#endif // HAVE_LIBZ + +} // namespace snappy + +#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_ diff --git a/external/snappy-1.1.9/snappy.cc b/external/snappy-1.1.9/snappy.cc new file mode 100644 index 0000000..79dc0e8 --- /dev/null +++ b/external/snappy-1.1.9/snappy.cc @@ -0,0 +1,2193 @@ +// Copyright 2005 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "snappy-internal.h" +#include "snappy-sinksource.h" +#include "snappy.h" + +#if !defined(SNAPPY_HAVE_SSSE3) +// __SSSE3__ is defined by GCC and Clang. Visual Studio doesn't target SIMD +// support between SSE2 and AVX (so SSSE3 instructions require AVX support), and +// defines __AVX__ when AVX support is available. +#if defined(__SSSE3__) || defined(__AVX__) +#define SNAPPY_HAVE_SSSE3 1 +#else +#define SNAPPY_HAVE_SSSE3 0 +#endif +#endif // !defined(SNAPPY_HAVE_SSSE3) + +#if !defined(SNAPPY_HAVE_BMI2) +// __BMI2__ is defined by GCC and Clang. Visual Studio doesn't target BMI2 +// specifically, but it does define __AVX2__ when AVX2 support is available. +// Fortunately, AVX2 was introduced in Haswell, just like BMI2. +// +// BMI2 is not defined as a subset of AVX2 (unlike SSSE3 and AVX above). So, +// GCC and Clang can build code with AVX2 enabled but BMI2 disabled, in which +// case issuing BMI2 instructions results in a compiler error. +#if defined(__BMI2__) || (defined(_MSC_VER) && defined(__AVX2__)) +#define SNAPPY_HAVE_BMI2 1 +#else +#define SNAPPY_HAVE_BMI2 0 +#endif +#endif // !defined(SNAPPY_HAVE_BMI2) + +#if SNAPPY_HAVE_SSSE3 +// Please do not replace with . or with headers that assume more +// advanced SSE versions without checking with all the OWNERS. +#include +#endif + +#if SNAPPY_HAVE_BMI2 +// Please do not replace with . or with headers that assume more +// advanced SSE versions without checking with all the OWNERS. +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace snappy { + +namespace { + +// The amount of slop bytes writers are using for unconditional copies. +constexpr int kSlopBytes = 64; + +using internal::char_table; +using internal::COPY_1_BYTE_OFFSET; +using internal::COPY_2_BYTE_OFFSET; +using internal::COPY_4_BYTE_OFFSET; +using internal::kMaximumTagLength; +using internal::LITERAL; + +// We translate the information encoded in a tag through a lookup table to a +// format that requires fewer instructions to decode. Effectively we store +// the length minus the tag part of the offset. The lowest significant byte +// thus stores the length. While total length - offset is given by +// entry - ExtractOffset(type). The nice thing is that the subtraction +// immediately sets the flags for the necessary check that offset >= length. +// This folds the cmp with sub. We engineer the long literals and copy-4 to +// always fail this check, so their presence doesn't affect the fast path. +// To prevent literals from triggering the guard against offset < length (offset +// does not apply to literals) the table is giving them a spurious offset of +// 256. +inline constexpr int16_t MakeEntry(int16_t len, int16_t offset) { + return len - (offset << 8); +} + +inline constexpr int16_t LengthMinusOffset(int data, int type) { + return type == 3 ? 0xFF // copy-4 (or type == 3) + : type == 2 ? MakeEntry(data + 1, 0) // copy-2 + : type == 1 ? MakeEntry((data & 7) + 4, data >> 3) // copy-1 + : data < 60 ? MakeEntry(data + 1, 1) // note spurious offset. + : 0xFF; // long literal +} + +inline constexpr int16_t LengthMinusOffset(uint8_t tag) { + return LengthMinusOffset(tag >> 2, tag & 3); +} + +template +struct index_sequence {}; + +template +struct make_index_sequence : make_index_sequence {}; + +template +struct make_index_sequence<0, Is...> : index_sequence {}; + +template +constexpr std::array MakeTable(index_sequence) { + return std::array{LengthMinusOffset(seq)...}; +} + +// We maximally co-locate the two tables so that only one register needs to be +// reserved for the table address. +struct { + alignas(64) const std::array length_minus_offset; + uint32_t extract_masks[4]; // Used for extracting offset based on tag type. +} table = {MakeTable(make_index_sequence<256>{}), {0, 0xFF, 0xFFFF, 0}}; + +// Any hash function will produce a valid compressed bitstream, but a good +// hash function reduces the number of collisions and thus yields better +// compression for compressible input, and more speed for incompressible +// input. Of course, it doesn't hurt if the hash function is reasonably fast +// either, as it gets called a lot. +inline uint32_t HashBytes(uint32_t bytes, uint32_t mask) { + constexpr uint32_t kMagic = 0x1e35a7bd; + return ((kMagic * bytes) >> (32 - kMaxHashTableBits)) & mask; +} + +} // namespace + +size_t MaxCompressedLength(size_t source_bytes) { + // Compressed data can be defined as: + // compressed := item* literal* + // item := literal* copy + // + // The trailing literal sequence has a space blowup of at most 62/60 + // since a literal of length 60 needs one tag byte + one extra byte + // for length information. + // + // Item blowup is trickier to measure. Suppose the "copy" op copies + // 4 bytes of data. Because of a special check in the encoding code, + // we produce a 4-byte copy only if the offset is < 65536. Therefore + // the copy op takes 3 bytes to encode, and this type of item leads + // to at most the 62/60 blowup for representing literals. + // + // Suppose the "copy" op copies 5 bytes of data. If the offset is big + // enough, it will take 5 bytes to encode the copy op. Therefore the + // worst case here is a one-byte literal followed by a five-byte copy. + // I.e., 6 bytes of input turn into 7 bytes of "compressed" data. + // + // This last factor dominates the blowup, so the final estimate is: + return 32 + source_bytes + source_bytes / 6; +} + +namespace { + +void UnalignedCopy64(const void* src, void* dst) { + char tmp[8]; + std::memcpy(tmp, src, 8); + std::memcpy(dst, tmp, 8); +} + +void UnalignedCopy128(const void* src, void* dst) { + // std::memcpy() gets vectorized when the appropriate compiler options are + // used. For example, x86 compilers targeting SSE2+ will optimize to an SSE2 + // load and store. + char tmp[16]; + std::memcpy(tmp, src, 16); + std::memcpy(dst, tmp, 16); +} + +template +inline void ConditionalUnalignedCopy128(const char* src, char* dst) { + if (use_16bytes_chunk) { + UnalignedCopy128(src, dst); + } else { + UnalignedCopy64(src, dst); + UnalignedCopy64(src + 8, dst + 8); + } +} + +// Copy [src, src+(op_limit-op)) to [op, (op_limit-op)) a byte at a time. Used +// for handling COPY operations where the input and output regions may overlap. +// For example, suppose: +// src == "ab" +// op == src + 2 +// op_limit == op + 20 +// After IncrementalCopySlow(src, op, op_limit), the result will have eleven +// copies of "ab" +// ababababababababababab +// Note that this does not match the semantics of either std::memcpy() or +// std::memmove(). +inline char* IncrementalCopySlow(const char* src, char* op, + char* const op_limit) { + // TODO: Remove pragma when LLVM is aware this + // function is only called in cold regions and when cold regions don't get + // vectorized or unrolled. +#ifdef __clang__ +#pragma clang loop unroll(disable) +#endif + while (op < op_limit) { + *op++ = *src++; + } + return op_limit; +} + +#if SNAPPY_HAVE_SSSE3 + +// Computes the bytes for shuffle control mask (please read comments on +// 'pattern_generation_masks' as well) for the given index_offset and +// pattern_size. For example, when the 'offset' is 6, it will generate a +// repeating pattern of size 6. So, the first 16 byte indexes will correspond to +// the pattern-bytes {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3} and the +// next 16 byte indexes will correspond to the pattern-bytes {4, 5, 0, 1, 2, 3, +// 4, 5, 0, 1, 2, 3, 4, 5, 0, 1}. These byte index sequences are generated by +// calling MakePatternMaskBytes(0, 6, index_sequence<16>()) and +// MakePatternMaskBytes(16, 6, index_sequence<16>()) respectively. +template +inline constexpr std::array MakePatternMaskBytes( + int index_offset, int pattern_size, index_sequence) { + return {static_cast((index_offset + indexes) % pattern_size)...}; +} + +// Computes the shuffle control mask bytes array for given pattern-sizes and +// returns an array. +template +inline constexpr std::array, + sizeof...(pattern_sizes_minus_one)> +MakePatternMaskBytesTable(int index_offset, + index_sequence) { + return {MakePatternMaskBytes( + index_offset, pattern_sizes_minus_one + 1, + make_index_sequence())...}; +} + +// This is an array of shuffle control masks that can be used as the source +// operand for PSHUFB to permute the contents of the destination XMM register +// into a repeating byte pattern. +alignas(16) constexpr std::array, + 16> pattern_generation_masks = + MakePatternMaskBytesTable( + /*index_offset=*/0, + /*pattern_sizes_minus_one=*/make_index_sequence<16>()); + +// Similar to 'pattern_generation_masks', this table is used to "rotate" the +// pattern so that we can copy the *next 16 bytes* consistent with the pattern. +// Basically, pattern_reshuffle_masks is a continuation of +// pattern_generation_masks. It follows that, pattern_reshuffle_masks is same as +// pattern_generation_masks for offsets 1, 2, 4, 8 and 16. +alignas(16) constexpr std::array, + 16> pattern_reshuffle_masks = + MakePatternMaskBytesTable( + /*index_offset=*/16, + /*pattern_sizes_minus_one=*/make_index_sequence<16>()); + +SNAPPY_ATTRIBUTE_ALWAYS_INLINE +static inline __m128i LoadPattern(const char* src, const size_t pattern_size) { + __m128i generation_mask = _mm_load_si128(reinterpret_cast( + pattern_generation_masks[pattern_size - 1].data())); + // Uninitialized bytes are masked out by the shuffle mask. + // TODO: remove annotation and macro defs once MSan is fixed. + SNAPPY_ANNOTATE_MEMORY_IS_INITIALIZED(src + pattern_size, 16 - pattern_size); + return _mm_shuffle_epi8( + _mm_loadu_si128(reinterpret_cast(src)), generation_mask); +} + +SNAPPY_ATTRIBUTE_ALWAYS_INLINE +static inline std::pair<__m128i /* pattern */, __m128i /* reshuffle_mask */> +LoadPatternAndReshuffleMask(const char* src, const size_t pattern_size) { + __m128i pattern = LoadPattern(src, pattern_size); + + // This mask will generate the next 16 bytes in-place. Doing so enables us to + // write data by at most 4 _mm_storeu_si128. + // + // For example, suppose pattern is: abcdefabcdefabcd + // Shuffling with this mask will generate: efabcdefabcdefab + // Shuffling again will generate: cdefabcdefabcdef + __m128i reshuffle_mask = _mm_load_si128(reinterpret_cast( + pattern_reshuffle_masks[pattern_size - 1].data())); + return {pattern, reshuffle_mask}; +} + +#endif // SNAPPY_HAVE_SSSE3 + +// Fallback for when we need to copy while extending the pattern, for example +// copying 10 bytes from 3 positions back abc -> abcabcabcabca. +// +// REQUIRES: [dst - offset, dst + 64) is a valid address range. +SNAPPY_ATTRIBUTE_ALWAYS_INLINE +static inline bool Copy64BytesWithPatternExtension(char* dst, size_t offset) { +#if SNAPPY_HAVE_SSSE3 + if (SNAPPY_PREDICT_TRUE(offset <= 16)) { + switch (offset) { + case 0: + return false; + case 1: { + std::memset(dst, dst[-1], 64); + return true; + } + case 2: + case 4: + case 8: + case 16: { + __m128i pattern = LoadPattern(dst - offset, offset); + for (int i = 0; i < 4; i++) { + _mm_storeu_si128(reinterpret_cast<__m128i*>(dst + 16 * i), pattern); + } + return true; + } + default: { + auto pattern_and_reshuffle_mask = + LoadPatternAndReshuffleMask(dst - offset, offset); + __m128i pattern = pattern_and_reshuffle_mask.first; + __m128i reshuffle_mask = pattern_and_reshuffle_mask.second; + for (int i = 0; i < 4; i++) { + _mm_storeu_si128(reinterpret_cast<__m128i*>(dst + 16 * i), pattern); + pattern = _mm_shuffle_epi8(pattern, reshuffle_mask); + } + return true; + } + } + } +#else + if (SNAPPY_PREDICT_TRUE(offset < 16)) { + if (SNAPPY_PREDICT_FALSE(offset == 0)) return false; + // Extend the pattern to the first 16 bytes. + for (int i = 0; i < 16; i++) dst[i] = dst[i - offset]; + // Find a multiple of pattern >= 16. + static std::array pattern_sizes = []() { + std::array res; + for (int i = 1; i < 16; i++) res[i] = (16 / i + 1) * i; + return res; + }(); + offset = pattern_sizes[offset]; + for (int i = 1; i < 4; i++) { + std::memcpy(dst + i * 16, dst + i * 16 - offset, 16); + } + return true; + } +#endif // SNAPPY_HAVE_SSSE3 + + // Very rare. + for (int i = 0; i < 4; i++) { + std::memcpy(dst + i * 16, dst + i * 16 - offset, 16); + } + return true; +} + +// Copy [src, src+(op_limit-op)) to [op, op_limit) but faster than +// IncrementalCopySlow. buf_limit is the address past the end of the writable +// region of the buffer. +inline char* IncrementalCopy(const char* src, char* op, char* const op_limit, + char* const buf_limit) { +#if SNAPPY_HAVE_SSSE3 + constexpr int big_pattern_size_lower_bound = 16; +#else + constexpr int big_pattern_size_lower_bound = 8; +#endif + + // Terminology: + // + // slop = buf_limit - op + // pat = op - src + // len = op_limit - op + assert(src < op); + assert(op < op_limit); + assert(op_limit <= buf_limit); + // NOTE: The copy tags use 3 or 6 bits to store the copy length, so len <= 64. + assert(op_limit - op <= 64); + // NOTE: In practice the compressor always emits len >= 4, so it is ok to + // assume that to optimize this function, but this is not guaranteed by the + // compression format, so we have to also handle len < 4 in case the input + // does not satisfy these conditions. + + size_t pattern_size = op - src; + // The cases are split into different branches to allow the branch predictor, + // FDO, and static prediction hints to work better. For each input we list the + // ratio of invocations that match each condition. + // + // input slop < 16 pat < 8 len > 16 + // ------------------------------------------ + // html|html4|cp 0% 1.01% 27.73% + // urls 0% 0.88% 14.79% + // jpg 0% 64.29% 7.14% + // pdf 0% 2.56% 58.06% + // txt[1-4] 0% 0.23% 0.97% + // pb 0% 0.96% 13.88% + // bin 0.01% 22.27% 41.17% + // + // It is very rare that we don't have enough slop for doing block copies. It + // is also rare that we need to expand a pattern. Small patterns are common + // for incompressible formats and for those we are plenty fast already. + // Lengths are normally not greater than 16 but they vary depending on the + // input. In general if we always predict len <= 16 it would be an ok + // prediction. + // + // In order to be fast we want a pattern >= 16 bytes (or 8 bytes in non-SSE) + // and an unrolled loop copying 1x 16 bytes (or 2x 8 bytes in non-SSE) at a + // time. + + // Handle the uncommon case where pattern is less than 16 (or 8 in non-SSE) + // bytes. + if (pattern_size < big_pattern_size_lower_bound) { +#if SNAPPY_HAVE_SSSE3 + // Load the first eight bytes into an 128-bit XMM register, then use PSHUFB + // to permute the register's contents in-place into a repeating sequence of + // the first "pattern_size" bytes. + // For example, suppose: + // src == "abc" + // op == op + 3 + // After _mm_shuffle_epi8(), "pattern" will have five copies of "abc" + // followed by one byte of slop: abcabcabcabcabca. + // + // The non-SSE fallback implementation suffers from store-forwarding stalls + // because its loads and stores partly overlap. By expanding the pattern + // in-place, we avoid the penalty. + + // Typically, the op_limit is the gating factor so try to simplify the loop + // based on that. + if (SNAPPY_PREDICT_TRUE(op_limit <= buf_limit - 15)) { + auto pattern_and_reshuffle_mask = + LoadPatternAndReshuffleMask(src, pattern_size); + __m128i pattern = pattern_and_reshuffle_mask.first; + __m128i reshuffle_mask = pattern_and_reshuffle_mask.second; + + // There is at least one, and at most four 16-byte blocks. Writing four + // conditionals instead of a loop allows FDO to layout the code with + // respect to the actual probabilities of each length. + // TODO: Replace with loop with trip count hint. + _mm_storeu_si128(reinterpret_cast<__m128i*>(op), pattern); + + if (op + 16 < op_limit) { + pattern = _mm_shuffle_epi8(pattern, reshuffle_mask); + _mm_storeu_si128(reinterpret_cast<__m128i*>(op + 16), pattern); + } + if (op + 32 < op_limit) { + pattern = _mm_shuffle_epi8(pattern, reshuffle_mask); + _mm_storeu_si128(reinterpret_cast<__m128i*>(op + 32), pattern); + } + if (op + 48 < op_limit) { + pattern = _mm_shuffle_epi8(pattern, reshuffle_mask); + _mm_storeu_si128(reinterpret_cast<__m128i*>(op + 48), pattern); + } + return op_limit; + } + char* const op_end = buf_limit - 15; + if (SNAPPY_PREDICT_TRUE(op < op_end)) { + auto pattern_and_reshuffle_mask = + LoadPatternAndReshuffleMask(src, pattern_size); + __m128i pattern = pattern_and_reshuffle_mask.first; + __m128i reshuffle_mask = pattern_and_reshuffle_mask.second; + + // This code path is relatively cold however so we save code size + // by avoiding unrolling and vectorizing. + // + // TODO: Remove pragma when when cold regions don't get + // vectorized or unrolled. +#ifdef __clang__ +#pragma clang loop unroll(disable) +#endif + do { + _mm_storeu_si128(reinterpret_cast<__m128i*>(op), pattern); + pattern = _mm_shuffle_epi8(pattern, reshuffle_mask); + op += 16; + } while (SNAPPY_PREDICT_TRUE(op < op_end)); + } + return IncrementalCopySlow(op - pattern_size, op, op_limit); +#else // !SNAPPY_HAVE_SSSE3 + // If plenty of buffer space remains, expand the pattern to at least 8 + // bytes. The way the following loop is written, we need 8 bytes of buffer + // space if pattern_size >= 4, 11 bytes if pattern_size is 1 or 3, and 10 + // bytes if pattern_size is 2. Precisely encoding that is probably not + // worthwhile; instead, invoke the slow path if we cannot write 11 bytes + // (because 11 are required in the worst case). + if (SNAPPY_PREDICT_TRUE(op <= buf_limit - 11)) { + while (pattern_size < 8) { + UnalignedCopy64(src, op); + op += pattern_size; + pattern_size *= 2; + } + if (SNAPPY_PREDICT_TRUE(op >= op_limit)) return op_limit; + } else { + return IncrementalCopySlow(src, op, op_limit); + } +#endif // SNAPPY_HAVE_SSSE3 + } + assert(pattern_size >= big_pattern_size_lower_bound); + constexpr bool use_16bytes_chunk = big_pattern_size_lower_bound == 16; + + // Copy 1x 16 bytes (or 2x 8 bytes in non-SSE) at a time. Because op - src can + // be < 16 in non-SSE, a single UnalignedCopy128 might overwrite data in op. + // UnalignedCopy64 is safe because expanding the pattern to at least 8 bytes + // guarantees that op - src >= 8. + // + // Typically, the op_limit is the gating factor so try to simplify the loop + // based on that. + if (SNAPPY_PREDICT_TRUE(op_limit <= buf_limit - 15)) { + // There is at least one, and at most four 16-byte blocks. Writing four + // conditionals instead of a loop allows FDO to layout the code with respect + // to the actual probabilities of each length. + // TODO: Replace with loop with trip count hint. + ConditionalUnalignedCopy128(src, op); + if (op + 16 < op_limit) { + ConditionalUnalignedCopy128(src + 16, op + 16); + } + if (op + 32 < op_limit) { + ConditionalUnalignedCopy128(src + 32, op + 32); + } + if (op + 48 < op_limit) { + ConditionalUnalignedCopy128(src + 48, op + 48); + } + return op_limit; + } + + // Fall back to doing as much as we can with the available slop in the + // buffer. This code path is relatively cold however so we save code size by + // avoiding unrolling and vectorizing. + // + // TODO: Remove pragma when when cold regions don't get vectorized + // or unrolled. +#ifdef __clang__ +#pragma clang loop unroll(disable) +#endif + for (char* op_end = buf_limit - 16; op < op_end; op += 16, src += 16) { + ConditionalUnalignedCopy128(src, op); + } + if (op >= op_limit) return op_limit; + + // We only take this branch if we didn't have enough slop and we can do a + // single 8 byte copy. + if (SNAPPY_PREDICT_FALSE(op <= buf_limit - 8)) { + UnalignedCopy64(src, op); + src += 8; + op += 8; + } + return IncrementalCopySlow(src, op, op_limit); +} + +} // namespace + +template +static inline char* EmitLiteral(char* op, const char* literal, int len) { + // The vast majority of copies are below 16 bytes, for which a + // call to std::memcpy() is overkill. This fast path can sometimes + // copy up to 15 bytes too much, but that is okay in the + // main loop, since we have a bit to go on for both sides: + // + // - The input will always have kInputMarginBytes = 15 extra + // available bytes, as long as we're in the main loop, and + // if not, allow_fast_path = false. + // - The output will always have 32 spare bytes (see + // MaxCompressedLength). + assert(len > 0); // Zero-length literals are disallowed + int n = len - 1; + if (allow_fast_path && len <= 16) { + // Fits in tag byte + *op++ = LITERAL | (n << 2); + + UnalignedCopy128(literal, op); + return op + len; + } + + if (n < 60) { + // Fits in tag byte + *op++ = LITERAL | (n << 2); + } else { + int count = (Bits::Log2Floor(n) >> 3) + 1; + assert(count >= 1); + assert(count <= 4); + *op++ = LITERAL | ((59 + count) << 2); + // Encode in upcoming bytes. + // Write 4 bytes, though we may care about only 1 of them. The output buffer + // is guaranteed to have at least 3 more spaces left as 'len >= 61' holds + // here and there is a std::memcpy() of size 'len' below. + LittleEndian::Store32(op, n); + op += count; + } + std::memcpy(op, literal, len); + return op + len; +} + +template +static inline char* EmitCopyAtMost64(char* op, size_t offset, size_t len) { + assert(len <= 64); + assert(len >= 4); + assert(offset < 65536); + assert(len_less_than_12 == (len < 12)); + + if (len_less_than_12) { + uint32_t u = (len << 2) + (offset << 8); + uint32_t copy1 = COPY_1_BYTE_OFFSET - (4 << 2) + ((offset >> 3) & 0xe0); + uint32_t copy2 = COPY_2_BYTE_OFFSET - (1 << 2); + // It turns out that offset < 2048 is a difficult to predict branch. + // `perf record` shows this is the highest percentage of branch misses in + // benchmarks. This code produces branch free code, the data dependency + // chain that bottlenecks the throughput is so long that a few extra + // instructions are completely free (IPC << 6 because of data deps). + u += offset < 2048 ? copy1 : copy2; + LittleEndian::Store32(op, u); + op += offset < 2048 ? 2 : 3; + } else { + // Write 4 bytes, though we only care about 3 of them. The output buffer + // is required to have some slack, so the extra byte won't overrun it. + uint32_t u = COPY_2_BYTE_OFFSET + ((len - 1) << 2) + (offset << 8); + LittleEndian::Store32(op, u); + op += 3; + } + return op; +} + +template +static inline char* EmitCopy(char* op, size_t offset, size_t len) { + assert(len_less_than_12 == (len < 12)); + if (len_less_than_12) { + return EmitCopyAtMost64(op, offset, len); + } else { + // A special case for len <= 64 might help, but so far measurements suggest + // it's in the noise. + + // Emit 64 byte copies but make sure to keep at least four bytes reserved. + while (SNAPPY_PREDICT_FALSE(len >= 68)) { + op = EmitCopyAtMost64(op, offset, 64); + len -= 64; + } + + // One or two copies will now finish the job. + if (len > 64) { + op = EmitCopyAtMost64(op, offset, 60); + len -= 60; + } + + // Emit remainder. + if (len < 12) { + op = EmitCopyAtMost64(op, offset, len); + } else { + op = EmitCopyAtMost64(op, offset, len); + } + return op; + } +} + +bool GetUncompressedLength(const char* start, size_t n, size_t* result) { + uint32_t v = 0; + const char* limit = start + n; + if (Varint::Parse32WithLimit(start, limit, &v) != NULL) { + *result = v; + return true; + } else { + return false; + } +} + +namespace { +uint32_t CalculateTableSize(uint32_t input_size) { + static_assert( + kMaxHashTableSize >= kMinHashTableSize, + "kMaxHashTableSize should be greater or equal to kMinHashTableSize."); + if (input_size > kMaxHashTableSize) { + return kMaxHashTableSize; + } + if (input_size < kMinHashTableSize) { + return kMinHashTableSize; + } + // This is equivalent to Log2Ceiling(input_size), assuming input_size > 1. + // 2 << Log2Floor(x - 1) is equivalent to 1 << (1 + Log2Floor(x - 1)). + return 2u << Bits::Log2Floor(input_size - 1); +} +} // namespace + +namespace internal { +WorkingMemory::WorkingMemory(size_t input_size) { + const size_t max_fragment_size = std::min(input_size, kBlockSize); + const size_t table_size = CalculateTableSize(max_fragment_size); + size_ = table_size * sizeof(*table_) + max_fragment_size + + MaxCompressedLength(max_fragment_size); + mem_ = std::allocator().allocate(size_); + table_ = reinterpret_cast(mem_); + input_ = mem_ + table_size * sizeof(*table_); + output_ = input_ + max_fragment_size; +} + +WorkingMemory::~WorkingMemory() { + std::allocator().deallocate(mem_, size_); +} + +uint16_t* WorkingMemory::GetHashTable(size_t fragment_size, + int* table_size) const { + const size_t htsize = CalculateTableSize(fragment_size); + memset(table_, 0, htsize * sizeof(*table_)); + *table_size = htsize; + return table_; +} +} // end namespace internal + +// Flat array compression that does not emit the "uncompressed length" +// prefix. Compresses "input" string to the "*op" buffer. +// +// REQUIRES: "input" is at most "kBlockSize" bytes long. +// REQUIRES: "op" points to an array of memory that is at least +// "MaxCompressedLength(input.size())" in size. +// REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero. +// REQUIRES: "table_size" is a power of two +// +// Returns an "end" pointer into "op" buffer. +// "end - op" is the compressed size of "input". +namespace internal { +char* CompressFragment(const char* input, size_t input_size, char* op, + uint16_t* table, const int table_size) { + // "ip" is the input pointer, and "op" is the output pointer. + const char* ip = input; + assert(input_size <= kBlockSize); + assert((table_size & (table_size - 1)) == 0); // table must be power of two + const uint32_t mask = table_size - 1; + const char* ip_end = input + input_size; + const char* base_ip = ip; + + const size_t kInputMarginBytes = 15; + if (SNAPPY_PREDICT_TRUE(input_size >= kInputMarginBytes)) { + const char* ip_limit = input + input_size - kInputMarginBytes; + + for (uint32_t preload = LittleEndian::Load32(ip + 1);;) { + // Bytes in [next_emit, ip) will be emitted as literal bytes. Or + // [next_emit, ip_end) after the main loop. + const char* next_emit = ip++; + uint64_t data = LittleEndian::Load64(ip); + // The body of this loop calls EmitLiteral once and then EmitCopy one or + // more times. (The exception is that when we're close to exhausting + // the input we goto emit_remainder.) + // + // In the first iteration of this loop we're just starting, so + // there's nothing to copy, so calling EmitLiteral once is + // necessary. And we only start a new iteration when the + // current iteration has determined that a call to EmitLiteral will + // precede the next call to EmitCopy (if any). + // + // Step 1: Scan forward in the input looking for a 4-byte-long match. + // If we get close to exhausting the input then goto emit_remainder. + // + // Heuristic match skipping: If 32 bytes are scanned with no matches + // found, start looking only at every other byte. If 32 more bytes are + // scanned (or skipped), look at every third byte, etc.. When a match is + // found, immediately go back to looking at every byte. This is a small + // loss (~5% performance, ~0.1% density) for compressible data due to more + // bookkeeping, but for non-compressible data (such as JPEG) it's a huge + // win since the compressor quickly "realizes" the data is incompressible + // and doesn't bother looking for matches everywhere. + // + // The "skip" variable keeps track of how many bytes there are since the + // last match; dividing it by 32 (ie. right-shifting by five) gives the + // number of bytes to move ahead for each iteration. + uint32_t skip = 32; + + const char* candidate; + if (ip_limit - ip >= 16) { + auto delta = ip - base_ip; + for (int j = 0; j < 4; ++j) { + for (int k = 0; k < 4; ++k) { + int i = 4 * j + k; + // These for-loops are meant to be unrolled. So we can freely + // special case the first iteration to use the value already + // loaded in preload. + uint32_t dword = i == 0 ? preload : static_cast(data); + assert(dword == LittleEndian::Load32(ip + i)); + uint32_t hash = HashBytes(dword, mask); + candidate = base_ip + table[hash]; + assert(candidate >= base_ip); + assert(candidate < ip + i); + table[hash] = delta + i; + if (SNAPPY_PREDICT_FALSE(LittleEndian::Load32(candidate) == dword)) { + *op = LITERAL | (i << 2); + UnalignedCopy128(next_emit, op + 1); + ip += i; + op = op + i + 2; + goto emit_match; + } + data >>= 8; + } + data = LittleEndian::Load64(ip + 4 * j + 4); + } + ip += 16; + skip += 16; + } + while (true) { + assert(static_cast(data) == LittleEndian::Load32(ip)); + uint32_t hash = HashBytes(data, mask); + uint32_t bytes_between_hash_lookups = skip >> 5; + skip += bytes_between_hash_lookups; + const char* next_ip = ip + bytes_between_hash_lookups; + if (SNAPPY_PREDICT_FALSE(next_ip > ip_limit)) { + ip = next_emit; + goto emit_remainder; + } + candidate = base_ip + table[hash]; + assert(candidate >= base_ip); + assert(candidate < ip); + + table[hash] = ip - base_ip; + if (SNAPPY_PREDICT_FALSE(static_cast(data) == + LittleEndian::Load32(candidate))) { + break; + } + data = LittleEndian::Load32(next_ip); + ip = next_ip; + } + + // Step 2: A 4-byte match has been found. We'll later see if more + // than 4 bytes match. But, prior to the match, input + // bytes [next_emit, ip) are unmatched. Emit them as "literal bytes." + assert(next_emit + 16 <= ip_end); + op = EmitLiteral(op, next_emit, ip - next_emit); + + // Step 3: Call EmitCopy, and then see if another EmitCopy could + // be our next move. Repeat until we find no match for the + // input immediately after what was consumed by the last EmitCopy call. + // + // If we exit this loop normally then we need to call EmitLiteral next, + // though we don't yet know how big the literal will be. We handle that + // by proceeding to the next iteration of the main loop. We also can exit + // this loop via goto if we get close to exhausting the input. + emit_match: + do { + // We have a 4-byte match at ip, and no need to emit any + // "literal bytes" prior to ip. + const char* base = ip; + std::pair p = + FindMatchLength(candidate + 4, ip + 4, ip_end, &data); + size_t matched = 4 + p.first; + ip += matched; + size_t offset = base - candidate; + assert(0 == memcmp(base, candidate, matched)); + if (p.second) { + op = EmitCopy(op, offset, matched); + } else { + op = EmitCopy(op, offset, matched); + } + if (SNAPPY_PREDICT_FALSE(ip >= ip_limit)) { + goto emit_remainder; + } + // Expect 5 bytes to match + assert((data & 0xFFFFFFFFFF) == + (LittleEndian::Load64(ip) & 0xFFFFFFFFFF)); + // We are now looking for a 4-byte match again. We read + // table[Hash(ip, shift)] for that. To improve compression, + // we also update table[Hash(ip - 1, mask)] and table[Hash(ip, mask)]. + table[HashBytes(LittleEndian::Load32(ip - 1), mask)] = ip - base_ip - 1; + uint32_t hash = HashBytes(data, mask); + candidate = base_ip + table[hash]; + table[hash] = ip - base_ip; + // Measurements on the benchmarks have shown the following probabilities + // for the loop to exit (ie. avg. number of iterations is reciprocal). + // BM_Flat/6 txt1 p = 0.3-0.4 + // BM_Flat/7 txt2 p = 0.35 + // BM_Flat/8 txt3 p = 0.3-0.4 + // BM_Flat/9 txt3 p = 0.34-0.4 + // BM_Flat/10 pb p = 0.4 + // BM_Flat/11 gaviota p = 0.1 + // BM_Flat/12 cp p = 0.5 + // BM_Flat/13 c p = 0.3 + } while (static_cast(data) == LittleEndian::Load32(candidate)); + // Because the least significant 5 bytes matched, we can utilize data + // for the next iteration. + preload = data >> 8; + } + } + +emit_remainder: + // Emit the remaining bytes as a literal + if (ip < ip_end) { + op = EmitLiteral(op, ip, ip_end - ip); + } + + return op; +} +} // end namespace internal + +// Called back at avery compression call to trace parameters and sizes. +static inline void Report(const char *algorithm, size_t compressed_size, + size_t uncompressed_size) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)algorithm; + (void)compressed_size; + (void)uncompressed_size; +} + +// Signature of output types needed by decompression code. +// The decompression code is templatized on a type that obeys this +// signature so that we do not pay virtual function call overhead in +// the middle of a tight decompression loop. +// +// class DecompressionWriter { +// public: +// // Called before decompression +// void SetExpectedLength(size_t length); +// +// // For performance a writer may choose to donate the cursor variable to the +// // decompression function. The decompression will inject it in all its +// // function calls to the writer. Keeping the important output cursor as a +// // function local stack variable allows the compiler to keep it in +// // register, which greatly aids performance by avoiding loads and stores of +// // this variable in the fast path loop iterations. +// T GetOutputPtr() const; +// +// // At end of decompression the loop donates the ownership of the cursor +// // variable back to the writer by calling this function. +// void SetOutputPtr(T op); +// +// // Called after decompression +// bool CheckLength() const; +// +// // Called repeatedly during decompression +// // Each function get a pointer to the op (output pointer), that the writer +// // can use and update. Note it's important that these functions get fully +// // inlined so that no actual address of the local variable needs to be +// // taken. +// bool Append(const char* ip, size_t length, T* op); +// bool AppendFromSelf(uint32_t offset, size_t length, T* op); +// +// // The rules for how TryFastAppend differs from Append are somewhat +// // convoluted: +// // +// // - TryFastAppend is allowed to decline (return false) at any +// // time, for any reason -- just "return false" would be +// // a perfectly legal implementation of TryFastAppend. +// // The intention is for TryFastAppend to allow a fast path +// // in the common case of a small append. +// // - TryFastAppend is allowed to read up to bytes +// // from the input buffer, whereas Append is allowed to read +// // . However, if it returns true, it must leave +// // at least five (kMaximumTagLength) bytes in the input buffer +// // afterwards, so that there is always enough space to read the +// // next tag without checking for a refill. +// // - TryFastAppend must always return decline (return false) +// // if is 61 or more, as in this case the literal length is not +// // decoded fully. In practice, this should not be a big problem, +// // as it is unlikely that one would implement a fast path accepting +// // this much data. +// // +// bool TryFastAppend(const char* ip, size_t available, size_t length, T* op); +// }; + +static inline uint32_t ExtractLowBytes(uint32_t v, int n) { + assert(n >= 0); + assert(n <= 4); +#if SNAPPY_HAVE_BMI2 + return _bzhi_u32(v, 8 * n); +#else + // This needs to be wider than uint32_t otherwise `mask << 32` will be + // undefined. + uint64_t mask = 0xffffffff; + return v & ~(mask << (8 * n)); +#endif +} + +static inline bool LeftShiftOverflows(uint8_t value, uint32_t shift) { + assert(shift < 32); + static const uint8_t masks[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe}; + return (value & masks[shift]) != 0; +} + +inline bool Copy64BytesWithPatternExtension(ptrdiff_t dst, size_t offset) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)dst; + return offset != 0; +} + +void MemCopy(char* dst, const uint8_t* src, size_t size) { + std::memcpy(dst, src, size); +} + +void MemCopy(ptrdiff_t dst, const uint8_t* src, size_t size) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)dst; + (void)src; + (void)size; +} + +void MemMove(char* dst, const void* src, size_t size) { + std::memmove(dst, src, size); +} + +void MemMove(ptrdiff_t dst, const void* src, size_t size) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)dst; + (void)src; + (void)size; +} + +SNAPPY_ATTRIBUTE_ALWAYS_INLINE +size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { + const uint8_t*& ip = *ip_p; + // This section is crucial for the throughput of the decompression loop. + // The latency of an iteration is fundamentally constrained by the + // following data chain on ip. + // ip -> c = Load(ip) -> ip1 = ip + 1 + (c & 3) -> ip = ip1 or ip2 + // ip2 = ip + 2 + (c >> 2) + // This amounts to 8 cycles. + // 5 (load) + 1 (c & 3) + 1 (lea ip1, [ip + (c & 3) + 1]) + 1 (cmov) + size_t literal_len = *tag >> 2; + size_t tag_type = *tag; + bool is_literal; +#if defined(__GNUC__) && defined(__x86_64__) + // TODO clang misses the fact that the (c & 3) already correctly + // sets the zero flag. + asm("and $3, %k[tag_type]\n\t" + : [tag_type] "+r"(tag_type), "=@ccz"(is_literal)); +#else + tag_type &= 3; + is_literal = (tag_type == 0); +#endif + // TODO + // This is code is subtle. Loading the values first and then cmov has less + // latency then cmov ip and then load. However clang would move the loads + // in an optimization phase, volatile prevents this transformation. + // Note that we have enough slop bytes (64) that the loads are always valid. + size_t tag_literal = + static_cast(ip)[1 + literal_len]; + size_t tag_copy = static_cast(ip)[tag_type]; + *tag = is_literal ? tag_literal : tag_copy; + const uint8_t* ip_copy = ip + 1 + tag_type; + const uint8_t* ip_literal = ip + 2 + literal_len; + ip = is_literal ? ip_literal : ip_copy; +#if defined(__GNUC__) && defined(__x86_64__) + // TODO Clang is "optimizing" zero-extension (a totally free + // operation) this means that after the cmov of tag, it emits another movzb + // tag, byte(tag). It really matters as it's on the core chain. This dummy + // asm, persuades clang to do the zero-extension at the load (it's automatic) + // removing the expensive movzb. + asm("" ::"r"(tag_copy)); +#endif + return tag_type; +} + +// Extract the offset for copy-1 and copy-2 returns 0 for literals or copy-4. +inline uint32_t ExtractOffset(uint32_t val, size_t tag_type) { + return val & table.extract_masks[tag_type]; +}; + +// Core decompression loop, when there is enough data available. +// Decompresses the input buffer [ip, ip_limit) into the output buffer +// [op, op_limit_min_slop). Returning when either we are too close to the end +// of the input buffer, or we exceed op_limit_min_slop or when a exceptional +// tag is encountered (literal of length > 60) or a copy-4. +// Returns {ip, op} at the points it stopped decoding. +// TODO This function probably does not need to be inlined, as it +// should decode large chunks at a time. This allows runtime dispatch to +// implementations based on CPU capability (BMI2 / perhaps 32 / 64 byte memcpy). +template +std::pair DecompressBranchless( + const uint8_t* ip, const uint8_t* ip_limit, ptrdiff_t op, T op_base, + ptrdiff_t op_limit_min_slop) { + // We unroll the inner loop twice so we need twice the spare room. + op_limit_min_slop -= kSlopBytes; + if (2 * (kSlopBytes + 1) < ip_limit - ip && op < op_limit_min_slop) { + const uint8_t* const ip_limit_min_slop = ip_limit - 2 * kSlopBytes - 1; + ip++; + // ip points just past the tag and we are touching at maximum kSlopBytes + // in an iteration. + size_t tag = ip[-1]; + do { + // The throughput is limited by instructions, unrolling the inner loop + // twice reduces the amount of instructions checking limits and also + // leads to reduced mov's. + for (int i = 0; i < 2; i++) { + const uint8_t* old_ip = ip; + assert(tag == ip[-1]); + // For literals tag_type = 0, hence we will always obtain 0 from + // ExtractLowBytes. For literals offset will thus be kLiteralOffset. + ptrdiff_t len_min_offset = table.length_minus_offset[tag]; + size_t tag_type = AdvanceToNextTag(&ip, &tag); + uint32_t next = LittleEndian::Load32(old_ip); + size_t len = len_min_offset & 0xFF; + len_min_offset -= ExtractOffset(next, tag_type); + if (SNAPPY_PREDICT_FALSE(len_min_offset > 0)) { + if (SNAPPY_PREDICT_FALSE(len & 0x80)) { + // Exceptional case (long literal or copy 4). + // Actually doing the copy here is negatively impacting the main + // loop due to compiler incorrectly allocating a register for + // this fallback. Hence we just break. + break_loop: + ip = old_ip; + goto exit; + } + // Only copy-1 or copy-2 tags can get here. + assert(tag_type == 1 || tag_type == 2); + std::ptrdiff_t delta = op + len_min_offset - len; + // Guard against copies before the buffer start. + if (SNAPPY_PREDICT_FALSE(delta < 0 || + !Copy64BytesWithPatternExtension( + op_base + op, len - len_min_offset))) { + goto break_loop; + } + op += len; + continue; + } + std::ptrdiff_t delta = op + len_min_offset - len; + if (SNAPPY_PREDICT_FALSE(delta < 0)) { +#if defined(__GNUC__) && defined(__x86_64__) + // TODO + // When validating, both code path reduced to `op += len`. Ie. this + // becomes effectively + // + // if (delta < 0) if (tag_type != 0) goto break_loop; + // op += len; + // + // The compiler interchanges the predictable and almost always false + // first if-statement with the completely unpredictable second + // if-statement, putting an unpredictable branch on every iteration. + // This empty asm is worth almost 2x, which I think qualifies for an + // award for the most load-bearing empty statement. + asm(""); +#endif + + // Due to the spurious offset in literals have this will trigger + // at the start of a block when op is still smaller than 256. + if (tag_type != 0) goto break_loop; + MemCopy(op_base + op, old_ip, 64); + op += len; + continue; + } + + // For copies we need to copy from op_base + delta, for literals + // we need to copy from ip instead of from the stream. + const void* from = + tag_type ? reinterpret_cast(op_base + delta) : old_ip; + MemMove(op_base + op, from, 64); + op += len; + } + } while (ip < ip_limit_min_slop && op < op_limit_min_slop); + exit: + ip--; + assert(ip <= ip_limit); + } + return {ip, op}; +} + +// Helper class for decompression +class SnappyDecompressor { + private: + Source* reader_; // Underlying source of bytes to decompress + const char* ip_; // Points to next buffered byte + const char* ip_limit_; // Points just past buffered bytes + // If ip < ip_limit_min_maxtaglen_ it's safe to read kMaxTagLength from + // buffer. + const char* ip_limit_min_maxtaglen_; + uint32_t peeked_; // Bytes peeked from reader (need to skip) + bool eof_; // Hit end of input without an error? + char scratch_[kMaximumTagLength]; // See RefillTag(). + + // Ensure that all of the tag metadata for the next tag is available + // in [ip_..ip_limit_-1]. Also ensures that [ip,ip+4] is readable even + // if (ip_limit_ - ip_ < 5). + // + // Returns true on success, false on error or end of input. + bool RefillTag(); + + void ResetLimit(const char* ip) { + ip_limit_min_maxtaglen_ = + ip_limit_ - std::min(ip_limit_ - ip, kMaximumTagLength - 1); + } + + public: + explicit SnappyDecompressor(Source* reader) + : reader_(reader), ip_(NULL), ip_limit_(NULL), peeked_(0), eof_(false) {} + + ~SnappyDecompressor() { + // Advance past any bytes we peeked at from the reader + reader_->Skip(peeked_); + } + + // Returns true iff we have hit the end of the input without an error. + bool eof() const { return eof_; } + + // Read the uncompressed length stored at the start of the compressed data. + // On success, stores the length in *result and returns true. + // On failure, returns false. + bool ReadUncompressedLength(uint32_t* result) { + assert(ip_ == NULL); // Must not have read anything yet + // Length is encoded in 1..5 bytes + *result = 0; + uint32_t shift = 0; + while (true) { + if (shift >= 32) return false; + size_t n; + const char* ip = reader_->Peek(&n); + if (n == 0) return false; + const unsigned char c = *(reinterpret_cast(ip)); + reader_->Skip(1); + uint32_t val = c & 0x7f; + if (LeftShiftOverflows(static_cast(val), shift)) return false; + *result |= val << shift; + if (c < 128) { + break; + } + shift += 7; + } + return true; + } + + // Process the next item found in the input. + // Returns true if successful, false on error or end of input. + template +#if defined(__GNUC__) && defined(__x86_64__) + __attribute__((aligned(32))) +#endif + void + DecompressAllTags(Writer* writer) { + const char* ip = ip_; + ResetLimit(ip); + auto op = writer->GetOutputPtr(); + // We could have put this refill fragment only at the beginning of the loop. + // However, duplicating it at the end of each branch gives the compiler more + // scope to optimize the expression based on the local + // context, which overall increases speed. +#define MAYBE_REFILL() \ + if (SNAPPY_PREDICT_FALSE(ip >= ip_limit_min_maxtaglen_)) { \ + ip_ = ip; \ + if (SNAPPY_PREDICT_FALSE(!RefillTag())) goto exit; \ + ip = ip_; \ + ResetLimit(ip); \ + } \ + preload = static_cast(*ip) + + // At the start of the for loop below the least significant byte of preload + // contains the tag. + uint32_t preload; + MAYBE_REFILL(); + for (;;) { + { + ptrdiff_t op_limit_min_slop; + auto op_base = writer->GetBase(&op_limit_min_slop); + if (op_base) { + auto res = + DecompressBranchless(reinterpret_cast(ip), + reinterpret_cast(ip_limit_), + op - op_base, op_base, op_limit_min_slop); + ip = reinterpret_cast(res.first); + op = op_base + res.second; + MAYBE_REFILL(); + } + } + const uint8_t c = static_cast(preload); + ip++; + + // Ratio of iterations that have LITERAL vs non-LITERAL for different + // inputs. + // + // input LITERAL NON_LITERAL + // ----------------------------------- + // html|html4|cp 23% 77% + // urls 36% 64% + // jpg 47% 53% + // pdf 19% 81% + // txt[1-4] 25% 75% + // pb 24% 76% + // bin 24% 76% + if (SNAPPY_PREDICT_FALSE((c & 0x3) == LITERAL)) { + size_t literal_length = (c >> 2) + 1u; + if (writer->TryFastAppend(ip, ip_limit_ - ip, literal_length, &op)) { + assert(literal_length < 61); + ip += literal_length; + // NOTE: There is no MAYBE_REFILL() here, as TryFastAppend() + // will not return true unless there's already at least five spare + // bytes in addition to the literal. + preload = static_cast(*ip); + continue; + } + if (SNAPPY_PREDICT_FALSE(literal_length >= 61)) { + // Long literal. + const size_t literal_length_length = literal_length - 60; + literal_length = + ExtractLowBytes(LittleEndian::Load32(ip), literal_length_length) + + 1; + ip += literal_length_length; + } + + size_t avail = ip_limit_ - ip; + while (avail < literal_length) { + if (!writer->Append(ip, avail, &op)) goto exit; + literal_length -= avail; + reader_->Skip(peeked_); + size_t n; + ip = reader_->Peek(&n); + avail = n; + peeked_ = avail; + if (avail == 0) goto exit; + ip_limit_ = ip + avail; + ResetLimit(ip); + } + if (!writer->Append(ip, literal_length, &op)) goto exit; + ip += literal_length; + MAYBE_REFILL(); + } else { + if (SNAPPY_PREDICT_FALSE((c & 3) == COPY_4_BYTE_OFFSET)) { + const size_t copy_offset = LittleEndian::Load32(ip); + const size_t length = (c >> 2) + 1; + ip += 4; + + if (!writer->AppendFromSelf(copy_offset, length, &op)) goto exit; + } else { + const ptrdiff_t entry = table.length_minus_offset[c]; + preload = LittleEndian::Load32(ip); + const uint32_t trailer = ExtractLowBytes(preload, c & 3); + const uint32_t length = entry & 0xff; + assert(length > 0); + + // copy_offset/256 is encoded in bits 8..10. By just fetching + // those bits, we get copy_offset (since the bit-field starts at + // bit 8). + const uint32_t copy_offset = trailer - entry + length; + if (!writer->AppendFromSelf(copy_offset, length, &op)) goto exit; + + ip += (c & 3); + // By using the result of the previous load we reduce the critical + // dependency chain of ip to 4 cycles. + preload >>= (c & 3) * 8; + if (ip < ip_limit_min_maxtaglen_) continue; + } + MAYBE_REFILL(); + } + } +#undef MAYBE_REFILL + exit: + writer->SetOutputPtr(op); + } +}; + +constexpr uint32_t CalculateNeeded(uint8_t tag) { + return ((tag & 3) == 0 && tag >= (60 * 4)) + ? (tag >> 2) - 58 + : (0x05030201 >> ((tag * 8) & 31)) & 0xFF; +} + +#if __cplusplus >= 201402L +constexpr bool VerifyCalculateNeeded() { + for (int i = 0; i < 1; i++) { + if (CalculateNeeded(i) != (char_table[i] >> 11) + 1) return false; + } + return true; +} + +// Make sure CalculateNeeded is correct by verifying it against the established +// table encoding the number of added bytes needed. +static_assert(VerifyCalculateNeeded(), ""); +#endif // c++14 + +bool SnappyDecompressor::RefillTag() { + const char* ip = ip_; + if (ip == ip_limit_) { + // Fetch a new fragment from the reader + reader_->Skip(peeked_); // All peeked bytes are used up + size_t n; + ip = reader_->Peek(&n); + peeked_ = n; + eof_ = (n == 0); + if (eof_) return false; + ip_limit_ = ip + n; + } + + // Read the tag character + assert(ip < ip_limit_); + const unsigned char c = *(reinterpret_cast(ip)); + // At this point make sure that the data for the next tag is consecutive. + // For copy 1 this means the next 2 bytes (tag and 1 byte offset) + // For copy 2 the next 3 bytes (tag and 2 byte offset) + // For copy 4 the next 5 bytes (tag and 4 byte offset) + // For all small literals we only need 1 byte buf for literals 60...63 the + // length is encoded in 1...4 extra bytes. + const uint32_t needed = CalculateNeeded(c); + assert(needed <= sizeof(scratch_)); + + // Read more bytes from reader if needed + uint32_t nbuf = ip_limit_ - ip; + if (nbuf < needed) { + // Stitch together bytes from ip and reader to form the word + // contents. We store the needed bytes in "scratch_". They + // will be consumed immediately by the caller since we do not + // read more than we need. + std::memmove(scratch_, ip, nbuf); + reader_->Skip(peeked_); // All peeked bytes are used up + peeked_ = 0; + while (nbuf < needed) { + size_t length; + const char* src = reader_->Peek(&length); + if (length == 0) return false; + uint32_t to_add = std::min(needed - nbuf, length); + std::memcpy(scratch_ + nbuf, src, to_add); + nbuf += to_add; + reader_->Skip(to_add); + } + assert(nbuf == needed); + ip_ = scratch_; + ip_limit_ = scratch_ + needed; + } else if (nbuf < kMaximumTagLength) { + // Have enough bytes, but move into scratch_ so that we do not + // read past end of input + std::memmove(scratch_, ip, nbuf); + reader_->Skip(peeked_); // All peeked bytes are used up + peeked_ = 0; + ip_ = scratch_; + ip_limit_ = scratch_ + nbuf; + } else { + // Pass pointer to buffer returned by reader_. + ip_ = ip; + } + return true; +} + +template +static bool InternalUncompress(Source* r, Writer* writer) { + // Read the uncompressed length from the front of the compressed input + SnappyDecompressor decompressor(r); + uint32_t uncompressed_len = 0; + if (!decompressor.ReadUncompressedLength(&uncompressed_len)) return false; + + return InternalUncompressAllTags(&decompressor, writer, r->Available(), + uncompressed_len); +} + +template +static bool InternalUncompressAllTags(SnappyDecompressor* decompressor, + Writer* writer, uint32_t compressed_len, + uint32_t uncompressed_len) { + Report("snappy_uncompress", compressed_len, uncompressed_len); + + writer->SetExpectedLength(uncompressed_len); + + // Process the entire input + decompressor->DecompressAllTags(writer); + writer->Flush(); + return (decompressor->eof() && writer->CheckLength()); +} + +bool GetUncompressedLength(Source* source, uint32_t* result) { + SnappyDecompressor decompressor(source); + return decompressor.ReadUncompressedLength(result); +} + +size_t Compress(Source* reader, Sink* writer) { + size_t written = 0; + size_t N = reader->Available(); + const size_t uncompressed_size = N; + char ulength[Varint::kMax32]; + char* p = Varint::Encode32(ulength, N); + writer->Append(ulength, p - ulength); + written += (p - ulength); + + internal::WorkingMemory wmem(N); + + while (N > 0) { + // Get next block to compress (without copying if possible) + size_t fragment_size; + const char* fragment = reader->Peek(&fragment_size); + assert(fragment_size != 0); // premature end of input + const size_t num_to_read = std::min(N, kBlockSize); + size_t bytes_read = fragment_size; + + size_t pending_advance = 0; + if (bytes_read >= num_to_read) { + // Buffer returned by reader is large enough + pending_advance = num_to_read; + fragment_size = num_to_read; + } else { + char* scratch = wmem.GetScratchInput(); + std::memcpy(scratch, fragment, bytes_read); + reader->Skip(bytes_read); + + while (bytes_read < num_to_read) { + fragment = reader->Peek(&fragment_size); + size_t n = std::min(fragment_size, num_to_read - bytes_read); + std::memcpy(scratch + bytes_read, fragment, n); + bytes_read += n; + reader->Skip(n); + } + assert(bytes_read == num_to_read); + fragment = scratch; + fragment_size = num_to_read; + } + assert(fragment_size == num_to_read); + + // Get encoding table for compression + int table_size; + uint16_t* table = wmem.GetHashTable(num_to_read, &table_size); + + // Compress input_fragment and append to dest + const int max_output = MaxCompressedLength(num_to_read); + + // Need a scratch buffer for the output, in case the byte sink doesn't + // have room for us directly. + + // Since we encode kBlockSize regions followed by a region + // which is <= kBlockSize in length, a previously allocated + // scratch_output[] region is big enough for this iteration. + char* dest = writer->GetAppendBuffer(max_output, wmem.GetScratchOutput()); + char* end = internal::CompressFragment(fragment, fragment_size, dest, table, + table_size); + writer->Append(dest, end - dest); + written += (end - dest); + + N -= num_to_read; + reader->Skip(pending_advance); + } + + Report("snappy_compress", written, uncompressed_size); + + return written; +} + +// ----------------------------------------------------------------------- +// IOVec interfaces +// ----------------------------------------------------------------------- + +// A type that writes to an iovec. +// Note that this is not a "ByteSink", but a type that matches the +// Writer template argument to SnappyDecompressor::DecompressAllTags(). +class SnappyIOVecWriter { + private: + // output_iov_end_ is set to iov + count and used to determine when + // the end of the iovs is reached. + const struct iovec* output_iov_end_; + +#if !defined(NDEBUG) + const struct iovec* output_iov_; +#endif // !defined(NDEBUG) + + // Current iov that is being written into. + const struct iovec* curr_iov_; + + // Pointer to current iov's write location. + char* curr_iov_output_; + + // Remaining bytes to write into curr_iov_output. + size_t curr_iov_remaining_; + + // Total bytes decompressed into output_iov_ so far. + size_t total_written_; + + // Maximum number of bytes that will be decompressed into output_iov_. + size_t output_limit_; + + static inline char* GetIOVecPointer(const struct iovec* iov, size_t offset) { + return reinterpret_cast(iov->iov_base) + offset; + } + + public: + // Does not take ownership of iov. iov must be valid during the + // entire lifetime of the SnappyIOVecWriter. + inline SnappyIOVecWriter(const struct iovec* iov, size_t iov_count) + : output_iov_end_(iov + iov_count), +#if !defined(NDEBUG) + output_iov_(iov), +#endif // !defined(NDEBUG) + curr_iov_(iov), + curr_iov_output_(iov_count ? reinterpret_cast(iov->iov_base) + : nullptr), + curr_iov_remaining_(iov_count ? iov->iov_len : 0), + total_written_(0), + output_limit_(-1) { + } + + inline void SetExpectedLength(size_t len) { output_limit_ = len; } + + inline bool CheckLength() const { return total_written_ == output_limit_; } + + inline bool Append(const char* ip, size_t len, char**) { + if (total_written_ + len > output_limit_) { + return false; + } + + return AppendNoCheck(ip, len); + } + + char* GetOutputPtr() { return nullptr; } + char* GetBase(ptrdiff_t*) { return nullptr; } + void SetOutputPtr(char* op) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)op; + } + + inline bool AppendNoCheck(const char* ip, size_t len) { + while (len > 0) { + if (curr_iov_remaining_ == 0) { + // This iovec is full. Go to the next one. + if (curr_iov_ + 1 >= output_iov_end_) { + return false; + } + ++curr_iov_; + curr_iov_output_ = reinterpret_cast(curr_iov_->iov_base); + curr_iov_remaining_ = curr_iov_->iov_len; + } + + const size_t to_write = std::min(len, curr_iov_remaining_); + std::memcpy(curr_iov_output_, ip, to_write); + curr_iov_output_ += to_write; + curr_iov_remaining_ -= to_write; + total_written_ += to_write; + ip += to_write; + len -= to_write; + } + + return true; + } + + inline bool TryFastAppend(const char* ip, size_t available, size_t len, + char**) { + const size_t space_left = output_limit_ - total_written_; + if (len <= 16 && available >= 16 + kMaximumTagLength && space_left >= 16 && + curr_iov_remaining_ >= 16) { + // Fast path, used for the majority (about 95%) of invocations. + UnalignedCopy128(ip, curr_iov_output_); + curr_iov_output_ += len; + curr_iov_remaining_ -= len; + total_written_ += len; + return true; + } + + return false; + } + + inline bool AppendFromSelf(size_t offset, size_t len, char**) { + // See SnappyArrayWriter::AppendFromSelf for an explanation of + // the "offset - 1u" trick. + if (offset - 1u >= total_written_) { + return false; + } + const size_t space_left = output_limit_ - total_written_; + if (len > space_left) { + return false; + } + + // Locate the iovec from which we need to start the copy. + const iovec* from_iov = curr_iov_; + size_t from_iov_offset = curr_iov_->iov_len - curr_iov_remaining_; + while (offset > 0) { + if (from_iov_offset >= offset) { + from_iov_offset -= offset; + break; + } + + offset -= from_iov_offset; + --from_iov; +#if !defined(NDEBUG) + assert(from_iov >= output_iov_); +#endif // !defined(NDEBUG) + from_iov_offset = from_iov->iov_len; + } + + // Copy bytes starting from the iovec pointed to by from_iov_index to + // the current iovec. + while (len > 0) { + assert(from_iov <= curr_iov_); + if (from_iov != curr_iov_) { + const size_t to_copy = + std::min(from_iov->iov_len - from_iov_offset, len); + AppendNoCheck(GetIOVecPointer(from_iov, from_iov_offset), to_copy); + len -= to_copy; + if (len > 0) { + ++from_iov; + from_iov_offset = 0; + } + } else { + size_t to_copy = curr_iov_remaining_; + if (to_copy == 0) { + // This iovec is full. Go to the next one. + if (curr_iov_ + 1 >= output_iov_end_) { + return false; + } + ++curr_iov_; + curr_iov_output_ = reinterpret_cast(curr_iov_->iov_base); + curr_iov_remaining_ = curr_iov_->iov_len; + continue; + } + if (to_copy > len) { + to_copy = len; + } + assert(to_copy > 0); + + IncrementalCopy(GetIOVecPointer(from_iov, from_iov_offset), + curr_iov_output_, curr_iov_output_ + to_copy, + curr_iov_output_ + curr_iov_remaining_); + curr_iov_output_ += to_copy; + curr_iov_remaining_ -= to_copy; + from_iov_offset += to_copy; + total_written_ += to_copy; + len -= to_copy; + } + } + + return true; + } + + inline void Flush() {} +}; + +bool RawUncompressToIOVec(const char* compressed, size_t compressed_length, + const struct iovec* iov, size_t iov_cnt) { + ByteArraySource reader(compressed, compressed_length); + return RawUncompressToIOVec(&reader, iov, iov_cnt); +} + +bool RawUncompressToIOVec(Source* compressed, const struct iovec* iov, + size_t iov_cnt) { + SnappyIOVecWriter output(iov, iov_cnt); + return InternalUncompress(compressed, &output); +} + +// ----------------------------------------------------------------------- +// Flat array interfaces +// ----------------------------------------------------------------------- + +// A type that writes to a flat array. +// Note that this is not a "ByteSink", but a type that matches the +// Writer template argument to SnappyDecompressor::DecompressAllTags(). +class SnappyArrayWriter { + private: + char* base_; + char* op_; + char* op_limit_; + // If op < op_limit_min_slop_ then it's safe to unconditionally write + // kSlopBytes starting at op. + char* op_limit_min_slop_; + + public: + inline explicit SnappyArrayWriter(char* dst) + : base_(dst), + op_(dst), + op_limit_(dst), + op_limit_min_slop_(dst) {} // Safe default see invariant. + + inline void SetExpectedLength(size_t len) { + op_limit_ = op_ + len; + // Prevent pointer from being past the buffer. + op_limit_min_slop_ = op_limit_ - std::min(kSlopBytes - 1, len); + } + + inline bool CheckLength() const { return op_ == op_limit_; } + + char* GetOutputPtr() { return op_; } + char* GetBase(ptrdiff_t* op_limit_min_slop) { + *op_limit_min_slop = op_limit_min_slop_ - base_; + return base_; + } + void SetOutputPtr(char* op) { op_ = op; } + + inline bool Append(const char* ip, size_t len, char** op_p) { + char* op = *op_p; + const size_t space_left = op_limit_ - op; + if (space_left < len) return false; + std::memcpy(op, ip, len); + *op_p = op + len; + return true; + } + + inline bool TryFastAppend(const char* ip, size_t available, size_t len, + char** op_p) { + char* op = *op_p; + const size_t space_left = op_limit_ - op; + if (len <= 16 && available >= 16 + kMaximumTagLength && space_left >= 16) { + // Fast path, used for the majority (about 95%) of invocations. + UnalignedCopy128(ip, op); + *op_p = op + len; + return true; + } else { + return false; + } + } + + SNAPPY_ATTRIBUTE_ALWAYS_INLINE + inline bool AppendFromSelf(size_t offset, size_t len, char** op_p) { + assert(len > 0); + char* const op = *op_p; + assert(op >= base_); + char* const op_end = op + len; + + // Check if we try to append from before the start of the buffer. + if (SNAPPY_PREDICT_FALSE(static_cast(op - base_) < offset)) + return false; + + if (SNAPPY_PREDICT_FALSE((kSlopBytes < 64 && len > kSlopBytes) || + op >= op_limit_min_slop_ || offset < len)) { + if (op_end > op_limit_ || offset == 0) return false; + *op_p = IncrementalCopy(op - offset, op, op_end, op_limit_); + return true; + } + std::memmove(op, op - offset, kSlopBytes); + *op_p = op_end; + return true; + } + inline size_t Produced() const { + assert(op_ >= base_); + return op_ - base_; + } + inline void Flush() {} +}; + +bool RawUncompress(const char* compressed, size_t compressed_length, + char* uncompressed) { + ByteArraySource reader(compressed, compressed_length); + return RawUncompress(&reader, uncompressed); +} + +bool RawUncompress(Source* compressed, char* uncompressed) { + SnappyArrayWriter output(uncompressed); + return InternalUncompress(compressed, &output); +} + +bool Uncompress(const char* compressed, size_t compressed_length, + std::string* uncompressed) { + size_t ulength; + if (!GetUncompressedLength(compressed, compressed_length, &ulength)) { + return false; + } + // On 32-bit builds: max_size() < kuint32max. Check for that instead + // of crashing (e.g., consider externally specified compressed data). + if (ulength > uncompressed->max_size()) { + return false; + } + STLStringResizeUninitialized(uncompressed, ulength); + return RawUncompress(compressed, compressed_length, + string_as_array(uncompressed)); +} + +// A Writer that drops everything on the floor and just does validation +class SnappyDecompressionValidator { + private: + size_t expected_; + size_t produced_; + + public: + inline SnappyDecompressionValidator() : expected_(0), produced_(0) {} + inline void SetExpectedLength(size_t len) { expected_ = len; } + size_t GetOutputPtr() { return produced_; } + size_t GetBase(ptrdiff_t* op_limit_min_slop) { + *op_limit_min_slop = std::numeric_limits::max() - kSlopBytes + 1; + return 1; + } + void SetOutputPtr(size_t op) { produced_ = op; } + inline bool CheckLength() const { return expected_ == produced_; } + inline bool Append(const char* ip, size_t len, size_t* produced) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)ip; + + *produced += len; + return *produced <= expected_; + } + inline bool TryFastAppend(const char* ip, size_t available, size_t length, + size_t* produced) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)ip; + (void)available; + (void)length; + (void)produced; + + return false; + } + inline bool AppendFromSelf(size_t offset, size_t len, size_t* produced) { + // See SnappyArrayWriter::AppendFromSelf for an explanation of + // the "offset - 1u" trick. + if (*produced <= offset - 1u) return false; + *produced += len; + return *produced <= expected_; + } + inline void Flush() {} +}; + +bool IsValidCompressedBuffer(const char* compressed, size_t compressed_length) { + ByteArraySource reader(compressed, compressed_length); + SnappyDecompressionValidator writer; + return InternalUncompress(&reader, &writer); +} + +bool IsValidCompressed(Source* compressed) { + SnappyDecompressionValidator writer; + return InternalUncompress(compressed, &writer); +} + +void RawCompress(const char* input, size_t input_length, char* compressed, + size_t* compressed_length) { + ByteArraySource reader(input, input_length); + UncheckedByteArraySink writer(compressed); + Compress(&reader, &writer); + + // Compute how many bytes were added + *compressed_length = (writer.CurrentDestination() - compressed); +} + +size_t Compress(const char* input, size_t input_length, + std::string* compressed) { + // Pre-grow the buffer to the max length of the compressed output + STLStringResizeUninitialized(compressed, MaxCompressedLength(input_length)); + + size_t compressed_length; + RawCompress(input, input_length, string_as_array(compressed), + &compressed_length); + compressed->resize(compressed_length); + return compressed_length; +} + +// ----------------------------------------------------------------------- +// Sink interface +// ----------------------------------------------------------------------- + +// A type that decompresses into a Sink. The template parameter +// Allocator must export one method "char* Allocate(int size);", which +// allocates a buffer of "size" and appends that to the destination. +template +class SnappyScatteredWriter { + Allocator allocator_; + + // We need random access into the data generated so far. Therefore + // we keep track of all of the generated data as an array of blocks. + // All of the blocks except the last have length kBlockSize. + std::vector blocks_; + size_t expected_; + + // Total size of all fully generated blocks so far + size_t full_size_; + + // Pointer into current output block + char* op_base_; // Base of output block + char* op_ptr_; // Pointer to next unfilled byte in block + char* op_limit_; // Pointer just past block + // If op < op_limit_min_slop_ then it's safe to unconditionally write + // kSlopBytes starting at op. + char* op_limit_min_slop_; + + inline size_t Size() const { return full_size_ + (op_ptr_ - op_base_); } + + bool SlowAppend(const char* ip, size_t len); + bool SlowAppendFromSelf(size_t offset, size_t len); + + public: + inline explicit SnappyScatteredWriter(const Allocator& allocator) + : allocator_(allocator), + full_size_(0), + op_base_(NULL), + op_ptr_(NULL), + op_limit_(NULL), + op_limit_min_slop_(NULL) {} + char* GetOutputPtr() { return op_ptr_; } + char* GetBase(ptrdiff_t* op_limit_min_slop) { + *op_limit_min_slop = op_limit_min_slop_ - op_base_; + return op_base_; + } + void SetOutputPtr(char* op) { op_ptr_ = op; } + + inline void SetExpectedLength(size_t len) { + assert(blocks_.empty()); + expected_ = len; + } + + inline bool CheckLength() const { return Size() == expected_; } + + // Return the number of bytes actually uncompressed so far + inline size_t Produced() const { return Size(); } + + inline bool Append(const char* ip, size_t len, char** op_p) { + char* op = *op_p; + size_t avail = op_limit_ - op; + if (len <= avail) { + // Fast path + std::memcpy(op, ip, len); + *op_p = op + len; + return true; + } else { + op_ptr_ = op; + bool res = SlowAppend(ip, len); + *op_p = op_ptr_; + return res; + } + } + + inline bool TryFastAppend(const char* ip, size_t available, size_t length, + char** op_p) { + char* op = *op_p; + const int space_left = op_limit_ - op; + if (length <= 16 && available >= 16 + kMaximumTagLength && + space_left >= 16) { + // Fast path, used for the majority (about 95%) of invocations. + UnalignedCopy128(ip, op); + *op_p = op + length; + return true; + } else { + return false; + } + } + + inline bool AppendFromSelf(size_t offset, size_t len, char** op_p) { + char* op = *op_p; + assert(op >= op_base_); + // Check if we try to append from before the start of the buffer. + if (SNAPPY_PREDICT_FALSE((kSlopBytes < 64 && len > kSlopBytes) || + static_cast(op - op_base_) < offset || + op >= op_limit_min_slop_ || offset < len)) { + if (offset == 0) return false; + if (SNAPPY_PREDICT_FALSE(static_cast(op - op_base_) < offset || + op + len > op_limit_)) { + op_ptr_ = op; + bool res = SlowAppendFromSelf(offset, len); + *op_p = op_ptr_; + return res; + } + *op_p = IncrementalCopy(op - offset, op, op + len, op_limit_); + return true; + } + // Fast path + char* const op_end = op + len; + std::memmove(op, op - offset, kSlopBytes); + *op_p = op_end; + return true; + } + + // Called at the end of the decompress. We ask the allocator + // write all blocks to the sink. + inline void Flush() { allocator_.Flush(Produced()); } +}; + +template +bool SnappyScatteredWriter::SlowAppend(const char* ip, size_t len) { + size_t avail = op_limit_ - op_ptr_; + while (len > avail) { + // Completely fill this block + std::memcpy(op_ptr_, ip, avail); + op_ptr_ += avail; + assert(op_limit_ - op_ptr_ == 0); + full_size_ += (op_ptr_ - op_base_); + len -= avail; + ip += avail; + + // Bounds check + if (full_size_ + len > expected_) return false; + + // Make new block + size_t bsize = std::min(kBlockSize, expected_ - full_size_); + op_base_ = allocator_.Allocate(bsize); + op_ptr_ = op_base_; + op_limit_ = op_base_ + bsize; + op_limit_min_slop_ = op_limit_ - std::min(kSlopBytes - 1, bsize); + + blocks_.push_back(op_base_); + avail = bsize; + } + + std::memcpy(op_ptr_, ip, len); + op_ptr_ += len; + return true; +} + +template +bool SnappyScatteredWriter::SlowAppendFromSelf(size_t offset, + size_t len) { + // Overflow check + // See SnappyArrayWriter::AppendFromSelf for an explanation of + // the "offset - 1u" trick. + const size_t cur = Size(); + if (offset - 1u >= cur) return false; + if (expected_ - cur < len) return false; + + // Currently we shouldn't ever hit this path because Compress() chops the + // input into blocks and does not create cross-block copies. However, it is + // nice if we do not rely on that, since we can get better compression if we + // allow cross-block copies and thus might want to change the compressor in + // the future. + // TODO Replace this with a properly optimized path. This is not + // triggered right now. But this is so super slow, that it would regress + // performance unacceptably if triggered. + size_t src = cur - offset; + char* op = op_ptr_; + while (len-- > 0) { + char c = blocks_[src >> kBlockLog][src & (kBlockSize - 1)]; + if (!Append(&c, 1, &op)) { + op_ptr_ = op; + return false; + } + src++; + } + op_ptr_ = op; + return true; +} + +class SnappySinkAllocator { + public: + explicit SnappySinkAllocator(Sink* dest) : dest_(dest) {} + ~SnappySinkAllocator() {} + + char* Allocate(int size) { + Datablock block(new char[size], size); + blocks_.push_back(block); + return block.data; + } + + // We flush only at the end, because the writer wants + // random access to the blocks and once we hand the + // block over to the sink, we can't access it anymore. + // Also we don't write more than has been actually written + // to the blocks. + void Flush(size_t size) { + size_t size_written = 0; + for (Datablock& block : blocks_) { + size_t block_size = std::min(block.size, size - size_written); + dest_->AppendAndTakeOwnership(block.data, block_size, + &SnappySinkAllocator::Deleter, NULL); + size_written += block_size; + } + blocks_.clear(); + } + + private: + struct Datablock { + char* data; + size_t size; + Datablock(char* p, size_t s) : data(p), size(s) {} + }; + + static void Deleter(void* arg, const char* bytes, size_t size) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)arg; + (void)size; + + delete[] bytes; + } + + Sink* dest_; + std::vector blocks_; + + // Note: copying this object is allowed +}; + +size_t UncompressAsMuchAsPossible(Source* compressed, Sink* uncompressed) { + SnappySinkAllocator allocator(uncompressed); + SnappyScatteredWriter writer(allocator); + InternalUncompress(compressed, &writer); + return writer.Produced(); +} + +bool Uncompress(Source* compressed, Sink* uncompressed) { + // Read the uncompressed length from the front of the compressed input + SnappyDecompressor decompressor(compressed); + uint32_t uncompressed_len = 0; + if (!decompressor.ReadUncompressedLength(&uncompressed_len)) { + return false; + } + + char c; + size_t allocated_size; + char* buf = uncompressed->GetAppendBufferVariable(1, uncompressed_len, &c, 1, + &allocated_size); + + const size_t compressed_len = compressed->Available(); + // If we can get a flat buffer, then use it, otherwise do block by block + // uncompression + if (allocated_size >= uncompressed_len) { + SnappyArrayWriter writer(buf); + bool result = InternalUncompressAllTags(&decompressor, &writer, + compressed_len, uncompressed_len); + uncompressed->Append(buf, writer.Produced()); + return result; + } else { + SnappySinkAllocator allocator(uncompressed); + SnappyScatteredWriter writer(allocator); + return InternalUncompressAllTags(&decompressor, &writer, compressed_len, + uncompressed_len); + } +} + +} // namespace snappy diff --git a/external/snappy-1.1.3/include/snappy/snappy.h b/external/snappy-1.1.9/snappy.h similarity index 92% rename from external/snappy-1.1.3/include/snappy/snappy.h rename to external/snappy-1.1.9/snappy.h index ec3880f..e4fdad3 100644 --- a/external/snappy-1.1.3/include/snappy/snappy.h +++ b/external/snappy-1.1.9/snappy.h @@ -40,9 +40,11 @@ #define THIRD_PARTY_SNAPPY_SNAPPY_H__ #include +#include + #include -#include "snappy/snappy-stubs-public.h" +#include "snappy-stubs-public.h" namespace snappy { class Source; @@ -63,17 +65,18 @@ namespace snappy { // Also note that this leaves "*source" in a state that is unsuitable for // further operations, such as RawUncompress(). You will need to rewind // or recreate the source yourself before attempting any further calls. - bool GetUncompressedLength(Source* source, uint32* result); + bool GetUncompressedLength(Source* source, uint32_t* result); // ------------------------------------------------------------------------ // Higher-level string based routines (should be sufficient for most users) // ------------------------------------------------------------------------ - // Sets "*output" to the compressed version of "input[0,input_length-1]". - // Original contents of *output are lost. + // Sets "*compressed" to the compressed version of "input[0,input_length-1]". + // Original contents of *compressed are lost. // - // REQUIRES: "input[]" is not an alias of "*output". - size_t Compress(const char* input, size_t input_length, string* output); + // REQUIRES: "input[]" is not an alias of "*compressed". + size_t Compress(const char* input, size_t input_length, + std::string* compressed); // Decompresses "compressed[0,compressed_length-1]" to "*uncompressed". // Original contents of "*uncompressed" are lost. @@ -82,7 +85,7 @@ namespace snappy { // // returns false if the message is corrupted and could not be decompressed bool Uncompress(const char* compressed, size_t compressed_length, - string* uncompressed); + std::string* uncompressed); // Decompresses "compressed" to "*uncompressed". // @@ -193,11 +196,14 @@ namespace snappy { // Note that there might be older data around that is compressed with larger // block sizes, so the decompression code should not rely on the // non-existence of long backreferences. - static const int kBlockLog = 16; - static const size_t kBlockSize = 1 << kBlockLog; + static constexpr int kBlockLog = 16; + static constexpr size_t kBlockSize = 1 << kBlockLog; - static const int kMaxHashTableBits = 14; - static const size_t kMaxHashTableSize = 1 << kMaxHashTableBits; + static constexpr int kMinHashTableBits = 8; + static constexpr size_t kMinHashTableSize = 1 << kMinHashTableBits; + + static constexpr int kMaxHashTableBits = 14; + static constexpr size_t kMaxHashTableSize = 1 << kMaxHashTableBits; } // end namespace snappy #endif // THIRD_PARTY_SNAPPY_SNAPPY_H__ diff --git a/external/snappy-1.1.9/snappy_benchmark.cc b/external/snappy-1.1.9/snappy_benchmark.cc new file mode 100644 index 0000000..9a54f9c --- /dev/null +++ b/external/snappy-1.1.9/snappy_benchmark.cc @@ -0,0 +1,330 @@ +// Copyright 2020 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include + +#include "snappy-test.h" + +#include "benchmark/benchmark.h" + +#include "snappy-internal.h" +#include "snappy-sinksource.h" +#include "snappy.h" +#include "snappy_test_data.h" + +namespace snappy { + +namespace { + +void BM_UFlat(benchmark::State& state) { + // Pick file to process based on state.range(0). + int file_index = state.range(0); + + CHECK_GE(file_index, 0); + CHECK_LT(file_index, ARRAYSIZE(kTestDataFiles)); + std::string contents = + ReadTestDataFile(kTestDataFiles[file_index].filename, + kTestDataFiles[file_index].size_limit); + + std::string zcontents; + snappy::Compress(contents.data(), contents.size(), &zcontents); + char* dst = new char[contents.size()]; + + for (auto s : state) { + CHECK(snappy::RawUncompress(zcontents.data(), zcontents.size(), dst)); + benchmark::DoNotOptimize(dst); + } + state.SetBytesProcessed(static_cast(state.iterations()) * + static_cast(contents.size())); + state.SetLabel(kTestDataFiles[file_index].label); + + delete[] dst; +} +BENCHMARK(BM_UFlat)->DenseRange(0, ARRAYSIZE(kTestDataFiles) - 1); + +struct SourceFiles { + SourceFiles() { + for (int i = 0; i < kFiles; i++) { + std::string contents = ReadTestDataFile(kTestDataFiles[i].filename, + kTestDataFiles[i].size_limit); + max_size = std::max(max_size, contents.size()); + sizes[i] = contents.size(); + snappy::Compress(contents.data(), contents.size(), &zcontents[i]); + } + } + static constexpr int kFiles = ARRAYSIZE(kTestDataFiles); + std::string zcontents[kFiles]; + size_t sizes[kFiles]; + size_t max_size = 0; +}; + +void BM_UFlatMedley(benchmark::State& state) { + static const SourceFiles* const source = new SourceFiles(); + + std::vector dst(source->max_size); + + for (auto s : state) { + for (int i = 0; i < SourceFiles::kFiles; i++) { + CHECK(snappy::RawUncompress(source->zcontents[i].data(), + source->zcontents[i].size(), dst.data())); + benchmark::DoNotOptimize(dst); + } + } + + int64_t source_sizes = 0; + for (int i = 0; i < SourceFiles::kFiles; i++) { + source_sizes += static_cast(source->sizes[i]); + } + state.SetBytesProcessed(static_cast(state.iterations()) * + source_sizes); +} +BENCHMARK(BM_UFlatMedley); + +void BM_UValidate(benchmark::State& state) { + // Pick file to process based on state.range(0). + int file_index = state.range(0); + + CHECK_GE(file_index, 0); + CHECK_LT(file_index, ARRAYSIZE(kTestDataFiles)); + std::string contents = + ReadTestDataFile(kTestDataFiles[file_index].filename, + kTestDataFiles[file_index].size_limit); + + std::string zcontents; + snappy::Compress(contents.data(), contents.size(), &zcontents); + + for (auto s : state) { + CHECK(snappy::IsValidCompressedBuffer(zcontents.data(), zcontents.size())); + } + state.SetBytesProcessed(static_cast(state.iterations()) * + static_cast(contents.size())); + state.SetLabel(kTestDataFiles[file_index].label); +} +BENCHMARK(BM_UValidate)->DenseRange(0, ARRAYSIZE(kTestDataFiles) - 1); + +void BM_UValidateMedley(benchmark::State& state) { + static const SourceFiles* const source = new SourceFiles(); + + for (auto s : state) { + for (int i = 0; i < SourceFiles::kFiles; i++) { + CHECK(snappy::IsValidCompressedBuffer(source->zcontents[i].data(), + source->zcontents[i].size())); + } + } + + int64_t source_sizes = 0; + for (int i = 0; i < SourceFiles::kFiles; i++) { + source_sizes += static_cast(source->sizes[i]); + } + state.SetBytesProcessed(static_cast(state.iterations()) * + source_sizes); +} +BENCHMARK(BM_UValidateMedley); + +void BM_UIOVec(benchmark::State& state) { + // Pick file to process based on state.range(0). + int file_index = state.range(0); + + CHECK_GE(file_index, 0); + CHECK_LT(file_index, ARRAYSIZE(kTestDataFiles)); + std::string contents = + ReadTestDataFile(kTestDataFiles[file_index].filename, + kTestDataFiles[file_index].size_limit); + + std::string zcontents; + snappy::Compress(contents.data(), contents.size(), &zcontents); + + // Uncompress into an iovec containing ten entries. + const int kNumEntries = 10; + struct iovec iov[kNumEntries]; + char *dst = new char[contents.size()]; + size_t used_so_far = 0; + for (int i = 0; i < kNumEntries; ++i) { + iov[i].iov_base = dst + used_so_far; + if (used_so_far == contents.size()) { + iov[i].iov_len = 0; + continue; + } + + if (i == kNumEntries - 1) { + iov[i].iov_len = contents.size() - used_so_far; + } else { + iov[i].iov_len = contents.size() / kNumEntries; + } + used_so_far += iov[i].iov_len; + } + + for (auto s : state) { + CHECK(snappy::RawUncompressToIOVec(zcontents.data(), zcontents.size(), iov, + kNumEntries)); + benchmark::DoNotOptimize(iov); + } + state.SetBytesProcessed(static_cast(state.iterations()) * + static_cast(contents.size())); + state.SetLabel(kTestDataFiles[file_index].label); + + delete[] dst; +} +BENCHMARK(BM_UIOVec)->DenseRange(0, 4); + +void BM_UFlatSink(benchmark::State& state) { + // Pick file to process based on state.range(0). + int file_index = state.range(0); + + CHECK_GE(file_index, 0); + CHECK_LT(file_index, ARRAYSIZE(kTestDataFiles)); + std::string contents = + ReadTestDataFile(kTestDataFiles[file_index].filename, + kTestDataFiles[file_index].size_limit); + + std::string zcontents; + snappy::Compress(contents.data(), contents.size(), &zcontents); + char* dst = new char[contents.size()]; + + for (auto s : state) { + snappy::ByteArraySource source(zcontents.data(), zcontents.size()); + snappy::UncheckedByteArraySink sink(dst); + CHECK(snappy::Uncompress(&source, &sink)); + benchmark::DoNotOptimize(sink); + } + state.SetBytesProcessed(static_cast(state.iterations()) * + static_cast(contents.size())); + state.SetLabel(kTestDataFiles[file_index].label); + + std::string s(dst, contents.size()); + CHECK_EQ(contents, s); + + delete[] dst; +} + +BENCHMARK(BM_UFlatSink)->DenseRange(0, ARRAYSIZE(kTestDataFiles) - 1); + +void BM_ZFlat(benchmark::State& state) { + // Pick file to process based on state.range(0). + int file_index = state.range(0); + + CHECK_GE(file_index, 0); + CHECK_LT(file_index, ARRAYSIZE(kTestDataFiles)); + std::string contents = + ReadTestDataFile(kTestDataFiles[file_index].filename, + kTestDataFiles[file_index].size_limit); + char* dst = new char[snappy::MaxCompressedLength(contents.size())]; + + size_t zsize = 0; + for (auto s : state) { + snappy::RawCompress(contents.data(), contents.size(), dst, &zsize); + benchmark::DoNotOptimize(dst); + } + state.SetBytesProcessed(static_cast(state.iterations()) * + static_cast(contents.size())); + const double compression_ratio = + static_cast(zsize) / std::max(1, contents.size()); + state.SetLabel(StrFormat("%s (%.2f %%)", kTestDataFiles[file_index].label, + 100.0 * compression_ratio)); + VLOG(0) << StrFormat("compression for %s: %d -> %d bytes", + kTestDataFiles[file_index].label, contents.size(), + zsize); + delete[] dst; +} +BENCHMARK(BM_ZFlat)->DenseRange(0, ARRAYSIZE(kTestDataFiles) - 1); + +void BM_ZFlatAll(benchmark::State& state) { + const int num_files = ARRAYSIZE(kTestDataFiles); + + std::vector contents(num_files); + std::vector dst(num_files); + + int64_t total_contents_size = 0; + for (int i = 0; i < num_files; ++i) { + contents[i] = ReadTestDataFile(kTestDataFiles[i].filename, + kTestDataFiles[i].size_limit); + dst[i] = new char[snappy::MaxCompressedLength(contents[i].size())]; + total_contents_size += contents[i].size(); + } + + size_t zsize = 0; + for (auto s : state) { + for (int i = 0; i < num_files; ++i) { + snappy::RawCompress(contents[i].data(), contents[i].size(), dst[i], + &zsize); + benchmark::DoNotOptimize(dst); + } + } + + state.SetBytesProcessed(static_cast(state.iterations()) * + total_contents_size); + + for (char* dst_item : dst) { + delete[] dst_item; + } + state.SetLabel(StrFormat("%d kTestDataFiles", num_files)); +} +BENCHMARK(BM_ZFlatAll); + +void BM_ZFlatIncreasingTableSize(benchmark::State& state) { + CHECK_GT(ARRAYSIZE(kTestDataFiles), 0); + const std::string base_content = ReadTestDataFile( + kTestDataFiles[0].filename, kTestDataFiles[0].size_limit); + + std::vector contents; + std::vector dst; + int64_t total_contents_size = 0; + for (int table_bits = kMinHashTableBits; table_bits <= kMaxHashTableBits; + ++table_bits) { + std::string content = base_content; + content.resize(1 << table_bits); + dst.push_back(new char[snappy::MaxCompressedLength(content.size())]); + total_contents_size += content.size(); + contents.push_back(std::move(content)); + } + + size_t zsize = 0; + for (auto s : state) { + for (size_t i = 0; i < contents.size(); ++i) { + snappy::RawCompress(contents[i].data(), contents[i].size(), dst[i], + &zsize); + benchmark::DoNotOptimize(dst); + } + } + + state.SetBytesProcessed(static_cast(state.iterations()) * + total_contents_size); + + for (char* dst_item : dst) { + delete[] dst_item; + } + state.SetLabel(StrFormat("%d tables", contents.size())); +} +BENCHMARK(BM_ZFlatIncreasingTableSize); + +} // namespace + +} // namespace snappy diff --git a/external/snappy-1.1.9/snappy_compress_fuzzer.cc b/external/snappy-1.1.9/snappy_compress_fuzzer.cc new file mode 100644 index 0000000..1d4429a --- /dev/null +++ b/external/snappy-1.1.9/snappy_compress_fuzzer.cc @@ -0,0 +1,60 @@ +// Copyright 2019 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// libFuzzer harness for fuzzing snappy compression code. + +#include +#include + +#include +#include + +#include "snappy.h" + +// Entry point for LibFuzzer. +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + std::string input(reinterpret_cast(data), size); + + std::string compressed; + size_t compressed_size = + snappy::Compress(input.data(), input.size(), &compressed); + + (void)compressed_size; // Variable only used in debug builds. + assert(compressed_size == compressed.size()); + assert(compressed.size() <= snappy::MaxCompressedLength(input.size())); + assert(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + + std::string uncompressed_after_compress; + bool uncompress_succeeded = snappy::Uncompress( + compressed.data(), compressed.size(), &uncompressed_after_compress); + + (void)uncompress_succeeded; // Variable only used in debug builds. + assert(uncompress_succeeded); + assert(input == uncompressed_after_compress); + return 0; +} diff --git a/external/snappy-1.1.9/snappy_test_data.cc b/external/snappy-1.1.9/snappy_test_data.cc new file mode 100644 index 0000000..8b54153 --- /dev/null +++ b/external/snappy-1.1.9/snappy_test_data.cc @@ -0,0 +1,57 @@ +// Copyright 2020 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Support code for reading test data. + +#include "snappy_test_data.h" + +#include +#include +#include + +#include "snappy-test.h" + +namespace snappy { + +std::string ReadTestDataFile(const char* base, size_t size_limit) { + std::string srcdir; + const char* srcdir_env = std::getenv("srcdir"); // This is set by Automake. + if (srcdir_env) { + srcdir = std::string(srcdir_env) + "/"; + } + + std::string contents; + CHECK_OK(file::GetContents(srcdir + "testdata/" + base, &contents, + file::Defaults())); + if (size_limit > 0) { + contents = contents.substr(0, size_limit); + } + return contents; +} + +} // namespace snappy diff --git a/external/snappy-1.1.9/snappy_test_data.h b/external/snappy-1.1.9/snappy_test_data.h new file mode 100644 index 0000000..b01f74b --- /dev/null +++ b/external/snappy-1.1.9/snappy_test_data.h @@ -0,0 +1,68 @@ +// Copyright 2020 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// List of test case files. + +#ifndef THIRD_PARTY_SNAPPY_SNAPPY_TEST_DATA_H__ +#define THIRD_PARTY_SNAPPY_SNAPPY_TEST_DATA_H__ + +#include +#include + +namespace snappy { + +std::string ReadTestDataFile(const char* base, size_t size_limit); + +// TODO: Replace anonymous namespace with inline variable when we can +// rely on C++17. +namespace { + +constexpr struct { + const char* label; + const char* filename; + size_t size_limit; +} kTestDataFiles[] = { + { "html", "html", 0 }, + { "urls", "urls.10K", 0 }, + { "jpg", "fireworks.jpeg", 0 }, + { "jpg_200", "fireworks.jpeg", 200 }, + { "pdf", "paper-100k.pdf", 0 }, + { "html4", "html_x_4", 0 }, + { "txt1", "alice29.txt", 0 }, + { "txt2", "asyoulik.txt", 0 }, + { "txt3", "lcet10.txt", 0 }, + { "txt4", "plrabn12.txt", 0 }, + { "pb", "geo.protodata", 0 }, + { "gaviota", "kppkn.gtb", 0 }, +}; + +} // namespace + +} // namespace snappy + +#endif // THIRD_PARTY_SNAPPY_SNAPPY_TEST_DATA_H__ diff --git a/external/snappy-1.1.9/snappy_test_tool.cc b/external/snappy-1.1.9/snappy_test_tool.cc new file mode 100644 index 0000000..24ac1ee --- /dev/null +++ b/external/snappy-1.1.9/snappy_test_tool.cc @@ -0,0 +1,471 @@ +// Copyright 2020 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "snappy-test.h" + +#include "snappy-internal.h" +#include "snappy-sinksource.h" +#include "snappy.h" +#include "snappy_test_data.h" + +SNAPPY_FLAG(int32_t, start_len, -1, + "Starting prefix size for testing (-1: just full file contents)"); +SNAPPY_FLAG(int32_t, end_len, -1, + "Starting prefix size for testing (-1: just full file contents)"); +SNAPPY_FLAG(int32_t, bytes, 10485760, + "How many bytes to compress/uncompress per file for timing"); + +SNAPPY_FLAG(bool, zlib, true, + "Run zlib compression (http://www.zlib.net)"); +SNAPPY_FLAG(bool, lzo, true, + "Run LZO compression (http://www.oberhumer.com/opensource/lzo/)"); +SNAPPY_FLAG(bool, lz4, true, + "Run LZ4 compression (https://github.com/lz4/lz4)"); +SNAPPY_FLAG(bool, snappy, true, "Run snappy compression"); + +SNAPPY_FLAG(bool, write_compressed, false, + "Write compressed versions of each file to .comp"); +SNAPPY_FLAG(bool, write_uncompressed, false, + "Write uncompressed versions of each file to .uncomp"); + +namespace snappy { + +namespace { + +#if defined(HAVE_FUNC_MMAP) && defined(HAVE_FUNC_SYSCONF) + +// To test against code that reads beyond its input, this class copies a +// string to a newly allocated group of pages, the last of which +// is made unreadable via mprotect. Note that we need to allocate the +// memory with mmap(), as POSIX allows mprotect() only on memory allocated +// with mmap(), and some malloc/posix_memalign implementations expect to +// be able to read previously allocated memory while doing heap allocations. +class DataEndingAtUnreadablePage { + public: + explicit DataEndingAtUnreadablePage(const std::string& s) { + const size_t page_size = sysconf(_SC_PAGESIZE); + const size_t size = s.size(); + // Round up space for string to a multiple of page_size. + size_t space_for_string = (size + page_size - 1) & ~(page_size - 1); + alloc_size_ = space_for_string + page_size; + mem_ = mmap(NULL, alloc_size_, + PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + CHECK_NE(MAP_FAILED, mem_); + protected_page_ = reinterpret_cast(mem_) + space_for_string; + char* dst = protected_page_ - size; + std::memcpy(dst, s.data(), size); + data_ = dst; + size_ = size; + // Make guard page unreadable. + CHECK_EQ(0, mprotect(protected_page_, page_size, PROT_NONE)); + } + + ~DataEndingAtUnreadablePage() { + const size_t page_size = sysconf(_SC_PAGESIZE); + // Undo the mprotect. + CHECK_EQ(0, mprotect(protected_page_, page_size, PROT_READ|PROT_WRITE)); + CHECK_EQ(0, munmap(mem_, alloc_size_)); + } + + const char* data() const { return data_; } + size_t size() const { return size_; } + + private: + size_t alloc_size_; + void* mem_; + char* protected_page_; + const char* data_; + size_t size_; +}; + +#else // defined(HAVE_FUNC_MMAP) && defined(HAVE_FUNC_SYSCONF) + +// Fallback for systems without mmap. +using DataEndingAtUnreadablePage = std::string; + +#endif + +enum CompressorType { ZLIB, LZO, LZ4, SNAPPY }; + +const char* names[] = {"ZLIB", "LZO", "LZ4", "SNAPPY"}; + +size_t MinimumRequiredOutputSpace(size_t input_size, CompressorType comp) { + switch (comp) { +#ifdef ZLIB_VERSION + case ZLIB: + return ZLib::MinCompressbufSize(input_size); +#endif // ZLIB_VERSION + +#ifdef LZO_VERSION + case LZO: + return input_size + input_size/64 + 16 + 3; +#endif // LZO_VERSION + +#ifdef LZ4_VERSION_NUMBER + case LZ4: + return LZ4_compressBound(input_size); +#endif // LZ4_VERSION_NUMBER + + case SNAPPY: + return snappy::MaxCompressedLength(input_size); + + default: + LOG(FATAL) << "Unknown compression type number " << comp; + return 0; + } +} + +// Returns true if we successfully compressed, false otherwise. +// +// If compressed_is_preallocated is set, do not resize the compressed buffer. +// This is typically what you want for a benchmark, in order to not spend +// time in the memory allocator. If you do set this flag, however, +// "compressed" must be preinitialized to at least MinCompressbufSize(comp) +// number of bytes, and may contain junk bytes at the end after return. +bool Compress(const char* input, size_t input_size, CompressorType comp, + std::string* compressed, bool compressed_is_preallocated) { + if (!compressed_is_preallocated) { + compressed->resize(MinimumRequiredOutputSpace(input_size, comp)); + } + + switch (comp) { +#ifdef ZLIB_VERSION + case ZLIB: { + ZLib zlib; + uLongf destlen = compressed->size(); + int ret = zlib.Compress( + reinterpret_cast(string_as_array(compressed)), + &destlen, + reinterpret_cast(input), + input_size); + CHECK_EQ(Z_OK, ret); + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + return true; + } +#endif // ZLIB_VERSION + +#ifdef LZO_VERSION + case LZO: { + unsigned char* mem = new unsigned char[LZO1X_1_15_MEM_COMPRESS]; + lzo_uint destlen; + int ret = lzo1x_1_15_compress( + reinterpret_cast(input), + input_size, + reinterpret_cast(string_as_array(compressed)), + &destlen, + mem); + CHECK_EQ(LZO_E_OK, ret); + delete[] mem; + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + break; + } +#endif // LZO_VERSION + +#ifdef LZ4_VERSION_NUMBER + case LZ4: { + int destlen = compressed->size(); + destlen = LZ4_compress_default(input, string_as_array(compressed), + input_size, destlen); + CHECK_NE(destlen, 0); + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + break; + } +#endif // LZ4_VERSION_NUMBER + + case SNAPPY: { + size_t destlen; + snappy::RawCompress(input, input_size, + string_as_array(compressed), + &destlen); + CHECK_LE(destlen, snappy::MaxCompressedLength(input_size)); + if (!compressed_is_preallocated) { + compressed->resize(destlen); + } + break; + } + + default: { + return false; // the asked-for library wasn't compiled in + } + } + return true; +} + +bool Uncompress(const std::string& compressed, CompressorType comp, int size, + std::string* output) { + // TODO: Switch to [[maybe_unused]] when we can assume C++17. + (void)size; + switch (comp) { +#ifdef ZLIB_VERSION + case ZLIB: { + output->resize(size); + ZLib zlib; + uLongf destlen = output->size(); + int ret = zlib.Uncompress( + reinterpret_cast(string_as_array(output)), + &destlen, + reinterpret_cast(compressed.data()), + compressed.size()); + CHECK_EQ(Z_OK, ret); + CHECK_EQ(static_cast(size), destlen); + break; + } +#endif // ZLIB_VERSION + +#ifdef LZO_VERSION + case LZO: { + output->resize(size); + lzo_uint destlen; + int ret = lzo1x_decompress( + reinterpret_cast(compressed.data()), + compressed.size(), + reinterpret_cast(string_as_array(output)), + &destlen, + NULL); + CHECK_EQ(LZO_E_OK, ret); + CHECK_EQ(static_cast(size), destlen); + break; + } +#endif // LZO_VERSION + +#ifdef LZ4_VERSION_NUMBER + case LZ4: { + output->resize(size); + int destlen = output->size(); + destlen = LZ4_decompress_safe(compressed.data(), string_as_array(output), + compressed.size(), destlen); + CHECK_NE(destlen, 0); + CHECK_EQ(size, destlen); + break; + } +#endif // LZ4_VERSION_NUMBER + case SNAPPY: { + snappy::RawUncompress(compressed.data(), compressed.size(), + string_as_array(output)); + break; + } + + default: { + return false; // the asked-for library wasn't compiled in + } + } + return true; +} + +void Measure(const char* data, size_t length, CompressorType comp, int repeats, + int block_size) { + // Run tests a few time and pick median running times + static const int kRuns = 5; + double ctime[kRuns]; + double utime[kRuns]; + int compressed_size = 0; + + { + // Chop the input into blocks + int num_blocks = (length + block_size - 1) / block_size; + std::vector input(num_blocks); + std::vector input_length(num_blocks); + std::vector compressed(num_blocks); + std::vector output(num_blocks); + for (int b = 0; b < num_blocks; ++b) { + int input_start = b * block_size; + int input_limit = std::min((b+1)*block_size, length); + input[b] = data+input_start; + input_length[b] = input_limit-input_start; + } + + // Pre-grow the output buffers so we don't measure string append time. + for (std::string& compressed_block : compressed) { + compressed_block.resize(MinimumRequiredOutputSpace(block_size, comp)); + } + + // First, try one trial compression to make sure the code is compiled in + if (!Compress(input[0], input_length[0], comp, &compressed[0], true)) { + LOG(WARNING) << "Skipping " << names[comp] << ": " + << "library not compiled in"; + return; + } + + for (int run = 0; run < kRuns; ++run) { + CycleTimer ctimer, utimer; + + // Pre-grow the output buffers so we don't measure string append time. + for (std::string& compressed_block : compressed) { + compressed_block.resize(MinimumRequiredOutputSpace(block_size, comp)); + } + + ctimer.Start(); + for (int b = 0; b < num_blocks; ++b) { + for (int i = 0; i < repeats; ++i) + Compress(input[b], input_length[b], comp, &compressed[b], true); + } + ctimer.Stop(); + + // Compress once more, with resizing, so we don't leave junk + // at the end that will confuse the decompressor. + for (int b = 0; b < num_blocks; ++b) { + Compress(input[b], input_length[b], comp, &compressed[b], false); + } + + for (int b = 0; b < num_blocks; ++b) { + output[b].resize(input_length[b]); + } + + utimer.Start(); + for (int i = 0; i < repeats; ++i) { + for (int b = 0; b < num_blocks; ++b) + Uncompress(compressed[b], comp, input_length[b], &output[b]); + } + utimer.Stop(); + + ctime[run] = ctimer.Get(); + utime[run] = utimer.Get(); + } + + compressed_size = 0; + for (const std::string& compressed_item : compressed) { + compressed_size += compressed_item.size(); + } + } + + std::sort(ctime, ctime + kRuns); + std::sort(utime, utime + kRuns); + const int med = kRuns/2; + + float comp_rate = (length / ctime[med]) * repeats / 1048576.0; + float uncomp_rate = (length / utime[med]) * repeats / 1048576.0; + std::string x = names[comp]; + x += ":"; + std::string urate = (uncomp_rate >= 0) ? StrFormat("%.1f", uncomp_rate) + : std::string("?"); + std::printf("%-7s [b %dM] bytes %6d -> %6d %4.1f%% " + "comp %5.1f MB/s uncomp %5s MB/s\n", + x.c_str(), + block_size/(1<<20), + static_cast(length), static_cast(compressed_size), + (compressed_size * 100.0) / std::max(1, length), + comp_rate, + urate.c_str()); +} + +void CompressFile(const char* fname) { + std::string fullinput; + CHECK_OK(file::GetContents(fname, &fullinput, file::Defaults())); + + std::string compressed; + Compress(fullinput.data(), fullinput.size(), SNAPPY, &compressed, false); + + CHECK_OK(file::SetContents(std::string(fname).append(".comp"), compressed, + file::Defaults())); +} + +void UncompressFile(const char* fname) { + std::string fullinput; + CHECK_OK(file::GetContents(fname, &fullinput, file::Defaults())); + + size_t uncompLength; + CHECK(snappy::GetUncompressedLength(fullinput.data(), fullinput.size(), + &uncompLength)); + + std::string uncompressed; + uncompressed.resize(uncompLength); + CHECK(snappy::Uncompress(fullinput.data(), fullinput.size(), &uncompressed)); + + CHECK_OK(file::SetContents(std::string(fname).append(".uncomp"), uncompressed, + file::Defaults())); +} + +void MeasureFile(const char* fname) { + std::string fullinput; + CHECK_OK(file::GetContents(fname, &fullinput, file::Defaults())); + std::printf("%-40s :\n", fname); + + int start_len = (snappy::GetFlag(FLAGS_start_len) < 0) + ? fullinput.size() + : snappy::GetFlag(FLAGS_start_len); + int end_len = fullinput.size(); + if (snappy::GetFlag(FLAGS_end_len) >= 0) { + end_len = std::min(fullinput.size(), snappy::GetFlag(FLAGS_end_len)); + } + for (int len = start_len; len <= end_len; ++len) { + const char* const input = fullinput.data(); + int repeats = (snappy::GetFlag(FLAGS_bytes) + len) / (len + 1); + if (snappy::GetFlag(FLAGS_zlib)) + Measure(input, len, ZLIB, repeats, 1024 << 10); + if (snappy::GetFlag(FLAGS_lzo)) + Measure(input, len, LZO, repeats, 1024 << 10); + if (snappy::GetFlag(FLAGS_lz4)) + Measure(input, len, LZ4, repeats, 1024 << 10); + if (snappy::GetFlag(FLAGS_snappy)) + Measure(input, len, SNAPPY, repeats, 4096 << 10); + + // For block-size based measurements + if (0 && snappy::GetFlag(FLAGS_snappy)) { + Measure(input, len, SNAPPY, repeats, 8<<10); + Measure(input, len, SNAPPY, repeats, 16<<10); + Measure(input, len, SNAPPY, repeats, 32<<10); + Measure(input, len, SNAPPY, repeats, 64<<10); + Measure(input, len, SNAPPY, repeats, 256<<10); + Measure(input, len, SNAPPY, repeats, 1024<<10); + } + } +} + +} // namespace + +} // namespace snappy + +int main(int argc, char** argv) { + InitGoogle(argv[0], &argc, &argv, true); + + for (int arg = 1; arg < argc; ++arg) { + if (snappy::GetFlag(FLAGS_write_compressed)) { + snappy::CompressFile(argv[arg]); + } else if (snappy::GetFlag(FLAGS_write_uncompressed)) { + snappy::UncompressFile(argv[arg]); + } else { + snappy::MeasureFile(argv[arg]); + } + } + return 0; +} diff --git a/external/snappy-1.1.9/snappy_uncompress_fuzzer.cc b/external/snappy-1.1.9/snappy_uncompress_fuzzer.cc new file mode 100644 index 0000000..385bfb5 --- /dev/null +++ b/external/snappy-1.1.9/snappy_uncompress_fuzzer.cc @@ -0,0 +1,58 @@ +// Copyright 2019 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// libFuzzer harness for fuzzing snappy's decompression code. + +#include +#include + +#include +#include + +#include "snappy.h" + +// Entry point for LibFuzzer. +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + std::string input(reinterpret_cast(data), size); + + // Avoid self-crafted decompression bombs. + size_t uncompressed_size; + constexpr size_t kMaxUncompressedSize = 1 << 20; + bool get_uncompressed_length_succeeded = snappy::GetUncompressedLength( + input.data(), input.size(), &uncompressed_size); + if (!get_uncompressed_length_succeeded || + (uncompressed_size > kMaxUncompressedSize)) { + return 0; + } + + std::string uncompressed; + // The return value of snappy::Uncompress() is ignored because decompression + // will fail on invalid inputs. + snappy::Uncompress(input.data(), input.size(), &uncompressed); + return 0; +} diff --git a/external/snappy-1.1.9/snappy_unittest.cc b/external/snappy-1.1.9/snappy_unittest.cc new file mode 100644 index 0000000..7a85635 --- /dev/null +++ b/external/snappy-1.1.9/snappy_unittest.cc @@ -0,0 +1,966 @@ +// Copyright 2005 and onwards Google Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include +#include + +#include "snappy-test.h" + +#include "gtest/gtest.h" + +#include "snappy-internal.h" +#include "snappy-sinksource.h" +#include "snappy.h" +#include "snappy_test_data.h" + +SNAPPY_FLAG(bool, snappy_dump_decompression_table, false, + "If true, we print the decompression table during tests."); + +namespace snappy { + +namespace { + +#if defined(HAVE_FUNC_MMAP) && defined(HAVE_FUNC_SYSCONF) + +// To test against code that reads beyond its input, this class copies a +// string to a newly allocated group of pages, the last of which +// is made unreadable via mprotect. Note that we need to allocate the +// memory with mmap(), as POSIX allows mprotect() only on memory allocated +// with mmap(), and some malloc/posix_memalign implementations expect to +// be able to read previously allocated memory while doing heap allocations. +class DataEndingAtUnreadablePage { + public: + explicit DataEndingAtUnreadablePage(const std::string& s) { + const size_t page_size = sysconf(_SC_PAGESIZE); + const size_t size = s.size(); + // Round up space for string to a multiple of page_size. + size_t space_for_string = (size + page_size - 1) & ~(page_size - 1); + alloc_size_ = space_for_string + page_size; + mem_ = mmap(NULL, alloc_size_, + PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + CHECK_NE(MAP_FAILED, mem_); + protected_page_ = reinterpret_cast(mem_) + space_for_string; + char* dst = protected_page_ - size; + std::memcpy(dst, s.data(), size); + data_ = dst; + size_ = size; + // Make guard page unreadable. + CHECK_EQ(0, mprotect(protected_page_, page_size, PROT_NONE)); + } + + ~DataEndingAtUnreadablePage() { + const size_t page_size = sysconf(_SC_PAGESIZE); + // Undo the mprotect. + CHECK_EQ(0, mprotect(protected_page_, page_size, PROT_READ|PROT_WRITE)); + CHECK_EQ(0, munmap(mem_, alloc_size_)); + } + + const char* data() const { return data_; } + size_t size() const { return size_; } + + private: + size_t alloc_size_; + void* mem_; + char* protected_page_; + const char* data_; + size_t size_; +}; + +#else // defined(HAVE_FUNC_MMAP) && defined(HAVE_FUNC_SYSCONF) + +// Fallback for systems without mmap. +using DataEndingAtUnreadablePage = std::string; + +#endif + +int VerifyString(const std::string& input) { + std::string compressed; + DataEndingAtUnreadablePage i(input); + const size_t written = snappy::Compress(i.data(), i.size(), &compressed); + CHECK_EQ(written, compressed.size()); + CHECK_LE(compressed.size(), + snappy::MaxCompressedLength(input.size())); + CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + + std::string uncompressed; + DataEndingAtUnreadablePage c(compressed); + CHECK(snappy::Uncompress(c.data(), c.size(), &uncompressed)); + CHECK_EQ(uncompressed, input); + return uncompressed.size(); +} + +void VerifyStringSink(const std::string& input) { + std::string compressed; + DataEndingAtUnreadablePage i(input); + const size_t written = snappy::Compress(i.data(), i.size(), &compressed); + CHECK_EQ(written, compressed.size()); + CHECK_LE(compressed.size(), + snappy::MaxCompressedLength(input.size())); + CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + + std::string uncompressed; + uncompressed.resize(input.size()); + snappy::UncheckedByteArraySink sink(string_as_array(&uncompressed)); + DataEndingAtUnreadablePage c(compressed); + snappy::ByteArraySource source(c.data(), c.size()); + CHECK(snappy::Uncompress(&source, &sink)); + CHECK_EQ(uncompressed, input); +} + +void VerifyIOVec(const std::string& input) { + std::string compressed; + DataEndingAtUnreadablePage i(input); + const size_t written = snappy::Compress(i.data(), i.size(), &compressed); + CHECK_EQ(written, compressed.size()); + CHECK_LE(compressed.size(), + snappy::MaxCompressedLength(input.size())); + CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + + // Try uncompressing into an iovec containing a random number of entries + // ranging from 1 to 10. + char* buf = new char[input.size()]; + std::minstd_rand0 rng(input.size()); + std::uniform_int_distribution uniform_1_to_10(1, 10); + size_t num = uniform_1_to_10(rng); + if (input.size() < num) { + num = input.size(); + } + struct iovec* iov = new iovec[num]; + size_t used_so_far = 0; + std::bernoulli_distribution one_in_five(1.0 / 5); + for (size_t i = 0; i < num; ++i) { + assert(used_so_far < input.size()); + iov[i].iov_base = buf + used_so_far; + if (i == num - 1) { + iov[i].iov_len = input.size() - used_so_far; + } else { + // Randomly choose to insert a 0 byte entry. + if (one_in_five(rng)) { + iov[i].iov_len = 0; + } else { + std::uniform_int_distribution uniform_not_used_so_far( + 0, input.size() - used_so_far - 1); + iov[i].iov_len = uniform_not_used_so_far(rng); + } + } + used_so_far += iov[i].iov_len; + } + CHECK(snappy::RawUncompressToIOVec( + compressed.data(), compressed.size(), iov, num)); + CHECK(!memcmp(buf, input.data(), input.size())); + delete[] iov; + delete[] buf; +} + +// Test that data compressed by a compressor that does not +// obey block sizes is uncompressed properly. +void VerifyNonBlockedCompression(const std::string& input) { + if (input.length() > snappy::kBlockSize) { + // We cannot test larger blocks than the maximum block size, obviously. + return; + } + + std::string prefix; + Varint::Append32(&prefix, input.size()); + + // Setup compression table + snappy::internal::WorkingMemory wmem(input.size()); + int table_size; + uint16_t* table = wmem.GetHashTable(input.size(), &table_size); + + // Compress entire input in one shot + std::string compressed; + compressed += prefix; + compressed.resize(prefix.size()+snappy::MaxCompressedLength(input.size())); + char* dest = string_as_array(&compressed) + prefix.size(); + char* end = snappy::internal::CompressFragment(input.data(), input.size(), + dest, table, table_size); + compressed.resize(end - compressed.data()); + + // Uncompress into std::string + std::string uncomp_str; + CHECK(snappy::Uncompress(compressed.data(), compressed.size(), &uncomp_str)); + CHECK_EQ(uncomp_str, input); + + // Uncompress using source/sink + std::string uncomp_str2; + uncomp_str2.resize(input.size()); + snappy::UncheckedByteArraySink sink(string_as_array(&uncomp_str2)); + snappy::ByteArraySource source(compressed.data(), compressed.size()); + CHECK(snappy::Uncompress(&source, &sink)); + CHECK_EQ(uncomp_str2, input); + + // Uncompress into iovec + { + static const int kNumBlocks = 10; + struct iovec vec[kNumBlocks]; + const int block_size = 1 + input.size() / kNumBlocks; + std::string iovec_data(block_size * kNumBlocks, 'x'); + for (int i = 0; i < kNumBlocks; ++i) { + vec[i].iov_base = string_as_array(&iovec_data) + i * block_size; + vec[i].iov_len = block_size; + } + CHECK(snappy::RawUncompressToIOVec(compressed.data(), compressed.size(), + vec, kNumBlocks)); + CHECK_EQ(std::string(iovec_data.data(), input.size()), input); + } +} + +// Expand the input so that it is at least K times as big as block size +std::string Expand(const std::string& input) { + static const int K = 3; + std::string data = input; + while (data.size() < K * snappy::kBlockSize) { + data += input; + } + return data; +} + +int Verify(const std::string& input) { + VLOG(1) << "Verifying input of size " << input.size(); + + // Compress using string based routines + const int result = VerifyString(input); + + // Verify using sink based routines + VerifyStringSink(input); + + VerifyNonBlockedCompression(input); + VerifyIOVec(input); + if (!input.empty()) { + const std::string expanded = Expand(input); + VerifyNonBlockedCompression(expanded); + VerifyIOVec(input); + } + + return result; +} + +bool IsValidCompressedBuffer(const std::string& c) { + return snappy::IsValidCompressedBuffer(c.data(), c.size()); +} +bool Uncompress(const std::string& c, std::string* u) { + return snappy::Uncompress(c.data(), c.size(), u); +} + +// This test checks to ensure that snappy doesn't coredump if it gets +// corrupted data. +TEST(CorruptedTest, VerifyCorrupted) { + std::string source = "making sure we don't crash with corrupted input"; + VLOG(1) << source; + std::string dest; + std::string uncmp; + snappy::Compress(source.data(), source.size(), &dest); + + // Mess around with the data. It's hard to simulate all possible + // corruptions; this is just one example ... + CHECK_GT(dest.size(), 3); + dest[1]--; + dest[3]++; + // this really ought to fail. + CHECK(!IsValidCompressedBuffer(dest)); + CHECK(!Uncompress(dest, &uncmp)); + + // This is testing for a security bug - a buffer that decompresses to 100k + // but we lie in the snappy header and only reserve 0 bytes of memory :) + source.resize(100000); + for (char& source_char : source) { + source_char = 'A'; + } + snappy::Compress(source.data(), source.size(), &dest); + dest[0] = dest[1] = dest[2] = dest[3] = 0; + CHECK(!IsValidCompressedBuffer(dest)); + CHECK(!Uncompress(dest, &uncmp)); + + if (sizeof(void *) == 4) { + // Another security check; check a crazy big length can't DoS us with an + // over-allocation. + // Currently this is done only for 32-bit builds. On 64-bit builds, + // where 3 GB might be an acceptable allocation size, Uncompress() + // attempts to decompress, and sometimes causes the test to run out of + // memory. + dest[0] = dest[1] = dest[2] = dest[3] = '\xff'; + // This decodes to a really large size, i.e., about 3 GB. + dest[4] = 'k'; + CHECK(!IsValidCompressedBuffer(dest)); + CHECK(!Uncompress(dest, &uncmp)); + } else { + LOG(WARNING) << "Crazy decompression lengths not checked on 64-bit build"; + } + + // This decodes to about 2 MB; much smaller, but should still fail. + dest[0] = dest[1] = dest[2] = '\xff'; + dest[3] = 0x00; + CHECK(!IsValidCompressedBuffer(dest)); + CHECK(!Uncompress(dest, &uncmp)); + + // try reading stuff in from a bad file. + for (int i = 1; i <= 3; ++i) { + std::string data = + ReadTestDataFile(StrFormat("baddata%d.snappy", i).c_str(), 0); + std::string uncmp; + // check that we don't return a crazy length + size_t ulen; + CHECK(!snappy::GetUncompressedLength(data.data(), data.size(), &ulen) + || (ulen < (1<<20))); + uint32_t ulen2; + snappy::ByteArraySource source(data.data(), data.size()); + CHECK(!snappy::GetUncompressedLength(&source, &ulen2) || + (ulen2 < (1<<20))); + CHECK(!IsValidCompressedBuffer(data)); + CHECK(!Uncompress(data, &uncmp)); + } +} + +// Helper routines to construct arbitrary compressed strings. +// These mirror the compression code in snappy.cc, but are copied +// here so that we can bypass some limitations in the how snappy.cc +// invokes these routines. +void AppendLiteral(std::string* dst, const std::string& literal) { + if (literal.empty()) return; + int n = literal.size() - 1; + if (n < 60) { + // Fit length in tag byte + dst->push_back(0 | (n << 2)); + } else { + // Encode in upcoming bytes + char number[4]; + int count = 0; + while (n > 0) { + number[count++] = n & 0xff; + n >>= 8; + } + dst->push_back(0 | ((59+count) << 2)); + *dst += std::string(number, count); + } + *dst += literal; +} + +void AppendCopy(std::string* dst, int offset, int length) { + while (length > 0) { + // Figure out how much to copy in one shot + int to_copy; + if (length >= 68) { + to_copy = 64; + } else if (length > 64) { + to_copy = 60; + } else { + to_copy = length; + } + length -= to_copy; + + if ((to_copy >= 4) && (to_copy < 12) && (offset < 2048)) { + assert(to_copy-4 < 8); // Must fit in 3 bits + dst->push_back(1 | ((to_copy-4) << 2) | ((offset >> 8) << 5)); + dst->push_back(offset & 0xff); + } else if (offset < 65536) { + dst->push_back(2 | ((to_copy-1) << 2)); + dst->push_back(offset & 0xff); + dst->push_back(offset >> 8); + } else { + dst->push_back(3 | ((to_copy-1) << 2)); + dst->push_back(offset & 0xff); + dst->push_back((offset >> 8) & 0xff); + dst->push_back((offset >> 16) & 0xff); + dst->push_back((offset >> 24) & 0xff); + } + } +} + +TEST(Snappy, SimpleTests) { + Verify(""); + Verify("a"); + Verify("ab"); + Verify("abc"); + + Verify("aaaaaaa" + std::string(16, 'b') + std::string("aaaaa") + "abc"); + Verify("aaaaaaa" + std::string(256, 'b') + std::string("aaaaa") + "abc"); + Verify("aaaaaaa" + std::string(2047, 'b') + std::string("aaaaa") + "abc"); + Verify("aaaaaaa" + std::string(65536, 'b') + std::string("aaaaa") + "abc"); + Verify("abcaaaaaaa" + std::string(65536, 'b') + std::string("aaaaa") + "abc"); +} + +// Regression test for cr/345340892. +TEST(Snappy, AppendSelfPatternExtensionEdgeCases) { + Verify("abcabcabcabcabcabcab"); + Verify("abcabcabcabcabcabcab0123456789ABCDEF"); + + Verify("abcabcabcabcabcabcabcabcabcabcabcabc"); + Verify("abcabcabcabcabcabcabcabcabcabcabcabc0123456789ABCDEF"); +} + +// Regression test for cr/345340892. +TEST(Snappy, AppendSelfPatternExtensionEdgeCasesExhaustive) { + std::mt19937 rng; + std::uniform_int_distribution uniform_byte(0, 255); + for (int pattern_size = 1; pattern_size <= 18; ++pattern_size) { + for (int length = 1; length <= 64; ++length) { + for (int extra_bytes_after_pattern : {0, 1, 15, 16, 128}) { + const int size = pattern_size + length + extra_bytes_after_pattern; + std::string input; + input.resize(size); + for (int i = 0; i < pattern_size; ++i) { + input[i] = 'a' + i; + } + for (int i = 0; i < length; ++i) { + input[pattern_size + i] = input[i]; + } + for (int i = 0; i < extra_bytes_after_pattern; ++i) { + input[pattern_size + length + i] = + static_cast(uniform_byte(rng)); + } + Verify(input); + } + } + } +} + +// Verify max blowup (lots of four-byte copies) +TEST(Snappy, MaxBlowup) { + std::mt19937 rng; + std::uniform_int_distribution uniform_byte(0, 255); + std::string input; + for (int i = 0; i < 80000; ++i) + input.push_back(static_cast(uniform_byte(rng))); + + for (int i = 0; i < 80000; i += 4) { + std::string four_bytes(input.end() - i - 4, input.end() - i); + input.append(four_bytes); + } + Verify(input); +} + +TEST(Snappy, RandomData) { + std::minstd_rand0 rng(snappy::GetFlag(FLAGS_test_random_seed)); + std::uniform_int_distribution uniform_0_to_3(0, 3); + std::uniform_int_distribution uniform_0_to_8(0, 8); + std::uniform_int_distribution uniform_byte(0, 255); + std::uniform_int_distribution uniform_4k(0, 4095); + std::uniform_int_distribution uniform_64k(0, 65535); + std::bernoulli_distribution one_in_ten(1.0 / 10); + + constexpr int num_ops = 20000; + for (int i = 0; i < num_ops; ++i) { + if ((i % 1000) == 0) { + VLOG(0) << "Random op " << i << " of " << num_ops; + } + + std::string x; + size_t len = uniform_4k(rng); + if (i < 100) { + len = 65536 + uniform_64k(rng); + } + while (x.size() < len) { + int run_len = 1; + if (one_in_ten(rng)) { + int skewed_bits = uniform_0_to_8(rng); + // int is guaranteed to hold at least 16 bits, this uses at most 8 bits. + std::uniform_int_distribution skewed_low(0, + (1 << skewed_bits) - 1); + run_len = skewed_low(rng); + } + char c = static_cast(uniform_byte(rng)); + if (i >= 100) { + int skewed_bits = uniform_0_to_3(rng); + // int is guaranteed to hold at least 16 bits, this uses at most 3 bits. + std::uniform_int_distribution skewed_low(0, + (1 << skewed_bits) - 1); + c = static_cast(skewed_low(rng)); + } + while (run_len-- > 0 && x.size() < len) { + x.push_back(c); + } + } + + Verify(x); + } +} + +TEST(Snappy, FourByteOffset) { + // The new compressor cannot generate four-byte offsets since + // it chops up the input into 32KB pieces. So we hand-emit the + // copy manually. + + // The two fragments that make up the input string. + std::string fragment1 = "012345689abcdefghijklmnopqrstuvwxyz"; + std::string fragment2 = "some other string"; + + // How many times each fragment is emitted. + const int n1 = 2; + const int n2 = 100000 / fragment2.size(); + const size_t length = n1 * fragment1.size() + n2 * fragment2.size(); + + std::string compressed; + Varint::Append32(&compressed, length); + + AppendLiteral(&compressed, fragment1); + std::string src = fragment1; + for (int i = 0; i < n2; ++i) { + AppendLiteral(&compressed, fragment2); + src += fragment2; + } + AppendCopy(&compressed, src.size(), fragment1.size()); + src += fragment1; + CHECK_EQ(length, src.size()); + + std::string uncompressed; + CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + CHECK(snappy::Uncompress(compressed.data(), compressed.size(), + &uncompressed)); + CHECK_EQ(uncompressed, src); +} + +TEST(Snappy, IOVecEdgeCases) { + // Test some tricky edge cases in the iovec output that are not necessarily + // exercised by random tests. + + // Our output blocks look like this initially (the last iovec is bigger + // than depicted): + // [ ] [ ] [ ] [ ] [ ] + static const int kLengths[] = { 2, 1, 4, 8, 128 }; + + struct iovec iov[ARRAYSIZE(kLengths)]; + for (int i = 0; i < ARRAYSIZE(kLengths); ++i) { + iov[i].iov_base = new char[kLengths[i]]; + iov[i].iov_len = kLengths[i]; + } + + std::string compressed; + Varint::Append32(&compressed, 22); + + // A literal whose output crosses three blocks. + // [ab] [c] [123 ] [ ] [ ] + AppendLiteral(&compressed, "abc123"); + + // A copy whose output crosses two blocks (source and destination + // segments marked). + // [ab] [c] [1231] [23 ] [ ] + // ^--^ -- + AppendCopy(&compressed, 3, 3); + + // A copy where the input is, at first, in the block before the output: + // + // [ab] [c] [1231] [231231 ] [ ] + // ^--- ^--- + // Then during the copy, the pointers move such that the input and + // output pointers are in the same block: + // + // [ab] [c] [1231] [23123123] [ ] + // ^- ^- + // And then they move again, so that the output pointer is no longer + // in the same block as the input pointer: + // [ab] [c] [1231] [23123123] [123 ] + // ^-- ^-- + AppendCopy(&compressed, 6, 9); + + // Finally, a copy where the input is from several blocks back, + // and it also crosses three blocks: + // + // [ab] [c] [1231] [23123123] [123b ] + // ^ ^ + // [ab] [c] [1231] [23123123] [123bc ] + // ^ ^ + // [ab] [c] [1231] [23123123] [123bc12 ] + // ^- ^- + AppendCopy(&compressed, 17, 4); + + CHECK(snappy::RawUncompressToIOVec( + compressed.data(), compressed.size(), iov, ARRAYSIZE(iov))); + CHECK_EQ(0, memcmp(iov[0].iov_base, "ab", 2)); + CHECK_EQ(0, memcmp(iov[1].iov_base, "c", 1)); + CHECK_EQ(0, memcmp(iov[2].iov_base, "1231", 4)); + CHECK_EQ(0, memcmp(iov[3].iov_base, "23123123", 8)); + CHECK_EQ(0, memcmp(iov[4].iov_base, "123bc12", 7)); + + for (int i = 0; i < ARRAYSIZE(kLengths); ++i) { + delete[] reinterpret_cast(iov[i].iov_base); + } +} + +TEST(Snappy, IOVecLiteralOverflow) { + static const int kLengths[] = { 3, 4 }; + + struct iovec iov[ARRAYSIZE(kLengths)]; + for (int i = 0; i < ARRAYSIZE(kLengths); ++i) { + iov[i].iov_base = new char[kLengths[i]]; + iov[i].iov_len = kLengths[i]; + } + + std::string compressed; + Varint::Append32(&compressed, 8); + + AppendLiteral(&compressed, "12345678"); + + CHECK(!snappy::RawUncompressToIOVec( + compressed.data(), compressed.size(), iov, ARRAYSIZE(iov))); + + for (int i = 0; i < ARRAYSIZE(kLengths); ++i) { + delete[] reinterpret_cast(iov[i].iov_base); + } +} + +TEST(Snappy, IOVecCopyOverflow) { + static const int kLengths[] = { 3, 4 }; + + struct iovec iov[ARRAYSIZE(kLengths)]; + for (int i = 0; i < ARRAYSIZE(kLengths); ++i) { + iov[i].iov_base = new char[kLengths[i]]; + iov[i].iov_len = kLengths[i]; + } + + std::string compressed; + Varint::Append32(&compressed, 8); + + AppendLiteral(&compressed, "123"); + AppendCopy(&compressed, 3, 5); + + CHECK(!snappy::RawUncompressToIOVec( + compressed.data(), compressed.size(), iov, ARRAYSIZE(iov))); + + for (int i = 0; i < ARRAYSIZE(kLengths); ++i) { + delete[] reinterpret_cast(iov[i].iov_base); + } +} + +bool CheckUncompressedLength(const std::string& compressed, size_t* ulength) { + const bool result1 = snappy::GetUncompressedLength(compressed.data(), + compressed.size(), + ulength); + + snappy::ByteArraySource source(compressed.data(), compressed.size()); + uint32_t length; + const bool result2 = snappy::GetUncompressedLength(&source, &length); + CHECK_EQ(result1, result2); + return result1; +} + +TEST(SnappyCorruption, TruncatedVarint) { + std::string compressed, uncompressed; + size_t ulength; + compressed.push_back('\xf0'); + CHECK(!CheckUncompressedLength(compressed, &ulength)); + CHECK(!snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + CHECK(!snappy::Uncompress(compressed.data(), compressed.size(), + &uncompressed)); +} + +TEST(SnappyCorruption, UnterminatedVarint) { + std::string compressed, uncompressed; + size_t ulength; + compressed.push_back('\x80'); + compressed.push_back('\x80'); + compressed.push_back('\x80'); + compressed.push_back('\x80'); + compressed.push_back('\x80'); + compressed.push_back(10); + CHECK(!CheckUncompressedLength(compressed, &ulength)); + CHECK(!snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + CHECK(!snappy::Uncompress(compressed.data(), compressed.size(), + &uncompressed)); +} + +TEST(SnappyCorruption, OverflowingVarint) { + std::string compressed, uncompressed; + size_t ulength; + compressed.push_back('\xfb'); + compressed.push_back('\xff'); + compressed.push_back('\xff'); + compressed.push_back('\xff'); + compressed.push_back('\x7f'); + CHECK(!CheckUncompressedLength(compressed, &ulength)); + CHECK(!snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); + CHECK(!snappy::Uncompress(compressed.data(), compressed.size(), + &uncompressed)); +} + +TEST(Snappy, ReadPastEndOfBuffer) { + // Check that we do not read past end of input + + // Make a compressed string that ends with a single-byte literal + std::string compressed; + Varint::Append32(&compressed, 1); + AppendLiteral(&compressed, "x"); + + std::string uncompressed; + DataEndingAtUnreadablePage c(compressed); + CHECK(snappy::Uncompress(c.data(), c.size(), &uncompressed)); + CHECK_EQ(uncompressed, std::string("x")); +} + +// Check for an infinite loop caused by a copy with offset==0 +TEST(Snappy, ZeroOffsetCopy) { + const char* compressed = "\x40\x12\x00\x00"; + // \x40 Length (must be > kMaxIncrementCopyOverflow) + // \x12\x00\x00 Copy with offset==0, length==5 + char uncompressed[100]; + EXPECT_FALSE(snappy::RawUncompress(compressed, 4, uncompressed)); +} + +TEST(Snappy, ZeroOffsetCopyValidation) { + const char* compressed = "\x05\x12\x00\x00"; + // \x05 Length + // \x12\x00\x00 Copy with offset==0, length==5 + EXPECT_FALSE(snappy::IsValidCompressedBuffer(compressed, 4)); +} + +int TestFindMatchLength(const char* s1, const char *s2, unsigned length) { + uint64_t data; + std::pair p = + snappy::internal::FindMatchLength(s1, s2, s2 + length, &data); + CHECK_EQ(p.first < 8, p.second); + return p.first; +} + +TEST(Snappy, FindMatchLength) { + // Exercise all different code paths through the function. + // 64-bit version: + + // Hit s1_limit in 64-bit loop, hit s1_limit in single-character loop. + EXPECT_EQ(6, TestFindMatchLength("012345", "012345", 6)); + EXPECT_EQ(11, TestFindMatchLength("01234567abc", "01234567abc", 11)); + + // Hit s1_limit in 64-bit loop, find a non-match in single-character loop. + EXPECT_EQ(9, TestFindMatchLength("01234567abc", "01234567axc", 9)); + + // Same, but edge cases. + EXPECT_EQ(11, TestFindMatchLength("01234567abc!", "01234567abc!", 11)); + EXPECT_EQ(11, TestFindMatchLength("01234567abc!", "01234567abc?", 11)); + + // Find non-match at once in first loop. + EXPECT_EQ(0, TestFindMatchLength("01234567xxxxxxxx", "?1234567xxxxxxxx", 16)); + EXPECT_EQ(1, TestFindMatchLength("01234567xxxxxxxx", "0?234567xxxxxxxx", 16)); + EXPECT_EQ(4, TestFindMatchLength("01234567xxxxxxxx", "01237654xxxxxxxx", 16)); + EXPECT_EQ(7, TestFindMatchLength("01234567xxxxxxxx", "0123456?xxxxxxxx", 16)); + + // Find non-match in first loop after one block. + EXPECT_EQ(8, TestFindMatchLength("abcdefgh01234567xxxxxxxx", + "abcdefgh?1234567xxxxxxxx", 24)); + EXPECT_EQ(9, TestFindMatchLength("abcdefgh01234567xxxxxxxx", + "abcdefgh0?234567xxxxxxxx", 24)); + EXPECT_EQ(12, TestFindMatchLength("abcdefgh01234567xxxxxxxx", + "abcdefgh01237654xxxxxxxx", 24)); + EXPECT_EQ(15, TestFindMatchLength("abcdefgh01234567xxxxxxxx", + "abcdefgh0123456?xxxxxxxx", 24)); + + // 32-bit version: + + // Short matches. + EXPECT_EQ(0, TestFindMatchLength("01234567", "?1234567", 8)); + EXPECT_EQ(1, TestFindMatchLength("01234567", "0?234567", 8)); + EXPECT_EQ(2, TestFindMatchLength("01234567", "01?34567", 8)); + EXPECT_EQ(3, TestFindMatchLength("01234567", "012?4567", 8)); + EXPECT_EQ(4, TestFindMatchLength("01234567", "0123?567", 8)); + EXPECT_EQ(5, TestFindMatchLength("01234567", "01234?67", 8)); + EXPECT_EQ(6, TestFindMatchLength("01234567", "012345?7", 8)); + EXPECT_EQ(7, TestFindMatchLength("01234567", "0123456?", 8)); + EXPECT_EQ(7, TestFindMatchLength("01234567", "0123456?", 7)); + EXPECT_EQ(7, TestFindMatchLength("01234567!", "0123456??", 7)); + + // Hit s1_limit in 32-bit loop, hit s1_limit in single-character loop. + EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd", "xxxxxxabcd", 10)); + EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd?", "xxxxxxabcd?", 10)); + EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcdef", "xxxxxxabcdef", 13)); + + // Same, but edge cases. + EXPECT_EQ(12, TestFindMatchLength("xxxxxx0123abc!", "xxxxxx0123abc!", 12)); + EXPECT_EQ(12, TestFindMatchLength("xxxxxx0123abc!", "xxxxxx0123abc?", 12)); + + // Hit s1_limit in 32-bit loop, find a non-match in single-character loop. + EXPECT_EQ(11, TestFindMatchLength("xxxxxx0123abc", "xxxxxx0123axc", 13)); + + // Find non-match at once in first loop. + EXPECT_EQ(6, TestFindMatchLength("xxxxxx0123xxxxxxxx", + "xxxxxx?123xxxxxxxx", 18)); + EXPECT_EQ(7, TestFindMatchLength("xxxxxx0123xxxxxxxx", + "xxxxxx0?23xxxxxxxx", 18)); + EXPECT_EQ(8, TestFindMatchLength("xxxxxx0123xxxxxxxx", + "xxxxxx0132xxxxxxxx", 18)); + EXPECT_EQ(9, TestFindMatchLength("xxxxxx0123xxxxxxxx", + "xxxxxx012?xxxxxxxx", 18)); + + // Same, but edge cases. + EXPECT_EQ(6, TestFindMatchLength("xxxxxx0123", "xxxxxx?123", 10)); + EXPECT_EQ(7, TestFindMatchLength("xxxxxx0123", "xxxxxx0?23", 10)); + EXPECT_EQ(8, TestFindMatchLength("xxxxxx0123", "xxxxxx0132", 10)); + EXPECT_EQ(9, TestFindMatchLength("xxxxxx0123", "xxxxxx012?", 10)); + + // Find non-match in first loop after one block. + EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd0123xx", + "xxxxxxabcd?123xx", 16)); + EXPECT_EQ(11, TestFindMatchLength("xxxxxxabcd0123xx", + "xxxxxxabcd0?23xx", 16)); + EXPECT_EQ(12, TestFindMatchLength("xxxxxxabcd0123xx", + "xxxxxxabcd0132xx", 16)); + EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcd0123xx", + "xxxxxxabcd012?xx", 16)); + + // Same, but edge cases. + EXPECT_EQ(10, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd?123", 14)); + EXPECT_EQ(11, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd0?23", 14)); + EXPECT_EQ(12, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd0132", 14)); + EXPECT_EQ(13, TestFindMatchLength("xxxxxxabcd0123", "xxxxxxabcd012?", 14)); +} + +TEST(Snappy, FindMatchLengthRandom) { + constexpr int kNumTrials = 10000; + constexpr int kTypicalLength = 10; + std::minstd_rand0 rng(snappy::GetFlag(FLAGS_test_random_seed)); + std::uniform_int_distribution uniform_byte(0, 255); + std::bernoulli_distribution one_in_two(1.0 / 2); + std::bernoulli_distribution one_in_typical_length(1.0 / kTypicalLength); + + for (int i = 0; i < kNumTrials; ++i) { + std::string s, t; + char a = static_cast(uniform_byte(rng)); + char b = static_cast(uniform_byte(rng)); + while (!one_in_typical_length(rng)) { + s.push_back(one_in_two(rng) ? a : b); + t.push_back(one_in_two(rng) ? a : b); + } + DataEndingAtUnreadablePage u(s); + DataEndingAtUnreadablePage v(t); + size_t matched = TestFindMatchLength(u.data(), v.data(), t.size()); + if (matched == t.size()) { + EXPECT_EQ(s, t); + } else { + EXPECT_NE(s[matched], t[matched]); + for (size_t j = 0; j < matched; ++j) { + EXPECT_EQ(s[j], t[j]); + } + } + } +} + +uint16_t MakeEntry(unsigned int extra, unsigned int len, + unsigned int copy_offset) { + // Check that all of the fields fit within the allocated space + assert(extra == (extra & 0x7)); // At most 3 bits + assert(copy_offset == (copy_offset & 0x7)); // At most 3 bits + assert(len == (len & 0x7f)); // At most 7 bits + return len | (copy_offset << 8) | (extra << 11); +} + +// Check that the decompression table is correct, and optionally print out +// the computed one. +TEST(Snappy, VerifyCharTable) { + using snappy::internal::LITERAL; + using snappy::internal::COPY_1_BYTE_OFFSET; + using snappy::internal::COPY_2_BYTE_OFFSET; + using snappy::internal::COPY_4_BYTE_OFFSET; + using snappy::internal::char_table; + + uint16_t dst[256]; + + // Place invalid entries in all places to detect missing initialization + int assigned = 0; + for (int i = 0; i < 256; ++i) { + dst[i] = 0xffff; + } + + // Small LITERAL entries. We store (len-1) in the top 6 bits. + for (uint8_t len = 1; len <= 60; ++len) { + dst[LITERAL | ((len - 1) << 2)] = MakeEntry(0, len, 0); + assigned++; + } + + // Large LITERAL entries. We use 60..63 in the high 6 bits to + // encode the number of bytes of length info that follow the opcode. + for (uint8_t extra_bytes = 1; extra_bytes <= 4; ++extra_bytes) { + // We set the length field in the lookup table to 1 because extra + // bytes encode len-1. + dst[LITERAL | ((extra_bytes + 59) << 2)] = MakeEntry(extra_bytes, 1, 0); + assigned++; + } + + // COPY_1_BYTE_OFFSET. + // + // The tag byte in the compressed data stores len-4 in 3 bits, and + // offset/256 in 5 bits. offset%256 is stored in the next byte. + // + // This format is used for length in range [4..11] and offset in + // range [0..2047] + for (uint8_t len = 4; len < 12; ++len) { + for (uint16_t offset = 0; offset < 2048; offset += 256) { + uint8_t offset_high = static_cast(offset >> 8); + dst[COPY_1_BYTE_OFFSET | ((len - 4) << 2) | (offset_high << 5)] = + MakeEntry(1, len, offset_high); + assigned++; + } + } + + // COPY_2_BYTE_OFFSET. + // Tag contains len-1 in top 6 bits, and offset in next two bytes. + for (uint8_t len = 1; len <= 64; ++len) { + dst[COPY_2_BYTE_OFFSET | ((len - 1) << 2)] = MakeEntry(2, len, 0); + assigned++; + } + + // COPY_4_BYTE_OFFSET. + // Tag contents len-1 in top 6 bits, and offset in next four bytes. + for (uint8_t len = 1; len <= 64; ++len) { + dst[COPY_4_BYTE_OFFSET | ((len - 1) << 2)] = MakeEntry(4, len, 0); + assigned++; + } + + // Check that each entry was initialized exactly once. + EXPECT_EQ(256, assigned) << "Assigned only " << assigned << " of 256"; + for (int i = 0; i < 256; ++i) { + EXPECT_NE(0xffff, dst[i]) << "Did not assign byte " << i; + } + + if (snappy::GetFlag(FLAGS_snappy_dump_decompression_table)) { + std::printf("static const uint16_t char_table[256] = {\n "); + for (int i = 0; i < 256; ++i) { + std::printf("0x%04x%s", + dst[i], + ((i == 255) ? "\n" : (((i % 8) == 7) ? ",\n " : ", "))); + } + std::printf("};\n"); + } + + // Check that computed table matched recorded table. + for (int i = 0; i < 256; ++i) { + EXPECT_EQ(dst[i], char_table[i]) << "Mismatch in byte " << i; + } +} + +TEST(Snappy, TestBenchmarkFiles) { + for (int i = 0; i < ARRAYSIZE(kTestDataFiles); ++i) { + Verify(ReadTestDataFile(kTestDataFiles[i].filename, + kTestDataFiles[i].size_limit)); + } +} + +} // namespace + +} // namespace snappy diff --git a/external/snappy-1.1.9/testdata/alice29.txt b/external/snappy-1.1.9/testdata/alice29.txt new file mode 100644 index 0000000..7033655 --- /dev/null +++ b/external/snappy-1.1.9/testdata/alice29.txt @@ -0,0 +1,3609 @@ + + + + + ALICE'S ADVENTURES IN WONDERLAND + + Lewis Carroll + + THE MILLENNIUM FULCRUM EDITION 2.9 + + + + + CHAPTER I + + Down the Rabbit-Hole + + + Alice was beginning to get very tired of sitting by her sister +on the bank, and of having nothing to do: once or twice she had +peeped into the book her sister was reading, but it had no +pictures or conversations in it, `and what is the use of a book,' +thought Alice `without pictures or conversation?' + + So she was considering in her own mind (as well as she could, +for the hot day made her feel very sleepy and stupid), whether +the pleasure of making a daisy-chain would be worth the trouble +of getting up and picking the daisies, when suddenly a White +Rabbit with pink eyes ran close by her. + + There was nothing so VERY remarkable in that; nor did Alice +think it so VERY much out of the way to hear the Rabbit say to +itself, `Oh dear! Oh dear! I shall be late!' (when she thought +it over afterwards, it occurred to her that she ought to have +wondered at this, but at the time it all seemed quite natural); +but when the Rabbit actually TOOK A WATCH OUT OF ITS WAISTCOAT- +POCKET, and looked at it, and then hurried on, Alice started to +her feet, for it flashed across her mind that she had never +before seen a rabbit with either a waistcoat-pocket, or a watch to +take out of it, and burning with curiosity, she ran across the +field after it, and fortunately was just in time to see it pop +down a large rabbit-hole under the hedge. + + In another moment down went Alice after it, never once +considering how in the world she was to get out again. + + The rabbit-hole went straight on like a tunnel for some way, +and then dipped suddenly down, so suddenly that Alice had not a +moment to think about stopping herself before she found herself +falling down a very deep well. + + Either the well was very deep, or she fell very slowly, for she +had plenty of time as she went down to look about her and to +wonder what was going to happen next. First, she tried to look +down and make out what she was coming to, but it was too dark to +see anything; then she looked at the sides of the well, and +noticed that they were filled with cupboards and book-shelves; +here and there she saw maps and pictures hung upon pegs. She +took down a jar from one of the shelves as she passed; it was +labelled `ORANGE MARMALADE', but to her great disappointment it +was empty: she did not like to drop the jar for fear of killing +somebody, so managed to put it into one of the cupboards as she +fell past it. + + `Well!' thought Alice to herself, `after such a fall as this, I +shall think nothing of tumbling down stairs! How brave they'll +all think me at home! Why, I wouldn't say anything about it, +even if I fell off the top of the house!' (Which was very likely +true.) + + Down, down, down. Would the fall NEVER come to an end! `I +wonder how many miles I've fallen by this time?' she said aloud. +`I must be getting somewhere near the centre of the earth. Let +me see: that would be four thousand miles down, I think--' (for, +you see, Alice had learnt several things of this sort in her +lessons in the schoolroom, and though this was not a VERY good +opportunity for showing off her knowledge, as there was no one to +listen to her, still it was good practice to say it over) `--yes, +that's about the right distance--but then I wonder what Latitude +or Longitude I've got to?' (Alice had no idea what Latitude was, +or Longitude either, but thought they were nice grand words to +say.) + + Presently she began again. `I wonder if I shall fall right +THROUGH the earth! How funny it'll seem to come out among the +people that walk with their heads downward! The Antipathies, I +think--' (she was rather glad there WAS no one listening, this +time, as it didn't sound at all the right word) `--but I shall +have to ask them what the name of the country is, you know. +Please, Ma'am, is this New Zealand or Australia?' (and she tried +to curtsey as she spoke--fancy CURTSEYING as you're falling +through the air! Do you think you could manage it?) `And what +an ignorant little girl she'll think me for asking! No, it'll +never do to ask: perhaps I shall see it written up somewhere.' + + Down, down, down. There was nothing else to do, so Alice soon +began talking again. `Dinah'll miss me very much to-night, I +should think!' (Dinah was the cat.) `I hope they'll remember +her saucer of milk at tea-time. Dinah my dear! I wish you were +down here with me! There are no mice in the air, I'm afraid, but +you might catch a bat, and that's very like a mouse, you know. +But do cats eat bats, I wonder?' And here Alice began to get +rather sleepy, and went on saying to herself, in a dreamy sort of +way, `Do cats eat bats? Do cats eat bats?' and sometimes, `Do +bats eat cats?' for, you see, as she couldn't answer either +question, it didn't much matter which way she put it. She felt +that she was dozing off, and had just begun to dream that she +was walking hand in hand with Dinah, and saying to her very +earnestly, `Now, Dinah, tell me the truth: did you ever eat a +bat?' when suddenly, thump! thump! down she came upon a heap of +sticks and dry leaves, and the fall was over. + + Alice was not a bit hurt, and she jumped up on to her feet in a +moment: she looked up, but it was all dark overhead; before her +was another long passage, and the White Rabbit was still in +sight, hurrying down it. There was not a moment to be lost: +away went Alice like the wind, and was just in time to hear it +say, as it turned a corner, `Oh my ears and whiskers, how late +it's getting!' She was close behind it when she turned the +corner, but the Rabbit was no longer to be seen: she found +herself in a long, low hall, which was lit up by a row of lamps +hanging from the roof. + + There were doors all round the hall, but they were all locked; +and when Alice had been all the way down one side and up the +other, trying every door, she walked sadly down the middle, +wondering how she was ever to get out again. + + Suddenly she came upon a little three-legged table, all made of +solid glass; there was nothing on it except a tiny golden key, +and Alice's first thought was that it might belong to one of the +doors of the hall; but, alas! either the locks were too large, or +the key was too small, but at any rate it would not open any of +them. However, on the second time round, she came upon a low +curtain she had not noticed before, and behind it was a little +door about fifteen inches high: she tried the little golden key +in the lock, and to her great delight it fitted! + + Alice opened the door and found that it led into a small +passage, not much larger than a rat-hole: she knelt down and +looked along the passage into the loveliest garden you ever saw. +How she longed to get out of that dark hall, and wander about +among those beds of bright flowers and those cool fountains, but +she could not even get her head though the doorway; `and even if +my head would go through,' thought poor Alice, `it would be of +very little use without my shoulders. Oh, how I wish +I could shut up like a telescope! I think I could, if I only +know how to begin.' For, you see, so many out-of-the-way things +had happened lately, that Alice had begun to think that very few +things indeed were really impossible. + + There seemed to be no use in waiting by the little door, so she +went back to the table, half hoping she might find another key on +it, or at any rate a book of rules for shutting people up like +telescopes: this time she found a little bottle on it, (`which +certainly was not here before,' said Alice,) and round the neck +of the bottle was a paper label, with the words `DRINK ME' +beautifully printed on it in large letters. + + It was all very well to say `Drink me,' but the wise little +Alice was not going to do THAT in a hurry. `No, I'll look +first,' she said, `and see whether it's marked "poison" or not'; +for she had read several nice little histories about children who +had got burnt, and eaten up by wild beasts and other unpleasant +things, all because they WOULD not remember the simple rules +their friends had taught them: such as, that a red-hot poker +will burn you if you hold it too long; and that if you cut your +finger VERY deeply with a knife, it usually bleeds; and she had +never forgotten that, if you drink much from a bottle marked +`poison,' it is almost certain to disagree with you, sooner or +later. + + However, this bottle was NOT marked `poison,' so Alice ventured +to taste it, and finding it very nice, (it had, in fact, a sort +of mixed flavour of cherry-tart, custard, pine-apple, roast +turkey, toffee, and hot buttered toast,) she very soon finished +it off. + + * * * * * * * + + * * * * * * + + * * * * * * * + + `What a curious feeling!' said Alice; `I must be shutting up +like a telescope.' + + And so it was indeed: she was now only ten inches high, and +her face brightened up at the thought that she was now the right +size for going though the little door into that lovely garden. +First, however, she waited for a few minutes to see if she was +going to shrink any further: she felt a little nervous about +this; `for it might end, you know,' said Alice to herself, `in my +going out altogether, like a candle. I wonder what I should be +like then?' And she tried to fancy what the flame of a candle is +like after the candle is blown out, for she could not remember +ever having seen such a thing. + + After a while, finding that nothing more happened, she decided +on going into the garden at once; but, alas for poor Alice! when +she got to the door, she found he had forgotten the little golden +key, and when she went back to the table for it, she found she +could not possibly reach it: she could see it quite plainly +through the glass, and she tried her best to climb up one of the +legs of the table, but it was too slippery; and when she had +tired herself out with trying, the poor little thing sat down and +cried. + + `Come, there's no use in crying like that!' said Alice to +herself, rather sharply; `I advise you to leave off this minute!' +She generally gave herself very good advice, (though she very +seldom followed it), and sometimes she scolded herself so +severely as to bring tears into her eyes; and once she remembered +trying to box her own ears for having cheated herself in a game +of croquet she was playing against herself, for this curious +child was very fond of pretending to be two people. `But it's no +use now,' thought poor Alice, `to pretend to be two people! Why, +there's hardly enough of me left to make ONE respectable +person!' + + Soon her eye fell on a little glass box that was lying under +the table: she opened it, and found in it a very small cake, on +which the words `EAT ME' were beautifully marked in currants. +`Well, I'll eat it,' said Alice, `and if it makes me grow larger, +I can reach the key; and if it makes me grow smaller, I can creep +under the door; so either way I'll get into the garden, and I +don't care which happens!' + + She ate a little bit, and said anxiously to herself, `Which +way? Which way?', holding her hand on the top of her head to +feel which way it was growing, and she was quite surprised to +find that she remained the same size: to be sure, this generally +happens when one eats cake, but Alice had got so much into the +way of expecting nothing but out-of-the-way things to happen, +that it seemed quite dull and stupid for life to go on in the +common way. + + So she set to work, and very soon finished off the cake. + + * * * * * * * + + * * * * * * + + * * * * * * * + + + + + CHAPTER II + + The Pool of Tears + + + `Curiouser and curiouser!' cried Alice (she was so much +surprised, that for the moment she quite forgot how to speak good +English); `now I'm opening out like the largest telescope that +ever was! Good-bye, feet!' (for when she looked down at her +feet, they seemed to be almost out of sight, they were getting so +far off). `Oh, my poor little feet, I wonder who will put on +your shoes and stockings for you now, dears? I'm sure _I_ shan't +be able! I shall be a great deal too far off to trouble myself +about you: you must manage the best way you can; --but I must be +kind to them,' thought Alice, `or perhaps they won't walk the +way I want to go! Let me see: I'll give them a new pair of +boots every Christmas.' + + And she went on planning to herself how she would manage it. +`They must go by the carrier,' she thought; `and how funny it'll +seem, sending presents to one's own feet! And how odd the +directions will look! + + ALICE'S RIGHT FOOT, ESQ. + HEARTHRUG, + NEAR THE FENDER, + (WITH ALICE'S LOVE). + +Oh dear, what nonsense I'm talking!' + + Just then her head struck against the roof of the hall: in +fact she was now more than nine feet high, and she at once took +up the little golden key and hurried off to the garden door. + + Poor Alice! It was as much as she could do, lying down on one +side, to look through into the garden with one eye; but to get +through was more hopeless than ever: she sat down and began to +cry again. + + `You ought to be ashamed of yourself,' said Alice, `a great +girl like you,' (she might well say this), `to go on crying in +this way! Stop this moment, I tell you!' But she went on all +the same, shedding gallons of tears, until there was a large pool +all round her, about four inches deep and reaching half down the +hall. + + After a time she heard a little pattering of feet in the +distance, and she hastily dried her eyes to see what was coming. +It was the White Rabbit returning, splendidly dressed, with a +pair of white kid gloves in one hand and a large fan in the +other: he came trotting along in a great hurry, muttering to +himself as he came, `Oh! the Duchess, the Duchess! Oh! won't she +be savage if I've kept her waiting!' Alice felt so desperate +that she was ready to ask help of any one; so, when the Rabbit +came near her, she began, in a low, timid voice, `If you please, +sir--' The Rabbit started violently, dropped the white kid +gloves and the fan, and skurried away into the darkness as hard +as he could go. + + Alice took up the fan and gloves, and, as the hall was very +hot, she kept fanning herself all the time she went on talking: +`Dear, dear! How queer everything is to-day! And yesterday +things went on just as usual. I wonder if I've been changed in +the night? Let me think: was I the same when I got up this +morning? I almost think I can remember feeling a little +different. But if I'm not the same, the next question is, Who in +the world am I? Ah, THAT'S the great puzzle!' And she began +thinking over all the children she knew that were of the same age +as herself, to see if she could have been changed for any of +them. + + `I'm sure I'm not Ada,' she said, `for her hair goes in such +long ringlets, and mine doesn't go in ringlets at all; and I'm +sure I can't be Mabel, for I know all sorts of things, and she, +oh! she knows such a very little! Besides, SHE'S she, and I'm I, +and--oh dear, how puzzling it all is! I'll try if I know all the +things I used to know. Let me see: four times five is twelve, +and four times six is thirteen, and four times seven is--oh dear! +I shall never get to twenty at that rate! However, the +Multiplication Table doesn't signify: let's try Geography. +London is the capital of Paris, and Paris is the capital of Rome, +and Rome--no, THAT'S all wrong, I'm certain! I must have been +changed for Mabel! I'll try and say "How doth the little--"' +and she crossed her hands on her lap as if she were saying lessons, +and began to repeat it, but her voice sounded hoarse and +strange, and the words did not come the same as they used to do:-- + + `How doth the little crocodile + Improve his shining tail, + And pour the waters of the Nile + On every golden scale! + + `How cheerfully he seems to grin, + How neatly spread his claws, + And welcome little fishes in + With gently smiling jaws!' + + `I'm sure those are not the right words,' said poor Alice, and +her eyes filled with tears again as she went on, `I must be Mabel +after all, and I shall have to go and live in that poky little +house, and have next to no toys to play with, and oh! ever so +many lessons to learn! No, I've made up my mind about it; if I'm +Mabel, I'll stay down here! It'll be no use their putting their +heads down and saying "Come up again, dear!" I shall only look +up and say "Who am I then? Tell me that first, and then, if I +like being that person, I'll come up: if not, I'll stay down +here till I'm somebody else"--but, oh dear!' cried Alice, with a +sudden burst of tears, `I do wish they WOULD put their heads +down! I am so VERY tired of being all alone here!' + + As she said this she looked down at her hands, and was +surprised to see that she had put on one of the Rabbit's little +white kid gloves while she was talking. `How CAN I have done +that?' she thought. `I must be growing small again.' She got up +and went to the table to measure herself by it, and found that, +as nearly as she could guess, she was now about two feet high, +and was going on shrinking rapidly: she soon found out that the +cause of this was the fan she was holding, and she dropped it +hastily, just in time to avoid shrinking away altogether. + +`That WAS a narrow escape!' said Alice, a good deal frightened at +the sudden change, but very glad to find herself still in +existence; `and now for the garden!' and she ran with all speed +back to the little door: but, alas! the little door was shut +again, and the little golden key was lying on the glass table as +before, `and things are worse than ever,' thought the poor child, +`for I never was so small as this before, never! And I declare +it's too bad, that it is!' + + As she said these words her foot slipped, and in another +moment, splash! she was up to her chin in salt water. He first +idea was that she had somehow fallen into the sea, `and in that +case I can go back by railway,' she said to herself. (Alice had +been to the seaside once in her life, and had come to the general +conclusion, that wherever you go to on the English coast you find +a number of bathing machines in the sea, some children digging in +the sand with wooden spades, then a row of lodging houses, and +behind them a railway station.) However, she soon made out that +she was in the pool of tears which she had wept when she was nine +feet high. + + `I wish I hadn't cried so much!' said Alice, as she swam about, +trying to find her way out. `I shall be punished for it now, I +suppose, by being drowned in my own tears! That WILL be a queer +thing, to be sure! However, everything is queer to-day.' + + Just then she heard something splashing about in the pool a +little way off, and she swam nearer to make out what it was: at +first she thought it must be a walrus or hippopotamus, but then +she remembered how small she was now, and she soon made out that +it was only a mouse that had slipped in like herself. + + `Would it be of any use, now,' thought Alice, `to speak to this +mouse? Everything is so out-of-the-way down here, that I should +think very likely it can talk: at any rate, there's no harm in +trying.' So she began: `O Mouse, do you know the way out of +this pool? I am very tired of swimming about here, O Mouse!' +(Alice thought this must be the right way of speaking to a mouse: +she had never done such a thing before, but she remembered having +seen in her brother's Latin Grammar, `A mouse--of a mouse--to a +mouse--a mouse--O mouse!' The Mouse looked at her rather +inquisitively, and seemed to her to wink with one of its little +eyes, but it said nothing. + + `Perhaps it doesn't understand English,' thought Alice; `I +daresay it's a French mouse, come over with William the +Conqueror.' (For, with all her knowledge of history, Alice had +no very clear notion how long ago anything had happened.) So she +began again: `Ou est ma chatte?' which was the first sentence in +her French lesson-book. The Mouse gave a sudden leap out of the +water, and seemed to quiver all over with fright. `Oh, I beg +your pardon!' cried Alice hastily, afraid that she had hurt the +poor animal's feelings. `I quite forgot you didn't like cats.' + + `Not like cats!' cried the Mouse, in a shrill, passionate +voice. `Would YOU like cats if you were me?' + + `Well, perhaps not,' said Alice in a soothing tone: `don't be +angry about it. And yet I wish I could show you our cat Dinah: +I think you'd take a fancy to cats if you could only see her. +She is such a dear quiet thing,' Alice went on, half to herself, +as she swam lazily about in the pool, `and she sits purring so +nicely by the fire, licking her paws and washing her face--and +she is such a nice soft thing to nurse--and she's such a capital +one for catching mice--oh, I beg your pardon!' cried Alice again, +for this time the Mouse was bristling all over, and she felt +certain it must be really offended. `We won't talk about her any +more if you'd rather not.' + + `We indeed!' cried the Mouse, who was trembling down to the end +of his tail. `As if I would talk on such a subject! Our family +always HATED cats: nasty, low, vulgar things! Don't let me hear +the name again!' + + `I won't indeed!' said Alice, in a great hurry to change the +subject of conversation. `Are you--are you fond--of--of dogs?' +The Mouse did not answer, so Alice went on eagerly: `There is +such a nice little dog near our house I should like to show you! +A little bright-eyed terrier, you know, with oh, such long curly +brown hair! And it'll fetch things when you throw them, and +it'll sit up and beg for its dinner, and all sorts of things--I +can't remember half of them--and it belongs to a farmer, you +know, and he says it's so useful, it's worth a hundred pounds! +He says it kills all the rats and--oh dear!' cried Alice in a +sorrowful tone, `I'm afraid I've offended it again!' For the +Mouse was swimming away from her as hard as it could go, and +making quite a commotion in the pool as it went. + + So she called softly after it, `Mouse dear! Do come back +again, and we won't talk about cats or dogs either, if you don't +like them!' When the Mouse heard this, it turned round and swam +slowly back to her: its face was quite pale (with passion, Alice +thought), and it said in a low trembling voice, `Let us get to +the shore, and then I'll tell you my history, and you'll +understand why it is I hate cats and dogs.' + + It was high time to go, for the pool was getting quite crowded +with the birds and animals that had fallen into it: there were a +Duck and a Dodo, a Lory and an Eaglet, and several other curious +creatures. Alice led the way, and the whole party swam to the +shore. + + + + CHAPTER III + + A Caucus-Race and a Long Tale + + + They were indeed a queer-looking party that assembled on the +bank--the birds with draggled feathers, the animals with their +fur clinging close to them, and all dripping wet, cross, and +uncomfortable. + + The first question of course was, how to get dry again: they +had a consultation about this, and after a few minutes it seemed +quite natural to Alice to find herself talking familiarly with +them, as if she had known them all her life. Indeed, she had +quite a long argument with the Lory, who at last turned sulky, +and would only say, `I am older than you, and must know better'; +and this Alice would not allow without knowing how old it was, +and, as the Lory positively refused to tell its age, there was no +more to be said. + + At last the Mouse, who seemed to be a person of authority among +them, called out, `Sit down, all of you, and listen to me! I'LL +soon make you dry enough!' They all sat down at once, in a large +ring, with the Mouse in the middle. Alice kept her eyes +anxiously fixed on it, for she felt sure she would catch a bad +cold if she did not get dry very soon. + + `Ahem!' said the Mouse with an important air, `are you all ready? +This is the driest thing I know. Silence all round, if you please! +"William the Conqueror, whose cause was favoured by the pope, was +soon submitted to by the English, who wanted leaders, and had been +of late much accustomed to usurpation and conquest. Edwin and +Morcar, the earls of Mercia and Northumbria--"' + + `Ugh!' said the Lory, with a shiver. + + `I beg your pardon!' said the Mouse, frowning, but very +politely: `Did you speak?' + + `Not I!' said the Lory hastily. + + `I thought you did,' said the Mouse. `--I proceed. "Edwin and +Morcar, the earls of Mercia and Northumbria, declared for him: +and even Stigand, the patriotic archbishop of Canterbury, found +it advisable--"' + + `Found WHAT?' said the Duck. + + `Found IT,' the Mouse replied rather crossly: `of course you +know what "it" means.' + + `I know what "it" means well enough, when I find a thing,' said +the Duck: `it's generally a frog or a worm. The question is, +what did the archbishop find?' + + The Mouse did not notice this question, but hurriedly went on, +`"--found it advisable to go with Edgar Atheling to meet William +and offer him the crown. William's conduct at first was +moderate. But the insolence of his Normans--" How are you +getting on now, my dear?' it continued, turning to Alice as it +spoke. + + `As wet as ever,' said Alice in a melancholy tone: `it doesn't +seem to dry me at all.' + + `In that case,' said the Dodo solemnly, rising to its feet, `I +move that the meeting adjourn, for the immediate adoption of more +energetic remedies--' + + `Speak English!' said the Eaglet. `I don't know the meaning of +half those long words, and, what's more, I don't believe you do +either!' And the Eaglet bent down its head to hide a smile: +some of the other birds tittered audibly. + + `What I was going to say,' said the Dodo in an offended tone, +`was, that the best thing to get us dry would be a Caucus-race.' + + `What IS a Caucus-race?' said Alice; not that she wanted much +to know, but the Dodo had paused as if it thought that SOMEBODY +ought to speak, and no one else seemed inclined to say anything. + + `Why,' said the Dodo, `the best way to explain it is to do it.' +(And, as you might like to try the thing yourself, some winter +day, I will tell you how the Dodo managed it.) + + First it marked out a race-course, in a sort of circle, (`the +exact shape doesn't matter,' it said,) and then all the party +were placed along the course, here and there. There was no `One, +two, three, and away,' but they began running when they liked, +and left off when they liked, so that it was not easy to know +when the race was over. However, when they had been running half +an hour or so, and were quite dry again, the Dodo suddenly called +out `The race is over!' and they all crowded round it, panting, +and asking, `But who has won?' + + This question the Dodo could not answer without a great deal of +thought, and it sat for a long time with one finger pressed upon +its forehead (the position in which you usually see Shakespeare, +in the pictures of him), while the rest waited in silence. At +last the Dodo said, `EVERYBODY has won, and all must have +prizes.' + + `But who is to give the prizes?' quite a chorus of voices +asked. + + `Why, SHE, of course,' said the Dodo, pointing to Alice with +one finger; and the whole party at once crowded round her, +calling out in a confused way, `Prizes! Prizes!' + + Alice had no idea what to do, and in despair she put her hand +in her pocket, and pulled out a box of comfits, (luckily the salt +water had not got into it), and handed them round as prizes. +There was exactly one a-piece all round. + + `But she must have a prize herself, you know,' said the Mouse. + + `Of course,' the Dodo replied very gravely. `What else have +you got in your pocket?' he went on, turning to Alice. + + `Only a thimble,' said Alice sadly. + + `Hand it over here,' said the Dodo. + + Then they all crowded round her once more, while the Dodo +solemnly presented the thimble, saying `We beg your acceptance of +this elegant thimble'; and, when it had finished this short +speech, they all cheered. + + Alice thought the whole thing very absurd, but they all looked +so grave that she did not dare to laugh; and, as she could not +think of anything to say, she simply bowed, and took the thimble, +looking as solemn as she could. + + The next thing was to eat the comfits: this caused some noise +and confusion, as the large birds complained that they could not +taste theirs, and the small ones choked and had to be patted on +the back. However, it was over at last, and they sat down again +in a ring, and begged the Mouse to tell them something more. + + `You promised to tell me your history, you know,' said Alice, +`and why it is you hate--C and D,' she added in a whisper, half +afraid that it would be offended again. + + `Mine is a long and a sad tale!' said the Mouse, turning to +Alice, and sighing. + + `It IS a long tail, certainly,' said Alice, looking down with +wonder at the Mouse's tail; `but why do you call it sad?' And +she kept on puzzling about it while the Mouse was speaking, so +that her idea of the tale was something like this:-- + + `Fury said to a + mouse, That he + met in the + house, + "Let us + both go to + law: I will + prosecute + YOU. --Come, + I'll take no + denial; We + must have a + trial: For + really this + morning I've + nothing + to do." + Said the + mouse to the + cur, "Such + a trial, + dear Sir, + With + no jury + or judge, + would be + wasting + our + breath." + "I'll be + judge, I'll + be jury," + Said + cunning + old Fury: + "I'll + try the + whole + cause, + and + condemn + you + to + death."' + + + `You are not attending!' said the Mouse to Alice severely. +`What are you thinking of?' + + `I beg your pardon,' said Alice very humbly: `you had got to +the fifth bend, I think?' + + `I had NOT!' cried the Mouse, sharply and very angrily. + + `A knot!' said Alice, always ready to make herself useful, and +looking anxiously about her. `Oh, do let me help to undo it!' + + `I shall do nothing of the sort,' said the Mouse, getting up +and walking away. `You insult me by talking such nonsense!' + + `I didn't mean it!' pleaded poor Alice. `But you're so easily +offended, you know!' + + The Mouse only growled in reply. + + `Please come back and finish your story!' Alice called after +it; and the others all joined in chorus, `Yes, please do!' but +the Mouse only shook its head impatiently, and walked a little +quicker. + + `What a pity it wouldn't stay!' sighed the Lory, as soon as it +was quite out of sight; and an old Crab took the opportunity of +saying to her daughter `Ah, my dear! Let this be a lesson to you +never to lose YOUR temper!' `Hold your tongue, Ma!' said the +young Crab, a little snappishly. `You're enough to try the +patience of an oyster!' + + `I wish I had our Dinah here, I know I do!' said Alice aloud, +addressing nobody in particular. `She'd soon fetch it back!' + + `And who is Dinah, if I might venture to ask the question?' +said the Lory. + + Alice replied eagerly, for she was always ready to talk about +her pet: `Dinah's our cat. And she's such a capital one for +catching mice you can't think! And oh, I wish you could see her +after the birds! Why, she'll eat a little bird as soon as look +at it!' + + This speech caused a remarkable sensation among the party. +Some of the birds hurried off at once: one the old Magpie began +wrapping itself up very carefully, remarking, `I really must be +getting home; the night-air doesn't suit my throat!' and a Canary +called out in a trembling voice to its children, `Come away, my +dears! It's high time you were all in bed!' On various pretexts +they all moved off, and Alice was soon left alone. + + `I wish I hadn't mentioned Dinah!' she said to herself in a +melancholy tone. `Nobody seems to like her, down here, and I'm +sure she's the best cat in the world! Oh, my dear Dinah! I +wonder if I shall ever see you any more!' And here poor Alice +began to cry again, for she felt very lonely and low-spirited. +In a little while, however, she again heard a little pattering of +footsteps in the distance, and she looked up eagerly, half hoping +that the Mouse had changed his mind, and was coming back to +finish his story. + + + + CHAPTER IV + + The Rabbit Sends in a Little Bill + + + It was the White Rabbit, trotting slowly back again, and +looking anxiously about as it went, as if it had lost something; +and she heard it muttering to itself `The Duchess! The Duchess! +Oh my dear paws! Oh my fur and whiskers! She'll get me +executed, as sure as ferrets are ferrets! Where CAN I have +dropped them, I wonder?' Alice guessed in a moment that it was +looking for the fan and the pair of white kid gloves, and she +very good-naturedly began hunting about for them, but they were +nowhere to be seen--everything seemed to have changed since her +swim in the pool, and the great hall, with the glass table and +the little door, had vanished completely. + + Very soon the Rabbit noticed Alice, as she went hunting about, +and called out to her in an angry tone, `Why, Mary Ann, what ARE +you doing out here? Run home this moment, and fetch me a pair of +gloves and a fan! Quick, now!' And Alice was so much frightened +that she ran off at once in the direction it pointed to, without +trying to explain the mistake it had made. + + `He took me for his housemaid,' she said to herself as she ran. +`How surprised he'll be when he finds out who I am! But I'd +better take him his fan and gloves--that is, if I can find them.' +As she said this, she came upon a neat little house, on the door +of which was a bright brass plate with the name `W. RABBIT' +engraved upon it. She went in without knocking, and hurried +upstairs, in great fear lest she should meet the real Mary Ann, +and be turned out of the house before she had found the fan and +gloves. + + `How queer it seems,' Alice said to herself, `to be going +messages for a rabbit! I suppose Dinah'll be sending me on +messages next!' And she began fancying the sort of thing that +would happen: `"Miss Alice! Come here directly, and get ready +for your walk!" "Coming in a minute, nurse! But I've got to see +that the mouse doesn't get out." Only I don't think,' Alice went +on, `that they'd let Dinah stop in the house if it began ordering +people about like that!' + + By this time she had found her way into a tidy little room with +a table in the window, and on it (as she had hoped) a fan and two +or three pairs of tiny white kid gloves: she took up the fan and +a pair of the gloves, and was just going to leave the room, when +her eye fell upon a little bottle that stood near the looking- +glass. There was no label this time with the words `DRINK ME,' +but nevertheless she uncorked it and put it to her lips. `I know +SOMETHING interesting is sure to happen,' she said to herself, +`whenever I eat or drink anything; so I'll just see what this +bottle does. I do hope it'll make me grow large again, for +really I'm quite tired of being such a tiny little thing!' + + It did so indeed, and much sooner than she had expected: +before she had drunk half the bottle, she found her head pressing +against the ceiling, and had to stoop to save her neck from being +broken. She hastily put down the bottle, saying to herself +`That's quite enough--I hope I shan't grow any more--As it is, I +can't get out at the door--I do wish I hadn't drunk quite so +much!' + + Alas! it was too late to wish that! She went on growing, and +growing, and very soon had to kneel down on the floor: in +another minute there was not even room for this, and she tried +the effect of lying down with one elbow against the door, and the +other arm curled round her head. Still she went on growing, and, +as a last resource, she put one arm out of the window, and one +foot up the chimney, and said to herself `Now I can do no more, +whatever happens. What WILL become of me?' + + Luckily for Alice, the little magic bottle had now had its full +effect, and she grew no larger: still it was very uncomfortable, +and, as there seemed to be no sort of chance of her ever getting +out of the room again, no wonder she felt unhappy. + + `It was much pleasanter at home,' thought poor Alice, `when one +wasn't always growing larger and smaller, and being ordered about +by mice and rabbits. I almost wish I hadn't gone down that +rabbit-hole--and yet--and yet--it's rather curious, you know, +this sort of life! I do wonder what CAN have happened to me! +When I used to read fairy-tales, I fancied that kind of thing +never happened, and now here I am in the middle of one! There +ought to be a book written about me, that there ought! And when +I grow up, I'll write one--but I'm grown up now,' she added in a +sorrowful tone; `at least there's no room to grow up any more +HERE.' + + `But then,' thought Alice, `shall I NEVER get any older than I +am now? That'll be a comfort, one way--never to be an old woman- +-but then--always to have lessons to learn! Oh, I shouldn't like +THAT!' + + `Oh, you foolish Alice!' she answered herself. `How can you +learn lessons in here? Why, there's hardly room for YOU, and no +room at all for any lesson-books!' + + And so she went on, taking first one side and then the other, +and making quite a conversation of it altogether; but after a few +minutes she heard a voice outside, and stopped to listen. + + `Mary Ann! Mary Ann!' said the voice. `Fetch me my gloves +this moment!' Then came a little pattering of feet on the +stairs. Alice knew it was the Rabbit coming to look for her, and +she trembled till she shook the house, quite forgetting that she +was now about a thousand times as large as the Rabbit, and had no +reason to be afraid of it. + + Presently the Rabbit came up to the door, and tried to open it; +but, as the door opened inwards, and Alice's elbow was pressed +hard against it, that attempt proved a failure. Alice heard it +say to itself `Then I'll go round and get in at the window.' + + `THAT you won't' thought Alice, and, after waiting till she +fancied she heard the Rabbit just under the window, she suddenly +spread out her hand, and made a snatch in the air. She did not +get hold of anything, but she heard a little shriek and a fall, +and a crash of broken glass, from which she concluded that it was +just possible it had fallen into a cucumber-frame, or something +of the sort. + + Next came an angry voice--the Rabbit's--`Pat! Pat! Where are +you?' And then a voice she had never heard before, `Sure then +I'm here! Digging for apples, yer honour!' + + `Digging for apples, indeed!' said the Rabbit angrily. `Here! +Come and help me out of THIS!' (Sounds of more broken glass.) + + `Now tell me, Pat, what's that in the window?' + + `Sure, it's an arm, yer honour!' (He pronounced it `arrum.') + + `An arm, you goose! Who ever saw one that size? Why, it +fills the whole window!' + + `Sure, it does, yer honour: but it's an arm for all that.' + + `Well, it's got no business there, at any rate: go and take it +away!' + + There was a long silence after this, and Alice could only hear +whispers now and then; such as, `Sure, I don't like it, yer +honour, at all, at all!' `Do as I tell you, you coward!' and at +last she spread out her hand again, and made another snatch in +the air. This time there were TWO little shrieks, and more +sounds of broken glass. `What a number of cucumber-frames there +must be!' thought Alice. `I wonder what they'll do next! As for +pulling me out of the window, I only wish they COULD! I'm sure I +don't want to stay in here any longer!' + + She waited for some time without hearing anything more: at +last came a rumbling of little cartwheels, and the sound of a +good many voice all talking together: she made out the words: +`Where's the other ladder?--Why, I hadn't to bring but one; +Bill's got the other--Bill! fetch it here, lad!--Here, put 'em up +at this corner--No, tie 'em together first--they don't reach half +high enough yet--Oh! they'll do well enough; don't be particular- +-Here, Bill! catch hold of this rope--Will the roof bear?--Mind +that loose slate--Oh, it's coming down! Heads below!' (a loud +crash)--`Now, who did that?--It was Bill, I fancy--Who's to go +down the chimney?--Nay, I shan't! YOU do it!--That I won't, +then!--Bill's to go down--Here, Bill! the master says you're to +go down the chimney!' + + `Oh! So Bill's got to come down the chimney, has he?' said +Alice to herself. `Shy, they seem to put everything upon Bill! +I wouldn't be in Bill's place for a good deal: this fireplace is +narrow, to be sure; but I THINK I can kick a little!' + + She drew her foot as far down the chimney as she could, and +waited till she heard a little animal (she couldn't guess of what +sort it was) scratching and scrambling about in the chimney close +above her: then, saying to herself `This is Bill,' she gave one +sharp kick, and waited to see what would happen next. + + The first thing she heard was a general chorus of `There goes +Bill!' then the Rabbit's voice along--`Catch him, you by the +hedge!' then silence, and then another confusion of voices--`Hold +up his head--Brandy now--Don't choke him--How was it, old fellow? +What happened to you? Tell us all about it!' + + Last came a little feeble, squeaking voice, (`That's Bill,' +thought Alice,) `Well, I hardly know--No more, thank ye; I'm +better now--but I'm a deal too flustered to tell you--all I know +is, something comes at me like a Jack-in-the-box, and up I goes +like a sky-rocket!' + + `So you did, old fellow!' said the others. + + `We must burn the house down!' said the Rabbit's voice; and +Alice called out as loud as she could, `If you do. I'll set +Dinah at you!' + + There was a dead silence instantly, and Alice thought to +herself, `I wonder what they WILL do next! If they had any +sense, they'd take the roof off.' After a minute or two, they +began moving about again, and Alice heard the Rabbit say, `A +barrowful will do, to begin with.' + + `A barrowful of WHAT?' thought Alice; but she had not long to +doubt, for the next moment a shower of little pebbles came +rattling in at the window, and some of them hit her in the face. +`I'll put a stop to this,' she said to herself, and shouted out, +`You'd better not do that again!' which produced another dead +silence. + + Alice noticed with some surprise that the pebbles were all +turning into little cakes as they lay on the floor, and a bright +idea came into her head. `If I eat one of these cakes,' she +thought, `it's sure to make SOME change in my size; and as it +can't possibly make me larger, it must make me smaller, I +suppose.' + + So she swallowed one of the cakes, and was delighted to find +that she began shrinking directly. As soon as she was small +enough to get through the door, she ran out of the house, and +found quite a crowd of little animals and birds waiting outside. +The poor little Lizard, Bill, was in the middle, being held up by +two guinea-pigs, who were giving it something out of a bottle. +They all made a rush at Alice the moment she appeared; but she +ran off as hard as she could, and soon found herself safe in a +thick wood. + + `The first thing I've got to do,' said Alice to herself, as she +wandered about in the wood, `is to grow to my right size again; +and the second thing is to find my way into that lovely garden. +I think that will be the best plan.' + + It sounded an excellent plan, no doubt, and very neatly and +simply arranged; the only difficulty was, that she had not the +smallest idea how to set about it; and while she was peering +about anxiously among the trees, a little sharp bark just over +her head made her look up in a great hurry. + + An enormous puppy was looking down at her with large round +eyes, and feebly stretching out one paw, trying to touch her. +`Poor little thing!' said Alice, in a coaxing tone, and she tried +hard to whistle to it; but she was terribly frightened all the +time at the thought that it might be hungry, in which case it +would be very likely to eat her up in spite of all her coaxing. + + Hardly knowing what she did, she picked up a little bit of +stick, and held it out to the puppy; whereupon the puppy jumped +into the air off all its feet at once, with a yelp of delight, +and rushed at the stick, and made believe to worry it; then Alice +dodged behind a great thistle, to keep herself from being run +over; and the moment she appeared on the other side, the puppy +made another rush at the stick, and tumbled head over heels in +its hurry to get hold of it; then Alice, thinking it was very +like having a game of play with a cart-horse, and expecting every +moment to be trampled under its feet, ran round the thistle +again; then the puppy began a series of short charges at the +stick, running a very little way forwards each time and a long +way back, and barking hoarsely all the while, till at last it sat +down a good way off, panting, with its tongue hanging out of its +mouth, and its great eyes half shut. + + This seemed to Alice a good opportunity for making her escape; +so she set off at once, and ran till she was quite tired and out +of breath, and till the puppy's bark sounded quite faint in the +distance. + + `And yet what a dear little puppy it was!' said Alice, as she +leant against a buttercup to rest herself, and fanned herself +with one of the leaves: `I should have liked teaching it tricks +very much, if--if I'd only been the right size to do it! Oh +dear! I'd nearly forgotten that I've got to grow up again! Let +me see--how IS it to be managed? I suppose I ought to eat or +drink something or other; but the great question is, what?' + + The great question certainly was, what? Alice looked all round +her at the flowers and the blades of grass, but she did not see +anything that looked like the right thing to eat or drink under +the circumstances. There was a large mushroom growing near her, +about the same height as herself; and when she had looked under +it, and on both sides of it, and behind it, it occurred to her +that she might as well look and see what was on the top of it. + + She stretched herself up on tiptoe, and peeped over the edge of +the mushroom, and her eyes immediately met those of a large +caterpillar, that was sitting on the top with its arms folded, +quietly smoking a long hookah, and taking not the smallest notice +of her or of anything else. + + + + CHAPTER V + + Advice from a Caterpillar + + + The Caterpillar and Alice looked at each other for some time in +silence: at last the Caterpillar took the hookah out of its +mouth, and addressed her in a languid, sleepy voice. + + `Who are YOU?' said the Caterpillar. + + This was not an encouraging opening for a conversation. Alice +replied, rather shyly, `I--I hardly know, sir, just at present-- +at least I know who I WAS when I got up this morning, but I think +I must have been changed several times since then.' + + `What do you mean by that?' said the Caterpillar sternly. +`Explain yourself!' + + `I can't explain MYSELF, I'm afraid, sir' said Alice, `because +I'm not myself, you see.' + + `I don't see,' said the Caterpillar. + + `I'm afraid I can't put it more clearly,' Alice replied very +politely, `for I can't understand it myself to begin with; and +being so many different sizes in a day is very confusing.' + + `It isn't,' said the Caterpillar. + + `Well, perhaps you haven't found it so yet,' said Alice; `but +when you have to turn into a chrysalis--you will some day, you +know--and then after that into a butterfly, I should think you'll +feel it a little queer, won't you?' + + `Not a bit,' said the Caterpillar. + + `Well, perhaps your feelings may be different,' said Alice; +`all I know is, it would feel very queer to ME.' + + `You!' said the Caterpillar contemptuously. `Who are YOU?' + + Which brought them back again to the beginning of the +conversation. Alice felt a little irritated at the Caterpillar's +making such VERY short remarks, and she drew herself up and said, +very gravely, `I think, you ought to tell me who YOU are, first.' + + `Why?' said the Caterpillar. + + Here was another puzzling question; and as Alice could not +think of any good reason, and as the Caterpillar seemed to be in +a VERY unpleasant state of mind, she turned away. + + `Come back!' the Caterpillar called after her. `I've something +important to say!' + + This sounded promising, certainly: Alice turned and came back +again. + + `Keep your temper,' said the Caterpillar. + + `Is that all?' said Alice, swallowing down her anger as well as +she could. + + `No,' said the Caterpillar. + + Alice thought she might as well wait, as she had nothing else +to do, and perhaps after all it might tell her something worth +hearing. For some minutes it puffed away without speaking, but +at last it unfolded its arms, took the hookah out of its mouth +again, and said, `So you think you're changed, do you?' + + `I'm afraid I am, sir,' said Alice; `I can't remember things as +I used--and I don't keep the same size for ten minutes together!' + + `Can't remember WHAT things?' said the Caterpillar. + + `Well, I've tried to say "HOW DOTH THE LITTLE BUSY BEE," but it +all came different!' Alice replied in a very melancholy voice. + + `Repeat, "YOU ARE OLD, FATHER WILLIAM,"' said the Caterpillar. + + Alice folded her hands, and began:-- + + `You are old, Father William,' the young man said, + `And your hair has become very white; + And yet you incessantly stand on your head-- + Do you think, at your age, it is right?' + + `In my youth,' Father William replied to his son, + `I feared it might injure the brain; + But, now that I'm perfectly sure I have none, + Why, I do it again and again.' + + `You are old,' said the youth, `as I mentioned before, + And have grown most uncommonly fat; + Yet you turned a back-somersault in at the door-- + Pray, what is the reason of that?' + + `In my youth,' said the sage, as he shook his grey locks, + `I kept all my limbs very supple + By the use of this ointment--one shilling the box-- + Allow me to sell you a couple?' + + `You are old,' said the youth, `and your jaws are too weak + For anything tougher than suet; + Yet you finished the goose, with the bones and the beak-- + Pray how did you manage to do it?' + + `In my youth,' said his father, `I took to the law, + And argued each case with my wife; + And the muscular strength, which it gave to my jaw, + Has lasted the rest of my life.' + + `You are old,' said the youth, `one would hardly suppose + That your eye was as steady as ever; + Yet you balanced an eel on the end of your nose-- + What made you so awfully clever?' + + `I have answered three questions, and that is enough,' + Said his father; `don't give yourself airs! + Do you think I can listen all day to such stuff? + Be off, or I'll kick you down stairs!' + + + `That is not said right,' said the Caterpillar. + + `Not QUITE right, I'm afraid,' said Alice, timidly; `some of the +words have got altered.' + + `It is wrong from beginning to end,' said the Caterpillar +decidedly, and there was silence for some minutes. + + The Caterpillar was the first to speak. + + `What size do you want to be?' it asked. + + `Oh, I'm not particular as to size,' Alice hastily replied; +`only one doesn't like changing so often, you know.' + + `I DON'T know,' said the Caterpillar. + + Alice said nothing: she had never been so much contradicted in +her life before, and she felt that she was losing her temper. + + `Are you content now?' said the Caterpillar. + + `Well, I should like to be a LITTLE larger, sir, if you +wouldn't mind,' said Alice: `three inches is such a wretched +height to be.' + + `It is a very good height indeed!' said the Caterpillar +angrily, rearing itself upright as it spoke (it was exactly three +inches high). + + `But I'm not used to it!' pleaded poor Alice in a piteous tone. +And she thought of herself, `I wish the creatures wouldn't be so +easily offended!' + + `You'll get used to it in time,' said the Caterpillar; and it +put the hookah into its mouth and began smoking again. + + This time Alice waited patiently until it chose to speak again. +In a minute or two the Caterpillar took the hookah out of its +mouth and yawned once or twice, and shook itself. Then it got +down off the mushroom, and crawled away in the grass, merely +remarking as it went, `One side will make you grow taller, and +the other side will make you grow shorter.' + + `One side of WHAT? The other side of WHAT?' thought Alice to +herself. + + `Of the mushroom,' said the Caterpillar, just as if she had +asked it aloud; and in another moment it was out of sight. + + Alice remained looking thoughtfully at the mushroom for a +minute, trying to make out which were the two sides of it; and as +it was perfectly round, she found this a very difficult question. +However, at last she stretched her arms round it as far as they +would go, and broke off a bit of the edge with each hand. + + `And now which is which?' she said to herself, and nibbled a +little of the right-hand bit to try the effect: the next moment +she felt a violent blow underneath her chin: it had struck her +foot! + + She was a good deal frightened by this very sudden change, but +she felt that there was no time to be lost, as she was shrinking +rapidly; so she set to work at once to eat some of the other bit. +Her chin was pressed so closely against her foot, that there was +hardly room to open her mouth; but she did it at last, and +managed to swallow a morsel of the lefthand bit. + + + * * * * * * * + + * * * * * * + + * * * * * * * + + `Come, my head's free at last!' said Alice in a tone of +delight, which changed into alarm in another moment, when she +found that her shoulders were nowhere to be found: all she could +see, when she looked down, was an immense length of neck, which +seemed to rise like a stalk out of a sea of green leaves that lay +far below her. + + `What CAN all that green stuff be?' said Alice. `And where +HAVE my shoulders got to? And oh, my poor hands, how is it I +can't see you?' She was moving them about as she spoke, but no +result seemed to follow, except a little shaking among the +distant green leaves. + + As there seemed to be no chance of getting her hands up to her +head, she tried to get her head down to them, and was delighted +to find that her neck would bend about easily in any direction, +like a serpent. She had just succeeded in curving it down into a +graceful zigzag, and was going to dive in among the leaves, which +she found to be nothing but the tops of the trees under which she +had been wandering, when a sharp hiss made her draw back in a +hurry: a large pigeon had flown into her face, and was beating +her violently with its wings. + + `Serpent!' screamed the Pigeon. + + `I'm NOT a serpent!' said Alice indignantly. `Let me alone!' + + `Serpent, I say again!' repeated the Pigeon, but in a more +subdued tone, and added with a kind of sob, `I've tried every +way, and nothing seems to suit them!' + + `I haven't the least idea what you're talking about,' said +Alice. + + `I've tried the roots of trees, and I've tried banks, and I've +tried hedges,' the Pigeon went on, without attending to her; `but +those serpents! There's no pleasing them!' + + Alice was more and more puzzled, but she thought there was no +use in saying anything more till the Pigeon had finished. + + `As if it wasn't trouble enough hatching the eggs,' said the +Pigeon; `but I must be on the look-out for serpents night and +day! Why, I haven't had a wink of sleep these three weeks!' + + `I'm very sorry you've been annoyed,' said Alice, who was +beginning to see its meaning. + + `And just as I'd taken the highest tree in the wood,' continued +the Pigeon, raising its voice to a shriek, `and just as I was +thinking I should be free of them at last, they must needs come +wriggling down from the sky! Ugh, Serpent!' + + `But I'm NOT a serpent, I tell you!' said Alice. `I'm a--I'm +a--' + + `Well! WHAT are you?' said the Pigeon. `I can see you're +trying to invent something!' + + `I--I'm a little girl,' said Alice, rather doubtfully, as she +remembered the number of changes she had gone through that day. + + `A likely story indeed!' said the Pigeon in a tone of the +deepest contempt. `I've seen a good many little girls in my +time, but never ONE with such a neck as that! No, no! You're a +serpent; and there's no use denying it. I suppose you'll be +telling me next that you never tasted an egg!' + + `I HAVE tasted eggs, certainly,' said Alice, who was a very +truthful child; `but little girls eat eggs quite as much as +serpents do, you know.' + + `I don't believe it,' said the Pigeon; `but if they do, why +then they're a kind of serpent, that's all I can say.' + + This was such a new idea to Alice, that she was quite silent +for a minute or two, which gave the Pigeon the opportunity of +adding, `You're looking for eggs, I know THAT well enough; and +what does it matter to me whether you're a little girl or a +serpent?' + + `It matters a good deal to ME,' said Alice hastily; `but I'm +not looking for eggs, as it happens; and if I was, I shouldn't +want YOURS: I don't like them raw.' + + `Well, be off, then!' said the Pigeon in a sulky tone, as it +settled down again into its nest. Alice crouched down among the +trees as well as she could, for her neck kept getting entangled +among the branches, and every now and then she had to stop and +untwist it. After a while she remembered that she still held the +pieces of mushroom in her hands, and she set to work very +carefully, nibbling first at one and then at the other, and +growing sometimes taller and sometimes shorter, until she had +succeeded in bringing herself down to her usual height. + + It was so long since she had been anything near the right size, +that it felt quite strange at first; but she got used to it in a +few minutes, and began talking to herself, as usual. `Come, +there's half my plan done now! How puzzling all these changes +are! I'm never sure what I'm going to be, from one minute to +another! However, I've got back to my right size: the next +thing is, to get into that beautiful garden--how IS that to be +done, I wonder?' As she said this, she came suddenly upon an +open place, with a little house in it about four feet high. +`Whoever lives there,' thought Alice, `it'll never do to come +upon them THIS size: why, I should frighten them out of their +wits!' So she began nibbling at the righthand bit again, and did +not venture to go near the house till she had brought herself +down to nine inches high. + + + + CHAPTER VI + + Pig and Pepper + + + For a minute or two she stood looking at the house, and +wondering what to do next, when suddenly a footman in livery came +running out of the wood--(she considered him to be a footman +because he was in livery: otherwise, judging by his face only, +she would have called him a fish)--and rapped loudly at the door +with his knuckles. It was opened by another footman in livery, +with a round face, and large eyes like a frog; and both footmen, +Alice noticed, had powdered hair that curled all over their +heads. She felt very curious to know what it was all about, and +crept a little way out of the wood to listen. + + The Fish-Footman began by producing from under his arm a great +letter, nearly as large as himself, and this he handed over to +the other, saying, in a solemn tone, `For the Duchess. An +invitation from the Queen to play croquet.' The Frog-Footman +repeated, in the same solemn tone, only changing the order of the +words a little, `From the Queen. An invitation for the Duchess +to play croquet.' + + Then they both bowed low, and their curls got entangled +together. + + Alice laughed so much at this, that she had to run back into +the wood for fear of their hearing her; and when she next peeped +out the Fish-Footman was gone, and the other was sitting on the +ground near the door, staring stupidly up into the sky. + + Alice went timidly up to the door, and knocked. + + `There's no sort of use in knocking,' said the Footman, `and +that for two reasons. First, because I'm on the same side of the +door as you are; secondly, because they're making such a noise +inside, no one could possibly hear you.' And certainly there was +a most extraordinary noise going on within--a constant howling +and sneezing, and every now and then a great crash, as if a dish +or kettle had been broken to pieces. + + `Please, then,' said Alice, `how am I to get in?' + + `There might be some sense in your knocking,' the Footman went +on without attending to her, `if we had the door between us. For +instance, if you were INSIDE, you might knock, and I could let +you out, you know.' He was looking up into the sky all the time +he was speaking, and this Alice thought decidedly uncivil. `But +perhaps he can't help it,' she said to herself; `his eyes are so +VERY nearly at the top of his head. But at any rate he might +answer questions.--How am I to get in?' she repeated, aloud. + + `I shall sit here,' the Footman remarked, `till tomorrow--' + + At this moment the door of the house opened, and a large plate +came skimming out, straight at the Footman's head: it just +grazed his nose, and broke to pieces against one of the trees +behind him. + + `--or next day, maybe,' the Footman continued in the same tone, +exactly as if nothing had happened. + + `How am I to get in?' asked Alice again, in a louder tone. + + `ARE you to get in at all?' said the Footman. `That's the +first question, you know.' + + It was, no doubt: only Alice did not like to be told so. +`It's really dreadful,' she muttered to herself, `the way all the +creatures argue. It's enough to drive one crazy!' + + The Footman seemed to think this a good opportunity for +repeating his remark, with variations. `I shall sit here,' he +said, `on and off, for days and days.' + + `But what am I to do?' said Alice. + + `Anything you like,' said the Footman, and began whistling. + + `Oh, there's no use in talking to him,' said Alice desperately: +`he's perfectly idiotic!' And she opened the door and went in. + + The door led right into a large kitchen, which was full of +smoke from one end to the other: the Duchess was sitting on a +three-legged stool in the middle, nursing a baby; the cook was +leaning over the fire, stirring a large cauldron which seemed to +be full of soup. + + `There's certainly too much pepper in that soup!' Alice said to +herself, as well as she could for sneezing. + + There was certainly too much of it in the air. Even the +Duchess sneezed occasionally; and as for the baby, it was +sneezing and howling alternately without a moment's pause. The +only things in the kitchen that did not sneeze, were the cook, +and a large cat which was sitting on the hearth and grinning from +ear to ear. + + `Please would you tell me,' said Alice, a little timidly, for +she was not quite sure whether it was good manners for her to +speak first, `why your cat grins like that?' + + `It's a Cheshire cat,' said the Duchess, `and that's why. +Pig!' + + She said the last word with such sudden violence that Alice +quite jumped; but she saw in another moment that it was addressed +to the baby, and not to her, so she took courage, and went on +again:-- + + `I didn't know that Cheshire cats always grinned; in fact, I +didn't know that cats COULD grin.' + + `They all can,' said the Duchess; `and most of 'em do.' + + `I don't know of any that do,' Alice said very politely, +feeling quite pleased to have got into a conversation. + + `You don't know much,' said the Duchess; `and that's a fact.' + + Alice did not at all like the tone of this remark, and thought +it would be as well to introduce some other subject of +conversation. While she was trying to fix on one, the cook took +the cauldron of soup off the fire, and at once set to work +throwing everything within her reach at the Duchess and the baby +--the fire-irons came first; then followed a shower of saucepans, +plates, and dishes. The Duchess took no notice of them even when +they hit her; and the baby was howling so much already, that it +was quite impossible to say whether the blows hurt it or not. + + `Oh, PLEASE mind what you're doing!' cried Alice, jumping up +and down in an agony of terror. `Oh, there goes his PRECIOUS +nose'; as an unusually large saucepan flew close by it, and very +nearly carried it off. + + `If everybody minded their own business,' the Duchess said in a +hoarse growl, `the world would go round a deal faster than it +does.' + + `Which would NOT be an advantage,' said Alice, who felt very +glad to get an opportunity of showing off a little of her +knowledge. `Just think of what work it would make with the day +and night! You see the earth takes twenty-four hours to turn +round on its axis--' + + `Talking of axes,' said the Duchess, `chop off her head!' + + Alice glanced rather anxiously at the cook, to see if she meant +to take the hint; but the cook was busily stirring the soup, and +seemed not to be listening, so she went on again: `Twenty-four +hours, I THINK; or is it twelve? I--' + + `Oh, don't bother ME,' said the Duchess; `I never could abide +figures!' And with that she began nursing her child again, +singing a sort of lullaby to it as she did so, and giving it a +violent shake at the end of every line: + + `Speak roughly to your little boy, + And beat him when he sneezes: + He only does it to annoy, + Because he knows it teases.' + + CHORUS. + + (In which the cook and the baby joined):-- + + `Wow! wow! wow!' + + While the Duchess sang the second verse of the song, she kept +tossing the baby violently up and down, and the poor little thing +howled so, that Alice could hardly hear the words:-- + + `I speak severely to my boy, + I beat him when he sneezes; + For he can thoroughly enjoy + The pepper when he pleases!' + + CHORUS. + + `Wow! wow! wow!' + + `Here! you may nurse it a bit, if you like!' the Duchess said +to Alice, flinging the baby at her as she spoke. `I must go and +get ready to play croquet with the Queen,' and she hurried out of +the room. The cook threw a frying-pan after her as she went out, +but it just missed her. + + Alice caught the baby with some difficulty, as it was a queer- +shaped little creature, and held out its arms and legs in all +directions, `just like a star-fish,' thought Alice. The poor +little thing was snorting like a steam-engine when she caught it, +and kept doubling itself up and straightening itself out again, +so that altogether, for the first minute or two, it was as much +as she could do to hold it. + + As soon as she had made out the proper way of nursing it, +(which was to twist it up into a sort of knot, and then keep +tight hold of its right ear and left foot, so as to prevent its +undoing itself,) she carried it out into the open air. `IF I +don't take this child away with me,' thought Alice, `they're sure +to kill it in a day or two: wouldn't it be murder to leave it +behind?' She said the last words out loud, and the little thing +grunted in reply (it had left off sneezing by this time). `Don't +grunt,' said Alice; `that's not at all a proper way of expressing +yourself.' + + The baby grunted again, and Alice looked very anxiously into +its face to see what was the matter with it. There could be no +doubt that it had a VERY turn-up nose, much more like a snout +than a real nose; also its eyes were getting extremely small for +a baby: altogether Alice did not like the look of the thing at +all. `But perhaps it was only sobbing,' she thought, and looked +into its eyes again, to see if there were any tears. + + No, there were no tears. `If you're going to turn into a pig, +my dear,' said Alice, seriously, `I'll have nothing more to do +with you. Mind now!' The poor little thing sobbed again (or +grunted, it was impossible to say which), and they went on for +some while in silence. + + Alice was just beginning to think to herself, `Now, what am I +to do with this creature when I get it home?' when it grunted +again, so violently, that she looked down into its face in some +alarm. This time there could be NO mistake about it: it was +neither more nor less than a pig, and she felt that it would be +quite absurd for her to carry it further. + + So she set the little creature down, and felt quite relieved to +see it trot away quietly into the wood. `If it had grown up,' +she said to herself, `it would have made a dreadfully ugly child: +but it makes rather a handsome pig, I think.' And she began +thinking over other children she knew, who might do very well as +pigs, and was just saying to herself, `if one only knew the right +way to change them--' when she was a little startled by seeing +the Cheshire Cat sitting on a bough of a tree a few yards off. + + The Cat only grinned when it saw Alice. It looked good- +natured, she thought: still it had VERY long claws and a great +many teeth, so she felt that it ought to be treated with respect. + + `Cheshire Puss,' she began, rather timidly, as she did not at +all know whether it would like the name: however, it only +grinned a little wider. `Come, it's pleased so far,' thought +Alice, and she went on. `Would you tell me, please, which way I +ought to go from here?' + + `That depends a good deal on where you want to get to,' said +the Cat. + + `I don't much care where--' said Alice. + + `Then it doesn't matter which way you go,' said the Cat. + + `--so long as I get SOMEWHERE,' Alice added as an explanation. + + `Oh, you're sure to do that,' said the Cat, `if you only walk +long enough.' + + Alice felt that this could not be denied, so she tried another +question. `What sort of people live about here?' + + `In THAT direction,' the Cat said, waving its right paw round, +`lives a Hatter: and in THAT direction,' waving the other paw, +`lives a March Hare. Visit either you like: they're both mad.' + + `But I don't want to go among mad people,' Alice remarked. + + `Oh, you can't help that,' said the Cat: `we're all mad here. +I'm mad. You're mad.' + + `How do you know I'm mad?' said Alice. + + `You must be,' said the Cat, `or you wouldn't have come here.' + + Alice didn't think that proved it at all; however, she went on +`And how do you know that you're mad?' + + `To begin with,' said the Cat, `a dog's not mad. You grant +that?' + + `I suppose so,' said Alice. + + `Well, then,' the Cat went on, `you see, a dog growls when it's +angry, and wags its tail when it's pleased. Now I growl when I'm +pleased, and wag my tail when I'm angry. Therefore I'm mad.' + + `I call it purring, not growling,' said Alice. + + `Call it what you like,' said the Cat. `Do you play croquet +with the Queen to-day?' + + `I should like it very much,' said Alice, `but I haven't been +invited yet.' + + `You'll see me there,' said the Cat, and vanished. + + Alice was not much surprised at this, she was getting so used +to queer things happening. While she was looking at the place +where it had been, it suddenly appeared again. + + `By-the-bye, what became of the baby?' said the Cat. `I'd +nearly forgotten to ask.' + + `It turned into a pig,' Alice quietly said, just as if it had +come back in a natural way. + + `I thought it would,' said the Cat, and vanished again. + + Alice waited a little, half expecting to see it again, but it +did not appear, and after a minute or two she walked on in the +direction in which the March Hare was said to live. `I've seen +hatters before,' she said to herself; `the March Hare will be +much the most interesting, and perhaps as this is May it won't be +raving mad--at least not so mad as it was in March.' As she said +this, she looked up, and there was the Cat again, sitting on a +branch of a tree. + + `Did you say pig, or fig?' said the Cat. + + `I said pig,' replied Alice; `and I wish you wouldn't keep +appearing and vanishing so suddenly: you make one quite giddy.' + + `All right,' said the Cat; and this time it vanished quite +slowly, beginning with the end of the tail, and ending with the +grin, which remained some time after the rest of it had gone. + + `Well! I've often seen a cat without a grin,' thought Alice; +`but a grin without a cat! It's the most curious thing I ever +say in my life!' + + She had not gone much farther before she came in sight of the +house of the March Hare: she thought it must be the right house, +because the chimneys were shaped like ears and the roof was +thatched with fur. It was so large a house, that she did not +like to go nearer till she had nibbled some more of the lefthand +bit of mushroom, and raised herself to about two feet high: even +then she walked up towards it rather timidly, saying to herself +`Suppose it should be raving mad after all! I almost wish I'd +gone to see the Hatter instead!' + + + + CHAPTER VII + + A Mad Tea-Party + + + There was a table set out under a tree in front of the house, +and the March Hare and the Hatter were having tea at it: a +Dormouse was sitting between them, fast asleep, and the other two +were using it as a cushion, resting their elbows on it, and the +talking over its head. `Very uncomfortable for the Dormouse,' +thought Alice; `only, as it's asleep, I suppose it doesn't mind.' + + The table was a large one, but the three were all crowded +together at one corner of it: `No room! No room!' they cried +out when they saw Alice coming. `There's PLENTY of room!' said +Alice indignantly, and she sat down in a large arm-chair at one +end of the table. + + `Have some wine,' the March Hare said in an encouraging tone. + + Alice looked all round the table, but there was nothing on it +but tea. `I don't see any wine,' she remarked. + + `There isn't any,' said the March Hare. + + `Then it wasn't very civil of you to offer it,' said Alice +angrily. + + `It wasn't very civil of you to sit down without being +invited,' said the March Hare. + + `I didn't know it was YOUR table,' said Alice; `it's laid for a +great many more than three.' + + `Your hair wants cutting,' said the Hatter. He had been +looking at Alice for some time with great curiosity, and this was +his first speech. + + `You should learn not to make personal remarks,' Alice said +with some severity; `it's very rude.' + + The Hatter opened his eyes very wide on hearing this; but all +he SAID was, `Why is a raven like a writing-desk?' + + `Come, we shall have some fun now!' thought Alice. `I'm glad +they've begun asking riddles.--I believe I can guess that,' she +added aloud. + + `Do you mean that you think you can find out the answer to it?' +said the March Hare. + + `Exactly so,' said Alice. + + `Then you should say what you mean,' the March Hare went on. + + `I do,' Alice hastily replied; `at least--at least I mean what +I say--that's the same thing, you know.' + + `Not the same thing a bit!' said the Hatter. `You might just +as well say that "I see what I eat" is the same thing as "I eat +what I see"!' + + `You might just as well say,' added the March Hare, `that "I +like what I get" is the same thing as "I get what I like"!' + + `You might just as well say,' added the Dormouse, who seemed to +be talking in his sleep, `that "I breathe when I sleep" is the +same thing as "I sleep when I breathe"!' + + `It IS the same thing with you,' said the Hatter, and here the +conversation dropped, and the party sat silent for a minute, +while Alice thought over all she could remember about ravens and +writing-desks, which wasn't much. + + The Hatter was the first to break the silence. `What day of +the month is it?' he said, turning to Alice: he had taken his +watch out of his pocket, and was looking at it uneasily, shaking +it every now and then, and holding it to his ear. + + Alice considered a little, and then said `The fourth.' + + `Two days wrong!' sighed the Hatter. `I told you butter +wouldn't suit the works!' he added looking angrily at the March +Hare. + + `It was the BEST butter,' the March Hare meekly replied. + + `Yes, but some crumbs must have got in as well,' the Hatter +grumbled: `you shouldn't have put it in with the bread-knife.' + + The March Hare took the watch and looked at it gloomily: then +he dipped it into his cup of tea, and looked at it again: but he +could think of nothing better to say than his first remark, `It +was the BEST butter, you know.' + + Alice had been looking over his shoulder with some curiosity. +`What a funny watch!' she remarked. `It tells the day of the +month, and doesn't tell what o'clock it is!' + + `Why should it?' muttered the Hatter. `Does YOUR watch tell +you what year it is?' + + `Of course not,' Alice replied very readily: `but that's +because it stays the same year for such a long time together.' + + `Which is just the case with MINE,' said the Hatter. + + Alice felt dreadfully puzzled. The Hatter's remark seemed to +have no sort of meaning in it, and yet it was certainly English. +`I don't quite understand you,' she said, as politely as she +could. + + `The Dormouse is asleep again,' said the Hatter, and he poured +a little hot tea upon its nose. + + The Dormouse shook its head impatiently, and said, without +opening its eyes, `Of course, of course; just what I was going to +remark myself.' + + `Have you guessed the riddle yet?' the Hatter said, turning to +Alice again. + + `No, I give it up,' Alice replied: `what's the answer?' + + `I haven't the slightest idea,' said the Hatter. + + `Nor I,' said the March Hare. + + Alice sighed wearily. `I think you might do something better +with the time,' she said, `than waste it in asking riddles that +have no answers.' + + `If you knew Time as well as I do,' said the Hatter, `you +wouldn't talk about wasting IT. It's HIM.' + + `I don't know what you mean,' said Alice. + + `Of course you don't!' the Hatter said, tossing his head +contemptuously. `I dare say you never even spoke to Time!' + + `Perhaps not,' Alice cautiously replied: `but I know I have to +beat time when I learn music.' + + `Ah! that accounts for it,' said the Hatter. `He won't stand +beating. Now, if you only kept on good terms with him, he'd do +almost anything you liked with the clock. For instance, suppose +it were nine o'clock in the morning, just time to begin lessons: +you'd only have to whisper a hint to Time, and round goes the +clock in a twinkling! Half-past one, time for dinner!' + + (`I only wish it was,' the March Hare said to itself in a +whisper.) + + `That would be grand, certainly,' said Alice thoughtfully: +`but then--I shouldn't be hungry for it, you know.' + + `Not at first, perhaps,' said the Hatter: `but you could keep +it to half-past one as long as you liked.' + + `Is that the way YOU manage?' Alice asked. + + The Hatter shook his head mournfully. `Not I!' he replied. +`We quarrelled last March--just before HE went mad, you know--' +(pointing with his tea spoon at the March Hare,) `--it was at the +great concert given by the Queen of Hearts, and I had to sing + + "Twinkle, twinkle, little bat! + How I wonder what you're at!" + +You know the song, perhaps?' + + `I've heard something like it,' said Alice. + + `It goes on, you know,' the Hatter continued, `in this way:-- + + "Up above the world you fly, + Like a tea-tray in the sky. + Twinkle, twinkle--"' + +Here the Dormouse shook itself, and began singing in its sleep +`Twinkle, twinkle, twinkle, twinkle--' and went on so long that +they had to pinch it to make it stop. + + `Well, I'd hardly finished the first verse,' said the Hatter, +`when the Queen jumped up and bawled out, "He's murdering the +time! Off with his head!"' + + `How dreadfully savage!' exclaimed Alice. + + `And ever since that,' the Hatter went on in a mournful tone, +`he won't do a thing I ask! It's always six o'clock now.' + + A bright idea came into Alice's head. `Is that the reason so +many tea-things are put out here?' she asked. + + `Yes, that's it,' said the Hatter with a sigh: `it's always +tea-time, and we've no time to wash the things between whiles.' + + `Then you keep moving round, I suppose?' said Alice. + + `Exactly so,' said the Hatter: `as the things get used up.' + + `But what happens when you come to the beginning again?' Alice +ventured to ask. + + `Suppose we change the subject,' the March Hare interrupted, +yawning. `I'm getting tired of this. I vote the young lady +tells us a story.' + + `I'm afraid I don't know one,' said Alice, rather alarmed at +the proposal. + + `Then the Dormouse shall!' they both cried. `Wake up, +Dormouse!' And they pinched it on both sides at once. + + The Dormouse slowly opened his eyes. `I wasn't asleep,' he +said in a hoarse, feeble voice: `I heard every word you fellows +were saying.' + + `Tell us a story!' said the March Hare. + + `Yes, please do!' pleaded Alice. + + `And be quick about it,' added the Hatter, `or you'll be asleep +again before it's done.' + + `Once upon a time there were three little sisters,' the +Dormouse began in a great hurry; `and their names were Elsie, +Lacie, and Tillie; and they lived at the bottom of a well--' + + `What did they live on?' said Alice, who always took a great +interest in questions of eating and drinking. + + `They lived on treacle,' said the Dormouse, after thinking a +minute or two. + + `They couldn't have done that, you know,' Alice gently +remarked; `they'd have been ill.' + + `So they were,' said the Dormouse; `VERY ill.' + + Alice tried to fancy to herself what such an extraordinary ways +of living would be like, but it puzzled her too much, so she went +on: `But why did they live at the bottom of a well?' + + `Take some more tea,' the March Hare said to Alice, very +earnestly. + + `I've had nothing yet,' Alice replied in an offended tone, `so +I can't take more.' + + `You mean you can't take LESS,' said the Hatter: `it's very +easy to take MORE than nothing.' + + `Nobody asked YOUR opinion,' said Alice. + + `Who's making personal remarks now?' the Hatter asked +triumphantly. + + Alice did not quite know what to say to this: so she helped +herself to some tea and bread-and-butter, and then turned to the +Dormouse, and repeated her question. `Why did they live at the +bottom of a well?' + + The Dormouse again took a minute or two to think about it, and +then said, `It was a treacle-well.' + + `There's no such thing!' Alice was beginning very angrily, but +the Hatter and the March Hare went `Sh! sh!' and the Dormouse +sulkily remarked, `If you can't be civil, you'd better finish the +story for yourself.' + + `No, please go on!' Alice said very humbly; `I won't interrupt +again. I dare say there may be ONE.' + + `One, indeed!' said the Dormouse indignantly. However, he +consented to go on. `And so these three little sisters--they +were learning to draw, you know--' + + `What did they draw?' said Alice, quite forgetting her promise. + + `Treacle,' said the Dormouse, without considering at all this +time. + + `I want a clean cup,' interrupted the Hatter: `let's all move +one place on.' + + He moved on as he spoke, and the Dormouse followed him: the +March Hare moved into the Dormouse's place, and Alice rather +unwillingly took the place of the March Hare. The Hatter was the +only one who got any advantage from the change: and Alice was a +good deal worse off than before, as the March Hare had just upset +the milk-jug into his plate. + + Alice did not wish to offend the Dormouse again, so she began +very cautiously: `But I don't understand. Where did they draw +the treacle from?' + + `You can draw water out of a water-well,' said the Hatter; `so +I should think you could draw treacle out of a treacle-well--eh, +stupid?' + + `But they were IN the well,' Alice said to the Dormouse, not +choosing to notice this last remark. + + `Of course they were', said the Dormouse; `--well in.' + + This answer so confused poor Alice, that she let the Dormouse +go on for some time without interrupting it. + + `They were learning to draw,' the Dormouse went on, yawning and +rubbing its eyes, for it was getting very sleepy; `and they drew +all manner of things--everything that begins with an M--' + + `Why with an M?' said Alice. + + `Why not?' said the March Hare. + + Alice was silent. + + The Dormouse had closed its eyes by this time, and was going +off into a doze; but, on being pinched by the Hatter, it woke up +again with a little shriek, and went on: `--that begins with an +M, such as mouse-traps, and the moon, and memory, and muchness-- +you know you say things are "much of a muchness"--did you ever +see such a thing as a drawing of a muchness?' + + `Really, now you ask me,' said Alice, very much confused, `I +don't think--' + + `Then you shouldn't talk,' said the Hatter. + + This piece of rudeness was more than Alice could bear: she got +up in great disgust, and walked off; the Dormouse fell asleep +instantly, and neither of the others took the least notice of her +going, though she looked back once or twice, half hoping that +they would call after her: the last time she saw them, they were +trying to put the Dormouse into the teapot. + + `At any rate I'll never go THERE again!' said Alice as she +picked her way through the wood. `It's the stupidest tea-party I +ever was at in all my life!' + + Just as she said this, she noticed that one of the trees had a +door leading right into it. `That's very curious!' she thought. +`But everything's curious today. I think I may as well go in at +once.' And in she went. + + Once more she found herself in the long hall, and close to the +little glass table. `Now, I'll manage better this time,' she +said to herself, and began by taking the little golden key, and +unlocking the door that led into the garden. Then she went to +work nibbling at the mushroom (she had kept a piece of it in her +pocked) till she was about a foot high: then she walked down the +little passage: and THEN--she found herself at last in the +beautiful garden, among the bright flower-beds and the cool +fountains. + + + + CHAPTER VIII + + The Queen's Croquet-Ground + + + A large rose-tree stood near the entrance of the garden: the +roses growing on it were white, but there were three gardeners at +it, busily painting them red. Alice thought this a very curious +thing, and she went nearer to watch them, and just as she came up +to them she heard one of them say, `Look out now, Five! Don't go +splashing paint over me like that!' + + `I couldn't help it,' said Five, in a sulky tone; `Seven jogged +my elbow.' + + On which Seven looked up and said, `That's right, Five! Always +lay the blame on others!' + + `YOU'D better not talk!' said Five. `I heard the Queen say only +yesterday you deserved to be beheaded!' + + `What for?' said the one who had spoken first. + + `That's none of YOUR business, Two!' said Seven. + + `Yes, it IS his business!' said Five, `and I'll tell him--it +was for bringing the cook tulip-roots instead of onions.' + + Seven flung down his brush, and had just begun `Well, of all +the unjust things--' when his eye chanced to fall upon Alice, as +she stood watching them, and he checked himself suddenly: the +others looked round also, and all of them bowed low. + + `Would you tell me,' said Alice, a little timidly, `why you are +painting those roses?' + + Five and Seven said nothing, but looked at Two. Two began in a +low voice, `Why the fact is, you see, Miss, this here ought to +have been a RED rose-tree, and we put a white one in by mistake; +and if the Queen was to find it out, we should all have our heads +cut off, you know. So you see, Miss, we're doing our best, afore +she comes, to--' At this moment Five, who had been anxiously +looking across the garden, called out `The Queen! The Queen!' +and the three gardeners instantly threw themselves flat upon +their faces. There was a sound of many footsteps, and Alice +looked round, eager to see the Queen. + + First came ten soldiers carrying clubs; these were all shaped +like the three gardeners, oblong and flat, with their hands and +feet at the corners: next the ten courtiers; these were +ornamented all over with diamonds, and walked two and two, as the +soldiers did. After these came the royal children; there were +ten of them, and the little dears came jumping merrily along hand +in hand, in couples: they were all ornamented with hearts. Next +came the guests, mostly Kings and Queens, and among them Alice +recognised the White Rabbit: it was talking in a hurried nervous +manner, smiling at everything that was said, and went by without +noticing her. Then followed the Knave of Hearts, carrying the +King's crown on a crimson velvet cushion; and, last of all this +grand procession, came THE KING AND QUEEN OF HEARTS. + + Alice was rather doubtful whether she ought not to lie down on +her face like the three gardeners, but she could not remember +every having heard of such a rule at processions; `and besides, +what would be the use of a procession,' thought she, `if people +had all to lie down upon their faces, so that they couldn't see +it?' So she stood still where she was, and waited. + + When the procession came opposite to Alice, they all stopped +and looked at her, and the Queen said severely `Who is this?' +She said it to the Knave of Hearts, who only bowed and smiled in +reply. + + `Idiot!' said the Queen, tossing her head impatiently; and, +turning to Alice, she went on, `What's your name, child?' + + `My name is Alice, so please your Majesty,' said Alice very +politely; but she added, to herself, `Why, they're only a pack of +cards, after all. I needn't be afraid of them!' + + `And who are THESE?' said the Queen, pointing to the three +gardeners who were lying round the rosetree; for, you see, as +they were lying on their faces, and the pattern on their backs +was the same as the rest of the pack, she could not tell whether +they were gardeners, or soldiers, or courtiers, or three of her +own children. + + `How should I know?' said Alice, surprised at her own courage. +`It's no business of MINE.' + + The Queen turned crimson with fury, and, after glaring at her +for a moment like a wild beast, screamed `Off with her head! +Off--' + + `Nonsense!' said Alice, very loudly and decidedly, and the +Queen was silent. + + The King laid his hand upon her arm, and timidly said +`Consider, my dear: she is only a child!' + + The Queen turned angrily away from him, and said to the Knave +`Turn them over!' + + The Knave did so, very carefully, with one foot. + + `Get up!' said the Queen, in a shrill, loud voice, and the +three gardeners instantly jumped up, and began bowing to the +King, the Queen, the royal children, and everybody else. + + `Leave off that!' screamed the Queen. `You make me giddy.' +And then, turning to the rose-tree, she went on, `What HAVE you +been doing here?' + + `May it please your Majesty,' said Two, in a very humble tone, +going down on one knee as he spoke, `we were trying--' + + `I see!' said the Queen, who had meanwhile been examining the +roses. `Off with their heads!' and the procession moved on, +three of the soldiers remaining behind to execute the unfortunate +gardeners, who ran to Alice for protection. + + `You shan't be beheaded!' said Alice, and she put them into a +large flower-pot that stood near. The three soldiers wandered +about for a minute or two, looking for them, and then quietly +marched off after the others. + + `Are their heads off?' shouted the Queen. + + `Their heads are gone, if it please your Majesty!' the soldiers +shouted in reply. + + `That's right!' shouted the Queen. `Can you play croquet?' + + The soldiers were silent, and looked at Alice, as the question +was evidently meant for her. + + `Yes!' shouted Alice. + + `Come on, then!' roared the Queen, and Alice joined the +procession, wondering very much what would happen next. + + `It's--it's a very fine day!' said a timid voice at her side. +She was walking by the White Rabbit, who was peeping anxiously +into her face. + + `Very,' said Alice: `--where's the Duchess?' + + `Hush! Hush!' said the Rabbit in a low, hurried tone. He +looked anxiously over his shoulder as he spoke, and then raised +himself upon tiptoe, put his mouth close to her ear, and +whispered `She's under sentence of execution.' + + `What for?' said Alice. + + `Did you say "What a pity!"?' the Rabbit asked. + + `No, I didn't,' said Alice: `I don't think it's at all a pity. +I said "What for?"' + + `She boxed the Queen's ears--' the Rabbit began. Alice gave a +little scream of laughter. `Oh, hush!' the Rabbit whispered in a +frightened tone. `The Queen will hear you! You see, she came +rather late, and the Queen said--' + + `Get to your places!' shouted the Queen in a voice of thunder, +and people began running about in all directions, tumbling up +against each other; however, they got settled down in a minute or +two, and the game began. Alice thought she had never seen such a +curious croquet-ground in her life; it was all ridges and +furrows; the balls were live hedgehogs, the mallets live +flamingoes, and the soldiers had to double themselves up and to +stand on their hands and feet, to make the arches. + + The chief difficulty Alice found at first was in managing her +flamingo: she succeeded in getting its body tucked away, +comfortably enough, under her arm, with its legs hanging down, +but generally, just as she had got its neck nicely straightened +out, and was going to give the hedgehog a blow with its head, it +WOULD twist itself round and look up in her face, with such a +puzzled expression that she could not help bursting out laughing: +and when she had got its head down, and was going to begin again, +it was very provoking to find that the hedgehog had unrolled +itself, and was in the act of crawling away: besides all this, +there was generally a ridge or furrow in the way wherever she +wanted to send the hedgehog to, and, as the doubled-up soldiers +were always getting up and walking off to other parts of the +ground, Alice soon came to the conclusion that it was a very +difficult game indeed. + + The players all played at once without waiting for turns, +quarrelling all the while, and fighting for the hedgehogs; and in +a very short time the Queen was in a furious passion, and went +stamping about, and shouting `Off with his head!' or `Off with +her head!' about once in a minute. + + Alice began to feel very uneasy: to be sure, she had not as +yet had any dispute with the Queen, but she knew that it might +happen any minute, `and then,' thought she, `what would become of +me? They're dreadfully fond of beheading people here; the great +wonder is, that there's any one left alive!' + + She was looking about for some way of escape, and wondering +whether she could get away without being seen, when she noticed a +curious appearance in the air: it puzzled her very much at +first, but, after watching it a minute or two, she made it out to +be a grin, and she said to herself `It's the Cheshire Cat: now I +shall have somebody to talk to.' + + `How are you getting on?' said the Cat, as soon as there was +mouth enough for it to speak with. + + Alice waited till the eyes appeared, and then nodded. `It's no +use speaking to it,' she thought, `till its ears have come, or at +least one of them.' In another minute the whole head appeared, +and then Alice put down her flamingo, and began an account of the +game, feeling very glad she had someone to listen to her. The +Cat seemed to think that there was enough of it now in sight, and +no more of it appeared. + + `I don't think they play at all fairly,' Alice began, in rather +a complaining tone, `and they all quarrel so dreadfully one can't +hear oneself speak--and they don't seem to have any rules in +particular; at least, if there are, nobody attends to them--and +you've no idea how confusing it is all the things being alive; +for instance, there's the arch I've got to go through next +walking about at the other end of the ground--and I should have +croqueted the Queen's hedgehog just now, only it ran away when it +saw mine coming!' + + `How do you like the Queen?' said the Cat in a low voice. + + `Not at all,' said Alice: `she's so extremely--' Just then +she noticed that the Queen was close behind her, listening: so +she went on, `--likely to win, that it's hardly worth while +finishing the game.' + + The Queen smiled and passed on. + + `Who ARE you talking to?' said the King, going up to Alice, and +looking at the Cat's head with great curiosity. + + `It's a friend of mine--a Cheshire Cat,' said Alice: `allow me +to introduce it.' + + `I don't like the look of it at all,' said the King: `however, +it may kiss my hand if it likes.' + + `I'd rather not,' the Cat remarked. + + `Don't be impertinent,' said the King, `and don't look at me +like that!' He got behind Alice as he spoke. + + `A cat may look at a king,' said Alice. `I've read that in +some book, but I don't remember where.' + + `Well, it must be removed,' said the King very decidedly, and +he called the Queen, who was passing at the moment, `My dear! I +wish you would have this cat removed!' + + The Queen had only one way of settling all difficulties, great +or small. `Off with his head!' she said, without even looking +round. + + `I'll fetch the executioner myself,' said the King eagerly, and +he hurried off. + + Alice thought she might as well go back, and see how the game +was going on, as she heard the Queen's voice in the distance, +screaming with passion. She had already heard her sentence three +of the players to be executed for having missed their turns, and +she did not like the look of things at all, as the game was in +such confusion that she never knew whether it was her turn or +not. So she went in search of her hedgehog. + + The hedgehog was engaged in a fight with another hedgehog, +which seemed to Alice an excellent opportunity for croqueting one +of them with the other: the only difficulty was, that her +flamingo was gone across to the other side of the garden, where +Alice could see it trying in a helpless sort of way to fly up +into a tree. + + By the time she had caught the flamingo and brought it back, +the fight was over, and both the hedgehogs were out of sight: +`but it doesn't matter much,' thought Alice, `as all the arches +are gone from this side of the ground.' So she tucked it away +under her arm, that it might not escape again, and went back for +a little more conversation with her friend. + + When she got back to the Cheshire Cat, she was surprised to +find quite a large crowd collected round it: there was a dispute +going on between the executioner, the King, and the Queen, who +were all talking at once, while all the rest were quite silent, +and looked very uncomfortable. + + The moment Alice appeared, she was appealed to by all three to +settle the question, and they repeated their arguments to her, +though, as they all spoke at once, she found it very hard indeed +to make out exactly what they said. + + The executioner's argument was, that you couldn't cut off a +head unless there was a body to cut it off from: that he had +never had to do such a thing before, and he wasn't going to begin +at HIS time of life. + + The King's argument was, that anything that had a head could be +beheaded, and that you weren't to talk nonsense. + + The Queen's argument was, that if something wasn't done about +it in less than no time she'd have everybody executed, all round. +(It was this last remark that had made the whole party look so +grave and anxious.) + + Alice could think of nothing else to say but `It belongs to the +Duchess: you'd better ask HER about it.' + + `She's in prison,' the Queen said to the executioner: `fetch +her here.' And the executioner went off like an arrow. + + The Cat's head began fading away the moment he was gone, and, +by the time he had come back with the Dutchess, it had entirely +disappeared; so the King and the executioner ran wildly up and +down looking for it, while the rest of the party went back to the game. + + + + CHAPTER IX + + The Mock Turtle's Story + + + `You can't think how glad I am to see you again, you dear old +thing!' said the Duchess, as she tucked her arm affectionately +into Alice's, and they walked off together. + + Alice was very glad to find her in such a pleasant temper, and +thought to herself that perhaps it was only the pepper that had +made her so savage when they met in the kitchen. + + `When I'M a Duchess,' she said to herself, (not in a very +hopeful tone though), `I won't have any pepper in my kitchen AT +ALL. Soup does very well without--Maybe it's always pepper that +makes people hot-tempered,' she went on, very much pleased at +having found out a new kind of rule, `and vinegar that makes them +sour--and camomile that makes them bitter--and--and barley-sugar +and such things that make children sweet-tempered. I only wish +people knew that: then they wouldn't be so stingy about it, you +know--' + + She had quite forgotten the Duchess by this time, and was a +little startled when she heard her voice close to her ear. +`You're thinking about something, my dear, and that makes you +forget to talk. I can't tell you just now what the moral of that +is, but I shall remember it in a bit.' + + `Perhaps it hasn't one,' Alice ventured to remark. + + `Tut, tut, child!' said the Duchess. `Everything's got a +moral, if only you can find it.' And she squeezed herself up +closer to Alice's side as she spoke. + + Alice did not much like keeping so close to her: first, +because the Duchess was VERY ugly; and secondly, because she was +exactly the right height to rest her chin upon Alice's shoulder, +and it was an uncomfortably sharp chin. However, she did not +like to be rude, so she bore it as well as she could. + + `The game's going on rather better now,' she said, by way of +keeping up the conversation a little. + + `'Tis so,' said the Duchess: `and the moral of that is--"Oh, +'tis love, 'tis love, that makes the world go round!"' + + `Somebody said,' Alice whispered, `that it's done by everybody +minding their own business!' + + `Ah, well! It means much the same thing,' said the Duchess, +digging her sharp little chin into Alice's shoulder as she added, +`and the moral of THAT is--"Take care of the sense, and the +sounds will take care of themselves."' + + `How fond she is of finding morals in things!' Alice thought to +herself. + + `I dare say you're wondering why I don't put my arm round your +waist,' the Duchess said after a pause: `the reason is, that I'm +doubtful about the temper of your flamingo. Shall I try the +experiment?' + + `HE might bite,' Alice cautiously replied, not feeling at all +anxious to have the experiment tried. + + `Very true,' said the Duchess: `flamingoes and mustard both +bite. And the moral of that is--"Birds of a feather flock +together."' + + `Only mustard isn't a bird,' Alice remarked. + + `Right, as usual,' said the Duchess: `what a clear way you +have of putting things!' + + `It's a mineral, I THINK,' said Alice. + + `Of course it is,' said the Duchess, who seemed ready to agree +to everything that Alice said; `there's a large mustard-mine near +here. And the moral of that is--"The more there is of mine, the +less there is of yours."' + + `Oh, I know!' exclaimed Alice, who had not attended to this +last remark, `it's a vegetable. It doesn't look like one, but it +is.' + + `I quite agree with you,' said the Duchess; `and the moral of +that is--"Be what you would seem to be"--or if you'd like it put +more simply--"Never imagine yourself not to be otherwise than +what it might appear to others that what you were or might have +been was not otherwise than what you had been would have appeared +to them to be otherwise."' + + `I think I should understand that better,' Alice said very +politely, `if I had it written down: but I can't quite follow it +as you say it.' + + `That's nothing to what I could say if I chose,' the Duchess +replied, in a pleased tone. + + `Pray don't trouble yourself to say it any longer than that,' +said Alice. + + `Oh, don't talk about trouble!' said the Duchess. `I make you +a present of everything I've said as yet.' + + `A cheap sort of present!' thought Alice. `I'm glad they don't +give birthday presents like that!' But she did not venture to +say it out loud. + + `Thinking again?' the Duchess asked, with another dig of her +sharp little chin. + + `I've a right to think,' said Alice sharply, for she was +beginning to feel a little worried. + + `Just about as much right,' said the Duchess, `as pigs have to +fly; and the m--' + + But here, to Alice's great surprise, the Duchess's voice died +away, even in the middle of her favourite word `moral,' and the +arm that was linked into hers began to tremble. Alice looked up, +and there stood the Queen in front of them, with her arms folded, +frowning like a thunderstorm. + + `A fine day, your Majesty!' the Duchess began in a low, weak +voice. + + `Now, I give you fair warning,' shouted the Queen, stamping on +the ground as she spoke; `either you or your head must be off, +and that in about half no time! Take your choice!' + + The Duchess took her choice, and was gone in a moment. + + `Let's go on with the game,' the Queen said to Alice; and Alice +was too much frightened to say a word, but slowly followed her +back to the croquet-ground. + + The other guests had taken advantage of the Queen's absence, +and were resting in the shade: however, the moment they saw her, +they hurried back to the game, the Queen merely remarking that a +moment's delay would cost them their lives. + + All the time they were playing the Queen never left off +quarrelling with the other players, and shouting `Off with his +head!' or `Off with her head!' Those whom she sentenced were +taken into custody by the soldiers, who of course had to leave +off being arches to do this, so that by the end of half an hour +or so there were no arches left, and all the players, except the +King, the Queen, and Alice, were in custody and under sentence of +execution. + + Then the Queen left off, quite out of breath, and said to +Alice, `Have you seen the Mock Turtle yet?' + + `No,' said Alice. `I don't even know what a Mock Turtle is.' + + `It's the thing Mock Turtle Soup is made from,' said the Queen. + + `I never saw one, or heard of one,' said Alice. + + `Come on, then,' said the Queen, `and he shall tell you his +history,' + + As they walked off together, Alice heard the King say in a low +voice, to the company generally, `You are all pardoned.' `Come, +THAT'S a good thing!' she said to herself, for she had felt quite +unhappy at the number of executions the Queen had ordered. + + They very soon came upon a Gryphon, lying fast asleep in the +sun. (IF you don't know what a Gryphon is, look at the picture.) +`Up, lazy thing!' said the Queen, `and take this young lady to +see the Mock Turtle, and to hear his history. I must go back and +see after some executions I have ordered'; and she walked off, +leaving Alice alone with the Gryphon. Alice did not quite like +the look of the creature, but on the whole she thought it would +be quite as safe to stay with it as to go after that savage +Queen: so she waited. + + The Gryphon sat up and rubbed its eyes: then it watched the +Queen till she was out of sight: then it chuckled. `What fun!' +said the Gryphon, half to itself, half to Alice. + + `What IS the fun?' said Alice. + + `Why, SHE,' said the Gryphon. `It's all her fancy, that: they +never executes nobody, you know. Come on!' + + `Everybody says "come on!" here,' thought Alice, as she went +slowly after it: `I never was so ordered about in all my life, +never!' + + They had not gone far before they saw the Mock Turtle in the +distance, sitting sad and lonely on a little ledge of rock, and, +as they came nearer, Alice could hear him sighing as if his heart +would break. She pitied him deeply. `What is his sorrow?' she +asked the Gryphon, and the Gryphon answered, very nearly in the +same words as before, `It's all his fancy, that: he hasn't got +no sorrow, you know. Come on!' + + So they went up to the Mock Turtle, who looked at them with +large eyes full of tears, but said nothing. + + `This here young lady,' said the Gryphon, `she wants for to +know your history, she do.' + + `I'll tell it her,' said the Mock Turtle in a deep, hollow +tone: `sit down, both of you, and don't speak a word till I've +finished.' + + So they sat down, and nobody spoke for some minutes. Alice +thought to herself, `I don't see how he can EVEN finish, if he +doesn't begin.' But she waited patiently. + + `Once,' said the Mock Turtle at last, with a deep sigh, `I was +a real Turtle.' + + These words were followed by a very long silence, broken only +by an occasional exclamation of `Hjckrrh!' from the Gryphon, and +the constant heavy sobbing of the Mock Turtle. Alice was very +nearly getting up and saying, `Thank you, sir, for your +interesting story,' but she could not help thinking there MUST be +more to come, so she sat still and said nothing. + + `When we were little,' the Mock Turtle went on at last, more +calmly, though still sobbing a little now and then, `we went to +school in the sea. The master was an old Turtle--we used to call +him Tortoise--' + + `Why did you call him Tortoise, if he wasn't one?' Alice asked. + + `We called him Tortoise because he taught us,' said the Mock +Turtle angrily: `really you are very dull!' + + `You ought to be ashamed of yourself for asking such a simple +question,' added the Gryphon; and then they both sat silent and +looked at poor Alice, who felt ready to sink into the earth. At +last the Gryphon said to the Mock Turtle, `Drive on, old fellow! +Don't be all day about it!' and he went on in these words: + + `Yes, we went to school in the sea, though you mayn't believe +it--' + + `I never said I didn't!' interrupted Alice. + + `You did,' said the Mock Turtle. + + `Hold your tongue!' added the Gryphon, before Alice could speak +again. The Mock Turtle went on. + + `We had the best of educations--in fact, we went to school +every day--' + + `I'VE been to a day-school, too,' said Alice; `you needn't be +so proud as all that.' + + `With extras?' asked the Mock Turtle a little anxiously. + + `Yes,' said Alice, `we learned French and music.' + + `And washing?' said the Mock Turtle. + + `Certainly not!' said Alice indignantly. + + `Ah! then yours wasn't a really good school,' said the Mock +Turtle in a tone of great relief. `Now at OURS they had at the +end of the bill, "French, music, AND WASHING--extra."' + + `You couldn't have wanted it much,' said Alice; `living at the +bottom of the sea.' + + `I couldn't afford to learn it.' said the Mock Turtle with a +sigh. `I only took the regular course.' + + `What was that?' inquired Alice. + + `Reeling and Writhing, of course, to begin with,' the Mock +Turtle replied; `and then the different branches of Arithmetic-- +Ambition, Distraction, Uglification, and Derision.' + + `I never heard of "Uglification,"' Alice ventured to say. `What +is it?' + + The Gryphon lifted up both its paws in surprise. `What! Never +heard of uglifying!' it exclaimed. `You know what to beautify +is, I suppose?' + + `Yes,' said Alice doubtfully: `it means--to--make--anything-- +prettier.' + + `Well, then,' the Gryphon went on, `if you don't know what to +uglify is, you ARE a simpleton.' + + Alice did not feel encouraged to ask any more questions about +it, so she turned to the Mock Turtle, and said `What else had you +to learn?' + + `Well, there was Mystery,' the Mock Turtle replied, counting +off the subjects on his flappers, `--Mystery, ancient and modern, +with Seaography: then Drawling--the Drawling-master was an old +conger-eel, that used to come once a week: HE taught us +Drawling, Stretching, and Fainting in Coils.' + + `What was THAT like?' said Alice. + + `Well, I can't show it you myself,' the Mock Turtle said: `I'm +too stiff. And the Gryphon never learnt it.' + + `Hadn't time,' said the Gryphon: `I went to the Classics +master, though. He was an old crab, HE was.' + + `I never went to him,' the Mock Turtle said with a sigh: `he +taught Laughing and Grief, they used to say.' + + `So he did, so he did,' said the Gryphon, sighing in his turn; +and both creatures hid their faces in their paws. + + `And how many hours a day did you do lessons?' said Alice, in a +hurry to change the subject. + + `Ten hours the first day,' said the Mock Turtle: `nine the +next, and so on.' + + `What a curious plan!' exclaimed Alice. + + `That's the reason they're called lessons,' the Gryphon +remarked: `because they lessen from day to day.' + + This was quite a new idea to Alice, and she thought it over a +little before she made her next remark. `Then the eleventh day +must have been a holiday?' + + `Of course it was,' said the Mock Turtle. + + `And how did you manage on the twelfth?' Alice went on eagerly. + + `That's enough about lessons,' the Gryphon interrupted in a +very decided tone: `tell her something about the games now.' + + + + CHAPTER X + + The Lobster Quadrille + + + The Mock Turtle sighed deeply, and drew the back of one flapper +across his eyes. He looked at Alice, and tried to speak, but for +a minute or two sobs choked his voice. `Same as if he had a bone +in his throat,' said the Gryphon: and it set to work shaking him +and punching him in the back. At last the Mock Turtle recovered +his voice, and, with tears running down his cheeks, he went on +again:-- + + `You may not have lived much under the sea--' (`I haven't,' +said Alice)--`and perhaps you were never even introduced to a lobster--' +(Alice began to say `I once tasted--' but checked herself hastily, +and said `No, never') `--so you can have no idea what a delightful +thing a Lobster Quadrille is!' + + `No, indeed,' said Alice. `What sort of a dance is it?' + + `Why,' said the Gryphon, `you first form into a line along the +sea-shore--' + + `Two lines!' cried the Mock Turtle. `Seals, turtles, salmon, +and so on; then, when you've cleared all the jelly-fish out of +the way--' + + `THAT generally takes some time,' interrupted the Gryphon. + + `--you advance twice--' + + `Each with a lobster as a partner!' cried the Gryphon. + + `Of course,' the Mock Turtle said: `advance twice, set to +partners--' + + `--change lobsters, and retire in same order,' continued the +Gryphon. + + `Then, you know,' the Mock Turtle went on, `you throw the--' + + `The lobsters!' shouted the Gryphon, with a bound into the air. + + `--as far out to sea as you can--' + + `Swim after them!' screamed the Gryphon. + + `Turn a somersault in the sea!' cried the Mock Turtle, +capering wildly about. + + `Back to land again, and that's all the first figure,' said the +Mock Turtle, suddenly dropping his voice; and the two creatures, +who had been jumping about like mad things all this time, sat +down again very sadly and quietly, and looked at Alice. + + `It must be a very pretty dance,' said Alice timidly. + + `Would you like to see a little of it?' said the Mock Turtle. + + `Very much indeed,' said Alice. + + `Come, let's try the first figure!' said the Mock Turtle to the +Gryphon. `We can do without lobsters, you know. Which shall +sing?' + + `Oh, YOU sing,' said the Gryphon. `I've forgotten the words.' + + So they began solemnly dancing round and round Alice, every now +and then treading on her toes when they passed too close, and +waving their forepaws to mark the time, while the Mock Turtle +sang this, very slowly and sadly:-- + + +`"Will you walk a little faster?" said a whiting to a snail. +"There's a porpoise close behind us, and he's treading on my + tail. +See how eagerly the lobsters and the turtles all advance! +They are waiting on the shingle--will you come and join the +dance? + +Will you, won't you, will you, won't you, will you join the +dance? +Will you, won't you, will you, won't you, won't you join the +dance? + + +"You can really have no notion how delightful it will be +When they take us up and throw us, with the lobsters, out to + sea!" +But the snail replied "Too far, too far!" and gave a look + askance-- +Said he thanked the whiting kindly, but he would not join the + dance. + Would not, could not, would not, could not, would not join + the dance. + Would not, could not, would not, could not, could not join + the dance. + +`"What matters it how far we go?" his scaly friend replied. +"There is another shore, you know, upon the other side. +The further off from England the nearer is to France-- +Then turn not pale, beloved snail, but come and join the dance. + + Will you, won't you, will you, won't you, will you join the + dance? + Will you, won't you, will you, won't you, won't you join the + dance?"' + + + + `Thank you, it's a very interesting dance to watch,' said +Alice, feeling very glad that it was over at last: `and I do so +like that curious song about the whiting!' + + `Oh, as to the whiting,' said the Mock Turtle, `they--you've +seen them, of course?' + + `Yes,' said Alice, `I've often seen them at dinn--' she +checked herself hastily. + + `I don't know where Dinn may be,' said the Mock Turtle, `but +if you've seen them so often, of course you know what they're +like.' + + `I believe so,' Alice replied thoughtfully. `They have their +tails in their mouths--and they're all over crumbs.' + + `You're wrong about the crumbs,' said the Mock Turtle: +`crumbs would all wash off in the sea. But they HAVE their tails +in their mouths; and the reason is--' here the Mock Turtle +yawned and shut his eyes.--`Tell her about the reason and all +that,' he said to the Gryphon. + + `The reason is,' said the Gryphon, `that they WOULD go with +the lobsters to the dance. So they got thrown out to sea. So +they had to fall a long way. So they got their tails fast in +their mouths. So they couldn't get them out again. That's all.' + + `Thank you,' said Alice, `it's very interesting. I never knew +so much about a whiting before.' + + `I can tell you more than that, if you like,' said the +Gryphon. `Do you know why it's called a whiting?' + + `I never thought about it,' said Alice. `Why?' + + `IT DOES THE BOOTS AND SHOES.' the Gryphon replied very +solemnly. + + Alice was thoroughly puzzled. `Does the boots and shoes!' she +repeated in a wondering tone. + + `Why, what are YOUR shoes done with?' said the Gryphon. `I +mean, what makes them so shiny?' + + Alice looked down at them, and considered a little before she +gave her answer. `They're done with blacking, I believe.' + + `Boots and shoes under the sea,' the Gryphon went on in a deep +voice, `are done with a whiting. Now you know.' + + `And what are they made of?' Alice asked in a tone of great +curiosity. + + `Soles and eels, of course,' the Gryphon replied rather +impatiently: `any shrimp could have told you that.' + + `If I'd been the whiting,' said Alice, whose thoughts were +still running on the song, `I'd have said to the porpoise, "Keep +back, please: we don't want YOU with us!"' + + `They were obliged to have him with them,' the Mock Turtle +said: `no wise fish would go anywhere without a porpoise.' + + `Wouldn't it really?' said Alice in a tone of great surprise. + + `Of course not,' said the Mock Turtle: `why, if a fish came +to ME, and told me he was going a journey, I should say "With +what porpoise?"' + + `Don't you mean "purpose"?' said Alice. + + `I mean what I say,' the Mock Turtle replied in an offended +tone. And the Gryphon added `Come, let's hear some of YOUR +adventures.' + + `I could tell you my adventures--beginning from this morning,' +said Alice a little timidly: `but it's no use going back to +yesterday, because I was a different person then.' + + `Explain all that,' said the Mock Turtle. + + `No, no! The adventures first,' said the Gryphon in an +impatient tone: `explanations take such a dreadful time.' + + So Alice began telling them her adventures from the time when +she first saw the White Rabbit. She was a little nervous about +it just at first, the two creatures got so close to her, one on +each side, and opened their eyes and mouths so VERY wide, but she +gained courage as she went on. Her listeners were perfectly +quiet till she got to the part about her repeating `YOU ARE OLD, +FATHER WILLIAM,' to the Caterpillar, and the words all coming +different, and then the Mock Turtle drew a long breath, and said +`That's very curious.' + + `It's all about as curious as it can be,' said the Gryphon. + + `It all came different!' the Mock Turtle repeated +thoughtfully. `I should like to hear her try and repeat +something now. Tell her to begin.' He looked at the Gryphon as +if he thought it had some kind of authority over Alice. + + `Stand up and repeat "'TIS THE VOICE OF THE SLUGGARD,"' said +the Gryphon. + + `How the creatures order one about, and make one repeat +lessons!' thought Alice; `I might as well be at school at once.' +However, she got up, and began to repeat it, but her head was so +full of the Lobster Quadrille, that she hardly knew what she was +saying, and the words came very queer indeed:-- + + `'Tis the voice of the Lobster; I heard him declare, + "You have baked me too brown, I must sugar my hair." + As a duck with its eyelids, so he with his nose + Trims his belt and his buttons, and turns out his toes.' + + [later editions continued as follows + When the sands are all dry, he is gay as a lark, + And will talk in contemptuous tones of the Shark, + But, when the tide rises and sharks are around, + His voice has a timid and tremulous sound.] + + `That's different from what I used to say when I was a child,' +said the Gryphon. + + `Well, I never heard it before,' said the Mock Turtle; `but it +sounds uncommon nonsense.' + + Alice said nothing; she had sat down with her face in her +hands, wondering if anything would EVER happen in a natural way +again. + + `I should like to have it explained,' said the Mock Turtle. + + `She can't explain it,' said the Gryphon hastily. `Go on with +the next verse.' + + `But about his toes?' the Mock Turtle persisted. `How COULD +he turn them out with his nose, you know?' + + `It's the first position in dancing.' Alice said; but was +dreadfully puzzled by the whole thing, and longed to change the +subject. + + `Go on with the next verse,' the Gryphon repeated impatiently: +`it begins "I passed by his garden."' + + Alice did not dare to disobey, though she felt sure it would +all come wrong, and she went on in a trembling voice:-- + + `I passed by his garden, and marked, with one eye, + How the Owl and the Panther were sharing a pie--' + + [later editions continued as follows + The Panther took pie-crust, and gravy, and meat, + While the Owl had the dish as its share of the treat. + When the pie was all finished, the Owl, as a boon, + Was kindly permitted to pocket the spoon: + While the Panther received knife and fork with a growl, + And concluded the banquet--] + + `What IS the use of repeating all that stuff,' the Mock Turtle +interrupted, `if you don't explain it as you go on? It's by far +the most confusing thing I ever heard!' + + `Yes, I think you'd better leave off,' said the Gryphon: and +Alice was only too glad to do so. + + `Shall we try another figure of the Lobster Quadrille?' the +Gryphon went on. `Or would you like the Mock Turtle to sing you +a song?' + + `Oh, a song, please, if the Mock Turtle would be so kind,' +Alice replied, so eagerly that the Gryphon said, in a rather +offended tone, `Hm! No accounting for tastes! Sing her "Turtle +Soup," will you, old fellow?' + + The Mock Turtle sighed deeply, and began, in a voice sometimes +choked with sobs, to sing this:-- + + + `Beautiful Soup, so rich and green, + Waiting in a hot tureen! + Who for such dainties would not stoop? + Soup of the evening, beautiful Soup! + Soup of the evening, beautiful Soup! + Beau--ootiful Soo--oop! + Beau--ootiful Soo--oop! + Soo--oop of the e--e--evening, + Beautiful, beautiful Soup! + + `Beautiful Soup! Who cares for fish, + Game, or any other dish? + Who would not give all else for two p + ennyworth only of beautiful Soup? + Pennyworth only of beautiful Soup? + Beau--ootiful Soo--oop! + Beau--ootiful Soo--oop! + Soo--oop of the e--e--evening, + Beautiful, beauti--FUL SOUP!' + + `Chorus again!' cried the Gryphon, and the Mock Turtle had +just begun to repeat it, when a cry of `The trial's beginning!' +was heard in the distance. + + `Come on!' cried the Gryphon, and, taking Alice by the hand, +it hurried off, without waiting for the end of the song. + + `What trial is it?' Alice panted as she ran; but the Gryphon +only answered `Come on!' and ran the faster, while more and more +faintly came, carried on the breeze that followed them, the +melancholy words:-- + + `Soo--oop of the e--e--evening, + Beautiful, beautiful Soup!' + + + + CHAPTER XI + + Who Stole the Tarts? + + + The King and Queen of Hearts were seated on their throne when +they arrived, with a great crowd assembled about them--all sorts +of little birds and beasts, as well as the whole pack of cards: +the Knave was standing before them, in chains, with a soldier on +each side to guard him; and near the King was the White Rabbit, +with a trumpet in one hand, and a scroll of parchment in the +other. In the very middle of the court was a table, with a large +dish of tarts upon it: they looked so good, that it made Alice +quite hungry to look at them--`I wish they'd get the trial done,' +she thought, `and hand round the refreshments!' But there seemed +to be no chance of this, so she began looking at everything about +her, to pass away the time. + + Alice had never been in a court of justice before, but she had +read about them in books, and she was quite pleased to find that +she knew the name of nearly everything there. `That's the +judge,' she said to herself, `because of his great wig.' + + The judge, by the way, was the King; and as he wore his crown +over the wig, (look at the frontispiece if you want to see how he +did it,) he did not look at all comfortable, and it was certainly +not becoming. + + `And that's the jury-box,' thought Alice, `and those twelve +creatures,' (she was obliged to say `creatures,' you see, because +some of them were animals, and some were birds,) `I suppose they +are the jurors.' She said this last word two or three times over +to herself, being rather proud of it: for she thought, and +rightly too, that very few little girls of her age knew the +meaning of it at all. However, `jury-men' would have done just +as well. + + The twelve jurors were all writing very busily on slates. +`What are they doing?' Alice whispered to the Gryphon. `They +can't have anything to put down yet, before the trial's begun.' + + `They're putting down their names,' the Gryphon whispered in +reply, `for fear they should forget them before the end of the +trial.' + + `Stupid things!' Alice began in a loud, indignant voice, but +she stopped hastily, for the White Rabbit cried out, `Silence in +the court!' and the King put on his spectacles and looked +anxiously round, to make out who was talking. + + Alice could see, as well as if she were looking over their +shoulders, that all the jurors were writing down `stupid things!' +on their slates, and she could even make out that one of them +didn't know how to spell `stupid,' and that he had to ask his +neighbour to tell him. `A nice muddle their slates'll be in +before the trial's over!' thought Alice. + + One of the jurors had a pencil that squeaked. This of course, +Alice could not stand, and she went round the court and got +behind him, and very soon found an opportunity of taking it +away. She did it so quickly that the poor little juror (it was +Bill, the Lizard) could not make out at all what had become of +it; so, after hunting all about for it, he was obliged to write +with one finger for the rest of the day; and this was of very +little use, as it left no mark on the slate. + + `Herald, read the accusation!' said the King. + + On this the White Rabbit blew three blasts on the trumpet, and +then unrolled the parchment scroll, and read as follows:-- + + `The Queen of Hearts, she made some tarts, + All on a summer day: + The Knave of Hearts, he stole those tarts, + And took them quite away!' + + `Consider your verdict,' the King said to the jury. + + `Not yet, not yet!' the Rabbit hastily interrupted. `There's +a great deal to come before that!' + + `Call the first witness,' said the King; and the White Rabbit +blew three blasts on the trumpet, and called out, `First +witness!' + + The first witness was the Hatter. He came in with a teacup in +one hand and a piece of bread-and-butter in the other. `I beg +pardon, your Majesty,' he began, `for bringing these in: but I +hadn't quite finished my tea when I was sent for.' + + `You ought to have finished,' said the King. `When did you +begin?' + + The Hatter looked at the March Hare, who had followed him into +the court, arm-in-arm with the Dormouse. `Fourteenth of March, I +think it was,' he said. + + `Fifteenth,' said the March Hare. + + `Sixteenth,' added the Dormouse. + + `Write that down,' the King said to the jury, and the jury +eagerly wrote down all three dates on their slates, and then +added them up, and reduced the answer to shillings and pence. + + `Take off your hat,' the King said to the Hatter. + + `It isn't mine,' said the Hatter. + + `Stolen!' the King exclaimed, turning to the jury, who +instantly made a memorandum of the fact. + + `I keep them to sell,' the Hatter added as an explanation; +`I've none of my own. I'm a hatter.' + + Here the Queen put on her spectacles, and began staring at the +Hatter, who turned pale and fidgeted. + + `Give your evidence,' said the King; `and don't be nervous, or +I'll have you executed on the spot.' + + This did not seem to encourage the witness at all: he kept +shifting from one foot to the other, looking uneasily at the +Queen, and in his confusion he bit a large piece out of his +teacup instead of the bread-and-butter. + + Just at this moment Alice felt a very curious sensation, which +puzzled her a good deal until she made out what it was: she was +beginning to grow larger again, and she thought at first she +would get up and leave the court; but on second thoughts she +decided to remain where she was as long as there was room for +her. + + `I wish you wouldn't squeeze so.' said the Dormouse, who was +sitting next to her. `I can hardly breathe.' + + `I can't help it,' said Alice very meekly: `I'm growing.' + + `You've no right to grow here,' said the Dormouse. + + `Don't talk nonsense,' said Alice more boldly: `you know +you're growing too.' + + `Yes, but I grow at a reasonable pace,' said the Dormouse: +`not in that ridiculous fashion.' And he got up very sulkily +and crossed over to the other side of the court. + + All this time the Queen had never left off staring at the +Hatter, and, just as the Dormouse crossed the court, she said to +one of the officers of the court, `Bring me the list of the +singers in the last concert!' on which the wretched Hatter +trembled so, that he shook both his shoes off. + + `Give your evidence,' the King repeated angrily, `or I'll have +you executed, whether you're nervous or not.' + + `I'm a poor man, your Majesty,' the Hatter began, in a +trembling voice, `--and I hadn't begun my tea--not above a week +or so--and what with the bread-and-butter getting so thin--and +the twinkling of the tea--' + + `The twinkling of the what?' said the King. + + `It began with the tea,' the Hatter replied. + + `Of course twinkling begins with a T!' said the King sharply. +`Do you take me for a dunce? Go on!' + + `I'm a poor man,' the Hatter went on, `and most things +twinkled after that--only the March Hare said--' + + `I didn't!' the March Hare interrupted in a great hurry. + + `You did!' said the Hatter. + + `I deny it!' said the March Hare. + + `He denies it,' said the King: `leave out that part.' + + `Well, at any rate, the Dormouse said--' the Hatter went on, +looking anxiously round to see if he would deny it too: but the +Dormouse denied nothing, being fast asleep. + + `After that,' continued the Hatter, `I cut some more bread- +and-butter--' + + `But what did the Dormouse say?' one of the jury asked. + + `That I can't remember,' said the Hatter. + + `You MUST remember,' remarked the King, `or I'll have you +executed.' + + The miserable Hatter dropped his teacup and bread-and-butter, +and went down on one knee. `I'm a poor man, your Majesty,' he +began. + + `You're a very poor speaker,' said the King. + + Here one of the guinea-pigs cheered, and was immediately +suppressed by the officers of the court. (As that is rather a +hard word, I will just explain to you how it was done. They had +a large canvas bag, which tied up at the mouth with strings: +into this they slipped the guinea-pig, head first, and then sat +upon it.) + + `I'm glad I've seen that done,' thought Alice. `I've so often +read in the newspapers, at the end of trials, "There was some +attempts at applause, which was immediately suppressed by the +officers of the court," and I never understood what it meant +till now.' + + `If that's all you know about it, you may stand down,' +continued the King. + + `I can't go no lower,' said the Hatter: `I'm on the floor, as +it is.' + + `Then you may SIT down,' the King replied. + + Here the other guinea-pig cheered, and was suppressed. + + `Come, that finished the guinea-pigs!' thought Alice. `Now we +shall get on better.' + + `I'd rather finish my tea,' said the Hatter, with an anxious +look at the Queen, who was reading the list of singers. + + `You may go,' said the King, and the Hatter hurriedly left the +court, without even waiting to put his shoes on. + + `--and just take his head off outside,' the Queen added to one +of the officers: but the Hatter was out of sight before the +officer could get to the door. + + `Call the next witness!' said the King. + + The next witness was the Duchess's cook. She carried the +pepper-box in her hand, and Alice guessed who it was, even before +she got into the court, by the way the people near the door began +sneezing all at once. + + `Give your evidence,' said the King. + + `Shan't,' said the cook. + + The King looked anxiously at the White Rabbit, who said in a +low voice, `Your Majesty must cross-examine THIS witness.' + + `Well, if I must, I must,' the King said, with a melancholy +air, and, after folding his arms and frowning at the cook till +his eyes were nearly out of sight, he said in a deep voice, `What +are tarts made of?' + + `Pepper, mostly,' said the cook. + + `Treacle,' said a sleepy voice behind her. + + `Collar that Dormouse,' the Queen shrieked out. `Behead that +Dormouse! Turn that Dormouse out of court! Suppress him! Pinch +him! Off with his whiskers!' + + For some minutes the whole court was in confusion, getting the +Dormouse turned out, and, by the time they had settled down +again, the cook had disappeared. + + `Never mind!' said the King, with an air of great relief. +`Call the next witness.' And he added in an undertone to the +Queen, `Really, my dear, YOU must cross-examine the next witness. +It quite makes my forehead ache!' + + Alice watched the White Rabbit as he fumbled over the list, +feeling very curious to see what the next witness would be like, +`--for they haven't got much evidence YET,' she said to herself. +Imagine her surprise, when the White Rabbit read out, at the top +of his shrill little voice, the name `Alice!' + + + + CHAPTER XII + + Alice's Evidence + + + `Here!' cried Alice, quite forgetting in the flurry of the +moment how large she had grown in the last few minutes, and she +jumped up in such a hurry that she tipped over the jury-box with +the edge of her skirt, upsetting all the jurymen on to the heads +of the crowd below, and there they lay sprawling about, reminding +her very much of a globe of goldfish she had accidentally upset +the week before. + + `Oh, I BEG your pardon!' she exclaimed in a tone of great +dismay, and began picking them up again as quickly as she could, +for the accident of the goldfish kept running in her head, and +she had a vague sort of idea that they must be collected at once +and put back into the jury-box, or they would die. + + `The trial cannot proceed,' said the King in a very grave +voice, `until all the jurymen are back in their proper places-- +ALL,' he repeated with great emphasis, looking hard at Alice as +he said do. + + Alice looked at the jury-box, and saw that, in her haste, she +had put the Lizard in head downwards, and the poor little thing +was waving its tail about in a melancholy way, being quite unable +to move. She soon got it out again, and put it right; `not that +it signifies much,' she said to herself; `I should think it +would be QUITE as much use in the trial one way up as the other.' + + As soon as the jury had a little recovered from the shock of +being upset, and their slates and pencils had been found and +handed back to them, they set to work very diligently to write +out a history of the accident, all except the Lizard, who seemed +too much overcome to do anything but sit with its mouth open, +gazing up into the roof of the court. + + `What do you know about this business?' the King said to +Alice. + + `Nothing,' said Alice. + + `Nothing WHATEVER?' persisted the King. + + `Nothing whatever,' said Alice. + + `That's very important,' the King said, turning to the jury. +They were just beginning to write this down on their slates, when +the White Rabbit interrupted: `UNimportant, your Majesty means, +of course,' he said in a very respectful tone, but frowning and +making faces at him as he spoke. + + `UNimportant, of course, I meant,' the King hastily said, and +went on to himself in an undertone, `important--unimportant-- +unimportant--important--' as if he were trying which word +sounded best. + + Some of the jury wrote it down `important,' and some +`unimportant.' Alice could see this, as she was near enough to +look over their slates; `but it doesn't matter a bit,' she +thought to herself. + + At this moment the King, who had been for some time busily +writing in his note-book, cackled out `Silence!' and read out +from his book, `Rule Forty-two. ALL PERSONS MORE THAN A MILE +HIGH TO LEAVE THE COURT.' + + Everybody looked at Alice. + + `I'M not a mile high,' said Alice. + + `You are,' said the King. + + `Nearly two miles high,' added the Queen. + + `Well, I shan't go, at any rate,' said Alice: `besides, +that's not a regular rule: you invented it just now.' + + `It's the oldest rule in the book,' said the King. + + `Then it ought to be Number One,' said Alice. + + The King turned pale, and shut his note-book hastily. +`Consider your verdict,' he said to the jury, in a low, trembling +voice. + + `There's more evidence to come yet, please your Majesty,' said +the White Rabbit, jumping up in a great hurry; `this paper has +just been picked up.' + + `What's in it?' said the Queen. + + `I haven't opened it yet,' said the White Rabbit, `but it seems +to be a letter, written by the prisoner to--to somebody.' + + `It must have been that,' said the King, `unless it was +written to nobody, which isn't usual, you know.' + + `Who is it directed to?' said one of the jurymen. + + `It isn't directed at all,' said the White Rabbit; `in fact, +there's nothing written on the OUTSIDE.' He unfolded the paper +as he spoke, and added `It isn't a letter, after all: it's a set +of verses.' + + `Are they in the prisoner's handwriting?' asked another of +they jurymen. + + `No, they're not,' said the White Rabbit, `and that's the +queerest thing about it.' (The jury all looked puzzled.) + + `He must have imitated somebody else's hand,' said the King. +(The jury all brightened up again.) + + `Please your Majesty,' said the Knave, `I didn't write it, and +they can't prove I did: there's no name signed at the end.' + + `If you didn't sign it,' said the King, `that only makes the +matter worse. You MUST have meant some mischief, or else you'd +have signed your name like an honest man.' + + There was a general clapping of hands at this: it was the +first really clever thing the King had said that day. + + `That PROVES his guilt,' said the Queen. + + `It proves nothing of the sort!' said Alice. `Why, you don't +even know what they're about!' + + `Read them,' said the King. + + The White Rabbit put on his spectacles. `Where shall I begin, +please your Majesty?' he asked. + + `Begin at the beginning,' the King said gravely, `and go on +till you come to the end: then stop.' + + These were the verses the White Rabbit read:-- + + `They told me you had been to her, + And mentioned me to him: + She gave me a good character, + But said I could not swim. + + He sent them word I had not gone + (We know it to be true): + If she should push the matter on, + What would become of you? + + I gave her one, they gave him two, + You gave us three or more; + They all returned from him to you, + Though they were mine before. + + If I or she should chance to be + Involved in this affair, + He trusts to you to set them free, + Exactly as we were. + + My notion was that you had been + (Before she had this fit) + An obstacle that came between + Him, and ourselves, and it. + + Don't let him know she liked them best, + For this must ever be + A secret, kept from all the rest, + Between yourself and me.' + + `That's the most important piece of evidence we've heard yet,' +said the King, rubbing his hands; `so now let the jury--' + + `If any one of them can explain it,' said Alice, (she had +grown so large in the last few minutes that she wasn't a bit +afraid of interrupting him,) `I'll give him sixpence. _I_ don't +believe there's an atom of meaning in it.' + + The jury all wrote down on their slates, `SHE doesn't believe +there's an atom of meaning in it,' but none of them attempted to +explain the paper. + + `If there's no meaning in it,' said the King, `that saves a +world of trouble, you know, as we needn't try to find any. And +yet I don't know,' he went on, spreading out the verses on his +knee, and looking at them with one eye; `I seem to see some +meaning in them, after all. "--SAID I COULD NOT SWIM--" you +can't swim, can you?' he added, turning to the Knave. + + The Knave shook his head sadly. `Do I look like it?' he said. +(Which he certainly did NOT, being made entirely of cardboard.) + + `All right, so far,' said the King, and he went on muttering +over the verses to himself: `"WE KNOW IT TO BE TRUE--" that's +the jury, of course-- "I GAVE HER ONE, THEY GAVE HIM TWO--" why, +that must be what he did with the tarts, you know--' + + `But, it goes on "THEY ALL RETURNED FROM HIM TO YOU,"' said +Alice. + + `Why, there they are!' said the King triumphantly, pointing to +the tarts on the table. `Nothing can be clearer than THAT. +Then again--"BEFORE SHE HAD THIS FIT--" you never had fits, my +dear, I think?' he said to the Queen. + + `Never!' said the Queen furiously, throwing an inkstand at the +Lizard as she spoke. (The unfortunate little Bill had left off +writing on his slate with one finger, as he found it made no +mark; but he now hastily began again, using the ink, that was +trickling down his face, as long as it lasted.) + + `Then the words don't FIT you,' said the King, looking round +the court with a smile. There was a dead silence. + + `It's a pun!' the King added in an offended tone, and +everybody laughed, `Let the jury consider their verdict,' the +King said, for about the twentieth time that day. + + `No, no!' said the Queen. `Sentence first--verdict afterwards.' + + `Stuff and nonsense!' said Alice loudly. `The idea of having +the sentence first!' + + `Hold your tongue!' said the Queen, turning purple. + + `I won't!' said Alice. + + `Off with her head!' the Queen shouted at the top of her voice. +Nobody moved. + + `Who cares for you?' said Alice, (she had grown to her full +size by this time.) `You're nothing but a pack of cards!' + + At this the whole pack rose up into the air, and came flying +down upon her: she gave a little scream, half of fright and half +of anger, and tried to beat them off, and found herself lying on +the bank, with her head in the lap of her sister, who was gently +brushing away some dead leaves that had fluttered down from the +trees upon her face. + + `Wake up, Alice dear!' said her sister; `Why, what a long +sleep you've had!' + + `Oh, I've had such a curious dream!' said Alice, and she told +her sister, as well as she could remember them, all these strange +Adventures of hers that you have just been reading about; and +when she had finished, her sister kissed her, and said, `It WAS a +curious dream, dear, certainly: but now run in to your tea; it's +getting late.' So Alice got up and ran off, thinking while she +ran, as well she might, what a wonderful dream it had been. + + But her sister sat still just as she left her, leaning her +head on her hand, watching the setting sun, and thinking of +little Alice and all her wonderful Adventures, till she too began +dreaming after a fashion, and this was her dream:-- + + First, she dreamed of little Alice herself, and once again the +tiny hands were clasped upon her knee, and the bright eager eyes +were looking up into hers--she could hear the very tones of her +voice, and see that queer little toss of her head to keep back +the wandering hair that WOULD always get into her eyes--and +still as she listened, or seemed to listen, the whole place +around her became alive the strange creatures of her little +sister's dream. + + The long grass rustled at her feet as the White Rabbit hurried +by--the frightened Mouse splashed his way through the +neighbouring pool--she could hear the rattle of the teacups as +the March Hare and his friends shared their never-ending meal, +and the shrill voice of the Queen ordering off her unfortunate +guests to execution--once more the pig-baby was sneezing on the +Duchess's knee, while plates and dishes crashed around it--once +more the shriek of the Gryphon, the squeaking of the Lizard's +slate-pencil, and the choking of the suppressed guinea-pigs, +filled the air, mixed up with the distant sobs of the miserable +Mock Turtle. + + So she sat on, with closed eyes, and half believed herself in +Wonderland, though she knew she had but to open them again, and +all would change to dull reality--the grass would be only +rustling in the wind, and the pool rippling to the waving of the +reeds--the rattling teacups would change to tinkling sheep- +bells, and the Queen's shrill cries to the voice of the shepherd +boy--and the sneeze of the baby, the shriek of the Gryphon, and +all thy other queer noises, would change (she knew) to the +confused clamour of the busy farm-yard--while the lowing of the +cattle in the distance would take the place of the Mock Turtle's +heavy sobs. + + Lastly, she pictured to herself how this same little sister of +hers would, in the after-time, be herself a grown woman; and how +she would keep, through all her riper years, the simple and +loving heart of her childhood: and how she would gather about +her other little children, and make THEIR eyes bright and eager +with many a strange tale, perhaps even with the dream of +Wonderland of long ago: and how she would feel with all their +simple sorrows, and find a pleasure in all their simple joys, +remembering her own child-life, and the happy summer days. + + THE END + \ No newline at end of file diff --git a/external/snappy-1.1.9/testdata/asyoulik.txt b/external/snappy-1.1.9/testdata/asyoulik.txt new file mode 100644 index 0000000..88dc7b6 --- /dev/null +++ b/external/snappy-1.1.9/testdata/asyoulik.txt @@ -0,0 +1,4122 @@ + AS YOU LIKE IT + + + DRAMATIS PERSONAE + + +DUKE SENIOR living in banishment. + +DUKE FREDERICK his brother, an usurper of his dominions. + + +AMIENS | + | lords attending on the banished duke. +JAQUES | + + +LE BEAU a courtier attending upon Frederick. + +CHARLES wrestler to Frederick. + + +OLIVER | + | +JAQUES (JAQUES DE BOYS:) | sons of Sir Rowland de Boys. + | +ORLANDO | + + +ADAM | + | servants to Oliver. +DENNIS | + + +TOUCHSTONE a clown. + +SIR OLIVER MARTEXT a vicar. + + +CORIN | + | shepherds. +SILVIUS | + + +WILLIAM a country fellow in love with Audrey. + + A person representing HYMEN. (HYMEN:) + +ROSALIND daughter to the banished duke. + +CELIA daughter to Frederick. + +PHEBE a shepherdess. + +AUDREY a country wench. + + Lords, pages, and attendants, &c. + (Forester:) + (A Lord:) + (First Lord:) + (Second Lord:) + (First Page:) + (Second Page:) + + +SCENE Oliver's house; Duke Frederick's court; and the + Forest of Arden. + + + + + AS YOU LIKE IT + + +ACT I + + + +SCENE I Orchard of Oliver's house. + + + [Enter ORLANDO and ADAM] + +ORLANDO As I remember, Adam, it was upon this fashion + bequeathed me by will but poor a thousand crowns, + and, as thou sayest, charged my brother, on his + blessing, to breed me well: and there begins my + sadness. My brother Jaques he keeps at school, and + report speaks goldenly of his profit: for my part, + he keeps me rustically at home, or, to speak more + properly, stays me here at home unkept; for call you + that keeping for a gentleman of my birth, that + differs not from the stalling of an ox? His horses + are bred better; for, besides that they are fair + with their feeding, they are taught their manage, + and to that end riders dearly hired: but I, his + brother, gain nothing under him but growth; for the + which his animals on his dunghills are as much + bound to him as I. Besides this nothing that he so + plentifully gives me, the something that nature gave + me his countenance seems to take from me: he lets + me feed with his hinds, bars me the place of a + brother, and, as much as in him lies, mines my + gentility with my education. This is it, Adam, that + grieves me; and the spirit of my father, which I + think is within me, begins to mutiny against this + servitude: I will no longer endure it, though yet I + know no wise remedy how to avoid it. + +ADAM Yonder comes my master, your brother. + +ORLANDO Go apart, Adam, and thou shalt hear how he will + shake me up. + + [Enter OLIVER] + +OLIVER Now, sir! what make you here? + +ORLANDO Nothing: I am not taught to make any thing. + +OLIVER What mar you then, sir? + +ORLANDO Marry, sir, I am helping you to mar that which God + made, a poor unworthy brother of yours, with idleness. + +OLIVER Marry, sir, be better employed, and be naught awhile. + +ORLANDO Shall I keep your hogs and eat husks with them? + What prodigal portion have I spent, that I should + come to such penury? + +OLIVER Know you where your are, sir? + +ORLANDO O, sir, very well; here in your orchard. + +OLIVER Know you before whom, sir? + +ORLANDO Ay, better than him I am before knows me. I know + you are my eldest brother; and, in the gentle + condition of blood, you should so know me. The + courtesy of nations allows you my better, in that + you are the first-born; but the same tradition + takes not away my blood, were there twenty brothers + betwixt us: I have as much of my father in me as + you; albeit, I confess, your coming before me is + nearer to his reverence. + +OLIVER What, boy! + +ORLANDO Come, come, elder brother, you are too young in this. + +OLIVER Wilt thou lay hands on me, villain? + +ORLANDO I am no villain; I am the youngest son of Sir + Rowland de Boys; he was my father, and he is thrice + a villain that says such a father begot villains. + Wert thou not my brother, I would not take this hand + from thy throat till this other had pulled out thy + tongue for saying so: thou hast railed on thyself. + +ADAM Sweet masters, be patient: for your father's + remembrance, be at accord. + +OLIVER Let me go, I say. + +ORLANDO I will not, till I please: you shall hear me. My + father charged you in his will to give me good + education: you have trained me like a peasant, + obscuring and hiding from me all gentleman-like + qualities. The spirit of my father grows strong in + me, and I will no longer endure it: therefore allow + me such exercises as may become a gentleman, or + give me the poor allottery my father left me by + testament; with that I will go buy my fortunes. + +OLIVER And what wilt thou do? beg, when that is spent? + Well, sir, get you in: I will not long be troubled + with you; you shall have some part of your will: I + pray you, leave me. + +ORLANDO I will no further offend you than becomes me for my good. + +OLIVER Get you with him, you old dog. + +ADAM Is 'old dog' my reward? Most true, I have lost my + teeth in your service. God be with my old master! + he would not have spoke such a word. + + [Exeunt ORLANDO and ADAM] + +OLIVER Is it even so? begin you to grow upon me? I will + physic your rankness, and yet give no thousand + crowns neither. Holla, Dennis! + + [Enter DENNIS] + +DENNIS Calls your worship? + +OLIVER Was not Charles, the duke's wrestler, here to speak with me? + +DENNIS So please you, he is here at the door and importunes + access to you. + +OLIVER Call him in. + + [Exit DENNIS] + + 'Twill be a good way; and to-morrow the wrestling is. + + [Enter CHARLES] + +CHARLES Good morrow to your worship. + +OLIVER Good Monsieur Charles, what's the new news at the + new court? + +CHARLES There's no news at the court, sir, but the old news: + that is, the old duke is banished by his younger + brother the new duke; and three or four loving lords + have put themselves into voluntary exile with him, + whose lands and revenues enrich the new duke; + therefore he gives them good leave to wander. + +OLIVER Can you tell if Rosalind, the duke's daughter, be + banished with her father? + +CHARLES O, no; for the duke's daughter, her cousin, so loves + her, being ever from their cradles bred together, + that she would have followed her exile, or have died + to stay behind her. She is at the court, and no + less beloved of her uncle than his own daughter; and + never two ladies loved as they do. + +OLIVER Where will the old duke live? + +CHARLES They say he is already in the forest of Arden, and + a many merry men with him; and there they live like + the old Robin Hood of England: they say many young + gentlemen flock to him every day, and fleet the time + carelessly, as they did in the golden world. + +OLIVER What, you wrestle to-morrow before the new duke? + +CHARLES Marry, do I, sir; and I came to acquaint you with a + matter. I am given, sir, secretly to understand + that your younger brother Orlando hath a disposition + to come in disguised against me to try a fall. + To-morrow, sir, I wrestle for my credit; and he that + escapes me without some broken limb shall acquit him + well. Your brother is but young and tender; and, + for your love, I would be loath to foil him, as I + must, for my own honour, if he come in: therefore, + out of my love to you, I came hither to acquaint you + withal, that either you might stay him from his + intendment or brook such disgrace well as he shall + run into, in that it is a thing of his own search + and altogether against my will. + +OLIVER Charles, I thank thee for thy love to me, which + thou shalt find I will most kindly requite. I had + myself notice of my brother's purpose herein and + have by underhand means laboured to dissuade him from + it, but he is resolute. I'll tell thee, Charles: + it is the stubbornest young fellow of France, full + of ambition, an envious emulator of every man's + good parts, a secret and villanous contriver against + me his natural brother: therefore use thy + discretion; I had as lief thou didst break his neck + as his finger. And thou wert best look to't; for if + thou dost him any slight disgrace or if he do not + mightily grace himself on thee, he will practise + against thee by poison, entrap thee by some + treacherous device and never leave thee till he + hath ta'en thy life by some indirect means or other; + for, I assure thee, and almost with tears I speak + it, there is not one so young and so villanous this + day living. I speak but brotherly of him; but + should I anatomize him to thee as he is, I must + blush and weep and thou must look pale and wonder. + +CHARLES I am heartily glad I came hither to you. If he come + to-morrow, I'll give him his payment: if ever he go + alone again, I'll never wrestle for prize more: and + so God keep your worship! + +OLIVER Farewell, good Charles. + + [Exit CHARLES] + + Now will I stir this gamester: I hope I shall see + an end of him; for my soul, yet I know not why, + hates nothing more than he. Yet he's gentle, never + schooled and yet learned, full of noble device, of + all sorts enchantingly beloved, and indeed so much + in the heart of the world, and especially of my own + people, who best know him, that I am altogether + misprised: but it shall not be so long; this + wrestler shall clear all: nothing remains but that + I kindle the boy thither; which now I'll go about. + + [Exit] + + + + + AS YOU LIKE IT + + +ACT I + + + +SCENE II Lawn before the Duke's palace. + + + [Enter CELIA and ROSALIND] + +CELIA I pray thee, Rosalind, sweet my coz, be merry. + +ROSALIND Dear Celia, I show more mirth than I am mistress of; + and would you yet I were merrier? Unless you could + teach me to forget a banished father, you must not + learn me how to remember any extraordinary pleasure. + +CELIA Herein I see thou lovest me not with the full weight + that I love thee. If my uncle, thy banished father, + had banished thy uncle, the duke my father, so thou + hadst been still with me, I could have taught my + love to take thy father for mine: so wouldst thou, + if the truth of thy love to me were so righteously + tempered as mine is to thee. + +ROSALIND Well, I will forget the condition of my estate, to + rejoice in yours. + +CELIA You know my father hath no child but I, nor none is + like to have: and, truly, when he dies, thou shalt + be his heir, for what he hath taken away from thy + father perforce, I will render thee again in + affection; by mine honour, I will; and when I break + that oath, let me turn monster: therefore, my + sweet Rose, my dear Rose, be merry. + +ROSALIND From henceforth I will, coz, and devise sports. Let + me see; what think you of falling in love? + +CELIA Marry, I prithee, do, to make sport withal: but + love no man in good earnest; nor no further in sport + neither than with safety of a pure blush thou mayst + in honour come off again. + +ROSALIND What shall be our sport, then? + +CELIA Let us sit and mock the good housewife Fortune from + her wheel, that her gifts may henceforth be bestowed equally. + +ROSALIND I would we could do so, for her benefits are + mightily misplaced, and the bountiful blind woman + doth most mistake in her gifts to women. + +CELIA 'Tis true; for those that she makes fair she scarce + makes honest, and those that she makes honest she + makes very ill-favouredly. + +ROSALIND Nay, now thou goest from Fortune's office to + Nature's: Fortune reigns in gifts of the world, + not in the lineaments of Nature. + + [Enter TOUCHSTONE] + +CELIA No? when Nature hath made a fair creature, may she + not by Fortune fall into the fire? Though Nature + hath given us wit to flout at Fortune, hath not + Fortune sent in this fool to cut off the argument? + +ROSALIND Indeed, there is Fortune too hard for Nature, when + Fortune makes Nature's natural the cutter-off of + Nature's wit. + +CELIA Peradventure this is not Fortune's work neither, but + Nature's; who perceiveth our natural wits too dull + to reason of such goddesses and hath sent this + natural for our whetstone; for always the dulness of + the fool is the whetstone of the wits. How now, + wit! whither wander you? + +TOUCHSTONE Mistress, you must come away to your father. + +CELIA Were you made the messenger? + +TOUCHSTONE No, by mine honour, but I was bid to come for you. + +ROSALIND Where learned you that oath, fool? + +TOUCHSTONE Of a certain knight that swore by his honour they + were good pancakes and swore by his honour the + mustard was naught: now I'll stand to it, the + pancakes were naught and the mustard was good, and + yet was not the knight forsworn. + +CELIA How prove you that, in the great heap of your + knowledge? + +ROSALIND Ay, marry, now unmuzzle your wisdom. + +TOUCHSTONE Stand you both forth now: stroke your chins, and + swear by your beards that I am a knave. + +CELIA By our beards, if we had them, thou art. + +TOUCHSTONE By my knavery, if I had it, then I were; but if you + swear by that that is not, you are not forsworn: no + more was this knight swearing by his honour, for he + never had any; or if he had, he had sworn it away + before ever he saw those pancakes or that mustard. + +CELIA Prithee, who is't that thou meanest? + +TOUCHSTONE One that old Frederick, your father, loves. + +CELIA My father's love is enough to honour him: enough! + speak no more of him; you'll be whipped for taxation + one of these days. + +TOUCHSTONE The more pity, that fools may not speak wisely what + wise men do foolishly. + +CELIA By my troth, thou sayest true; for since the little + wit that fools have was silenced, the little foolery + that wise men have makes a great show. Here comes + Monsieur Le Beau. + +ROSALIND With his mouth full of news. + +CELIA Which he will put on us, as pigeons feed their young. + +ROSALIND Then shall we be news-crammed. + +CELIA All the better; we shall be the more marketable. + + [Enter LE BEAU] + + Bon jour, Monsieur Le Beau: what's the news? + +LE BEAU Fair princess, you have lost much good sport. + +CELIA Sport! of what colour? + +LE BEAU What colour, madam! how shall I answer you? + +ROSALIND As wit and fortune will. + +TOUCHSTONE Or as the Destinies decree. + +CELIA Well said: that was laid on with a trowel. + +TOUCHSTONE Nay, if I keep not my rank,-- + +ROSALIND Thou losest thy old smell. + +LE BEAU You amaze me, ladies: I would have told you of good + wrestling, which you have lost the sight of. + +ROSALIND You tell us the manner of the wrestling. + +LE BEAU I will tell you the beginning; and, if it please + your ladyships, you may see the end; for the best is + yet to do; and here, where you are, they are coming + to perform it. + +CELIA Well, the beginning, that is dead and buried. + +LE BEAU There comes an old man and his three sons,-- + +CELIA I could match this beginning with an old tale. + +LE BEAU Three proper young men, of excellent growth and presence. + +ROSALIND With bills on their necks, 'Be it known unto all men + by these presents.' + +LE BEAU The eldest of the three wrestled with Charles, the + duke's wrestler; which Charles in a moment threw him + and broke three of his ribs, that there is little + hope of life in him: so he served the second, and + so the third. Yonder they lie; the poor old man, + their father, making such pitiful dole over them + that all the beholders take his part with weeping. + +ROSALIND Alas! + +TOUCHSTONE But what is the sport, monsieur, that the ladies + have lost? + +LE BEAU Why, this that I speak of. + +TOUCHSTONE Thus men may grow wiser every day: it is the first + time that ever I heard breaking of ribs was sport + for ladies. + +CELIA Or I, I promise thee. + +ROSALIND But is there any else longs to see this broken music + in his sides? is there yet another dotes upon + rib-breaking? Shall we see this wrestling, cousin? + +LE BEAU You must, if you stay here; for here is the place + appointed for the wrestling, and they are ready to + perform it. + +CELIA Yonder, sure, they are coming: let us now stay and see it. + + [Flourish. Enter DUKE FREDERICK, Lords, ORLANDO, + CHARLES, and Attendants] + +DUKE FREDERICK Come on: since the youth will not be entreated, his + own peril on his forwardness. + +ROSALIND Is yonder the man? + +LE BEAU Even he, madam. + +CELIA Alas, he is too young! yet he looks successfully. + +DUKE FREDERICK How now, daughter and cousin! are you crept hither + to see the wrestling? + +ROSALIND Ay, my liege, so please you give us leave. + +DUKE FREDERICK You will take little delight in it, I can tell you; + there is such odds in the man. In pity of the + challenger's youth I would fain dissuade him, but he + will not be entreated. Speak to him, ladies; see if + you can move him. + +CELIA Call him hither, good Monsieur Le Beau. + +DUKE FREDERICK Do so: I'll not be by. + +LE BEAU Monsieur the challenger, the princesses call for you. + +ORLANDO I attend them with all respect and duty. + +ROSALIND Young man, have you challenged Charles the wrestler? + +ORLANDO No, fair princess; he is the general challenger: I + come but in, as others do, to try with him the + strength of my youth. + +CELIA Young gentleman, your spirits are too bold for your + years. You have seen cruel proof of this man's + strength: if you saw yourself with your eyes or + knew yourself with your judgment, the fear of your + adventure would counsel you to a more equal + enterprise. We pray you, for your own sake, to + embrace your own safety and give over this attempt. + +ROSALIND Do, young sir; your reputation shall not therefore + be misprised: we will make it our suit to the duke + that the wrestling might not go forward. + +ORLANDO I beseech you, punish me not with your hard + thoughts; wherein I confess me much guilty, to deny + so fair and excellent ladies any thing. But let + your fair eyes and gentle wishes go with me to my + trial: wherein if I be foiled, there is but one + shamed that was never gracious; if killed, but one + dead that was willing to be so: I shall do my + friends no wrong, for I have none to lament me, the + world no injury, for in it I have nothing; only in + the world I fill up a place, which may be better + supplied when I have made it empty. + +ROSALIND The little strength that I have, I would it were with you. + +CELIA And mine, to eke out hers. + +ROSALIND Fare you well: pray heaven I be deceived in you! + +CELIA Your heart's desires be with you! + +CHARLES Come, where is this young gallant that is so + desirous to lie with his mother earth? + +ORLANDO Ready, sir; but his will hath in it a more modest working. + +DUKE FREDERICK You shall try but one fall. + +CHARLES No, I warrant your grace, you shall not entreat him + to a second, that have so mightily persuaded him + from a first. + +ORLANDO An you mean to mock me after, you should not have + mocked me before: but come your ways. + +ROSALIND Now Hercules be thy speed, young man! + +CELIA I would I were invisible, to catch the strong + fellow by the leg. + + [They wrestle] + +ROSALIND O excellent young man! + +CELIA If I had a thunderbolt in mine eye, I can tell who + should down. + + [Shout. CHARLES is thrown] + +DUKE FREDERICK No more, no more. + +ORLANDO Yes, I beseech your grace: I am not yet well breathed. + +DUKE FREDERICK How dost thou, Charles? + +LE BEAU He cannot speak, my lord. + +DUKE FREDERICK Bear him away. What is thy name, young man? + +ORLANDO Orlando, my liege; the youngest son of Sir Rowland de Boys. + +DUKE FREDERICK I would thou hadst been son to some man else: + The world esteem'd thy father honourable, + But I did find him still mine enemy: + Thou shouldst have better pleased me with this deed, + Hadst thou descended from another house. + But fare thee well; thou art a gallant youth: + I would thou hadst told me of another father. + + [Exeunt DUKE FREDERICK, train, and LE BEAU] + +CELIA Were I my father, coz, would I do this? + +ORLANDO I am more proud to be Sir Rowland's son, + His youngest son; and would not change that calling, + To be adopted heir to Frederick. + +ROSALIND My father loved Sir Rowland as his soul, + And all the world was of my father's mind: + Had I before known this young man his son, + I should have given him tears unto entreaties, + Ere he should thus have ventured. + +CELIA Gentle cousin, + Let us go thank him and encourage him: + My father's rough and envious disposition + Sticks me at heart. Sir, you have well deserved: + If you do keep your promises in love + But justly, as you have exceeded all promise, + Your mistress shall be happy. + +ROSALIND Gentleman, + + [Giving him a chain from her neck] + + Wear this for me, one out of suits with fortune, + That could give more, but that her hand lacks means. + Shall we go, coz? + +CELIA Ay. Fare you well, fair gentleman. + +ORLANDO Can I not say, I thank you? My better parts + Are all thrown down, and that which here stands up + Is but a quintain, a mere lifeless block. + +ROSALIND He calls us back: my pride fell with my fortunes; + I'll ask him what he would. Did you call, sir? + Sir, you have wrestled well and overthrown + More than your enemies. + +CELIA Will you go, coz? + +ROSALIND Have with you. Fare you well. + + [Exeunt ROSALIND and CELIA] + +ORLANDO What passion hangs these weights upon my tongue? + I cannot speak to her, yet she urged conference. + O poor Orlando, thou art overthrown! + Or Charles or something weaker masters thee. + + [Re-enter LE BEAU] + +LE BEAU Good sir, I do in friendship counsel you + To leave this place. Albeit you have deserved + High commendation, true applause and love, + Yet such is now the duke's condition + That he misconstrues all that you have done. + The duke is humorous; what he is indeed, + More suits you to conceive than I to speak of. + +ORLANDO I thank you, sir: and, pray you, tell me this: + Which of the two was daughter of the duke + That here was at the wrestling? + +LE BEAU Neither his daughter, if we judge by manners; + But yet indeed the lesser is his daughter + The other is daughter to the banish'd duke, + And here detain'd by her usurping uncle, + To keep his daughter company; whose loves + Are dearer than the natural bond of sisters. + But I can tell you that of late this duke + Hath ta'en displeasure 'gainst his gentle niece, + Grounded upon no other argument + But that the people praise her for her virtues + And pity her for her good father's sake; + And, on my life, his malice 'gainst the lady + Will suddenly break forth. Sir, fare you well: + Hereafter, in a better world than this, + I shall desire more love and knowledge of you. + +ORLANDO I rest much bounden to you: fare you well. + + [Exit LE BEAU] + + Thus must I from the smoke into the smother; + From tyrant duke unto a tyrant brother: + But heavenly Rosalind! + + [Exit] + + + + + AS YOU LIKE IT + + +ACT I + + + +SCENE III A room in the palace. + + + [Enter CELIA and ROSALIND] + +CELIA Why, cousin! why, Rosalind! Cupid have mercy! not a word? + +ROSALIND Not one to throw at a dog. + +CELIA No, thy words are too precious to be cast away upon + curs; throw some of them at me; come, lame me with reasons. + +ROSALIND Then there were two cousins laid up; when the one + should be lamed with reasons and the other mad + without any. + +CELIA But is all this for your father? + +ROSALIND No, some of it is for my child's father. O, how + full of briers is this working-day world! + +CELIA They are but burs, cousin, thrown upon thee in + holiday foolery: if we walk not in the trodden + paths our very petticoats will catch them. + +ROSALIND I could shake them off my coat: these burs are in my heart. + +CELIA Hem them away. + +ROSALIND I would try, if I could cry 'hem' and have him. + +CELIA Come, come, wrestle with thy affections. + +ROSALIND O, they take the part of a better wrestler than myself! + +CELIA O, a good wish upon you! you will try in time, in + despite of a fall. But, turning these jests out of + service, let us talk in good earnest: is it + possible, on such a sudden, you should fall into so + strong a liking with old Sir Rowland's youngest son? + +ROSALIND The duke my father loved his father dearly. + +CELIA Doth it therefore ensue that you should love his son + dearly? By this kind of chase, I should hate him, + for my father hated his father dearly; yet I hate + not Orlando. + +ROSALIND No, faith, hate him not, for my sake. + +CELIA Why should I not? doth he not deserve well? + +ROSALIND Let me love him for that, and do you love him + because I do. Look, here comes the duke. + +CELIA With his eyes full of anger. + + [Enter DUKE FREDERICK, with Lords] + +DUKE FREDERICK Mistress, dispatch you with your safest haste + And get you from our court. + +ROSALIND Me, uncle? + +DUKE FREDERICK You, cousin + Within these ten days if that thou be'st found + So near our public court as twenty miles, + Thou diest for it. + +ROSALIND I do beseech your grace, + Let me the knowledge of my fault bear with me: + If with myself I hold intelligence + Or have acquaintance with mine own desires, + If that I do not dream or be not frantic,-- + As I do trust I am not--then, dear uncle, + Never so much as in a thought unborn + Did I offend your highness. + +DUKE FREDERICK Thus do all traitors: + If their purgation did consist in words, + They are as innocent as grace itself: + Let it suffice thee that I trust thee not. + +ROSALIND Yet your mistrust cannot make me a traitor: + Tell me whereon the likelihood depends. + +DUKE FREDERICK Thou art thy father's daughter; there's enough. + +ROSALIND So was I when your highness took his dukedom; + So was I when your highness banish'd him: + Treason is not inherited, my lord; + Or, if we did derive it from our friends, + What's that to me? my father was no traitor: + Then, good my liege, mistake me not so much + To think my poverty is treacherous. + +CELIA Dear sovereign, hear me speak. + +DUKE FREDERICK Ay, Celia; we stay'd her for your sake, + Else had she with her father ranged along. + +CELIA I did not then entreat to have her stay; + It was your pleasure and your own remorse: + I was too young that time to value her; + But now I know her: if she be a traitor, + Why so am I; we still have slept together, + Rose at an instant, learn'd, play'd, eat together, + And wheresoever we went, like Juno's swans, + Still we went coupled and inseparable. + +DUKE FREDERICK She is too subtle for thee; and her smoothness, + Her very silence and her patience + Speak to the people, and they pity her. + Thou art a fool: she robs thee of thy name; + And thou wilt show more bright and seem more virtuous + When she is gone. Then open not thy lips: + Firm and irrevocable is my doom + Which I have pass'd upon her; she is banish'd. + +CELIA Pronounce that sentence then on me, my liege: + I cannot live out of her company. + +DUKE FREDERICK You are a fool. You, niece, provide yourself: + If you outstay the time, upon mine honour, + And in the greatness of my word, you die. + + [Exeunt DUKE FREDERICK and Lords] + +CELIA O my poor Rosalind, whither wilt thou go? + Wilt thou change fathers? I will give thee mine. + I charge thee, be not thou more grieved than I am. + +ROSALIND I have more cause. + +CELIA Thou hast not, cousin; + Prithee be cheerful: know'st thou not, the duke + Hath banish'd me, his daughter? + +ROSALIND That he hath not. + +CELIA No, hath not? Rosalind lacks then the love + Which teacheth thee that thou and I am one: + Shall we be sunder'd? shall we part, sweet girl? + No: let my father seek another heir. + Therefore devise with me how we may fly, + Whither to go and what to bear with us; + And do not seek to take your change upon you, + To bear your griefs yourself and leave me out; + For, by this heaven, now at our sorrows pale, + Say what thou canst, I'll go along with thee. + +ROSALIND Why, whither shall we go? + +CELIA To seek my uncle in the forest of Arden. + +ROSALIND Alas, what danger will it be to us, + Maids as we are, to travel forth so far! + Beauty provoketh thieves sooner than gold. + +CELIA I'll put myself in poor and mean attire + And with a kind of umber smirch my face; + The like do you: so shall we pass along + And never stir assailants. + +ROSALIND Were it not better, + Because that I am more than common tall, + That I did suit me all points like a man? + A gallant curtle-axe upon my thigh, + A boar-spear in my hand; and--in my heart + Lie there what hidden woman's fear there will-- + We'll have a swashing and a martial outside, + As many other mannish cowards have + That do outface it with their semblances. + +CELIA What shall I call thee when thou art a man? + +ROSALIND I'll have no worse a name than Jove's own page; + And therefore look you call me Ganymede. + But what will you be call'd? + +CELIA Something that hath a reference to my state + No longer Celia, but Aliena. + +ROSALIND But, cousin, what if we assay'd to steal + The clownish fool out of your father's court? + Would he not be a comfort to our travel? + +CELIA He'll go along o'er the wide world with me; + Leave me alone to woo him. Let's away, + And get our jewels and our wealth together, + Devise the fittest time and safest way + To hide us from pursuit that will be made + After my flight. Now go we in content + To liberty and not to banishment. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE I The Forest of Arden. + + + [Enter DUKE SENIOR, AMIENS, and two or three Lords, + like foresters] + +DUKE SENIOR Now, my co-mates and brothers in exile, + Hath not old custom made this life more sweet + Than that of painted pomp? Are not these woods + More free from peril than the envious court? + Here feel we but the penalty of Adam, + The seasons' difference, as the icy fang + And churlish chiding of the winter's wind, + Which, when it bites and blows upon my body, + Even till I shrink with cold, I smile and say + 'This is no flattery: these are counsellors + That feelingly persuade me what I am.' + Sweet are the uses of adversity, + Which, like the toad, ugly and venomous, + Wears yet a precious jewel in his head; + And this our life exempt from public haunt + Finds tongues in trees, books in the running brooks, + Sermons in stones and good in every thing. + I would not change it. + +AMIENS Happy is your grace, + That can translate the stubbornness of fortune + Into so quiet and so sweet a style. + +DUKE SENIOR Come, shall we go and kill us venison? + And yet it irks me the poor dappled fools, + Being native burghers of this desert city, + Should in their own confines with forked heads + Have their round haunches gored. + +First Lord Indeed, my lord, + The melancholy Jaques grieves at that, + And, in that kind, swears you do more usurp + Than doth your brother that hath banish'd you. + To-day my Lord of Amiens and myself + Did steal behind him as he lay along + Under an oak whose antique root peeps out + Upon the brook that brawls along this wood: + To the which place a poor sequester'd stag, + That from the hunter's aim had ta'en a hurt, + Did come to languish, and indeed, my lord, + The wretched animal heaved forth such groans + That their discharge did stretch his leathern coat + Almost to bursting, and the big round tears + Coursed one another down his innocent nose + In piteous chase; and thus the hairy fool + Much marked of the melancholy Jaques, + Stood on the extremest verge of the swift brook, + Augmenting it with tears. + +DUKE SENIOR But what said Jaques? + Did he not moralize this spectacle? + +First Lord O, yes, into a thousand similes. + First, for his weeping into the needless stream; + 'Poor deer,' quoth he, 'thou makest a testament + As worldlings do, giving thy sum of more + To that which had too much:' then, being there alone, + Left and abandon'd of his velvet friends, + ''Tis right:' quoth he; 'thus misery doth part + The flux of company:' anon a careless herd, + Full of the pasture, jumps along by him + And never stays to greet him; 'Ay' quoth Jaques, + 'Sweep on, you fat and greasy citizens; + 'Tis just the fashion: wherefore do you look + Upon that poor and broken bankrupt there?' + Thus most invectively he pierceth through + The body of the country, city, court, + Yea, and of this our life, swearing that we + Are mere usurpers, tyrants and what's worse, + To fright the animals and to kill them up + In their assign'd and native dwelling-place. + +DUKE SENIOR And did you leave him in this contemplation? + +Second Lord We did, my lord, weeping and commenting + Upon the sobbing deer. + +DUKE SENIOR Show me the place: + I love to cope him in these sullen fits, + For then he's full of matter. + +First Lord I'll bring you to him straight. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE II A room in the palace. + + + [Enter DUKE FREDERICK, with Lords] + +DUKE FREDERICK Can it be possible that no man saw them? + It cannot be: some villains of my court + Are of consent and sufferance in this. + +First Lord I cannot hear of any that did see her. + The ladies, her attendants of her chamber, + Saw her abed, and in the morning early + They found the bed untreasured of their mistress. + +Second Lord My lord, the roynish clown, at whom so oft + Your grace was wont to laugh, is also missing. + Hisperia, the princess' gentlewoman, + Confesses that she secretly o'erheard + Your daughter and her cousin much commend + The parts and graces of the wrestler + That did but lately foil the sinewy Charles; + And she believes, wherever they are gone, + That youth is surely in their company. + +DUKE FREDERICK Send to his brother; fetch that gallant hither; + If he be absent, bring his brother to me; + I'll make him find him: do this suddenly, + And let not search and inquisition quail + To bring again these foolish runaways. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE III Before OLIVER'S house. + + + [Enter ORLANDO and ADAM, meeting] + +ORLANDO Who's there? + +ADAM What, my young master? O, my gentle master! + O my sweet master! O you memory + Of old Sir Rowland! why, what make you here? + Why are you virtuous? why do people love you? + And wherefore are you gentle, strong and valiant? + Why would you be so fond to overcome + The bonny priser of the humorous duke? + Your praise is come too swiftly home before you. + Know you not, master, to some kind of men + Their graces serve them but as enemies? + No more do yours: your virtues, gentle master, + Are sanctified and holy traitors to you. + O, what a world is this, when what is comely + Envenoms him that bears it! + +ORLANDO Why, what's the matter? + +ADAM O unhappy youth! + Come not within these doors; within this roof + The enemy of all your graces lives: + Your brother--no, no brother; yet the son-- + Yet not the son, I will not call him son + Of him I was about to call his father-- + Hath heard your praises, and this night he means + To burn the lodging where you use to lie + And you within it: if he fail of that, + He will have other means to cut you off. + I overheard him and his practises. + This is no place; this house is but a butchery: + Abhor it, fear it, do not enter it. + +ORLANDO Why, whither, Adam, wouldst thou have me go? + +ADAM No matter whither, so you come not here. + +ORLANDO What, wouldst thou have me go and beg my food? + Or with a base and boisterous sword enforce + A thievish living on the common road? + This I must do, or know not what to do: + Yet this I will not do, do how I can; + I rather will subject me to the malice + Of a diverted blood and bloody brother. + +ADAM But do not so. I have five hundred crowns, + The thrifty hire I saved under your father, + Which I did store to be my foster-nurse + When service should in my old limbs lie lame + And unregarded age in corners thrown: + Take that, and He that doth the ravens feed, + Yea, providently caters for the sparrow, + Be comfort to my age! Here is the gold; + And all this I give you. Let me be your servant: + Though I look old, yet I am strong and lusty; + For in my youth I never did apply + Hot and rebellious liquors in my blood, + Nor did not with unbashful forehead woo + The means of weakness and debility; + Therefore my age is as a lusty winter, + Frosty, but kindly: let me go with you; + I'll do the service of a younger man + In all your business and necessities. + +ORLANDO O good old man, how well in thee appears + The constant service of the antique world, + When service sweat for duty, not for meed! + Thou art not for the fashion of these times, + Where none will sweat but for promotion, + And having that, do choke their service up + Even with the having: it is not so with thee. + But, poor old man, thou prunest a rotten tree, + That cannot so much as a blossom yield + In lieu of all thy pains and husbandry + But come thy ways; well go along together, + And ere we have thy youthful wages spent, + We'll light upon some settled low content. + +ADAM Master, go on, and I will follow thee, + To the last gasp, with truth and loyalty. + From seventeen years till now almost fourscore + Here lived I, but now live here no more. + At seventeen years many their fortunes seek; + But at fourscore it is too late a week: + Yet fortune cannot recompense me better + Than to die well and not my master's debtor. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE IV The Forest of Arden. + + + [Enter ROSALIND for Ganymede, CELIA for Aliena, + and TOUCHSTONE] + +ROSALIND O Jupiter, how weary are my spirits! + +TOUCHSTONE I care not for my spirits, if my legs were not weary. + +ROSALIND I could find in my heart to disgrace my man's + apparel and to cry like a woman; but I must comfort + the weaker vessel, as doublet and hose ought to show + itself courageous to petticoat: therefore courage, + good Aliena! + +CELIA I pray you, bear with me; I cannot go no further. + +TOUCHSTONE For my part, I had rather bear with you than bear + you; yet I should bear no cross if I did bear you, + for I think you have no money in your purse. + +ROSALIND Well, this is the forest of Arden. + +TOUCHSTONE Ay, now am I in Arden; the more fool I; when I was + at home, I was in a better place: but travellers + must be content. + +ROSALIND Ay, be so, good Touchstone. + + [Enter CORIN and SILVIUS] + + Look you, who comes here; a young man and an old in + solemn talk. + +CORIN That is the way to make her scorn you still. + +SILVIUS O Corin, that thou knew'st how I do love her! + +CORIN I partly guess; for I have loved ere now. + +SILVIUS No, Corin, being old, thou canst not guess, + Though in thy youth thou wast as true a lover + As ever sigh'd upon a midnight pillow: + But if thy love were ever like to mine-- + As sure I think did never man love so-- + How many actions most ridiculous + Hast thou been drawn to by thy fantasy? + +CORIN Into a thousand that I have forgotten. + +SILVIUS O, thou didst then ne'er love so heartily! + If thou remember'st not the slightest folly + That ever love did make thee run into, + Thou hast not loved: + Or if thou hast not sat as I do now, + Wearying thy hearer in thy mistress' praise, + Thou hast not loved: + Or if thou hast not broke from company + Abruptly, as my passion now makes me, + Thou hast not loved. + O Phebe, Phebe, Phebe! + + [Exit] + +ROSALIND Alas, poor shepherd! searching of thy wound, + I have by hard adventure found mine own. + +TOUCHSTONE And I mine. I remember, when I was in love I broke + my sword upon a stone and bid him take that for + coming a-night to Jane Smile; and I remember the + kissing of her batlet and the cow's dugs that her + pretty chopt hands had milked; and I remember the + wooing of a peascod instead of her, from whom I took + two cods and, giving her them again, said with + weeping tears 'Wear these for my sake.' We that are + true lovers run into strange capers; but as all is + mortal in nature, so is all nature in love mortal in folly. + +ROSALIND Thou speakest wiser than thou art ware of. + +TOUCHSTONE Nay, I shall ne'er be ware of mine own wit till I + break my shins against it. + +ROSALIND Jove, Jove! this shepherd's passion + Is much upon my fashion. + +TOUCHSTONE And mine; but it grows something stale with me. + +CELIA I pray you, one of you question yond man + If he for gold will give us any food: + I faint almost to death. + +TOUCHSTONE Holla, you clown! + +ROSALIND Peace, fool: he's not thy kinsman. + +CORIN Who calls? + +TOUCHSTONE Your betters, sir. + +CORIN Else are they very wretched. + +ROSALIND Peace, I say. Good even to you, friend. + +CORIN And to you, gentle sir, and to you all. + +ROSALIND I prithee, shepherd, if that love or gold + Can in this desert place buy entertainment, + Bring us where we may rest ourselves and feed: + Here's a young maid with travel much oppress'd + And faints for succor. + +CORIN Fair sir, I pity her + And wish, for her sake more than for mine own, + My fortunes were more able to relieve her; + But I am shepherd to another man + And do not shear the fleeces that I graze: + My master is of churlish disposition + And little recks to find the way to heaven + By doing deeds of hospitality: + Besides, his cote, his flocks and bounds of feed + Are now on sale, and at our sheepcote now, + By reason of his absence, there is nothing + That you will feed on; but what is, come see. + And in my voice most welcome shall you be. + +ROSALIND What is he that shall buy his flock and pasture? + +CORIN That young swain that you saw here but erewhile, + That little cares for buying any thing. + +ROSALIND I pray thee, if it stand with honesty, + Buy thou the cottage, pasture and the flock, + And thou shalt have to pay for it of us. + +CELIA And we will mend thy wages. I like this place. + And willingly could waste my time in it. + +CORIN Assuredly the thing is to be sold: + Go with me: if you like upon report + The soil, the profit and this kind of life, + I will your very faithful feeder be + And buy it with your gold right suddenly. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE V The Forest. + + + [Enter AMIENS, JAQUES, and others] + + SONG. +AMIENS Under the greenwood tree + Who loves to lie with me, + And turn his merry note + Unto the sweet bird's throat, + Come hither, come hither, come hither: + Here shall he see No enemy + But winter and rough weather. + +JAQUES More, more, I prithee, more. + +AMIENS It will make you melancholy, Monsieur Jaques. + +JAQUES I thank it. More, I prithee, more. I can suck + melancholy out of a song, as a weasel sucks eggs. + More, I prithee, more. + +AMIENS My voice is ragged: I know I cannot please you. + +JAQUES I do not desire you to please me; I do desire you to + sing. Come, more; another stanzo: call you 'em stanzos? + +AMIENS What you will, Monsieur Jaques. + +JAQUES Nay, I care not for their names; they owe me + nothing. Will you sing? + +AMIENS More at your request than to please myself. + +JAQUES Well then, if ever I thank any man, I'll thank you; + but that they call compliment is like the encounter + of two dog-apes, and when a man thanks me heartily, + methinks I have given him a penny and he renders me + the beggarly thanks. Come, sing; and you that will + not, hold your tongues. + +AMIENS Well, I'll end the song. Sirs, cover the while; the + duke will drink under this tree. He hath been all + this day to look you. + +JAQUES And I have been all this day to avoid him. He is + too disputable for my company: I think of as many + matters as he, but I give heaven thanks and make no + boast of them. Come, warble, come. + + SONG. + Who doth ambition shun + + [All together here] + + And loves to live i' the sun, + Seeking the food he eats + And pleased with what he gets, + Come hither, come hither, come hither: + Here shall he see No enemy + But winter and rough weather. + +JAQUES I'll give you a verse to this note that I made + yesterday in despite of my invention. + +AMIENS And I'll sing it. + +JAQUES Thus it goes:-- + + If it do come to pass + That any man turn ass, + Leaving his wealth and ease, + A stubborn will to please, + Ducdame, ducdame, ducdame: + Here shall he see + Gross fools as he, + An if he will come to me. + +AMIENS What's that 'ducdame'? + +JAQUES 'Tis a Greek invocation, to call fools into a + circle. I'll go sleep, if I can; if I cannot, I'll + rail against all the first-born of Egypt. + +AMIENS And I'll go seek the duke: his banquet is prepared. + + [Exeunt severally] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE VI The forest. + + + [Enter ORLANDO and ADAM] + +ADAM Dear master, I can go no further. O, I die for food! + Here lie I down, and measure out my grave. Farewell, + kind master. + +ORLANDO Why, how now, Adam! no greater heart in thee? Live + a little; comfort a little; cheer thyself a little. + If this uncouth forest yield any thing savage, I + will either be food for it or bring it for food to + thee. Thy conceit is nearer death than thy powers. + For my sake be comfortable; hold death awhile at + the arm's end: I will here be with thee presently; + and if I bring thee not something to eat, I will + give thee leave to die: but if thou diest before I + come, thou art a mocker of my labour. Well said! + thou lookest cheerly, and I'll be with thee quickly. + Yet thou liest in the bleak air: come, I will bear + thee to some shelter; and thou shalt not die for + lack of a dinner, if there live any thing in this + desert. Cheerly, good Adam! + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT II + + + +SCENE VII The forest. + + + [A table set out. Enter DUKE SENIOR, AMIENS, and + Lords like outlaws] + +DUKE SENIOR I think he be transform'd into a beast; + For I can no where find him like a man. + +First Lord My lord, he is but even now gone hence: + Here was he merry, hearing of a song. + +DUKE SENIOR If he, compact of jars, grow musical, + We shall have shortly discord in the spheres. + Go, seek him: tell him I would speak with him. + + [Enter JAQUES] + +First Lord He saves my labour by his own approach. + +DUKE SENIOR Why, how now, monsieur! what a life is this, + That your poor friends must woo your company? + What, you look merrily! + +JAQUES A fool, a fool! I met a fool i' the forest, + A motley fool; a miserable world! + As I do live by food, I met a fool + Who laid him down and bask'd him in the sun, + And rail'd on Lady Fortune in good terms, + In good set terms and yet a motley fool. + 'Good morrow, fool,' quoth I. 'No, sir,' quoth he, + 'Call me not fool till heaven hath sent me fortune:' + And then he drew a dial from his poke, + And, looking on it with lack-lustre eye, + Says very wisely, 'It is ten o'clock: + Thus we may see,' quoth he, 'how the world wags: + 'Tis but an hour ago since it was nine, + And after one hour more 'twill be eleven; + And so, from hour to hour, we ripe and ripe, + And then, from hour to hour, we rot and rot; + And thereby hangs a tale.' When I did hear + The motley fool thus moral on the time, + My lungs began to crow like chanticleer, + That fools should be so deep-contemplative, + And I did laugh sans intermission + An hour by his dial. O noble fool! + A worthy fool! Motley's the only wear. + +DUKE SENIOR What fool is this? + +JAQUES O worthy fool! One that hath been a courtier, + And says, if ladies be but young and fair, + They have the gift to know it: and in his brain, + Which is as dry as the remainder biscuit + After a voyage, he hath strange places cramm'd + With observation, the which he vents + In mangled forms. O that I were a fool! + I am ambitious for a motley coat. + +DUKE SENIOR Thou shalt have one. + +JAQUES It is my only suit; + Provided that you weed your better judgments + Of all opinion that grows rank in them + That I am wise. I must have liberty + Withal, as large a charter as the wind, + To blow on whom I please; for so fools have; + And they that are most galled with my folly, + They most must laugh. And why, sir, must they so? + The 'why' is plain as way to parish church: + He that a fool doth very wisely hit + Doth very foolishly, although he smart, + Not to seem senseless of the bob: if not, + The wise man's folly is anatomized + Even by the squandering glances of the fool. + Invest me in my motley; give me leave + To speak my mind, and I will through and through + Cleanse the foul body of the infected world, + If they will patiently receive my medicine. + +DUKE SENIOR Fie on thee! I can tell what thou wouldst do. + +JAQUES What, for a counter, would I do but good? + +DUKE SENIOR Most mischievous foul sin, in chiding sin: + For thou thyself hast been a libertine, + As sensual as the brutish sting itself; + And all the embossed sores and headed evils, + That thou with licence of free foot hast caught, + Wouldst thou disgorge into the general world. + +JAQUES Why, who cries out on pride, + That can therein tax any private party? + Doth it not flow as hugely as the sea, + Till that the weary very means do ebb? + What woman in the city do I name, + When that I say the city-woman bears + The cost of princes on unworthy shoulders? + Who can come in and say that I mean her, + When such a one as she such is her neighbour? + Or what is he of basest function + That says his bravery is not of my cost, + Thinking that I mean him, but therein suits + His folly to the mettle of my speech? + There then; how then? what then? Let me see wherein + My tongue hath wrong'd him: if it do him right, + Then he hath wrong'd himself; if he be free, + Why then my taxing like a wild-goose flies, + Unclaim'd of any man. But who comes here? + + [Enter ORLANDO, with his sword drawn] + +ORLANDO Forbear, and eat no more. + +JAQUES Why, I have eat none yet. + +ORLANDO Nor shalt not, till necessity be served. + +JAQUES Of what kind should this cock come of? + +DUKE SENIOR Art thou thus bolden'd, man, by thy distress, + Or else a rude despiser of good manners, + That in civility thou seem'st so empty? + +ORLANDO You touch'd my vein at first: the thorny point + Of bare distress hath ta'en from me the show + Of smooth civility: yet am I inland bred + And know some nurture. But forbear, I say: + He dies that touches any of this fruit + Till I and my affairs are answered. + +JAQUES An you will not be answered with reason, I must die. + +DUKE SENIOR What would you have? Your gentleness shall force + More than your force move us to gentleness. + +ORLANDO I almost die for food; and let me have it. + +DUKE SENIOR Sit down and feed, and welcome to our table. + +ORLANDO Speak you so gently? Pardon me, I pray you: + I thought that all things had been savage here; + And therefore put I on the countenance + Of stern commandment. But whate'er you are + That in this desert inaccessible, + Under the shade of melancholy boughs, + Lose and neglect the creeping hours of time + If ever you have look'd on better days, + If ever been where bells have knoll'd to church, + If ever sat at any good man's feast, + If ever from your eyelids wiped a tear + And know what 'tis to pity and be pitied, + Let gentleness my strong enforcement be: + In the which hope I blush, and hide my sword. + +DUKE SENIOR True is it that we have seen better days, + And have with holy bell been knoll'd to church + And sat at good men's feasts and wiped our eyes + Of drops that sacred pity hath engender'd: + And therefore sit you down in gentleness + And take upon command what help we have + That to your wanting may be minister'd. + +ORLANDO Then but forbear your food a little while, + Whiles, like a doe, I go to find my fawn + And give it food. There is an old poor man, + Who after me hath many a weary step + Limp'd in pure love: till he be first sufficed, + Oppress'd with two weak evils, age and hunger, + I will not touch a bit. + +DUKE SENIOR Go find him out, + And we will nothing waste till you return. + +ORLANDO I thank ye; and be blest for your good comfort! + + [Exit] + +DUKE SENIOR Thou seest we are not all alone unhappy: + This wide and universal theatre + Presents more woeful pageants than the scene + Wherein we play in. + +JAQUES All the world's a stage, + And all the men and women merely players: + They have their exits and their entrances; + And one man in his time plays many parts, + His acts being seven ages. At first the infant, + Mewling and puking in the nurse's arms. + And then the whining school-boy, with his satchel + And shining morning face, creeping like snail + Unwillingly to school. And then the lover, + Sighing like furnace, with a woeful ballad + Made to his mistress' eyebrow. Then a soldier, + Full of strange oaths and bearded like the pard, + Jealous in honour, sudden and quick in quarrel, + Seeking the bubble reputation + Even in the cannon's mouth. And then the justice, + In fair round belly with good capon lined, + With eyes severe and beard of formal cut, + Full of wise saws and modern instances; + And so he plays his part. The sixth age shifts + Into the lean and slipper'd pantaloon, + With spectacles on nose and pouch on side, + His youthful hose, well saved, a world too wide + For his shrunk shank; and his big manly voice, + Turning again toward childish treble, pipes + And whistles in his sound. Last scene of all, + That ends this strange eventful history, + Is second childishness and mere oblivion, + Sans teeth, sans eyes, sans taste, sans everything. + + [Re-enter ORLANDO, with ADAM] + +DUKE SENIOR Welcome. Set down your venerable burthen, + And let him feed. + +ORLANDO I thank you most for him. + +ADAM So had you need: + I scarce can speak to thank you for myself. + +DUKE SENIOR Welcome; fall to: I will not trouble you + As yet, to question you about your fortunes. + Give us some music; and, good cousin, sing. + + SONG. +AMIENS Blow, blow, thou winter wind. + Thou art not so unkind + As man's ingratitude; + Thy tooth is not so keen, + Because thou art not seen, + Although thy breath be rude. + Heigh-ho! sing, heigh-ho! unto the green holly: + Most friendship is feigning, most loving mere folly: + Then, heigh-ho, the holly! + This life is most jolly. + Freeze, freeze, thou bitter sky, + That dost not bite so nigh + As benefits forgot: + Though thou the waters warp, + Thy sting is not so sharp + As friend remember'd not. + Heigh-ho! sing, &c. + +DUKE SENIOR If that you were the good Sir Rowland's son, + As you have whisper'd faithfully you were, + And as mine eye doth his effigies witness + Most truly limn'd and living in your face, + Be truly welcome hither: I am the duke + That loved your father: the residue of your fortune, + Go to my cave and tell me. Good old man, + Thou art right welcome as thy master is. + Support him by the arm. Give me your hand, + And let me all your fortunes understand. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE I A room in the palace. + + + [Enter DUKE FREDERICK, Lords, and OLIVER] + +DUKE FREDERICK Not see him since? Sir, sir, that cannot be: + But were I not the better part made mercy, + I should not seek an absent argument + Of my revenge, thou present. But look to it: + Find out thy brother, wheresoe'er he is; + Seek him with candle; bring him dead or living + Within this twelvemonth, or turn thou no more + To seek a living in our territory. + Thy lands and all things that thou dost call thine + Worth seizure do we seize into our hands, + Till thou canst quit thee by thy brothers mouth + Of what we think against thee. + +OLIVER O that your highness knew my heart in this! + I never loved my brother in my life. + +DUKE FREDERICK More villain thou. Well, push him out of doors; + And let my officers of such a nature + Make an extent upon his house and lands: + Do this expediently and turn him going. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE II The forest. + + + [Enter ORLANDO, with a paper] + +ORLANDO Hang there, my verse, in witness of my love: + And thou, thrice-crowned queen of night, survey + With thy chaste eye, from thy pale sphere above, + Thy huntress' name that my full life doth sway. + O Rosalind! these trees shall be my books + And in their barks my thoughts I'll character; + That every eye which in this forest looks + Shall see thy virtue witness'd every where. + Run, run, Orlando; carve on every tree + The fair, the chaste and unexpressive she. + + [Exit] + + [Enter CORIN and TOUCHSTONE] + +CORIN And how like you this shepherd's life, Master Touchstone? + +TOUCHSTONE Truly, shepherd, in respect of itself, it is a good + life, but in respect that it is a shepherd's life, + it is naught. In respect that it is solitary, I + like it very well; but in respect that it is + private, it is a very vile life. Now, in respect it + is in the fields, it pleaseth me well; but in + respect it is not in the court, it is tedious. As + is it a spare life, look you, it fits my humour well; + but as there is no more plenty in it, it goes much + against my stomach. Hast any philosophy in thee, shepherd? + +CORIN No more but that I know the more one sickens the + worse at ease he is; and that he that wants money, + means and content is without three good friends; + that the property of rain is to wet and fire to + burn; that good pasture makes fat sheep, and that a + great cause of the night is lack of the sun; that + he that hath learned no wit by nature nor art may + complain of good breeding or comes of a very dull kindred. + +TOUCHSTONE Such a one is a natural philosopher. Wast ever in + court, shepherd? + +CORIN No, truly. + +TOUCHSTONE Then thou art damned. + +CORIN Nay, I hope. + +TOUCHSTONE Truly, thou art damned like an ill-roasted egg, all + on one side. + +CORIN For not being at court? Your reason. + +TOUCHSTONE Why, if thou never wast at court, thou never sawest + good manners; if thou never sawest good manners, + then thy manners must be wicked; and wickedness is + sin, and sin is damnation. Thou art in a parlous + state, shepherd. + +CORIN Not a whit, Touchstone: those that are good manners + at the court are as ridiculous in the country as the + behavior of the country is most mockable at the + court. You told me you salute not at the court, but + you kiss your hands: that courtesy would be + uncleanly, if courtiers were shepherds. + +TOUCHSTONE Instance, briefly; come, instance. + +CORIN Why, we are still handling our ewes, and their + fells, you know, are greasy. + +TOUCHSTONE Why, do not your courtier's hands sweat? and is not + the grease of a mutton as wholesome as the sweat of + a man? Shallow, shallow. A better instance, I say; come. + +CORIN Besides, our hands are hard. + +TOUCHSTONE Your lips will feel them the sooner. Shallow again. + A more sounder instance, come. + +CORIN And they are often tarred over with the surgery of + our sheep: and would you have us kiss tar? The + courtier's hands are perfumed with civet. + +TOUCHSTONE Most shallow man! thou worms-meat, in respect of a + good piece of flesh indeed! Learn of the wise, and + perpend: civet is of a baser birth than tar, the + very uncleanly flux of a cat. Mend the instance, shepherd. + +CORIN You have too courtly a wit for me: I'll rest. + +TOUCHSTONE Wilt thou rest damned? God help thee, shallow man! + God make incision in thee! thou art raw. + +CORIN Sir, I am a true labourer: I earn that I eat, get + that I wear, owe no man hate, envy no man's + happiness, glad of other men's good, content with my + harm, and the greatest of my pride is to see my ewes + graze and my lambs suck. + +TOUCHSTONE That is another simple sin in you, to bring the ewes + and the rams together and to offer to get your + living by the copulation of cattle; to be bawd to a + bell-wether, and to betray a she-lamb of a + twelvemonth to a crooked-pated, old, cuckoldly ram, + out of all reasonable match. If thou beest not + damned for this, the devil himself will have no + shepherds; I cannot see else how thou shouldst + 'scape. + +CORIN Here comes young Master Ganymede, my new mistress's brother. + + [Enter ROSALIND, with a paper, reading] + +ROSALIND From the east to western Ind, + No jewel is like Rosalind. + Her worth, being mounted on the wind, + Through all the world bears Rosalind. + All the pictures fairest lined + Are but black to Rosalind. + Let no fair be kept in mind + But the fair of Rosalind. + +TOUCHSTONE I'll rhyme you so eight years together, dinners and + suppers and sleeping-hours excepted: it is the + right butter-women's rank to market. + +ROSALIND Out, fool! + +TOUCHSTONE For a taste: + If a hart do lack a hind, + Let him seek out Rosalind. + If the cat will after kind, + So be sure will Rosalind. + Winter garments must be lined, + So must slender Rosalind. + They that reap must sheaf and bind; + Then to cart with Rosalind. + Sweetest nut hath sourest rind, + Such a nut is Rosalind. + He that sweetest rose will find + Must find love's prick and Rosalind. + This is the very false gallop of verses: why do you + infect yourself with them? + +ROSALIND Peace, you dull fool! I found them on a tree. + +TOUCHSTONE Truly, the tree yields bad fruit. + +ROSALIND I'll graff it with you, and then I shall graff it + with a medlar: then it will be the earliest fruit + i' the country; for you'll be rotten ere you be half + ripe, and that's the right virtue of the medlar. + +TOUCHSTONE You have said; but whether wisely or no, let the + forest judge. + + [Enter CELIA, with a writing] + +ROSALIND Peace! Here comes my sister, reading: stand aside. + +CELIA [Reads] + + Why should this a desert be? + For it is unpeopled? No: + Tongues I'll hang on every tree, + That shall civil sayings show: + Some, how brief the life of man + Runs his erring pilgrimage, + That the stretching of a span + Buckles in his sum of age; + Some, of violated vows + 'Twixt the souls of friend and friend: + But upon the fairest boughs, + Or at every sentence end, + Will I Rosalinda write, + Teaching all that read to know + The quintessence of every sprite + Heaven would in little show. + Therefore Heaven Nature charged + That one body should be fill'd + With all graces wide-enlarged: + Nature presently distill'd + Helen's cheek, but not her heart, + Cleopatra's majesty, + Atalanta's better part, + Sad Lucretia's modesty. + Thus Rosalind of many parts + By heavenly synod was devised, + Of many faces, eyes and hearts, + To have the touches dearest prized. + Heaven would that she these gifts should have, + And I to live and die her slave. + +ROSALIND O most gentle pulpiter! what tedious homily of love + have you wearied your parishioners withal, and never + cried 'Have patience, good people!' + +CELIA How now! back, friends! Shepherd, go off a little. + Go with him, sirrah. + +TOUCHSTONE Come, shepherd, let us make an honourable retreat; + though not with bag and baggage, yet with scrip and scrippage. + + [Exeunt CORIN and TOUCHSTONE] + +CELIA Didst thou hear these verses? + +ROSALIND O, yes, I heard them all, and more too; for some of + them had in them more feet than the verses would bear. + +CELIA That's no matter: the feet might bear the verses. + +ROSALIND Ay, but the feet were lame and could not bear + themselves without the verse and therefore stood + lamely in the verse. + +CELIA But didst thou hear without wondering how thy name + should be hanged and carved upon these trees? + +ROSALIND I was seven of the nine days out of the wonder + before you came; for look here what I found on a + palm-tree. I was never so be-rhymed since + Pythagoras' time, that I was an Irish rat, which I + can hardly remember. + +CELIA Trow you who hath done this? + +ROSALIND Is it a man? + +CELIA And a chain, that you once wore, about his neck. + Change you colour? + +ROSALIND I prithee, who? + +CELIA O Lord, Lord! it is a hard matter for friends to + meet; but mountains may be removed with earthquakes + and so encounter. + +ROSALIND Nay, but who is it? + +CELIA Is it possible? + +ROSALIND Nay, I prithee now with most petitionary vehemence, + tell me who it is. + +CELIA O wonderful, wonderful, and most wonderful + wonderful! and yet again wonderful, and after that, + out of all hooping! + +ROSALIND Good my complexion! dost thou think, though I am + caparisoned like a man, I have a doublet and hose in + my disposition? One inch of delay more is a + South-sea of discovery; I prithee, tell me who is it + quickly, and speak apace. I would thou couldst + stammer, that thou mightst pour this concealed man + out of thy mouth, as wine comes out of a narrow- + mouthed bottle, either too much at once, or none at + all. I prithee, take the cork out of thy mouth that + may drink thy tidings. + +CELIA So you may put a man in your belly. + +ROSALIND Is he of God's making? What manner of man? Is his + head worth a hat, or his chin worth a beard? + +CELIA Nay, he hath but a little beard. + +ROSALIND Why, God will send more, if the man will be + thankful: let me stay the growth of his beard, if + thou delay me not the knowledge of his chin. + +CELIA It is young Orlando, that tripped up the wrestler's + heels and your heart both in an instant. + +ROSALIND Nay, but the devil take mocking: speak, sad brow and + true maid. + +CELIA I' faith, coz, 'tis he. + +ROSALIND Orlando? + +CELIA Orlando. + +ROSALIND Alas the day! what shall I do with my doublet and + hose? What did he when thou sawest him? What said + he? How looked he? Wherein went he? What makes + him here? Did he ask for me? Where remains he? + How parted he with thee? and when shalt thou see + him again? Answer me in one word. + +CELIA You must borrow me Gargantua's mouth first: 'tis a + word too great for any mouth of this age's size. To + say ay and no to these particulars is more than to + answer in a catechism. + +ROSALIND But doth he know that I am in this forest and in + man's apparel? Looks he as freshly as he did the + day he wrestled? + +CELIA It is as easy to count atomies as to resolve the + propositions of a lover; but take a taste of my + finding him, and relish it with good observance. + I found him under a tree, like a dropped acorn. + +ROSALIND It may well be called Jove's tree, when it drops + forth such fruit. + +CELIA Give me audience, good madam. + +ROSALIND Proceed. + +CELIA There lay he, stretched along, like a wounded knight. + +ROSALIND Though it be pity to see such a sight, it well + becomes the ground. + +CELIA Cry 'holla' to thy tongue, I prithee; it curvets + unseasonably. He was furnished like a hunter. + +ROSALIND O, ominous! he comes to kill my heart. + +CELIA I would sing my song without a burden: thou bringest + me out of tune. + +ROSALIND Do you not know I am a woman? when I think, I must + speak. Sweet, say on. + +CELIA You bring me out. Soft! comes he not here? + + [Enter ORLANDO and JAQUES] + +ROSALIND 'Tis he: slink by, and note him. + +JAQUES I thank you for your company; but, good faith, I had + as lief have been myself alone. + +ORLANDO And so had I; but yet, for fashion sake, I thank you + too for your society. + +JAQUES God be wi' you: let's meet as little as we can. + +ORLANDO I do desire we may be better strangers. + +JAQUES I pray you, mar no more trees with writing + love-songs in their barks. + +ORLANDO I pray you, mar no more of my verses with reading + them ill-favouredly. + +JAQUES Rosalind is your love's name? + +ORLANDO Yes, just. + +JAQUES I do not like her name. + +ORLANDO There was no thought of pleasing you when she was + christened. + +JAQUES What stature is she of? + +ORLANDO Just as high as my heart. + +JAQUES You are full of pretty answers. Have you not been + acquainted with goldsmiths' wives, and conned them + out of rings? + +ORLANDO Not so; but I answer you right painted cloth, from + whence you have studied your questions. + +JAQUES You have a nimble wit: I think 'twas made of + Atalanta's heels. Will you sit down with me? and + we two will rail against our mistress the world and + all our misery. + +ORLANDO I will chide no breather in the world but myself, + against whom I know most faults. + +JAQUES The worst fault you have is to be in love. + +ORLANDO 'Tis a fault I will not change for your best virtue. + I am weary of you. + +JAQUES By my troth, I was seeking for a fool when I found + you. + +ORLANDO He is drowned in the brook: look but in, and you + shall see him. + +JAQUES There I shall see mine own figure. + +ORLANDO Which I take to be either a fool or a cipher. + +JAQUES I'll tarry no longer with you: farewell, good + Signior Love. + +ORLANDO I am glad of your departure: adieu, good Monsieur + Melancholy. + + [Exit JAQUES] + +ROSALIND [Aside to CELIA] I will speak to him, like a saucy + lackey and under that habit play the knave with him. + Do you hear, forester? + +ORLANDO Very well: what would you? + +ROSALIND I pray you, what is't o'clock? + +ORLANDO You should ask me what time o' day: there's no clock + in the forest. + +ROSALIND Then there is no true lover in the forest; else + sighing every minute and groaning every hour would + detect the lazy foot of Time as well as a clock. + +ORLANDO And why not the swift foot of Time? had not that + been as proper? + +ROSALIND By no means, sir: Time travels in divers paces with + divers persons. I'll tell you who Time ambles + withal, who Time trots withal, who Time gallops + withal and who he stands still withal. + +ORLANDO I prithee, who doth he trot withal? + +ROSALIND Marry, he trots hard with a young maid between the + contract of her marriage and the day it is + solemnized: if the interim be but a se'nnight, + Time's pace is so hard that it seems the length of + seven year. + +ORLANDO Who ambles Time withal? + +ROSALIND With a priest that lacks Latin and a rich man that + hath not the gout, for the one sleeps easily because + he cannot study, and the other lives merrily because + he feels no pain, the one lacking the burden of lean + and wasteful learning, the other knowing no burden + of heavy tedious penury; these Time ambles withal. + +ORLANDO Who doth he gallop withal? + +ROSALIND With a thief to the gallows, for though he go as + softly as foot can fall, he thinks himself too soon there. + +ORLANDO Who stays it still withal? + +ROSALIND With lawyers in the vacation, for they sleep between + term and term and then they perceive not how Time moves. + +ORLANDO Where dwell you, pretty youth? + +ROSALIND With this shepherdess, my sister; here in the + skirts of the forest, like fringe upon a petticoat. + +ORLANDO Are you native of this place? + +ROSALIND As the cony that you see dwell where she is kindled. + +ORLANDO Your accent is something finer than you could + purchase in so removed a dwelling. + +ROSALIND I have been told so of many: but indeed an old + religious uncle of mine taught me to speak, who was + in his youth an inland man; one that knew courtship + too well, for there he fell in love. I have heard + him read many lectures against it, and I thank God + I am not a woman, to be touched with so many + giddy offences as he hath generally taxed their + whole sex withal. + +ORLANDO Can you remember any of the principal evils that he + laid to the charge of women? + +ROSALIND There were none principal; they were all like one + another as half-pence are, every one fault seeming + monstrous till his fellow fault came to match it. + +ORLANDO I prithee, recount some of them. + +ROSALIND No, I will not cast away my physic but on those that + are sick. There is a man haunts the forest, that + abuses our young plants with carving 'Rosalind' on + their barks; hangs odes upon hawthorns and elegies + on brambles, all, forsooth, deifying the name of + Rosalind: if I could meet that fancy-monger I would + give him some good counsel, for he seems to have the + quotidian of love upon him. + +ORLANDO I am he that is so love-shaked: I pray you tell me + your remedy. + +ROSALIND There is none of my uncle's marks upon you: he + taught me how to know a man in love; in which cage + of rushes I am sure you are not prisoner. + +ORLANDO What were his marks? + +ROSALIND A lean cheek, which you have not, a blue eye and + sunken, which you have not, an unquestionable + spirit, which you have not, a beard neglected, + which you have not; but I pardon you for that, for + simply your having in beard is a younger brother's + revenue: then your hose should be ungartered, your + bonnet unbanded, your sleeve unbuttoned, your shoe + untied and every thing about you demonstrating a + careless desolation; but you are no such man; you + are rather point-device in your accoutrements as + loving yourself than seeming the lover of any other. + +ORLANDO Fair youth, I would I could make thee believe I love. + +ROSALIND Me believe it! you may as soon make her that you + love believe it; which, I warrant, she is apter to + do than to confess she does: that is one of the + points in the which women still give the lie to + their consciences. But, in good sooth, are you he + that hangs the verses on the trees, wherein Rosalind + is so admired? + +ORLANDO I swear to thee, youth, by the white hand of + Rosalind, I am that he, that unfortunate he. + +ROSALIND But are you so much in love as your rhymes speak? + +ORLANDO Neither rhyme nor reason can express how much. + +ROSALIND Love is merely a madness, and, I tell you, deserves + as well a dark house and a whip as madmen do: and + the reason why they are not so punished and cured + is, that the lunacy is so ordinary that the whippers + are in love too. Yet I profess curing it by counsel. + +ORLANDO Did you ever cure any so? + +ROSALIND Yes, one, and in this manner. He was to imagine me + his love, his mistress; and I set him every day to + woo me: at which time would I, being but a moonish + youth, grieve, be effeminate, changeable, longing + and liking, proud, fantastical, apish, shallow, + inconstant, full of tears, full of smiles, for every + passion something and for no passion truly any + thing, as boys and women are for the most part + cattle of this colour; would now like him, now loathe + him; then entertain him, then forswear him; now weep + for him, then spit at him; that I drave my suitor + from his mad humour of love to a living humour of + madness; which was, to forswear the full stream of + the world, and to live in a nook merely monastic. + And thus I cured him; and this way will I take upon + me to wash your liver as clean as a sound sheep's + heart, that there shall not be one spot of love in't. + +ORLANDO I would not be cured, youth. + +ROSALIND I would cure you, if you would but call me Rosalind + and come every day to my cote and woo me. + +ORLANDO Now, by the faith of my love, I will: tell me + where it is. + +ROSALIND Go with me to it and I'll show it you and by the way + you shall tell me where in the forest you live. + Will you go? + +ORLANDO With all my heart, good youth. + +ROSALIND Nay you must call me Rosalind. Come, sister, will you go? + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE III The forest. + + + [Enter TOUCHSTONE and AUDREY; JAQUES behind] + +TOUCHSTONE Come apace, good Audrey: I will fetch up your + goats, Audrey. And how, Audrey? am I the man yet? + doth my simple feature content you? + +AUDREY Your features! Lord warrant us! what features! + +TOUCHSTONE I am here with thee and thy goats, as the most + capricious poet, honest Ovid, was among the Goths. + +JAQUES [Aside] O knowledge ill-inhabited, worse than Jove + in a thatched house! + +TOUCHSTONE When a man's verses cannot be understood, nor a + man's good wit seconded with the forward child + Understanding, it strikes a man more dead than a + great reckoning in a little room. Truly, I would + the gods had made thee poetical. + +AUDREY I do not know what 'poetical' is: is it honest in + deed and word? is it a true thing? + +TOUCHSTONE No, truly; for the truest poetry is the most + feigning; and lovers are given to poetry, and what + they swear in poetry may be said as lovers they do feign. + +AUDREY Do you wish then that the gods had made me poetical? + +TOUCHSTONE I do, truly; for thou swearest to me thou art + honest: now, if thou wert a poet, I might have some + hope thou didst feign. + +AUDREY Would you not have me honest? + +TOUCHSTONE No, truly, unless thou wert hard-favoured; for + honesty coupled to beauty is to have honey a sauce to sugar. + +JAQUES [Aside] A material fool! + +AUDREY Well, I am not fair; and therefore I pray the gods + make me honest. + +TOUCHSTONE Truly, and to cast away honesty upon a foul slut + were to put good meat into an unclean dish. + +AUDREY I am not a slut, though I thank the gods I am foul. + +TOUCHSTONE Well, praised be the gods for thy foulness! + sluttishness may come hereafter. But be it as it may + be, I will marry thee, and to that end I have been + with Sir Oliver Martext, the vicar of the next + village, who hath promised to meet me in this place + of the forest and to couple us. + +JAQUES [Aside] I would fain see this meeting. + +AUDREY Well, the gods give us joy! + +TOUCHSTONE Amen. A man may, if he were of a fearful heart, + stagger in this attempt; for here we have no temple + but the wood, no assembly but horn-beasts. But what + though? Courage! As horns are odious, they are + necessary. It is said, 'many a man knows no end of + his goods:' right; many a man has good horns, and + knows no end of them. Well, that is the dowry of + his wife; 'tis none of his own getting. Horns? + Even so. Poor men alone? No, no; the noblest deer + hath them as huge as the rascal. Is the single man + therefore blessed? No: as a walled town is more + worthier than a village, so is the forehead of a + married man more honourable than the bare brow of a + bachelor; and by how much defence is better than no + skill, by so much is a horn more precious than to + want. Here comes Sir Oliver. + + [Enter SIR OLIVER MARTEXT] + + Sir Oliver Martext, you are well met: will you + dispatch us here under this tree, or shall we go + with you to your chapel? + +SIR OLIVER MARTEXT Is there none here to give the woman? + +TOUCHSTONE I will not take her on gift of any man. + +SIR OLIVER MARTEXT Truly, she must be given, or the marriage is not lawful. + +JAQUES [Advancing] + + Proceed, proceed I'll give her. + +TOUCHSTONE Good even, good Master What-ye-call't: how do you, + sir? You are very well met: God 'ild you for your + last company: I am very glad to see you: even a + toy in hand here, sir: nay, pray be covered. + +JAQUES Will you be married, motley? + +TOUCHSTONE As the ox hath his bow, sir, the horse his curb and + the falcon her bells, so man hath his desires; and + as pigeons bill, so wedlock would be nibbling. + +JAQUES And will you, being a man of your breeding, be + married under a bush like a beggar? Get you to + church, and have a good priest that can tell you + what marriage is: this fellow will but join you + together as they join wainscot; then one of you will + prove a shrunk panel and, like green timber, warp, warp. + +TOUCHSTONE [Aside] I am not in the mind but I were better to be + married of him than of another: for he is not like + to marry me well; and not being well married, it + will be a good excuse for me hereafter to leave my wife. + +JAQUES Go thou with me, and let me counsel thee. + +TOUCHSTONE 'Come, sweet Audrey: + We must be married, or we must live in bawdry. + Farewell, good Master Oliver: not,-- + O sweet Oliver, + O brave Oliver, + Leave me not behind thee: but,-- + Wind away, + Begone, I say, + I will not to wedding with thee. + + [Exeunt JAQUES, TOUCHSTONE and AUDREY] + +SIR OLIVER MARTEXT 'Tis no matter: ne'er a fantastical knave of them + all shall flout me out of my calling. + + [Exit] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE IV The forest. + + + [Enter ROSALIND and CELIA] + +ROSALIND Never talk to me; I will weep. + +CELIA Do, I prithee; but yet have the grace to consider + that tears do not become a man. + +ROSALIND But have I not cause to weep? + +CELIA As good cause as one would desire; therefore weep. + +ROSALIND His very hair is of the dissembling colour. + +CELIA Something browner than Judas's marry, his kisses are + Judas's own children. + +ROSALIND I' faith, his hair is of a good colour. + +CELIA An excellent colour: your chestnut was ever the only colour. + +ROSALIND And his kissing is as full of sanctity as the touch + of holy bread. + +CELIA He hath bought a pair of cast lips of Diana: a nun + of winter's sisterhood kisses not more religiously; + the very ice of chastity is in them. + +ROSALIND But why did he swear he would come this morning, and + comes not? + +CELIA Nay, certainly, there is no truth in him. + +ROSALIND Do you think so? + +CELIA Yes; I think he is not a pick-purse nor a + horse-stealer, but for his verity in love, I do + think him as concave as a covered goblet or a + worm-eaten nut. + +ROSALIND Not true in love? + +CELIA Yes, when he is in; but I think he is not in. + +ROSALIND You have heard him swear downright he was. + +CELIA 'Was' is not 'is:' besides, the oath of a lover is + no stronger than the word of a tapster; they are + both the confirmer of false reckonings. He attends + here in the forest on the duke your father. + +ROSALIND I met the duke yesterday and had much question with + him: he asked me of what parentage I was; I told + him, of as good as he; so he laughed and let me go. + But what talk we of fathers, when there is such a + man as Orlando? + +CELIA O, that's a brave man! he writes brave verses, + speaks brave words, swears brave oaths and breaks + them bravely, quite traverse, athwart the heart of + his lover; as a puisny tilter, that spurs his horse + but on one side, breaks his staff like a noble + goose: but all's brave that youth mounts and folly + guides. Who comes here? + + [Enter CORIN] + +CORIN Mistress and master, you have oft inquired + After the shepherd that complain'd of love, + Who you saw sitting by me on the turf, + Praising the proud disdainful shepherdess + That was his mistress. + +CELIA Well, and what of him? + +CORIN If you will see a pageant truly play'd, + Between the pale complexion of true love + And the red glow of scorn and proud disdain, + Go hence a little and I shall conduct you, + If you will mark it. + +ROSALIND O, come, let us remove: + The sight of lovers feedeth those in love. + Bring us to this sight, and you shall say + I'll prove a busy actor in their play. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT III + + + +SCENE V Another part of the forest. + + + [Enter SILVIUS and PHEBE] + +SILVIUS Sweet Phebe, do not scorn me; do not, Phebe; + Say that you love me not, but say not so + In bitterness. The common executioner, + Whose heart the accustom'd sight of death makes hard, + Falls not the axe upon the humbled neck + But first begs pardon: will you sterner be + Than he that dies and lives by bloody drops? + + [Enter ROSALIND, CELIA, and CORIN, behind] + +PHEBE I would not be thy executioner: + I fly thee, for I would not injure thee. + Thou tell'st me there is murder in mine eye: + 'Tis pretty, sure, and very probable, + That eyes, that are the frail'st and softest things, + Who shut their coward gates on atomies, + Should be call'd tyrants, butchers, murderers! + Now I do frown on thee with all my heart; + And if mine eyes can wound, now let them kill thee: + Now counterfeit to swoon; why now fall down; + Or if thou canst not, O, for shame, for shame, + Lie not, to say mine eyes are murderers! + Now show the wound mine eye hath made in thee: + Scratch thee but with a pin, and there remains + Some scar of it; lean but upon a rush, + The cicatrice and capable impressure + Thy palm some moment keeps; but now mine eyes, + Which I have darted at thee, hurt thee not, + Nor, I am sure, there is no force in eyes + That can do hurt. + +SILVIUS O dear Phebe, + If ever,--as that ever may be near,-- + You meet in some fresh cheek the power of fancy, + Then shall you know the wounds invisible + That love's keen arrows make. + +PHEBE But till that time + Come not thou near me: and when that time comes, + Afflict me with thy mocks, pity me not; + As till that time I shall not pity thee. + +ROSALIND And why, I pray you? Who might be your mother, + That you insult, exult, and all at once, + Over the wretched? What though you have no beauty,-- + As, by my faith, I see no more in you + Than without candle may go dark to bed-- + Must you be therefore proud and pitiless? + Why, what means this? Why do you look on me? + I see no more in you than in the ordinary + Of nature's sale-work. 'Od's my little life, + I think she means to tangle my eyes too! + No, faith, proud mistress, hope not after it: + 'Tis not your inky brows, your black silk hair, + Your bugle eyeballs, nor your cheek of cream, + That can entame my spirits to your worship. + You foolish shepherd, wherefore do you follow her, + Like foggy south puffing with wind and rain? + You are a thousand times a properer man + Than she a woman: 'tis such fools as you + That makes the world full of ill-favour'd children: + 'Tis not her glass, but you, that flatters her; + And out of you she sees herself more proper + Than any of her lineaments can show her. + But, mistress, know yourself: down on your knees, + And thank heaven, fasting, for a good man's love: + For I must tell you friendly in your ear, + Sell when you can: you are not for all markets: + Cry the man mercy; love him; take his offer: + Foul is most foul, being foul to be a scoffer. + So take her to thee, shepherd: fare you well. + +PHEBE Sweet youth, I pray you, chide a year together: + I had rather hear you chide than this man woo. + +ROSALIND He's fallen in love with your foulness and she'll + fall in love with my anger. If it be so, as fast as + she answers thee with frowning looks, I'll sauce her + with bitter words. Why look you so upon me? + +PHEBE For no ill will I bear you. + +ROSALIND I pray you, do not fall in love with me, + For I am falser than vows made in wine: + Besides, I like you not. If you will know my house, + 'Tis at the tuft of olives here hard by. + Will you go, sister? Shepherd, ply her hard. + Come, sister. Shepherdess, look on him better, + And be not proud: though all the world could see, + None could be so abused in sight as he. + Come, to our flock. + + [Exeunt ROSALIND, CELIA and CORIN] + +PHEBE Dead Shepherd, now I find thy saw of might, + 'Who ever loved that loved not at first sight?' + +SILVIUS Sweet Phebe,-- + +PHEBE Ha, what say'st thou, Silvius? + +SILVIUS Sweet Phebe, pity me. + +PHEBE Why, I am sorry for thee, gentle Silvius. + +SILVIUS Wherever sorrow is, relief would be: + If you do sorrow at my grief in love, + By giving love your sorrow and my grief + Were both extermined. + +PHEBE Thou hast my love: is not that neighbourly? + +SILVIUS I would have you. + +PHEBE Why, that were covetousness. + Silvius, the time was that I hated thee, + And yet it is not that I bear thee love; + But since that thou canst talk of love so well, + Thy company, which erst was irksome to me, + I will endure, and I'll employ thee too: + But do not look for further recompense + Than thine own gladness that thou art employ'd. + +SILVIUS So holy and so perfect is my love, + And I in such a poverty of grace, + That I shall think it a most plenteous crop + To glean the broken ears after the man + That the main harvest reaps: loose now and then + A scatter'd smile, and that I'll live upon. + +PHEBE Know'st now the youth that spoke to me erewhile? + +SILVIUS Not very well, but I have met him oft; + And he hath bought the cottage and the bounds + That the old carlot once was master of. + +PHEBE Think not I love him, though I ask for him: + 'Tis but a peevish boy; yet he talks well; + But what care I for words? yet words do well + When he that speaks them pleases those that hear. + It is a pretty youth: not very pretty: + But, sure, he's proud, and yet his pride becomes him: + He'll make a proper man: the best thing in him + Is his complexion; and faster than his tongue + Did make offence his eye did heal it up. + He is not very tall; yet for his years he's tall: + His leg is but so so; and yet 'tis well: + There was a pretty redness in his lip, + A little riper and more lusty red + Than that mix'd in his cheek; 'twas just the difference + Between the constant red and mingled damask. + There be some women, Silvius, had they mark'd him + In parcels as I did, would have gone near + To fall in love with him; but, for my part, + I love him not nor hate him not; and yet + I have more cause to hate him than to love him: + For what had he to do to chide at me? + He said mine eyes were black and my hair black: + And, now I am remember'd, scorn'd at me: + I marvel why I answer'd not again: + But that's all one; omittance is no quittance. + I'll write to him a very taunting letter, + And thou shalt bear it: wilt thou, Silvius? + +SILVIUS Phebe, with all my heart. + +PHEBE I'll write it straight; + The matter's in my head and in my heart: + I will be bitter with him and passing short. + Go with me, Silvius. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT IV + + + +SCENE I The forest. + + + [Enter ROSALIND, CELIA, and JAQUES] + +JAQUES I prithee, pretty youth, let me be better acquainted + with thee. + +ROSALIND They say you are a melancholy fellow. + +JAQUES I am so; I do love it better than laughing. + +ROSALIND Those that are in extremity of either are abominable + fellows and betray themselves to every modern + censure worse than drunkards. + +JAQUES Why, 'tis good to be sad and say nothing. + +ROSALIND Why then, 'tis good to be a post. + +JAQUES I have neither the scholar's melancholy, which is + emulation, nor the musician's, which is fantastical, + nor the courtier's, which is proud, nor the + soldier's, which is ambitious, nor the lawyer's, + which is politic, nor the lady's, which is nice, nor + the lover's, which is all these: but it is a + melancholy of mine own, compounded of many simples, + extracted from many objects, and indeed the sundry's + contemplation of my travels, in which my often + rumination wraps me m a most humorous sadness. + +ROSALIND A traveller! By my faith, you have great reason to + be sad: I fear you have sold your own lands to see + other men's; then, to have seen much and to have + nothing, is to have rich eyes and poor hands. + +JAQUES Yes, I have gained my experience. + +ROSALIND And your experience makes you sad: I had rather have + a fool to make me merry than experience to make me + sad; and to travel for it too! + + [Enter ORLANDO] + +ORLANDO Good day and happiness, dear Rosalind! + +JAQUES Nay, then, God be wi' you, an you talk in blank verse. + + [Exit] + +ROSALIND Farewell, Monsieur Traveller: look you lisp and + wear strange suits, disable all the benefits of your + own country, be out of love with your nativity and + almost chide God for making you that countenance you + are, or I will scarce think you have swam in a + gondola. Why, how now, Orlando! where have you been + all this while? You a lover! An you serve me such + another trick, never come in my sight more. + +ORLANDO My fair Rosalind, I come within an hour of my promise. + +ROSALIND Break an hour's promise in love! He that will + divide a minute into a thousand parts and break but + a part of the thousandth part of a minute in the + affairs of love, it may be said of him that Cupid + hath clapped him o' the shoulder, but I'll warrant + him heart-whole. + +ORLANDO Pardon me, dear Rosalind. + +ROSALIND Nay, an you be so tardy, come no more in my sight: I + had as lief be wooed of a snail. + +ORLANDO Of a snail? + +ROSALIND Ay, of a snail; for though he comes slowly, he + carries his house on his head; a better jointure, + I think, than you make a woman: besides he brings + his destiny with him. + +ORLANDO What's that? + +ROSALIND Why, horns, which such as you are fain to be + beholding to your wives for: but he comes armed in + his fortune and prevents the slander of his wife. + +ORLANDO Virtue is no horn-maker; and my Rosalind is virtuous. + +ROSALIND And I am your Rosalind. + +CELIA It pleases him to call you so; but he hath a + Rosalind of a better leer than you. + +ROSALIND Come, woo me, woo me, for now I am in a holiday + humour and like enough to consent. What would you + say to me now, an I were your very very Rosalind? + +ORLANDO I would kiss before I spoke. + +ROSALIND Nay, you were better speak first, and when you were + gravelled for lack of matter, you might take + occasion to kiss. Very good orators, when they are + out, they will spit; and for lovers lacking--God + warn us!--matter, the cleanliest shift is to kiss. + +ORLANDO How if the kiss be denied? + +ROSALIND Then she puts you to entreaty, and there begins new matter. + +ORLANDO Who could be out, being before his beloved mistress? + +ROSALIND Marry, that should you, if I were your mistress, or + I should think my honesty ranker than my wit. + +ORLANDO What, of my suit? + +ROSALIND Not out of your apparel, and yet out of your suit. + Am not I your Rosalind? + +ORLANDO I take some joy to say you are, because I would be + talking of her. + +ROSALIND Well in her person I say I will not have you. + +ORLANDO Then in mine own person I die. + +ROSALIND No, faith, die by attorney. The poor world is + almost six thousand years old, and in all this time + there was not any man died in his own person, + videlicit, in a love-cause. Troilus had his brains + dashed out with a Grecian club; yet he did what he + could to die before, and he is one of the patterns + of love. Leander, he would have lived many a fair + year, though Hero had turned nun, if it had not been + for a hot midsummer night; for, good youth, he went + but forth to wash him in the Hellespont and being + taken with the cramp was drowned and the foolish + coroners of that age found it was 'Hero of Sestos.' + But these are all lies: men have died from time to + time and worms have eaten them, but not for love. + +ORLANDO I would not have my right Rosalind of this mind, + for, I protest, her frown might kill me. + +ROSALIND By this hand, it will not kill a fly. But come, now + I will be your Rosalind in a more coming-on + disposition, and ask me what you will. I will grant + it. + +ORLANDO Then love me, Rosalind. + +ROSALIND Yes, faith, will I, Fridays and Saturdays and all. + +ORLANDO And wilt thou have me? + +ROSALIND Ay, and twenty such. + +ORLANDO What sayest thou? + +ROSALIND Are you not good? + +ORLANDO I hope so. + +ROSALIND Why then, can one desire too much of a good thing? + Come, sister, you shall be the priest and marry us. + Give me your hand, Orlando. What do you say, sister? + +ORLANDO Pray thee, marry us. + +CELIA I cannot say the words. + +ROSALIND You must begin, 'Will you, Orlando--' + +CELIA Go to. Will you, Orlando, have to wife this Rosalind? + +ORLANDO I will. + +ROSALIND Ay, but when? + +ORLANDO Why now; as fast as she can marry us. + +ROSALIND Then you must say 'I take thee, Rosalind, for wife.' + +ORLANDO I take thee, Rosalind, for wife. + +ROSALIND I might ask you for your commission; but I do take + thee, Orlando, for my husband: there's a girl goes + before the priest; and certainly a woman's thought + runs before her actions. + +ORLANDO So do all thoughts; they are winged. + +ROSALIND Now tell me how long you would have her after you + have possessed her. + +ORLANDO For ever and a day. + +ROSALIND Say 'a day,' without the 'ever.' No, no, Orlando; + men are April when they woo, December when they wed: + maids are May when they are maids, but the sky + changes when they are wives. I will be more jealous + of thee than a Barbary cock-pigeon over his hen, + more clamorous than a parrot against rain, more + new-fangled than an ape, more giddy in my desires + than a monkey: I will weep for nothing, like Diana + in the fountain, and I will do that when you are + disposed to be merry; I will laugh like a hyen, and + that when thou art inclined to sleep. + +ORLANDO But will my Rosalind do so? + +ROSALIND By my life, she will do as I do. + +ORLANDO O, but she is wise. + +ROSALIND Or else she could not have the wit to do this: the + wiser, the waywarder: make the doors upon a woman's + wit and it will out at the casement; shut that and + 'twill out at the key-hole; stop that, 'twill fly + with the smoke out at the chimney. + +ORLANDO A man that had a wife with such a wit, he might say + 'Wit, whither wilt?' + +ROSALIND Nay, you might keep that cheque for it till you met + your wife's wit going to your neighbour's bed. + +ORLANDO And what wit could wit have to excuse that? + +ROSALIND Marry, to say she came to seek you there. You shall + never take her without her answer, unless you take + her without her tongue. O, that woman that cannot + make her fault her husband's occasion, let her + never nurse her child herself, for she will breed + it like a fool! + +ORLANDO For these two hours, Rosalind, I will leave thee. + +ROSALIND Alas! dear love, I cannot lack thee two hours. + +ORLANDO I must attend the duke at dinner: by two o'clock I + will be with thee again. + +ROSALIND Ay, go your ways, go your ways; I knew what you + would prove: my friends told me as much, and I + thought no less: that flattering tongue of yours + won me: 'tis but one cast away, and so, come, + death! Two o'clock is your hour? + +ORLANDO Ay, sweet Rosalind. + +ROSALIND By my troth, and in good earnest, and so God mend + me, and by all pretty oaths that are not dangerous, + if you break one jot of your promise or come one + minute behind your hour, I will think you the most + pathetical break-promise and the most hollow lover + and the most unworthy of her you call Rosalind that + may be chosen out of the gross band of the + unfaithful: therefore beware my censure and keep + your promise. + +ORLANDO With no less religion than if thou wert indeed my + Rosalind: so adieu. + +ROSALIND Well, Time is the old justice that examines all such + offenders, and let Time try: adieu. + + [Exit ORLANDO] + +CELIA You have simply misused our sex in your love-prate: + we must have your doublet and hose plucked over your + head, and show the world what the bird hath done to + her own nest. + +ROSALIND O coz, coz, coz, my pretty little coz, that thou + didst know how many fathom deep I am in love! But + it cannot be sounded: my affection hath an unknown + bottom, like the bay of Portugal. + +CELIA Or rather, bottomless, that as fast as you pour + affection in, it runs out. + +ROSALIND No, that same wicked bastard of Venus that was begot + of thought, conceived of spleen and born of madness, + that blind rascally boy that abuses every one's eyes + because his own are out, let him be judge how deep I + am in love. I'll tell thee, Aliena, I cannot be out + of the sight of Orlando: I'll go find a shadow and + sigh till he come. + +CELIA And I'll sleep. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT IV + + + +SCENE II The forest. + + + [Enter JAQUES, Lords, and Foresters] + +JAQUES Which is he that killed the deer? + +A Lord Sir, it was I. + +JAQUES Let's present him to the duke, like a Roman + conqueror; and it would do well to set the deer's + horns upon his head, for a branch of victory. Have + you no song, forester, for this purpose? + +Forester Yes, sir. + +JAQUES Sing it: 'tis no matter how it be in tune, so it + make noise enough. + + SONG. +Forester What shall he have that kill'd the deer? + His leather skin and horns to wear. + Then sing him home; + + [The rest shall bear this burden] + + Take thou no scorn to wear the horn; + It was a crest ere thou wast born: + Thy father's father wore it, + And thy father bore it: + The horn, the horn, the lusty horn + Is not a thing to laugh to scorn. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT IV + + + +SCENE III The forest. + + + [Enter ROSALIND and CELIA] + +ROSALIND How say you now? Is it not past two o'clock? and + here much Orlando! + +CELIA I warrant you, with pure love and troubled brain, he + hath ta'en his bow and arrows and is gone forth to + sleep. Look, who comes here. + + [Enter SILVIUS] + +SILVIUS My errand is to you, fair youth; + My gentle Phebe bid me give you this: + I know not the contents; but, as I guess + By the stern brow and waspish action + Which she did use as she was writing of it, + It bears an angry tenor: pardon me: + I am but as a guiltless messenger. + +ROSALIND Patience herself would startle at this letter + And play the swaggerer; bear this, bear all: + She says I am not fair, that I lack manners; + She calls me proud, and that she could not love me, + Were man as rare as phoenix. 'Od's my will! + Her love is not the hare that I do hunt: + Why writes she so to me? Well, shepherd, well, + This is a letter of your own device. + +SILVIUS No, I protest, I know not the contents: + Phebe did write it. + +ROSALIND Come, come, you are a fool + And turn'd into the extremity of love. + I saw her hand: she has a leathern hand. + A freestone-colour'd hand; I verily did think + That her old gloves were on, but 'twas her hands: + She has a huswife's hand; but that's no matter: + I say she never did invent this letter; + This is a man's invention and his hand. + +SILVIUS Sure, it is hers. + +ROSALIND Why, 'tis a boisterous and a cruel style. + A style for-challengers; why, she defies me, + Like Turk to Christian: women's gentle brain + Could not drop forth such giant-rude invention + Such Ethiope words, blacker in their effect + Than in their countenance. Will you hear the letter? + +SILVIUS So please you, for I never heard it yet; + Yet heard too much of Phebe's cruelty. + +ROSALIND She Phebes me: mark how the tyrant writes. + + [Reads] + + Art thou god to shepherd turn'd, + That a maiden's heart hath burn'd? + Can a woman rail thus? + +SILVIUS Call you this railing? + +ROSALIND [Reads] + + Why, thy godhead laid apart, + Warr'st thou with a woman's heart? + Did you ever hear such railing? + Whiles the eye of man did woo me, + That could do no vengeance to me. + Meaning me a beast. + If the scorn of your bright eyne + Have power to raise such love in mine, + Alack, in me what strange effect + Would they work in mild aspect! + Whiles you chid me, I did love; + How then might your prayers move! + He that brings this love to thee + Little knows this love in me: + And by him seal up thy mind; + Whether that thy youth and kind + Will the faithful offer take + Of me and all that I can make; + Or else by him my love deny, + And then I'll study how to die. + +SILVIUS Call you this chiding? + +CELIA Alas, poor shepherd! + +ROSALIND Do you pity him? no, he deserves no pity. Wilt + thou love such a woman? What, to make thee an + instrument and play false strains upon thee! not to + be endured! Well, go your way to her, for I see + love hath made thee a tame snake, and say this to + her: that if she love me, I charge her to love + thee; if she will not, I will never have her unless + thou entreat for her. If you be a true lover, + hence, and not a word; for here comes more company. + + [Exit SILVIUS] + + [Enter OLIVER] + +OLIVER Good morrow, fair ones: pray you, if you know, + Where in the purlieus of this forest stands + A sheep-cote fenced about with olive trees? + +CELIA West of this place, down in the neighbour bottom: + The rank of osiers by the murmuring stream + Left on your right hand brings you to the place. + But at this hour the house doth keep itself; + There's none within. + +OLIVER If that an eye may profit by a tongue, + Then should I know you by description; + Such garments and such years: 'The boy is fair, + Of female favour, and bestows himself + Like a ripe sister: the woman low + And browner than her brother.' Are not you + The owner of the house I did inquire for? + +CELIA It is no boast, being ask'd, to say we are. + +OLIVER Orlando doth commend him to you both, + And to that youth he calls his Rosalind + He sends this bloody napkin. Are you he? + +ROSALIND I am: what must we understand by this? + +OLIVER Some of my shame; if you will know of me + What man I am, and how, and why, and where + This handkercher was stain'd. + +CELIA I pray you, tell it. + +OLIVER When last the young Orlando parted from you + He left a promise to return again + Within an hour, and pacing through the forest, + Chewing the food of sweet and bitter fancy, + Lo, what befell! he threw his eye aside, + And mark what object did present itself: + Under an oak, whose boughs were moss'd with age + And high top bald with dry antiquity, + A wretched ragged man, o'ergrown with hair, + Lay sleeping on his back: about his neck + A green and gilded snake had wreathed itself, + Who with her head nimble in threats approach'd + The opening of his mouth; but suddenly, + Seeing Orlando, it unlink'd itself, + And with indented glides did slip away + Into a bush: under which bush's shade + A lioness, with udders all drawn dry, + Lay couching, head on ground, with catlike watch, + When that the sleeping man should stir; for 'tis + The royal disposition of that beast + To prey on nothing that doth seem as dead: + This seen, Orlando did approach the man + And found it was his brother, his elder brother. + +CELIA O, I have heard him speak of that same brother; + And he did render him the most unnatural + That lived amongst men. + +OLIVER And well he might so do, + For well I know he was unnatural. + +ROSALIND But, to Orlando: did he leave him there, + Food to the suck'd and hungry lioness? + +OLIVER Twice did he turn his back and purposed so; + But kindness, nobler ever than revenge, + And nature, stronger than his just occasion, + Made him give battle to the lioness, + Who quickly fell before him: in which hurtling + From miserable slumber I awaked. + +CELIA Are you his brother? + +ROSALIND Wast you he rescued? + +CELIA Was't you that did so oft contrive to kill him? + +OLIVER 'Twas I; but 'tis not I I do not shame + To tell you what I was, since my conversion + So sweetly tastes, being the thing I am. + +ROSALIND But, for the bloody napkin? + +OLIVER By and by. + When from the first to last betwixt us two + Tears our recountments had most kindly bathed, + As how I came into that desert place:-- + In brief, he led me to the gentle duke, + Who gave me fresh array and entertainment, + Committing me unto my brother's love; + Who led me instantly unto his cave, + There stripp'd himself, and here upon his arm + The lioness had torn some flesh away, + Which all this while had bled; and now he fainted + And cried, in fainting, upon Rosalind. + Brief, I recover'd him, bound up his wound; + And, after some small space, being strong at heart, + He sent me hither, stranger as I am, + To tell this story, that you might excuse + His broken promise, and to give this napkin + Dyed in his blood unto the shepherd youth + That he in sport doth call his Rosalind. + + [ROSALIND swoons] + +CELIA Why, how now, Ganymede! sweet Ganymede! + +OLIVER Many will swoon when they do look on blood. + +CELIA There is more in it. Cousin Ganymede! + +OLIVER Look, he recovers. + +ROSALIND I would I were at home. + +CELIA We'll lead you thither. + I pray you, will you take him by the arm? + +OLIVER Be of good cheer, youth: you a man! you lack a + man's heart. + +ROSALIND I do so, I confess it. Ah, sirrah, a body would + think this was well counterfeited! I pray you, tell + your brother how well I counterfeited. Heigh-ho! + +OLIVER This was not counterfeit: there is too great + testimony in your complexion that it was a passion + of earnest. + +ROSALIND Counterfeit, I assure you. + +OLIVER Well then, take a good heart and counterfeit to be a man. + +ROSALIND So I do: but, i' faith, I should have been a woman by right. + +CELIA Come, you look paler and paler: pray you, draw + homewards. Good sir, go with us. + +OLIVER That will I, for I must bear answer back + How you excuse my brother, Rosalind. + +ROSALIND I shall devise something: but, I pray you, commend + my counterfeiting to him. Will you go? + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT V + + + +SCENE I The forest. + + + [Enter TOUCHSTONE and AUDREY] + +TOUCHSTONE We shall find a time, Audrey; patience, gentle Audrey. + +AUDREY Faith, the priest was good enough, for all the old + gentleman's saying. + +TOUCHSTONE A most wicked Sir Oliver, Audrey, a most vile + Martext. But, Audrey, there is a youth here in the + forest lays claim to you. + +AUDREY Ay, I know who 'tis; he hath no interest in me in + the world: here comes the man you mean. + +TOUCHSTONE It is meat and drink to me to see a clown: by my + troth, we that have good wits have much to answer + for; we shall be flouting; we cannot hold. + + [Enter WILLIAM] + +WILLIAM Good even, Audrey. + +AUDREY God ye good even, William. + +WILLIAM And good even to you, sir. + +TOUCHSTONE Good even, gentle friend. Cover thy head, cover thy + head; nay, prithee, be covered. How old are you, friend? + +WILLIAM Five and twenty, sir. + +TOUCHSTONE A ripe age. Is thy name William? + +WILLIAM William, sir. + +TOUCHSTONE A fair name. Wast born i' the forest here? + +WILLIAM Ay, sir, I thank God. + +TOUCHSTONE 'Thank God;' a good answer. Art rich? + +WILLIAM Faith, sir, so so. + +TOUCHSTONE 'So so' is good, very good, very excellent good; and + yet it is not; it is but so so. Art thou wise? + +WILLIAM Ay, sir, I have a pretty wit. + +TOUCHSTONE Why, thou sayest well. I do now remember a saying, + 'The fool doth think he is wise, but the wise man + knows himself to be a fool.' The heathen + philosopher, when he had a desire to eat a grape, + would open his lips when he put it into his mouth; + meaning thereby that grapes were made to eat and + lips to open. You do love this maid? + +WILLIAM I do, sir. + +TOUCHSTONE Give me your hand. Art thou learned? + +WILLIAM No, sir. + +TOUCHSTONE Then learn this of me: to have, is to have; for it + is a figure in rhetoric that drink, being poured out + of a cup into a glass, by filling the one doth empty + the other; for all your writers do consent that ipse + is he: now, you are not ipse, for I am he. + +WILLIAM Which he, sir? + +TOUCHSTONE He, sir, that must marry this woman. Therefore, you + clown, abandon,--which is in the vulgar leave,--the + society,--which in the boorish is company,--of this + female,--which in the common is woman; which + together is, abandon the society of this female, or, + clown, thou perishest; or, to thy better + understanding, diest; or, to wit I kill thee, make + thee away, translate thy life into death, thy + liberty into bondage: I will deal in poison with + thee, or in bastinado, or in steel; I will bandy + with thee in faction; I will o'errun thee with + policy; I will kill thee a hundred and fifty ways: + therefore tremble and depart. + +AUDREY Do, good William. + +WILLIAM God rest you merry, sir. + + [Exit] + + [Enter CORIN] + +CORIN Our master and mistress seeks you; come, away, away! + +TOUCHSTONE Trip, Audrey! trip, Audrey! I attend, I attend. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT V + + + +SCENE II The forest. + + + [Enter ORLANDO and OLIVER] + +ORLANDO Is't possible that on so little acquaintance you + should like her? that but seeing you should love + her? and loving woo? and, wooing, she should + grant? and will you persever to enjoy her? + +OLIVER Neither call the giddiness of it in question, the + poverty of her, the small acquaintance, my sudden + wooing, nor her sudden consenting; but say with me, + I love Aliena; say with her that she loves me; + consent with both that we may enjoy each other: it + shall be to your good; for my father's house and all + the revenue that was old Sir Rowland's will I + estate upon you, and here live and die a shepherd. + +ORLANDO You have my consent. Let your wedding be to-morrow: + thither will I invite the duke and all's contented + followers. Go you and prepare Aliena; for look + you, here comes my Rosalind. + + [Enter ROSALIND] + +ROSALIND God save you, brother. + +OLIVER And you, fair sister. + + [Exit] + +ROSALIND O, my dear Orlando, how it grieves me to see thee + wear thy heart in a scarf! + +ORLANDO It is my arm. + +ROSALIND I thought thy heart had been wounded with the claws + of a lion. + +ORLANDO Wounded it is, but with the eyes of a lady. + +ROSALIND Did your brother tell you how I counterfeited to + swoon when he showed me your handkerchief? + +ORLANDO Ay, and greater wonders than that. + +ROSALIND O, I know where you are: nay, 'tis true: there was + never any thing so sudden but the fight of two rams + and Caesar's thrasonical brag of 'I came, saw, and + overcame:' for your brother and my sister no sooner + met but they looked, no sooner looked but they + loved, no sooner loved but they sighed, no sooner + sighed but they asked one another the reason, no + sooner knew the reason but they sought the remedy; + and in these degrees have they made a pair of stairs + to marriage which they will climb incontinent, or + else be incontinent before marriage: they are in + the very wrath of love and they will together; clubs + cannot part them. + +ORLANDO They shall be married to-morrow, and I will bid the + duke to the nuptial. But, O, how bitter a thing it + is to look into happiness through another man's + eyes! By so much the more shall I to-morrow be at + the height of heart-heaviness, by how much I shall + think my brother happy in having what he wishes for. + +ROSALIND Why then, to-morrow I cannot serve your turn for Rosalind? + +ORLANDO I can live no longer by thinking. + +ROSALIND I will weary you then no longer with idle talking. + Know of me then, for now I speak to some purpose, + that I know you are a gentleman of good conceit: I + speak not this that you should bear a good opinion + of my knowledge, insomuch I say I know you are; + neither do I labour for a greater esteem than may in + some little measure draw a belief from you, to do + yourself good and not to grace me. Believe then, if + you please, that I can do strange things: I have, + since I was three year old, conversed with a + magician, most profound in his art and yet not + damnable. If you do love Rosalind so near the heart + as your gesture cries it out, when your brother + marries Aliena, shall you marry her: I know into + what straits of fortune she is driven; and it is + not impossible to me, if it appear not inconvenient + to you, to set her before your eyes tomorrow human + as she is and without any danger. + +ORLANDO Speakest thou in sober meanings? + +ROSALIND By my life, I do; which I tender dearly, though I + say I am a magician. Therefore, put you in your + best array: bid your friends; for if you will be + married to-morrow, you shall, and to Rosalind, if you will. + + [Enter SILVIUS and PHEBE] + + Look, here comes a lover of mine and a lover of hers. + +PHEBE Youth, you have done me much ungentleness, + To show the letter that I writ to you. + +ROSALIND I care not if I have: it is my study + To seem despiteful and ungentle to you: + You are there followed by a faithful shepherd; + Look upon him, love him; he worships you. + +PHEBE Good shepherd, tell this youth what 'tis to love. + +SILVIUS It is to be all made of sighs and tears; + And so am I for Phebe. + +PHEBE And I for Ganymede. + +ORLANDO And I for Rosalind. + +ROSALIND And I for no woman. + +SILVIUS It is to be all made of faith and service; + And so am I for Phebe. + +PHEBE And I for Ganymede. + +ORLANDO And I for Rosalind. + +ROSALIND And I for no woman. + +SILVIUS It is to be all made of fantasy, + All made of passion and all made of wishes, + All adoration, duty, and observance, + All humbleness, all patience and impatience, + All purity, all trial, all observance; + And so am I for Phebe. + +PHEBE And so am I for Ganymede. + +ORLANDO And so am I for Rosalind. + +ROSALIND And so am I for no woman. + +PHEBE If this be so, why blame you me to love you? + +SILVIUS If this be so, why blame you me to love you? + +ORLANDO If this be so, why blame you me to love you? + +ROSALIND Who do you speak to, 'Why blame you me to love you?' + +ORLANDO To her that is not here, nor doth not hear. + +ROSALIND Pray you, no more of this; 'tis like the howling + of Irish wolves against the moon. + + [To SILVIUS] + + I will help you, if I can: + + [To PHEBE] + + I would love you, if I could. To-morrow meet me all together. + + [To PHEBE] + + I will marry you, if ever I marry woman, and I'll be + married to-morrow: + + [To ORLANDO] + + I will satisfy you, if ever I satisfied man, and you + shall be married to-morrow: + + [To SILVIUS] + + I will content you, if what pleases you contents + you, and you shall be married to-morrow. + + [To ORLANDO] + + As you love Rosalind, meet: + + [To SILVIUS] + + as you love Phebe, meet: and as I love no woman, + I'll meet. So fare you well: I have left you commands. + +SILVIUS I'll not fail, if I live. + +PHEBE Nor I. + +ORLANDO Nor I. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT V + + + +SCENE III The forest. + + + [Enter TOUCHSTONE and AUDREY] + +TOUCHSTONE To-morrow is the joyful day, Audrey; to-morrow will + we be married. + +AUDREY I do desire it with all my heart; and I hope it is + no dishonest desire to desire to be a woman of the + world. Here comes two of the banished duke's pages. + + [Enter two Pages] + +First Page Well met, honest gentleman. + +TOUCHSTONE By my troth, well met. Come, sit, sit, and a song. + +Second Page We are for you: sit i' the middle. + +First Page Shall we clap into't roundly, without hawking or + spitting or saying we are hoarse, which are the only + prologues to a bad voice? + +Second Page I'faith, i'faith; and both in a tune, like two + gipsies on a horse. + + SONG. + It was a lover and his lass, + With a hey, and a ho, and a hey nonino, + That o'er the green corn-field did pass + In the spring time, the only pretty ring time, + When birds do sing, hey ding a ding, ding: + Sweet lovers love the spring. + + Between the acres of the rye, + With a hey, and a ho, and a hey nonino + These pretty country folks would lie, + In spring time, &c. + + This carol they began that hour, + With a hey, and a ho, and a hey nonino, + How that a life was but a flower + In spring time, &c. + + And therefore take the present time, + With a hey, and a ho, and a hey nonino; + For love is crowned with the prime + In spring time, &c. + +TOUCHSTONE Truly, young gentlemen, though there was no great + matter in the ditty, yet the note was very + untuneable. + +First Page You are deceived, sir: we kept time, we lost not our time. + +TOUCHSTONE By my troth, yes; I count it but time lost to hear + such a foolish song. God be wi' you; and God mend + your voices! Come, Audrey. + + [Exeunt] + + + + + AS YOU LIKE IT + + +ACT V + + + +SCENE IV The forest. + + + [Enter DUKE SENIOR, AMIENS, JAQUES, ORLANDO, OLIVER, + and CELIA] + +DUKE SENIOR Dost thou believe, Orlando, that the boy + Can do all this that he hath promised? + +ORLANDO I sometimes do believe, and sometimes do not; + As those that fear they hope, and know they fear. + + [Enter ROSALIND, SILVIUS, and PHEBE] + +ROSALIND Patience once more, whiles our compact is urged: + You say, if I bring in your Rosalind, + You will bestow her on Orlando here? + +DUKE SENIOR That would I, had I kingdoms to give with her. + +ROSALIND And you say, you will have her, when I bring her? + +ORLANDO That would I, were I of all kingdoms king. + +ROSALIND You say, you'll marry me, if I be willing? + +PHEBE That will I, should I die the hour after. + +ROSALIND But if you do refuse to marry me, + You'll give yourself to this most faithful shepherd? + +PHEBE So is the bargain. + +ROSALIND You say, that you'll have Phebe, if she will? + +SILVIUS Though to have her and death were both one thing. + +ROSALIND I have promised to make all this matter even. + Keep you your word, O duke, to give your daughter; + You yours, Orlando, to receive his daughter: + Keep your word, Phebe, that you'll marry me, + Or else refusing me, to wed this shepherd: + Keep your word, Silvius, that you'll marry her. + If she refuse me: and from hence I go, + To make these doubts all even. + + [Exeunt ROSALIND and CELIA] + +DUKE SENIOR I do remember in this shepherd boy + Some lively touches of my daughter's favour. + +ORLANDO My lord, the first time that I ever saw him + Methought he was a brother to your daughter: + But, my good lord, this boy is forest-born, + And hath been tutor'd in the rudiments + Of many desperate studies by his uncle, + Whom he reports to be a great magician, + Obscured in the circle of this forest. + + [Enter TOUCHSTONE and AUDREY] + +JAQUES There is, sure, another flood toward, and these + couples are coming to the ark. Here comes a pair of + very strange beasts, which in all tongues are called fools. + +TOUCHSTONE Salutation and greeting to you all! + +JAQUES Good my lord, bid him welcome: this is the + motley-minded gentleman that I have so often met in + the forest: he hath been a courtier, he swears. + +TOUCHSTONE If any man doubt that, let him put me to my + purgation. I have trod a measure; I have flattered + a lady; I have been politic with my friend, smooth + with mine enemy; I have undone three tailors; I have + had four quarrels, and like to have fought one. + +JAQUES And how was that ta'en up? + +TOUCHSTONE Faith, we met, and found the quarrel was upon the + seventh cause. + +JAQUES How seventh cause? Good my lord, like this fellow. + +DUKE SENIOR I like him very well. + +TOUCHSTONE God 'ild you, sir; I desire you of the like. I + press in here, sir, amongst the rest of the country + copulatives, to swear and to forswear: according as + marriage binds and blood breaks: a poor virgin, + sir, an ill-favoured thing, sir, but mine own; a poor + humour of mine, sir, to take that that no man else + will: rich honesty dwells like a miser, sir, in a + poor house; as your pearl in your foul oyster. + +DUKE SENIOR By my faith, he is very swift and sententious. + +TOUCHSTONE According to the fool's bolt, sir, and such dulcet diseases. + +JAQUES But, for the seventh cause; how did you find the + quarrel on the seventh cause? + +TOUCHSTONE Upon a lie seven times removed:--bear your body more + seeming, Audrey:--as thus, sir. I did dislike the + cut of a certain courtier's beard: he sent me word, + if I said his beard was not cut well, he was in the + mind it was: this is called the Retort Courteous. + If I sent him word again 'it was not well cut,' he + would send me word, he cut it to please himself: + this is called the Quip Modest. If again 'it was + not well cut,' he disabled my judgment: this is + called the Reply Churlish. If again 'it was not + well cut,' he would answer, I spake not true: this + is called the Reproof Valiant. If again 'it was not + well cut,' he would say I lied: this is called the + Counter-cheque Quarrelsome: and so to the Lie + Circumstantial and the Lie Direct. + +JAQUES And how oft did you say his beard was not well cut? + +TOUCHSTONE I durst go no further than the Lie Circumstantial, + nor he durst not give me the Lie Direct; and so we + measured swords and parted. + +JAQUES Can you nominate in order now the degrees of the lie? + +TOUCHSTONE O sir, we quarrel in print, by the book; as you have + books for good manners: I will name you the degrees. + The first, the Retort Courteous; the second, the + Quip Modest; the third, the Reply Churlish; the + fourth, the Reproof Valiant; the fifth, the + Countercheque Quarrelsome; the sixth, the Lie with + Circumstance; the seventh, the Lie Direct. All + these you may avoid but the Lie Direct; and you may + avoid that too, with an If. I knew when seven + justices could not take up a quarrel, but when the + parties were met themselves, one of them thought but + of an If, as, 'If you said so, then I said so;' and + they shook hands and swore brothers. Your If is the + only peacemaker; much virtue in If. + +JAQUES Is not this a rare fellow, my lord? he's as good at + any thing and yet a fool. + +DUKE SENIOR He uses his folly like a stalking-horse and under + the presentation of that he shoots his wit. + + [Enter HYMEN, ROSALIND, and CELIA] + + [Still Music] + +HYMEN Then is there mirth in heaven, + When earthly things made even + Atone together. + Good duke, receive thy daughter + Hymen from heaven brought her, + Yea, brought her hither, + That thou mightst join her hand with his + Whose heart within his bosom is. + +ROSALIND [To DUKE SENIOR] To you I give myself, for I am yours. + + [To ORLANDO] + + To you I give myself, for I am yours. + +DUKE SENIOR If there be truth in sight, you are my daughter. + +ORLANDO If there be truth in sight, you are my Rosalind. + +PHEBE If sight and shape be true, + Why then, my love adieu! + +ROSALIND I'll have no father, if you be not he: + I'll have no husband, if you be not he: + Nor ne'er wed woman, if you be not she. + +HYMEN Peace, ho! I bar confusion: + 'Tis I must make conclusion + Of these most strange events: + Here's eight that must take hands + To join in Hymen's bands, + If truth holds true contents. + You and you no cross shall part: + You and you are heart in heart + You to his love must accord, + Or have a woman to your lord: + You and you are sure together, + As the winter to foul weather. + Whiles a wedlock-hymn we sing, + Feed yourselves with questioning; + That reason wonder may diminish, + How thus we met, and these things finish. + + SONG. + Wedding is great Juno's crown: + O blessed bond of board and bed! + 'Tis Hymen peoples every town; + High wedlock then be honoured: + Honour, high honour and renown, + To Hymen, god of every town! + +DUKE SENIOR O my dear niece, welcome thou art to me! + Even daughter, welcome, in no less degree. + +PHEBE I will not eat my word, now thou art mine; + Thy faith my fancy to thee doth combine. + + [Enter JAQUES DE BOYS] + +JAQUES DE BOYS Let me have audience for a word or two: + I am the second son of old Sir Rowland, + That bring these tidings to this fair assembly. + Duke Frederick, hearing how that every day + Men of great worth resorted to this forest, + Address'd a mighty power; which were on foot, + In his own conduct, purposely to take + His brother here and put him to the sword: + And to the skirts of this wild wood he came; + Where meeting with an old religious man, + After some question with him, was converted + Both from his enterprise and from the world, + His crown bequeathing to his banish'd brother, + And all their lands restored to them again + That were with him exiled. This to be true, + I do engage my life. + +DUKE SENIOR Welcome, young man; + Thou offer'st fairly to thy brothers' wedding: + To one his lands withheld, and to the other + A land itself at large, a potent dukedom. + First, in this forest, let us do those ends + That here were well begun and well begot: + And after, every of this happy number + That have endured shrewd days and nights with us + Shall share the good of our returned fortune, + According to the measure of their states. + Meantime, forget this new-fall'n dignity + And fall into our rustic revelry. + Play, music! And you, brides and bridegrooms all, + With measure heap'd in joy, to the measures fall. + +JAQUES Sir, by your patience. If I heard you rightly, + The duke hath put on a religious life + And thrown into neglect the pompous court? + +JAQUES DE BOYS He hath. + +JAQUES To him will I : out of these convertites + There is much matter to be heard and learn'd. + + [To DUKE SENIOR] + + You to your former honour I bequeath; + Your patience and your virtue well deserves it: + + [To ORLANDO] + + You to a love that your true faith doth merit: + + [To OLIVER] + + You to your land and love and great allies: + + [To SILVIUS] + + You to a long and well-deserved bed: + + [To TOUCHSTONE] + + And you to wrangling; for thy loving voyage + Is but for two months victuall'd. So, to your pleasures: + I am for other than for dancing measures. + +DUKE SENIOR Stay, Jaques, stay. + +JAQUES To see no pastime I what you would have + I'll stay to know at your abandon'd cave. + + [Exit] + +DUKE SENIOR Proceed, proceed: we will begin these rites, + As we do trust they'll end, in true delights. + + [A dance] + + + + + AS YOU LIKE IT + + EPILOGUE + + +ROSALIND It is not the fashion to see the lady the epilogue; + but it is no more unhandsome than to see the lord + the prologue. If it be true that good wine needs + no bush, 'tis true that a good play needs no + epilogue; yet to good wine they do use good bushes, + and good plays prove the better by the help of good + epilogues. What a case am I in then, that am + neither a good epilogue nor cannot insinuate with + you in the behalf of a good play! I am not + furnished like a beggar, therefore to beg will not + become me: my way is to conjure you; and I'll begin + with the women. I charge you, O women, for the love + you bear to men, to like as much of this play as + please you: and I charge you, O men, for the love + you bear to women--as I perceive by your simpering, + none of you hates them--that between you and the + women the play may please. If I were a woman I + would kiss as many of you as had beards that pleased + me, complexions that liked me and breaths that I + defied not: and, I am sure, as many as have good + beards or good faces or sweet breaths will, for my + kind offer, when I make curtsy, bid me farewell. + + [Exeunt] diff --git a/external/snappy-1.1.9/testdata/baddata1.snappy b/external/snappy-1.1.9/testdata/baddata1.snappy new file mode 100644 index 0000000..99d970f Binary files /dev/null and b/external/snappy-1.1.9/testdata/baddata1.snappy differ diff --git a/external/snappy-1.1.9/testdata/baddata2.snappy b/external/snappy-1.1.9/testdata/baddata2.snappy new file mode 100644 index 0000000..8f5cb13 Binary files /dev/null and b/external/snappy-1.1.9/testdata/baddata2.snappy differ diff --git a/external/snappy-1.1.9/testdata/baddata3.snappy b/external/snappy-1.1.9/testdata/baddata3.snappy new file mode 100644 index 0000000..774aead Binary files /dev/null and b/external/snappy-1.1.9/testdata/baddata3.snappy differ diff --git a/external/snappy-1.1.9/testdata/fireworks.jpeg b/external/snappy-1.1.9/testdata/fireworks.jpeg new file mode 100644 index 0000000..078cf17 Binary files /dev/null and b/external/snappy-1.1.9/testdata/fireworks.jpeg differ diff --git a/external/snappy-1.1.9/testdata/geo.protodata b/external/snappy-1.1.9/testdata/geo.protodata new file mode 100644 index 0000000..c4e3e0d Binary files /dev/null and b/external/snappy-1.1.9/testdata/geo.protodata differ diff --git a/external/snappy-1.1.9/testdata/html b/external/snappy-1.1.9/testdata/html new file mode 100644 index 0000000..ef768cc --- /dev/null +++ b/external/snappy-1.1.9/testdata/html @@ -0,0 +1 @@ + content: @ 1099872000000000: 'HTTP/1.1 200 OK\r\nX-Google-Crawl-Date: Mon, 08 Nov 2004 17:22:09 GMT\r\nContent-Type: text/html\r\nConnection: close\r\nX-Powered-By: PHP/4.3.8\r\nServer: Apache/1.3.31 (Unix) mod_gzip/1.3.19.1a PHP/4.3.8\r\nDate: Mon, 08 Nov 2004 17:19:07 GMT\r\n\r\n \r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\nMicro Achat : Ordinateurs, PDA - Toute l\'informatique avec 01Informatique, L\'Ordinateur Individuel, Micro Hebdo, D\351cision Informatique et 01R\351seaux\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

Derni\350re mise \340 jour de cette page : lundi 8 novembre 2004  |  16:45
\r\n \r\n\r\n\r\n\r\n\t\r\n\r\n\t\t\r\n\r\n\t\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t

\r\n\r\n\r\n\r\n


\r\n\r\n\r\n\r\n
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\"\"
Imagerie 
\"\"\n\t\t\t\t\t\t\t\tLG L1720B\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
332.89 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tAcer Veriton 7600G\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
705 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Ordinateurs 
\"\"\n\t\t\t\t\t\t\t\tShuttle SN95G5\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
375 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tAsus A7N8X-E Deluxe\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
91.99 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Composants 
\"\"\n\t\t\t\t\t\t\t\tThermalright SP-94\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\340 partir de\n\t\t\t\t\t\t\t\t\t
49 €
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\"\"
1 \">\"PC Look
2 \">\"Atelier Informatique
3 \">\"Zanax Multim\351dia
4 \">\"MISTEROOPS
5 \">\"168 Golden Avenue
6 \">\"microchoix
7 \">\"e-Soph
8 \">\"PC Price Club
9 \">\"PC 77
10 \">\"Web In Informatique
\n\t\t\t\t
\n\t\t\t\t
\r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\r\n\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n

\r\n\t\t\t

\r\n\t\t\t

\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\r\n \r\n \r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

CD et DVD bient\364t insensibles aux rayures
OpenOffice gagne son service
La messagerie en cinq minutes selon Ipswitch
> toutes les news


\r\n\t\t
\r\n \r\n\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Recevez chaque jour l\'actualit\351 des produits et des promos
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n\r\n\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

Entreprise
\r\n\t\t\t\tQuand le billet papier s\'envole vers la d\351mat\351rialisation


Trucs et astuces
\r\n\t\t\t\tD\351pannez Windows XP


Conso
\r\n\t\t\t\tVos photos sur papier imprimante ou labo ?


Produits & Tests
\r\n\t\t\t\t5 programmes d\222encodage vid\351o gratuits


\r\n\t\t
\r\n\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n
\r\n
\r\n\t\t\r\n\t\t

\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\r\n
\r\n
\r\nPortable
\r\nUn nouvel ultra portable r\351alis\351 par Nec
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nLe Versa S940 a un format r\351duit, mais ses performances sont \340 la hauteur.
\r\n\340 partir de 1663 \200\r\n
\r\n
\r\nPortable
\r\nAsus pr\351sente trois petits nouveaux dans la gamme A3N
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\nCes trois portables Centrino int\350grent, entre autres, une webcam et un contr\364leur Wi-Fi.
\r\n\340 partir de 1346 \200\r\n
\r\n
\r\n\t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t\r\n \t\r\n\t\r\n\t
\r\n\t\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
BON PLAN
\r\n
\r\n
\r\nLes derni\350res technologies INTEL dans un nouveau design pour ce shuttle haut de gamme, pour un prix abordable.
\r\n

\r\n
\r\n\340 partir de
\r\n
415 \200
\r\n
\r\n
\r\n
publicit\351
\r\n
\r\n\t\r\n\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\tDesktops
\r\n\t\t\t\tPortables
\r\n\t\t\t\tMini-PC
\r\n\t\t\t\tPda / Tablets-PC
\r\n\t\t\t\tApple
\r\n\t\t\t\tGPS
\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t


\r\n\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\r\n\t\t\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\tPortable Toshiba consacre deux gammes de machines au multim\351dia
\r\n\tEquipement haut de gamme et Windows Media Center sont au menu de ces portables \340 vocation multim\351dia.

\r\n\tOrdinateur Arriv\351e d\'un Power Mac G5 d\'entr\351e de gamme
\r\n\tLa firme \340 la pomme propose une station de travail \351volutive et relativement abordable.

\r\n\tPC Alienware propose deux machines au look \351trange
\r\n\tAurora et Area 51 sont deux gammes d\'ordinateurs enti\350rement configurables.

\r\n\tPortable Trois nouveaux iBook G4 chez Apple
\r\n\tChez Apple, les portables gagnent en vitesse et communiquent sans fil en standard.

\r\n\t\t\t\t> toutes les news\r\n\t\t\t
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tAsus A3N15-C Pro
\r\n Voici un portable autonome et puissant gr\342ce \340 la technologie Intel Centrino.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1170 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tSoltek EQ3702A Miroir
\r\n Ce mini PC est une solution int\351ressante pour les utilisateurs poss\351dant d\351j\340 un \351cran.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t559 \200
\r\n
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \tIBM ThinkPad R51
\r\n Voici un portable complet et pourtant relativement l\351ger.
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t
\r\n\t1299 \200
\r\n
\r\n\t\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\t\t\t\t> toutes les promos\r\n\t\t
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n
\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n\t\r\n\r\n
\r\n\r\n\t\t\t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t \t\r\n
\r\n
\r\nLes graveurs de DVD
\r\nQuel graveur choisir ? Quel type de format ? Quelle vitesse ? Double couche ou simple couche ? Voici tout ce qu\'il faut savoir pour faire le bon choix.
\r\n\t\t\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t
\r\n
\r\n\r\n\r\n\t\r\n\t\t\r\n\r\n\r\n \t\r\n
\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t

\r\n\t\t\t\tChoisir une r\351gion
\r\n\r\n
Un d\351partement
\r\n\r\n
\r\n
Un arrondissement
\r\n\r\n
\r\n
\r\n\t\t\t\tRecherche directe
\r\n\t\t\t\trechercher une ville
et/ou une boutique
\r\n\t\t\t\t

\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
Recherche avanc\351e
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Bureautique
\r\n\t\t\t\tTraducteur, organiseur...

\r\n\t\t\t\t

Multim\351dia
\r\n\t\t\t\tPhoto, audio, vid\351o...

\r\n\t\t\t\t

Utilitaires
\r\n\t\t\t\tAntivirus, pilotes, gravure...

\r\n\t\t\t\t

Personnaliser son PC
\r\n\t\t\t\tEcrans de veille, th\350mes...

\r\n\t\t\t\t

D\351veloppement
\r\n\t\t\t\tCr\351ation de logiciels, BDD...

\r\n\t\t\t\t

Jeux
\r\n\t\t\t\tAction, simulation...

\r\n\t\t\t\t

Internet
\r\n\t\t\t\tUtilitaires, email, FTP...

\r\n\t\t\t\t

Loisirs
\r\n\t\t\t\tHumour, culture...

\r\n\t\t\t\t
\r\n\t\t
\r\n
\r\n
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t
\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t

\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n + + C=10 M=100 Y=50 K=0 + CMYK + PROCESS + 10.000002 + 100.000000 + 50.000000 + 0.000000 + + + C=0 M=95 Y=20 K=0 + CMYK + PROCESS + 0.000000 + 94.999999 + 19.999999 + 0.000000 + + + C=25 M=25 Y=40 K=0 + CMYK + PROCESS + 25.000000 + 25.000000 + 39.999998 + 0.000000 + + + C=40 M=45 Y=50 K=5 + CMYK + PROCESS + 39.999998 + 44.999999 + 50.000000 + 5.000001 + + + C=50 M=50 Y=60 K=25 + CMYK + PROCESS + 50.000000 + 50.000000 + 60.000002 + 25.000000 + + + C=55 M=60 Y=65 K=40 + CMYK + PROCESS + 55.000001 + 60.000002 + 64.999998 + 39.999998 + + + C=25 M=40 Y=65 K=0 + CMYK + PROCESS + 25.000000 + 39.999998 + 64.999998 + 0.000000 + + + C=30 M=50 Y=75 K=10 + CMYK + PROCESS + 30.000001 + 50.000000 + 75.000000 + 10.000002 + + + C=35 M=60 Y=80 K=25 + CMYK + PROCESS + 35.000002 + 60.000002 + 80.000001 + 25.000000 + + + C=40 M=65 Y=90 K=35 + CMYK + PROCESS + 39.999998 + 64.999998 + 90.000004 + 35.000002 + + + C=40 M=70 Y=100 K=50 + CMYK + PROCESS + 39.999998 + 69.999999 + 100.000000 + 50.000000 + + + C=50 M=70 Y=80 K=70 + CMYK + PROCESS + 50.000000 + 69.999999 + 80.000001 + 69.999999 + + + + + + Grays + 1 + + + + C=0 M=0 Y=0 K=100 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 100.000000 + + + C=0 M=0 Y=0 K=90 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 89.999402 + + + C=0 M=0 Y=0 K=80 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 79.998797 + + + C=0 M=0 Y=0 K=70 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 69.999701 + + + C=0 M=0 Y=0 K=60 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 59.999102 + + + C=0 M=0 Y=0 K=50 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 50.000000 + + + C=0 M=0 Y=0 K=40 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 39.999402 + + + C=0 M=0 Y=0 K=30 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 29.998803 + + + C=0 M=0 Y=0 K=20 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 19.999701 + + + C=0 M=0 Y=0 K=10 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 9.999102 + + + C=0 M=0 Y=0 K=5 + CMYK + PROCESS + 0.000000 + 0.000000 + 0.000000 + 4.998803 + + + + + + Brights + 1 + + + + C=0 M=100 Y=100 K=0 + CMYK + PROCESS + 0.000000 + 100.000000 + 100.000000 + 0.000000 + + + C=0 M=75 Y=100 K=0 + CMYK + PROCESS + 0.000000 + 75.000000 + 100.000000 + 0.000000 + + + C=0 M=10 Y=95 K=0 + CMYK + PROCESS + 0.000000 + 10.000002 + 94.999999 + 0.000000 + + + C=85 M=10 Y=100 K=0 + CMYK + PROCESS + 84.999996 + 10.000002 + 100.000000 + 0.000000 + + + C=100 M=90 Y=0 K=0 + CMYK + PROCESS + 100.000000 + 90.000004 + 0.000000 + 0.000000 + + + C=60 M=90 Y=0 K=0 + CMYK + PROCESS + 60.000002 + 90.000004 + 0.003099 + 0.003099 + + + + + + + + + Adobe PDF library 9.00 + + + + + + + + + + + + + + + + + + + + + + + + + +endstream endobj 145 0 obj<> endobj 1 0 obj<> endobj 2 0 obj<>/Font<>/ProcSet[/PDF/Text]/ExtGState<>>> endobj 3 0 obj<>stream +hÞ”[MsÜF’½ëWðnmU(s™e{¥ÝñØkjw²`7ÈƨhhÒœÝ_±‡ù½›ïe€&›rl(BÑÄG¡ª2óåËúæ_o’‹ûáÍ·ß|óƒ»H.>Þ½)V¥sæ"–þ§ËWq’\X¯âØ¥÷obÞïïåÇÇ5þ{|ó)ú¥^×íxyºl•D]ÿE~gÅ*vMû¥Þè_YôþÇAÚ¨jqÕÙèÝ·?ób¾*¢]ýPïøW¹rÑØñ‰UÝ×mž©?ôõ04]‹»±\¹}ºüüñßÞ\¯Ê²¼¸NVIîd=ßɼöuÕÊp6wòñîN~¹re¢ßŽU;6c565î–2éc³®v¸„uì» gƒ¿ŠèSšü3Í>_áïD04í½¬îçQwñ#*Îåã¿Èׇ}µ“ÁL%´ÇýmÝË_9f€¹˜ÜÊ0Ü“²^YצYÓN¾9nëpsìe)ë¾9Œ²òŠÃ&ò„|÷€O›"–Ý~lÆíüýms¿•=2yT­×ǾZ?­ø'Ñ=ÊV÷Wø;“ù¨`L)·T0¦XåA4&ÅåÝq'×»êIGJd½×©Å·ÍC7bb©1QßíêðtÓrJ1EãÊ\ES·Ã±çR!â"º«dîwÇ +?‰ÖÝþ°«G³ÞqÏ p§Û¢õÝ_ß⧑«}}؉øü+.ÅDûöAèþ¹˜É¤$&þ¼ +*÷vÐoˆ¼:UçTæ¿išÍ‘ksØô÷?ây'ÒÛVƒ^4Ñm]Oß½ëŽA½©Ä$x‹I;#ŠúŠ¹4Õ.|ö®ëý®oîýŽQˆwÇv­KÊ,ăñ2kd‡6ÕX‹³,–‰4#.CÍ›¿ ²]ó¥Þ=é‹F6­õw¡â–QD1ü{~Û´Õ(µ}ÒËE´œK_ßw•*hZ@CtûEAËgÛ/Ê)rjöòìJÿ´Ñ‡vS×è\a¼ #ŸxhêGý­FšæØ“õ¶ïöøØü}l¶cYŒh)ùª¨â(»·ÇTþæNšÒÉþ¨ñÈSb”²áû[,Ê”¥W%üÊ£MswW÷/S2²¨ÌXËGåO¨¥ªáï5Œ´Ìåþr>ë®ýû,ž„Ø ¼Îb`'%ÉóÍÅE,Bþ>ö|$•G0§,1%ñž@ÜèÏT/¿2Ž;ë‡,žBQC)e¸‡™]…MÎR™Ø¶±~˜Rmê[Qž¾ +P c§ ƒ] î©QÉkO‡NFšáJ_¶Øù•É‡·Íz{θ‡C½nîš5”ÚÉ<Âòe’ƒÚH²˜¥‚Q`Su/JCSI£cÛüvôf“F·M·ëî¡asÖ£ßpΪ?™äŸÆ²óy»·Ý€˜'°#‘ó¡°ø;¥nåi*s¨ð#–}ðêÞõO¸‚ß×ëmÕ6າˆY‚Â^õzÉ .R`cß­aôXg|_Ž½~¬á"ÒÜhjñ@÷þͼ ú,Îø=qr‚Ðf²Î®½Â¥Œš40ÆP“Ûu}€ž`‘Ë@4Ë ë;ÂzRìÏ—¶{í»¯u,"ÞM¡ØOµ&SÔ›&´©÷"a™*W`èÕ"IˆF$—,Ñb¥OÚè¦És=<¦Ò#jáâå¬ú{ˆ~ñ›rå-"ß"· .êYF}V$¹[ù'=ùžªJ’}ÛJéZÄgŽÂ6`v©õÆ&v—‹¬Àeøœ¬z|$Üã¥lUr«»«iÚƒþ]ªÀ³øŽ=Xê3M7ª˜‰-ÉuÕ®• ÛîQ/ç1y°Ü8âöî8ˆÑ@š®ôv…—’å´pËÎÓ:c²‘Ș‰…€ei$ˆŸeTW=]C +Çè]•¼E³Á;ÍÈ»p×~Í +åU{¯»Q*0÷5á.õxr"ÎCŽ¾ë»¡;l›]uùñï³$ÍJĘ‘C…8Þ÷22´?¡Õá×@Hr… ü4AïØÉð$[ˆ­Z«ë3‰£X+!M²·Í?86À[T°¢>yúÙœh×ÝÒ°q ¢Pç$áð +ŒY¸p%«öb¥#XŠ5¡|–b¥^Q*B;óN™ºËJ:”à§3RÕÿüã…ò»¬Èå*ðÄ›9"‰a½­÷x¼pNA +è +S²b' –Uäp‹~tÜ…å6ûC×äs$Œt€Wh¿eÞ¢»+hªq², GFÙIHÆø[W5‡SØa<DèŽìßXÝî¦ÝSq-¾Í˜Ô1æ¨+£"G[»†‘!&f,Ý­pág‘ âä|ùž‰ùç­v0EÂQÍ`ÒŽIYZå)Ž+S ÄÔåðˆwMïï¹@Å]ÁàÚçG\¡Ñµc¬v[ŸøCÝ?0˜!ÿ¨Öâÿ8äÖC1Rµ<*—ªåùŸ`yqY¦ˆ!K5¦_¨Ñq7ß|èM ¾õQS›:¦Y0âªްYuÈIaf>]"B”ç] <-W½{0psõïÛ涹¼f^HãGØè¾Ñ¸ÍÆÁ†dV`)0¥ÉÐÒØYohjVÆBÕ訅ôù¤aRpvã)øP¬¾ßO¢ûÓí%‰Ãâ̹ Wˆ-%Œ~©×— >ì-œ@¨Üe‚\›:¹‘Ô¬¸ ‡+pÌXÈËðI”ûRt/€·¸'* ÓO€.©áXIMh=N`B—šû©epxcš_ ±¾~¿»dâ¦~–§žÐR„‡'%¤ÚWº( &­£o×·+,NyL'³$RxÜa9™KBˆYXW2¿ÆòÓ¨ò³/0Ã,sJý1yX>(f$ÆWò(»J +쇋®ŒÃD~äŸ1R­ÎáîûîQg#¨p©øpœ2 :}R·ŠHX0 ‹â= ³#Î1pëë:º­]³cö®ÕQ3&ŸsdÊëÙÖ̤j¸¾×íoF?¦ÛË8âV&Ñþ–Ó’™âñSnÞ#ÅÂ:tÂb0£2.£»±¡×žz••D-º‹;„¸+,ø=߃`®p©ð!jΰL “D]asÉ ›ÀäáF½cÊÌT óÊ\0ø¦>I/LPaªf¡¿ rF“´ HKìØ™e(ÕÎçO/ìe£ì;ex~ÎZôYï þPŽÉò3c³»d|¾¸Võ4ádOЇÒ)óñZ~Fë$¸Ö•K$tI¦‰@[µAuÆ0\¼d‚ ™FdõÕZ¸sËj†?K~ºoXŽå&=xÕï ìØ6U8¬~.PTZ;@°WaNCnuÿ›ðùè¡ùPä(Ψ-ñ&âfM’¿Ȳñ!<™ó±×4¬lÿ×ÈÄømC ãåÑ5cÂ^A®Ö—Y‹1xU_§–2Ðg¦t´i¦´Mc¡¾%='0Ä>ÿâ·¢ÖÚ“uWHh*ZC‘w3ÿ¨‚ÌH£¶ÛVwAûðкÛa Hœ¯‰Êð“*^¶I˜Ø½SÄ®¡lÖ«p*>Q„!:MÖ¥¥€Ml±µ’™¡Õ²"rÙ9ù1LAéëDà‹m]X؆¡IÓ)ÑW”'Szó»¾S4CBå…lĉ‡™&6¼q“j¦È‚Ÿ©:î ·ŠS³”H+z·ý ãG?_KtÉŒb~£Ùî> 4=t£Uÿ¦® *¡8g2a¨¼Šj£DÖÒ&§üý_ß©Büô¬å{õ +™ Åg­B$E»Ä³Mõt|G +þǨ>#!›8ÂJM:>ž„3ðw•Îy².ê#®­Á’˜3—Ÿ:0QãIó.Žµ8k±"t›NÈZ}õGÍøØ%@i"çÜ·µL¥ž€·5)³½w?/Æ>Ñ+ú$´.&Ž¡NØô3ꔈ{[ª“-R 韹¡n>Êuš e›ã‰P 4~ð€z¥£åZÝË](œiæîð~ð|¢Máë 6A8°*¡Ÿî‰®;Ù:±üMãõê‡ùh‚!÷¥GÍ°þÁÖ#;ÌB­Î¡±jPëDía•¦h±¶S~‚¯È—wjyÇ¡Q£|¨ÃãáE‰½êQ÷©ú'ࢳ»ªX +Î|J1c@«Ø"ëA¾'cÝeI3ÈŠ°Z²G£#s>]žME÷Ìnó,ÓÑR\ÉFuNT':òƒnÉöjœD“JÁXI…¹gc÷ëq«¸Ðm¼†7óÌ°¬Ž‚5“zÚŽDyò®Öý¬ú¶F ÇAN;·etS?L°£óÙ…1g«B†üÔþBÐ@¨Ï3V̶žºžuÙD»|±“Ão‚nh®ÓAìJF*§ƒgyÆhL¤“V¨²â±VÎBb¬eh£¿¯‚Ì×”†|é0*n7AHRiDª£ÆH‹‚§Ä*ÎH,puÉ¢—)?Ëe —÷°;šÐÉÍ55§îåÎܬÓ_눉8Û3¯¼SíYéMÙˆ tþ¾mî4„BXIâÞŽA…õ•<.}ûú"!‡.ðüõÌd>?3Aq«ÝæÌ‹xîHÁã—Šžt} lh*Qô„®ðLPô3ÉC{ËA+Í¥Þ[Ù²Ìü½“Äþêz'ñw’—/ýéÙKiž„·ŠsoÉEúú›×óý$ö¤¡(ž +{giÉÿ´â0sä +úäIÌÑŸŽ›¬â8õ48²'eö—ŪLL"ã\FxË _¬BOù!¬óÑ'o¯=µ`$žjð† Ï̵õ4ËÝ©Â#,$Y¡·†×»ÛØãÛµì½ÈR²…Gíª,|{`²Œ§öWlÐŒš•/†¬Âpïí¿«aÕšÉ%ã/·÷Š—è[Ó$¦G’¢RŸ"/ŸAØiôŒ£;F«ÓË6ä”’+um`P­þ,ÎåÑkë‹€À••¿¥‘ŠŒ^T½tÄÇfTˆ‚'Íã)É{.\¯Ur!|©ÖOÚÄ +ÛùÙS¹ªÔËvíÿ* + ¡ó«…Å!Xwµrñ»»Fá,ÄûäýXÑ•vvºhë™0z +õ'wJ)s² üüî]hµízoá‰/1#œ—AËû-—ø+Æ/ÇÎ6ñ=ân–ò„f©Ý˜`7‰µötÄòåˆ/­-óÉî(þÀ†¨¿ežÍ>Ίe£h"ÙAOàä'Þê¡ñ¶yôám(‡K@ ®6®~J2U#œ +Òã<‹â†²ÖãrñJqÃä¢óé[ä $ÊÓê‚o0-ó¸xf>f¥A´Q'n¼C*Ë9»Ṳ́ÇOÚ–œè VJ|×vœœØ‚ðª?2*“×( XŠ¦dø\îÓ0)IPÐù«sföèOˆœ§ñ.Í7Î'‡£N£ +„àÅâ8ÉltGÖšÈü®,Ìœ¡Œ¬Kñ‰dîÆG´ÆdOšH^e1g³µ›pÆ5ö%Æ‹$æ$¯Aé¤/9hoZK¿Ä`_Z%SæBõPVçß[þZ¦ì´P7‘ô/¬¥±ŽwV•S6p½O®´‡Quîl6à ×” ˜­F±akï׊¬–'d§yvÕèyi¸ù*m4,Å>éÑ ÜG]ž“Õ 9D7ÿ"˜¶*™éœ¨ºWíAØh8ªD\©›1¥qšuÄ51Ëc¯ƒ÷u«YÔéñyÜתkÒæÌŒÏݱ+ezuœˆÝ¡80T,•ŠÉÀôäÜJµ®™*y‚+š¢Â”L^5•³Fæ–µ¿îzãV1àÜ›gª¼ì¡eþu×­µL[yzÝü#ä·¦cƒñŒA¬m“´×GôüDÛþL-d>ô©šâ{[sGžíÉ•,£ê5yþ¥i5,çiKàèäÖç ôv7eÈä™W +ïĺ‰ái´”[v¡Ÿªx~ÊÖe@UpžéRDOÿï¢ÂUhâåV•F;€uCǾ4Ö&Èä!ˆÖ¼æ3Ð,§3xeÁ(ÏCHϵÍìŬ,Ì{Ë¢j ¯ðAsùJè6ǯBäõ OÆÌÏ€+œ}ø ɯp9)êÈeš;Á)¨g…ùäe»ÓrŸb­Z«Ã‘7N}Ç£4)[V~¥ñæš‹ãóVû@õ‡›¿©P?œe·ýÏ_~‡ +—%Šø_ßþ ëæ¼-wQ[ž ól‡¯²EÏ6bÙ¤çåjc{޷뫾ÖÀs”ÈÉøLÆ2=éÂÿZ%Ë‘H0èÛi4>v:ò26¿ +#œDiæyé +m—È8#ˆuïK˜€àhÑæK#ziT”\Ýûá =e̽òݲ±ž%œ>â¸'o?þ¬¹Þ¨'–{H4Ày±'›ªõ•LŸ=ÇÌëÞ‡x‹ŒŸ¯…ŸÇ‹»jí1|}óc£ª‘^i‹¾ïÝÉÕùtB×}¥[Ñ~¾„VÀ;-9¼l¯ÔNï§[pô#[rÂÙ–øùäë«s¨n!à†¹OŒEtôp·`ÓÜôÖí|v+bþE‚R»šyoXT€`Ûãz§Uw(#äE¸ ¥žRõm÷à3Oý•+´©-ÖÍBoU`úÇÆ{ÌmóŠäÎUÐî”jë›0ÎvU0ù{òÜÕØÓ4AÔ#x/kqC8øÉ&‹(Ž£/^Ôs²äÓY×g2›ê"@grÞ½É6Ò™™â6˜ÚðÕÑL9À9·.o³KùœMPºWtôu)="kúÔRfH©ûkßÊÓoØQ‹Î¤Ä¼B[ÎHi}?Üqí‹sSŠg“°©èxËOhï¢ý” ­S )·C¥Ìa)žÔºYð:ìk=ƱYóÅÑ—".òS²èar/{˜DÒ¦Lç¢t:µ h¢MlÈæÏÚ²KL¾ŒbxD®ºÑÌAÆ/­'–V˜å¥#”_lÇ×wŨŽ{ù-“å™P3´¯°ŒaæÄÚç„ô09úpŒ,Æœ,†ÿsÕ¾;Ð+šW!ÀEëÏ _Ehí¾çÔ­•D6•vÃ$Ñtxéd›ôŒ¢ß&ÜwÑc£my82Ñ+pÔÕFO)ŠW%_6‘AˆgYý<ÈUÈ*:p|+ó<öá¬ðºîµ„Æt}8…,!e„óÉü4@áË„R\s!{ô>ú%!–e +éÌþ¶·É0ÒZw?ŒO~cÇ=L"RÈ'mSQhkŸ£Y¯ð9 +¨ëŸtË žÿ>·ç}½¯T-ŒwÆS0k Í»ªG ®‚Ý÷µÿKâËV6Uøg½’l×ûšç"ñªcéOGžQ¢ëe÷âtd=ÎÙyyÜ<…*‘J-V›Þ©Òoq€ z[áå…X@4¯Va`ñ) ‚º? Ù-aoN`,‡ÝiîšÙÀ´*¦Í…æ¿ü™v6j›øi–dçØÅS…4DÎõš¸ :QßæÜð°ƒ>ü·Z‹¼l­êúQ]güÎõYêà"ÁïÍb}$ˆ âP#í™è‰òqŠc²¥ÍiGY^;ò;®äaEv0ÌÐqಙ±Þ•“¢º¢ -Œ…¡øª^ÌJ÷d49[ŸºaArë]½÷ îŒvFMTQÒ¨8ÃvǾ¹=2IžÇ>V´l“¹;öãVy Èg½;®›¦Ó]áâŒ(—f„¤¬7#6vûæ7Ãã[M Å?oª} 2´ +€£ŒCf© `Ü ôsthC“ÿ‰BV.ÿ]àXA™+YýýDZ’mGÓ'̇ ˜ó£Li7ŒõÓ‚F©¾¥ðÿœè[Š½ÿ¨Ð¤§­ E¦¼¸.e‘ÂQuù?ÿ姛°ØwÝþp9–bË¿¥÷„I±)ÿp6»ôøø¸:ìºA(?cï𳫮Ǚ +ÇtZzy]:œþ­jZËM±—iœX§e§ÿ«Û÷µúï=arÝ?`KhŇaÀ &ˤk¢¯%óûuÇÆ&e/þO€¦±.µ +endstream endobj 4 0 obj<> endobj 5 0 obj<>/ProcSet[/PDF/Text]/ExtGState<>>> endobj 6 0 obj<>stream +hÞÌ[Û’äÆq}çWì‹#0Ž™.uá‡%)YT¥][K>`z03»M=Ãa8üþ^ç9Y…KO/I…eKÁ.¦ª²2Ož¼Ô¯þí]öæaøäÓ÷Ÿüê7îMöæýý'å¦r®x“ÊáÒ–›ÔöÏ‹I3óæýþ“”ôrñ~‹ÿ=ò!ùíp¬®2¿©’ôê¦0~S$õUš øC^•?ø«Oöu•Yù廦Ço©üÖÝã*ß”I½Ý^eÕÆ&Í0´W™Ì"¹Ý5úœI¶òn±É“n_ã¦KÆö°‘»…‘ë·».½ÜoxÅÈ8õî*ËäßÝ5~±xåñ*Ëå£Õ'»v1ˤ›«ÌÉ﮾}ÿ;Y×M¶É¼Á|.ë;ö ^Ë“»Vfhäý±}šr©“»g,-O°2—æae¶²r5Èœø¬ÇVF.“9z½h¾™ìøµLæ"Z™ÿI…éÒLÆå¤Éã˱ƒÜ‹y]Cû#„“͛ŚÊÜèššZÌ·H,=¶ +¿Ì=‘-·.Ï!þnçmrÛj|T&ÞõíUžb·!|ÑáËSU26ýS2É®ÖMxÁ•Ìñ¶Ÿu¨¦ÁVeÆÅÝÕéøˢšÞÿ3V‚ù@Ínwøº“A®nŒLÇR ú‡›õëÔÇñ܃îÝɈ.¶œG‘´ÇQÅÒv Ãh‹‘Éy +•ßl{¡Júf‡Uù¤[Ì¢HºÃðI‰Jã‹Ï­l‡3òÆQÕj×^Q7ó¢¶âÂçó*•Ïížfá“Ã(~^zä ÞΖšWNž>4?Œxˆ{ÜLzÛan2Âp›Xé3^)ñ©BÀšñbå©jaØVUϹIïÌ,‡¡6œý¯~S(žT"¹#\„ˈ'N.r—åÀ“Ég¢X7NF…b¢ÙX`ßR¥Ä´ ѼÃØ··'™”LÎë†è-ÅŽT^ýÍ™ñu>€½1ïÚÃÃly–OFÝaûK*í à!KîpEÝÙq¸’›¡UÅÜcÈðaÁA[ƹ©>ŠªÎoÒ,{ãd~EšzÂOõ;$æÚŽØ!5z‚Д‡þí»;H[6y§Áyg¢n:(âBôµ¥frûË„š ¡S3]%³ÄS™èCƒ©8Ž;7ÍœsÔUÞlªªZÃÊeT ø~Àë¸VX\|þû·ºQåÒ¶Ðñ|9Yu$¯«ò/ðÚ÷úÚI Q&]->7k³ÂB–.k¤3Mn~Ôå7óºÚq£c•ÉûGhå €.€‚]Ó~Óäjuk»ø·ºƒ·–W·õ 3ž'ªÂ6- S +0F(=8G;ŒqKkÕola»“§º7ÈÛ—ø†x‰¤~“|Ù( ¨e˜ Ööövнév'Uƒ‘Ô ÊøN J¼ïá;%õþ­fÖC=ÂÓYò.Â_³•äÌm…Ë?1¤‡çY ?f“¯šñQ—ÛÝ JÝLrßõ—¬ç®ë€O»AÅöÍ•`hÚö¡°zïÚXE›o¯õȲpˆŠ"ªðN™²÷ÇF©ãžK Ë3oj’<öy8ªo¯ûAA£D­ d6–üvÉy船L{§`ÕaÈÒÉ$=`.Ä;JEA§‡NöšTøˆß^UñHß mÇÝ Öâ“ëK¶{_ouêí +S*›™¹¹Í¡C+·9 öuôÐ7£ZË +s1@µ4)Ljƒ{ØÑ?5*õâÑè<ð góœ²z BÄ›ªè‘¾ö“€Ø1eø è‹ÅjE<µZÀ“\&¡…¦Ål )49ªkÁv5Om §r;”ávíuáÇ]§÷BX6y$§ ½k‡­FÈtÙä¢Ö=ù‹pÿa« Ñ ¿ãþŽqi´ìiƒ„ÓÄ°T9p}eW÷hTÊ×Þ‘S0^Åþ­ò8{¦˜XG¾D|áÉsÍ÷AOÇ0ƒ}Àd~žeQø /8‹ix‚§]ˆÐe›K°§?dZ n~8FF¨Ë¥‚áôñs#³´¥cØ·nß©„F,ûp#QÈ“Zh¶e= ÿXËöæiäéÖ ÛÓÇ+1© vóÙ§_jìYÂå…v<Û Áœ¨½)¿UKЈ+’ð< êú›öá ° Z3,?Ëè•v§AtÄX~‚ÈôEwš~ÐðØHT)æ&zñÎÝûlEë^ÂÑP¨ºÉ9×”Ý(¯ìëö ¡NVEßn¨²”QGP‹¬À7êË /.þû›«Ò˜êIÕ$AçÒɇl˜g‘M"ïá$”!¹)ŽÂÇ,Âáæ¾ÛöT%ÛÜñÂþ>‰ë½ ±¤‚=¯Œ lW.á_æõæþB†XÀy߃A9¥ÇDqGl9õÇn€[°þgÃ%Ô6yíæÝQj»Ú"ÍÂÞ@²@êƒòH ~N·ÜÞ)56OI€¿?1š'©„Ðltœ÷"Þk}BwChh½}œ÷QxÅá.z@Œ™{È\e,à+¹Òbe²úŽ Ó£Pâ†ð˜± ¸AËœa^2½vêú„(ÚÇ[|aš™Œ +[Q†ÇvGç!ß&¿æJƒáÛrËÌGsHy!üÉ­RmØ/· < +±Pª¯?ûL½uÆ$¥¦'<ܾ©ÁTf.`­¦rÛBH‡&Fâh»R–3Ú€ÀNpz¯Òùs³ \õ:’ºdØ`‘j·{ù18æ c1;¶×ÄYL™1Üڧ&f³ŽÝ3y“åbFmx Ù'—#Šû3áÏÑ½É ü Yìš'*#ySåq9¢¼¿t Gç(zhïäþݵtÜ‘¸¨qLû#FßÊÀ”¢Ód·Ê,”£p™&§5°ÈB¦QX·€rb‹^c‹,×›‰ +²pë¿Â­4ÜÂòõNîdᎩ*nýËÙK¹Ïâ[6]Å1HI|¨÷à€¢.\‘dŸª’EÕ!æ¿;%´Ú ó©û—A›ªtÅÚ”çÀÉÞo¯•y™äSuiÖ³"NîÄÌ2Ro­µî‰¾üØ>Óß#Ó-Ϭ±‚?ž¿'ÀðÍ•ä7^–dÏÀ}8=<ÀJÈñWû‡·¤Ô½°Žé A Üp)a|áa°5Ö! œÊ2>hÈhe“†*ƒk$W{3•–EMY2ƒ<{J¹•²´ Ž’fÉï»±¾Ý½@P• 9ayóHf*ÛEКMC ÁzH¤u&j~D¾mõ‘lòMòÇí â*“C7Æk\ȃô~x‰uªA¨nÃ:*~R³·>ÕLóEÙöÂ,èõJˆ¬e—hGl1³³$*•™œi”o’cW,Ý=¶ý„*E¥œvasBœc>GY|Å72²Aœ£¬»öNŸô* ¡¶]ß7"·F“¼•zaù°r +³`Œ©¡’† ZhÇB\é&À_@»W†,ð䫵GÛòyZFãú׫›Ì +¶e %ˆÔ™¹ûÍÈ• :ê_qÇ&ŸÁ¿Ò §«ª\«Õûú»†ô¯Ýý ½“S˜HÚµ6>¨ã,è%·]NR ÒÎY YKbÌØÇfÊw[:^Ìø—ã®I¡é[úùŠL[`~¤)CY2æ=+Ø$T¿çÌð¦K^>œ1윕fVàh÷á3× > +`ÿÐîe’ŽÂ'…ý§kežZ¥DÈ.)ìS-È+¬Pš*×Ú±,¿þâbsfÜ&­¼û[›…ÀŒŒ0Qäb˜GÇ…ê3fµ"ñ±»Tzþ?.-gð÷E¨,ÿÛq¢6à:ñ¹Ò¼¸Dø¢`=<¢6l™XœÜ¶-cýö+\6C,` ­6Ý},°ÐR/CÇõž–ä¡õ‹ð6„¦EÐг¸žCV>mðN1`-dnC LOêô?Û-“?]CÎøY.í"n"5,à ‘)…8‡)–e7[ %7ö +´°%™s5lQœòrYx³–èZ,–"¾p¹ › ?¦¯9~œ9ƒË!`€Ýç¨R9r@ø:ÇìüšŽMö½®æ4~@K`^!ÌAòl)±ôÊOmw¸³L¼8³h®œ@/ªokÆÄ“›öš÷*ÖÜBÝ6àÚúW ’¹é8ag*Ƙ°³Y̸9ëÖìA,gêŒaa÷Nóч—Kê´ y +cÐ1ŠˆÙ›Gù6¤¾ýôf )J²ý»€'Ú^çÑNï»a‡ÒÔ@©õ=-› +[w®ÌÞ‹I `3¢&"ÚBSݨ±SñšÈiHÅÜ—h#ScÞɦږŶšƒ> ¦Ðm›ah†Îq%‚«ÂqUHnÈoÆî†K5%‰»ø&èb'l1´}`‹)Í4ÙàÅʘÐá H´Ý®{½Þ-?ZÄ>†Ó(ï³¼i,‹¯Ù ®Æ±Å%fH1ë̾)d4lcˆœKgËÂËY€xaÁëOt›uê¥K{™W­ú­Æ„mˆû¢}êuB¹OIé”/j®ñŒg/ò$ÄYú«2ÔΗêSh‘úP1eæŠÞî‹Ãv'¨©ÀœFMâØŒ¾µÚœ ò¿˜z` r~™plT¯²=÷¢€çù1ëýG°43ö"–ê€etÉËÀPøAþ×V`–wK³ÞÿeÞV—} +€½æºW!Xá³)CÎKÛfœÓ0`•Ô#¨R‰Ž»¢ñ&4RB‡.lø¡ì±71ï jæ‹*xÞ„¶²“òxüíÕW{6Ý®|µ'\DŽâ¦{ÖUþ•1$Ÿ÷ÝÐÛ]½«|¤p“ÇÛh»®GLÄ3‘-kÓn…¦uPäíño©ìŠT)Öðk91Š¦Ðpî…)ˆ² ¯tóÂ,Vr[*6.Àck*ä?šÙQøÓ`ûúY\X­­^yµÔÐh\´èú£ºÃØØ´šì&–#þpÐÀ¥XVš†zßè=*¤ÊàÅ¡~ /ØœÖC"](¸þÉ¿ÉF¾Z,á°_ +9ŒZg÷¢VÃÒØ4}g\5(ÿ¿¤oP;€Äú6IùŒ›)¼zDôHYr³_ƒ›) +é;¨ÏQ¦ÓÉZ63ëôîÙE ®Ö†°)krA²…Clóýü"¹œ–S" +Ùl­,ðµòfÛ„2à„oi5qõkUtŽáS²Ù„[2FÒüðØÞ¶cìßuÏš|È3¾ÖŸ + #S7©cÁÚHG°[ »šþiáÇ.ãØMï2ùùÔ>uë8Lt¼È}T€cÓS¹:kyh¡Íå”y•áQÀàNÝî”îa¯֒À€lb©`æ«Ö¾z­dè \Õýä/vZÎ1²þÎC|ÊsÇlÑâ+©'!þu"Ù,Žïë—XeN÷2`8²P-’YwÒRêU/hÚá´¿Õ‚˜çË,ÑæTÜÚ¶ýöÔŽ¡A¼ä>Fé‰S‹e(´áxÄ £ñéE6ªo×­s‡ö}_!ôNû½@Á5þFã@Ñ—Õb§ôwÝ)y'xsvä“ã~óD¾d³ÌÍaùB¯W¹"ÃV-f”IÿÕ›záUyÁ¸”áÒŸerYŠ<Á˜jŠÉC²á–0Ÿ8;íØG–Yk,1)ÝžºÝS¸u K…Tò`Sµ! iþzA¬ËW)™Y!!¢åßgÙ`I“&³.ªÚlv§…‡C +SM™tè|,ç1=€î¥jù+õÖ!¹$—°¡Ú-sYH‹P‹) +=€ò‘\™ª²Yfy6}†ÔmZUùl_™föRþ,ä‹çc\,Jp#´ÝYãÛÀ1™Ë’ˆƒ†Ç!Ü/X2;?Å1çÎxR‚äPŒfw]—×V)‡Wy3öZ.&ã1ôVßTÚŽˆTãä˜È‚—<¬BnûòsY¸Q(â´(åÞѱs‡F©dÍ\n&«zPgÙ¦i²ŠI-üʲËS󢧲IF|ätn>¸`óL´Ûô\2ŽÆ¯s­j ìlºìÒuÌ¢„F*Ç8;p¼áٽࢠí^.›ü"ÀÖ('Æ™ŽÇÚèœÕ¾¥A]YÐ5‡i„T `‘“×^ +çÙ¤}Š•öu”µ,v\bß¡ã‘œ Êøœr_æ# +jÆa“÷YÄâ‚åK5y¯ž?2_ÒÃúâBŽíL>»0ÌÈ÷Ùв2”TÚ´,äöûS­]*ûZûžðÀúï7ÉWï”M2MJÿy9Åâyû‚.ñî¸ýž©$†ƒ»®Ü3°ÁǼ™²°4ëAÀ3í2‡ÆxÊKhŒùx6tª3|ûæöå#‰!XPq-c¥Å_ïÌ[ +Rì)?¶ÛGTà ØÄçØÍ;¥1Q[Õ=;mts9CºŠ<ÓxÇi_ˆ>ô9xqy$ìò¢ ä ¯4r¨wìfcƒé[ßqó=Pm•ï"c’Oì«G±íªôÅÌ܈—ç’×™ ãÛ+Jç–X´ÞÍdZºÐŽ¤© m¿G·¹F¼å¢•P£êØhN^O;jòé,ln—Ïf‚wÍìÌtðËcÇ#–Q…*çF<÷-¤쵊…ýkÎAro”äå‚0{ªlõ¹ØÀ2'FB'`,ú¯[ +Mb 7,¤ÿû!t™M½—Á®*L¸iWý^jôÚat¦ßQ8ZêÌÍDG-;FtÔæZø˜•’?•‹Þ•Zí† Ïâ×ÇÂÄÝT>.‰pV1Ì”É*—a«Ò¶2Ÿ:0½à¤:¨lh³*%ÔºA[ïæ¢r`Ùýа5I{©ž Tmdžø9 +mQFëæ¬ëLusWÄî íªšbë4²î%> cŒeS¶Dí 8iHc˜–C"‰]:ˆm˜ùL1‘ÕãeìøðÁhC3ˆvø, Î:Õ/ÞXd¤Iÿ¦-¹6µåÇ|±³15kÜG}1«c>ñ­¥—iwšG÷S&óZ{›mr× Çvlôn¡¾‰ç\Cq˜GyWYö, ¦* ÖV« +Ã?Š˜Šì'ÄÄ#>È£h>ۼ纽åÚgö†ë¹¢Ð9˜©èÉ£œýñùR{yˆjÖð,–Ä_ ë•gÉ#4¼¡'7¶ÿ³$v뱜ÿ©èG>×­š2¦rJkÙ!¤Y,Ë3Óü!ј—ÿˆÎÄU?¹tVQ×%»Œ½Tyåbê7gÎþ¬è¨Ï‚,m 'ÕÔ”’.¨ºàL> £Ã'Ãã¡8ŠTrïBS6*Ÿ±wÚóˆmèv6Þ/’2x¡dRfëµYì€V¡k-Œ–JÏ}ÙîC\´Ð°eg>;Àdìy‘Ü0U¨ >³a™!ÅfT 9+K—û M +VÏB…¼ ÑŸâN½7—y ÖÞxúU³csɆG$˜•ÏåJìÍ/3÷ÚÅ"ˆ˜> +DãvË…‚<4јΛ|Ø€`íܾÀyæl\[æ> kû¶¼kGàšSiø%MB!‰MB¬™kŸñ Ë_´·Å_È•²þrž ]Õdª>Í™0— ê^þ÷Æ‹*_M˜ÿñ„nãgÃëx” îè«é r‘ÇCH»µÉ4‡¨þ´Šp¹ÅïŠiLèÛÍŠêÍØ[é[(¨¯¿üû˜ý쬆Êüê§ì:{ÑÖ5“ü§Ð†NåùùysÜuÃöŠ4Y^EÚ¦ëÑ'ãxˆ¹¸º©\…³¤¿«'MƒQGó438Å€­ŸünwÚ³cAX–â÷ð€©°%_ Nṯ¯eóûM–¦…É´Mé×ï?ùW)Ý» +endstream endobj 7 0 obj<> endobj 8 0 obj<>/XObject<>/ProcSet[/PDF/Text/ImageC]/ExtGState<>>> endobj 9 0 obj<>stream +hÞœZÉrãF½ë+t™pF„QPð­7íðÒ¶¾´ú’ 7Ð(ZŽ‰ùŒùÞÉ—YÅÅ-M8&Ñ µdåòòeB_üóV]oÆ«×wW_|•_«ë»õ•OË<7×ýO3gܵ*ò´4>¿¾Û^e$M7ÕCµœš¾gs£UZ&‹z:Ôu‡Ÿ6uÉ×ßãr©Iî“ÙÇ»oé`eäd¥R–ö½{{• ³»_ñRËËÔ¹L…Wÿ¯²°.ÍH¾ð. ïTXfËÒ…W_^.£Ã\^VÞåŸïø!¹Ä:-’Ûýn×ÖÛº›ªá 7*R›|ÕlöC_&õÉ­}}?»á‹Í]¸4æz®Rå}!›-ûnÝ Û¦ÛÌæÚ*RIß-i¹6Ž–W›ªéð#Oódz¨&<z–Ñ"é÷, ­‡j[úá¿¡ÝP¯Ö>oTËåžÌÑÔ#Ës÷w:¾Q-é¿ë'1EžTÓt™ñ¡®Œ–4J¢Žõoûšå3ÊCÖ5ž +zšj1q‘tûí‚Wñ§)뺚H5c_Ý6Û¦­†öéæ$Ðz?ÐV´Úæ9­©Ÿênä+XW’F°u¢Ž³2Üö«ºÅ•,žð¾ û4ݲ݇¥¹ ÂÊÒŸx5¿­›/ª±^ÎÞÔ.A“5Lêe¹ÉuÒÖu _Í‹T‘®û-=“D:ùà²<‡6î‡ø´Ý·SóX M5…=óäëfµb×'¡óäûjøÔ?žNÿ—"Í-9‹N–tN5ÁØ6ÃƉ¶åWA'«§?⧧Ÿ"”ÍJz&¼ûáÍoßÉ€¡¹æãé¬U³bu‘ØìÐÜØlºfÝ,«nj¡DºF™4ÛÝÐ?ÖòóÒ¥0b¢S±Ö-ø,ŠÉ%èöêÅ(ÎíóQœ–eùÄp¡âªBÿ)†­³ªn…—síRE÷¸ ÉU5qdä3gA1>ô‡î~–F¼º«>±1 ¦T2õ›~{#Ábá#‡INÖ O"wãNMGJ¿ ×*6ÞùäÍë÷çáIrÎFô1R:m%dƾբųÉè|þ?GÌ®eÐpÚ“ m³y`ƒ:$EŽ!ËáMt.æ\ÀeÃ0‹ãÄ‚ú(‹8s@„HÄ ·?¼ÂPFÖê]‹«…Y†dœšnpz¾6p×q¿ÙÔã$°çèVÒ6Ay²çtèeœ\´žÎ”9óL#²à·¥ß„T“è „êvÕ05U %Ä÷ÛsàÎ3h¦éÖý° ²cž î6Øà[üÚ7'†.S&Ëj V7<Ô˜ÆXÇa{ÓÚâ,Š %ZB°Ðåss. ðŠ¬,)^rŸZc9Û~HîH)9ùÙÐï7ØNpÐØŒ]µOcŸ³Š-óXW `F°|»˜Í=é½éª˜  Ã+ÊZi%ñÐŒ´¢2º ãtZ3›Ã.ë`sÚD—0àC5,ú¡‘%Eó— +¨Ø³ÁKhæÓ>Ä +á-bìJjcSœÄÉ*XœjA—G®Ý#lÈS½ø Ý›Üòèƒt8Ò#8B„ጢó òaærzOæ#XS¢ó¯k +Žg²².,{˜e¬Ü’4È3 /oV4‘$‘i!Ua’O¾«Æ™¢Ä +Ÿ¦T¢¡Å™ÂÕa9˜£‘„,9ìÅñT€@@ŠlÞ=DTnÉË›™¢‡;z +! ¥€¸"%ß1ô€ŸÍ8ײår°¢-m®6SHÌØl‰8ÑîJpÒxP‚-=ŒF?:HO±Þ>ý1S`"@œÌÁQxªÂ=±3"êô–’ D@%V$ʲYhzØô,]-ã*`cÍÑh!ÚØ@Çã8Š’غ©q”¡Õ4#¿Ô:‡’B–Æ Ž±„[$j/>EN7⛶št¼XàRžÈnð¹Ä÷ÉWŒaª¶\bH'Ð&ëuÉT ´‡ <à/¦)x‹›¹•D1 *僆y9b›Û‘ëʾdCámðW-î–‘ºü¦Ç+lkÞ“LÃ<3î3!ÌáJëç\ÁåyW0Z`PËsH0É¢’XÍý–I½d÷.hæsÕcÅ$mV ¬bxΑ×ÌÚ²å1:oιÒZ$~Åñ$ÝĘüU»Ý ŽÑ“àPrD&S¼%ò«f^´8²Üú hm!;=U`óMÝsxÔ"É44ÐKšàa!2Ü„ô0±B)ª›Nð‚IŒ‡Ó7,—Jvý(‘‰{+á8ª8G;ã)÷í^¡ 6ô Ib=8=Ì »–¿Œ)´%$€9fåuÈ + Ç;Ü¢á <™Ÿõ4ÍX=R,‘ æä4B^2ˆòÁ:l©“P¯Ê(ï²ò3˜t"®'×TÌÎñŠE_Õ;#tZñ| u­$`Õ2`Pä žjv+böeDƒwwW¿]YhÇjNPTm§%UÜ\‚ÛkàÊÜõr{õÅ7[uý¶¿úIŠ÷À¯i¯"“¥á1ïsJo^R[,Z-Wu*Ånt»|¨A‰–RcX$W²ˆ$…À‘5ZuLç–£Ÿ Ó?ËP#5ª˜—+U«A)8‡Y2P’^r`ø”Y‘6q9Â1±ë\*rÉsà¼lR°ñ©ò¼`[.™Ïb)qŸ¼ºŸqUÇá^D<Ž.T‘Ø[*/§¡âĉèDI¤ +rѵü(ƒ6²âB¦ô\E†ŠúÎ2acôy¢1胰ûX)5¡¶™Ô[wýÏ7²ž2v»¯ãÁtRMbiË âŒUÔ#ù©eÚ¨$ÌÞ£dÂh3XòX×yÑ3i–±¬[_–ad›Â—ìváÑ0(“—Äg)®¼+àw‰Â²Ï}Ô’—[¸k. +bd˜|ΰ± +¤¤*ÇÓ…¶Ó‡$Mg(Ï£O!¢Ña27¨âfþX6fæü*Ÿ_€ +âåâlc^Œ60P•]Þäñd“ .OÂÔ(¿•ª4—ž·ªUÃà` +Ãl»ml ‰ÈåTu›¶alS0õPGþmOT +rsÉwì¡FÒb`¥ŒD^ÑOܸ)l(ï䈊ћöRÂlòi!8ýîÒ$·SäÕhù‰pÈ^Ìox^#™ýîöVv†WIA]cï8Ey},˜%T +ÃÂìö!ÏÛX {”»äÈCó{LL +x?WëgiÂæ{Ÿ,úiâîwDÖúsœh, +g=4èáI)ý=,AiSûAv—tò’V Hº8‘éøé' +Æ.”{Ÿ¼fgÉ@—Þ Þçè3î%×1tÍ•_É}vˆ•´ÀÐqØÏ2Ø>ÿþöl‹¯BM>Âd(§Öû.~Å)‹øE%Ó¢Ø8ê;­†æxËTaWbrRÇÚœlûÍ ÁŽ´”™¿Øeʪ¿îÈvEiòk¸qŒw°F!mæH´ŽôÚË|aË¢Œùâ~õì[ÉPœ%T¨ÖE¤6ÌÙñFùåDë(äÄ¿‚Öj!sªž48Ù…‘ÓM Ö±<ÙøX裸ËHW࢕ëÕ†Â5ŦœXÑÊãvä†ý ^âv %œ— +ã†OEЀ¸ßDÚ÷0yl³Ýoe¹“ø ú=¼) +ÆósVCuè„u˜³3WÕø ²¸p(wxJ4l_Eâ@£’‡[Xž›'4íÔTÄ\8&+‰Ô“ &! xd|0Œ0Â}G‰D}Ž@…:Fh¨Ï¾þd:Þ}Š\©è>áS¥FYlWDำp„|ò“Ö<Ê·æ1„¸b&ø¹`«DŸThcˆoŠ +iŒ×m*‡ùHTÔ%#„2¼|ÐÊ;!óñs{)º¹).Xl¤3™„ZËÅ%ò~F¨†pÇâ¼ú€ÊÏ@Ÿï×Ö¤›U*& ¤úÃ~ò^´$ +E™Nn2îGÑù ÀÌiü¯s°+Å•—¢½Ž½ Ùßq7šžtï|,ðÆXãóØEìÛ¾Ÿd¹âæ[Ëê崴‡èé)6ëF[€ÕB¼]ÛO©¼Sò)WޔϹ”Ðt<G\É|s$™Üëëeß­æÜ°V|ÍÙŸVHÓŒ¹ïø¸B.ßY,€ÿñëâçèo‰+MÚd”ûJFñD¿P¡ƒ‡¾Öš¤ô>|!¹GwÉæy$|¶ Þóè¬&ÃfäÞåtþ²™[÷ÌéL&Þβ„]Õq©Ö­BqM€V^Â=KÄõþgÌW#§‘64Íδ9ÉC€ä^ª÷©Žõø^¤ñ&“&Á?.‘Ê‘ò"Rëäž¹À;f þÇ QJÅÿ|ƒcÚ„˜.Tò¾®†‘gæJ€©1•k.<ëõºYrA!âÇP”É(Ck™h% Ä/M§ÏÔØö,þþ\®ÜH=§¤~fÈe/ˆð”£ñ‹·xóßós˜nF‚K&ðê‚à&‹†"bꇋö!ÚRÄ6ÞÓŸþÂàÄ+â_øÓõDLøý%:HÅ$]é,V}ó%)SQ53㯜_üÚjÓÝrѤ<è:MÉ ‘(¾”¥-m¯zžÎç­~âÍ„ ¯¤¿‰ÅVpD +™ÓßÒŸò½S£øó9†þÈw"·óxàM‡"žøþ»oå3Q‘¼é·»PÝs¢×@æ× aßÖÁ4ä_øF‡û‡”°n\Š#ÑÒÍLû„¤Œd`gó2/‘]¿­º}øÓ(@“&R‰ïy aÇ éÛý]GžF“¿*òËÌö›qä¦f‰†’’eê´¾V¢âØ0ÿ¯¹ à +endstream endobj 10 0 obj<> endobj 11 0 obj<>stream +hÞTP»nÃ0 ÜõStmt4¼äxèµ›]‘hW@M ´<øï+)N‚ <€GîH¹o-Ùò‹î0À`É0ÎnapÁÑ”«ÃÖeÔ“ò £¸[ç€SKƒƒºò;çÀ+ìNåÛkñò“ ²¥v}ùsŽD·xÿ‡R€š Bîß•ÿP‚̺Ù¯¡Ê}¹Y;ƒ³WYшPWØ\É<ÏnŠË ‹ëfQTÇFÄÝMªtÌ=^˜c¸|qŽÌ-áý)Þùä•Jü 0fdi` +endstream endobj 12 0 obj<>stream +hÞbd`ad`ddò ðò ðÑvL) 0q6q5µ‰ŠþæËùÝ÷«ægëyþ+‚Ýßy…@ÜHꀀ‘Ÿ™‘‘IH‹ïû¢ï³¾ÿmXñ»Ärj.+ˆr@tEñâ¼¼ââ¼¼ÅÅ+V,^¼BŽ ÀªÅ'c +endstream endobj 13 0 obj<> endobj 14 0 obj<>stream +hÞìÛO«+ÇÁ'àûÄlf˜Í+È:AÙ½Œ ÖÖÆzg6Yi“¥ !Ûƒ÷?€£p Z_o´t6ƒ áÞ…!Èp `4' ƒÁp¦¸‹vWÿÓ¿sԭ硸Ü#u—ZUÝ­î_U?>p6»ÝîEƒétª}ÆêîîîÅ æo-—Ëõz½ßïµ'À¥…K¯–˳ív«‰FéÄ<¿"Ü]Jõ.'ÏóÉdÒ~=¦•Fé¼y~n0×뵆¸„p¡Õy=–繆Ÿ³çù‘>À%ÌçóÎ+±,Ë4Àø\(϶ۭæ8£ý~ßç2l:j+€ñ¹\žïFà¼V«•™7«)ÏŸN§ó.7’ëõZ œK¸Bë™ç/—KÍ02My~x½ÏêÛív6›5ÝH. - p›Íæ ‡%ó<×hcrbž„[ŦH:ja€³X,µW\MWbY–i4€19=Ïl-¦…N—çyíµÖd2Ùï÷fVÜ‚³äù<àr²,«½ÖZ­Váݦ)úÛíVÓŒÆEóüÉd¢…N×”Øïv»ðîz½®}w¹\j:€Ñ8Kžn$k+Y,ZàDM×ZÓé´X Ïó¦‡%Ã[`Î’ç/—ËÚJÖëµ8QÓµV–e-À žç7Õ'ŒpŠÉdR{¹µßïã2ÛíÖ%À¸5¥ñËårÛj½^¯V«p‡Øôp÷f³Ñ¼' +]µ×Zóù¼²dÓ…Y¸rÓŒ#ДçŸh¹\j[€ÓÍçóÚË­õz]Y²ež†fKäù¡N pºý~ßtÅ•çù) 08çÍó'“I:U €ã:å¾i2–e`è.1?±Xì÷{m p¢étZ{¹µÙlj—_¯×µË‡z4&ÀÐ]"Ï7 àtÛí¶é‰È¦Uò<ïÖ®jÓ¤ƒv¹¿kn$Ã2³Ù¬=Òoz€yž7]_ív»–›fõ¡N 0\My~ÿ©õáÆ0,Üôd÷t:ÕȇZ¯×gv2Ô©a†ëô<¿°ÛíÜ9œKçSGujX€á:WžßRÕb±ÐÎýµÌ”8Q¨Yó Ôóüý~_[Õt:ÕÎý­V« åùËåRó Ôóü éÎQ;ô7™L.”燚ó<×ÂC$ϸ*ëõúÅ%…ú52À1Ïßívò|€-‹Ú ªét:?DX¾¶žÙl¦‘†èŒy~Ó½g¸ÔÎ}ì÷û¦ ›Íæ ªZæZ„·45Ààœ+Ïϲ¬é†qµZig€>š®©&“ɵ5MÑ_.—š`pNÌó·Ûíz½žÏç/š™ÐÓyø–Ñ<ϵ6À°4åùç2ŸÏ52@Ûíö¼$ò@OËå²ö‚j:]çb±¨­s6›ip€a¹hž*×Â}äy>™LÎ~MµÙlÌ»‡ËåùËåRóô´^¯›.«öûý)57 ¸Z–Käùáž1Ë2m Ðßl6«½² +¯ŸXójµjºfËó\Ë ÅyóüpWnOœBpkò<Ÿ7Øl6'V¾Ûíš*ßn·`(Öëõü«Õêî­,Ë­¢ö §‡‡Wîó,ûòåKí×ìÍë׿úégŸ|ª)àš½÷λ¿úé‡ïðæõk­WÎ5cuÿÕ«WÚ€ýâ‹_ýÇ´(ŸgÙÃÃ6«õáûx f¬Þ{çÝpÖ4¹¿¿y~(ï½ó®9¢pµ¾|ù²x &¹Zcd>ϲй¿ûècãª4ùÝG—#ý"PúÛ×_k¸6ÅAúÛ_ÿæ¯_|¡AÆ$Ž®†ÎýòåK @ª˜ñ›©>\¡?þþñ ýðýÞ¼~­MF#thù ì) €‘ùêÕ«ß}ôq,ŸgÙ¡å³O>­Íó¥úp!á ‹Çì¡3±Ã!_9Hÿò§? ~¯Ä›×¯Ë'äCWOGWîòðð aÆáó,kIãÏU>|ÿƒCSG Éï>ú8\á>tõßþú7•#4¼êü>»¿}ýu¹_]=ô`zúÕ¹£ñ4y~Œ•L…Ó˜çÿåOn:B¿ÏëÄ\ÔEóüPù—/_jägqézïwÃZùÓŸ4&‚Á‘ç•2-ÄG08òü±rB …øGž?VNÈ´ÁàÈóÇÊ €â#yþX9!ÐB|ƒ#Ï+'dZˆ`päùcå„ @ ñ Ž<¬œ®ÄÝÝÝ‹·¶Ûíõl•øèP¡ûŠ~ ª5xòü±rBnÙ~¿ß6Ëó¼iÅÍfs÷Öz½•t~Ðn·+–ϲ,ü¿vyþÑBOµôcKõé—Ê–,Viê&y>ÏNž?Vò|à–ŽVm`»Ùl¦ÓieÉÕjÕô»Ýn>ŸW–¯¤ƒòü£Å½Vm®Þ¿_ +áõårYY>ì é(€<Ÿg'Ï+y>pËÒD·=Ï_¯×åì7˜L&ÅŸËå2­·ÛÅf³YX>Ž„?+ѱ<ÿhíã2i®~P¿<¾ óÃë1ÃËÇ?C=•H_žÏ³“ç•<¸eEžß3wÝív1òÝï÷Å‹å¤w½^——o)ñd2)Gôqšwe@ž´¢éBoöYøÐ~ ‹EñVVŠFãàN¨­¼°<Ÿg'Ï+y>pËŠÜu³ÙôY8Næ¯ÌÇÎó¼˜ì]Éuc>Ÿ%yZ¬*Ž <Êóëõ:´I¹‰Ú»fµZõ©öÐ~‰ùüb±hªª<”#ÏçÙÉóÇJžܬ<Ïûççûý¾iòv°Z­Ò¨¿˜^ ù ›Í&”kóüíÏúja3ŠµÂw<±•ž1>*Òõ>ß½xD¢g~~h¿ÄyûéÈBÜ…ÊQmž\„O,Öê3¨‘<¬äùÀÍŠ¹kŸ…³,k™ÌŸF¸»Ý®x¥iÒxñî|>¯”óü<ÏÊŴÿBøX MƒãGo…eÊk§¤úƒÈóûËÑ/E{Îf³–,ïE•!ì9ÅB¹Gjóùòþ­¬>¨ò`4‘ç•<¸Yëõºižvj±X”cóT%nÏÿërà˜ç‡UŠ ç©ðzebzܲÖd29: +¾þ:Ñgû¡ýÒ™ÿ§OU”óü8·¿Ot®„Ö‘K'yþXÉó€›U$±“ÉdþÖb±¯4åÞEÌnª­˜Mgqǘ·©Â˜ÙÆ|>®RTUž¿Ùlâ¬ûJ°Óã"Ìß"ÆÚá£c:Ý4½¼Óõçù±æ? M××Ú/±ò¬!-F…Êq•¢+=Ç\Ò)÷cø7~ñ°zèô8ÐgØ‚'Ï+y>Àà„ÛÀí/¥ÚpǺMq·ê wµáF8¦ñþ:܇6ÝY× +ŸnœÃ-pyªa¹´„-íMV «Ç<$V¶Íì•¡i2êYv¶güŽa»ûY9l9ñ@†¢itøihš;§ß§*óºÓé÷é¼îøJí4ìp:Š?aåSSLƒðÒŠ¿¤ÇMí¾þäùc%ÏœKäù-3Øû$ÛMÉl6+f/—ŸyoÏáËSéÊâDè¦í,ϻ묭¼m§¤ã6Ö Ô)y~LMÓ¸eît1\~bŠ?ãÏPíÔciÐ9ÏóÊ*-gÝ4Žî“÷©¹Épóüø8C¹×í—ؼMóÂë•YG÷Hgžß§fx”ç—<`p.‘ç7MW.¢Î2ôߤÅbQ¹GÞívéb•H$|Pšü‡ÛÕÊ„›åtƒÓq‡Ú‡BýY–•+ ÿ·áµ#1ݽMcÍóÓOO;:ìw%éw—çÃ-H“ÕÎyÝ•U:#ô´Â[Îó[¾ì)¿AG4re•ÎæM+”çóìäùc%Ïœ³çùiî] ·›f£Ei˜ßãËQj´f wiòþìü¬°LSD¿ßïÓ1‚–»é[p;yþ釡PF)ýQ‹lí¯Iü=ç„xÂiú9+~ËÊ?7}R÷b­øÀc¿Œ7|‘£Oz#ÈóË× GôKûNÚ¶õHyšAçHØæ³ÿ.3Jòü±’ç ÎÙóüøPy ½ã fg>ÿX—Ž¶Ü`¦cåÁ‚bôùjñ~6*?þè|ûÚùü•§ Ú…ûñmIü¸PIøjóŸ…ÿWª-žQ,°Z­6›MŸO õ„Ãò±òPIh™þO´lÛAÝV ûIQIøOø³eú'êEË”¿`gåíûjî9±Ëb¢ê/wel“ðŸâ•ÙlVy<¤ÒéÀÐ¥á|ùÅp^JW©âÓì=ª|c%MQsí6ĪZ~²[¶¤Ó óü4œ?¢_j³÷BœcPþˆ£{¤i–BŸ-2yþXÉóçìy~e¢ûr¹\¯×•h¹gL³Ùö,zþKíy~Ëçîv»JUå(5­*|¯Î¦¨ m:ïºÒÅ}ýjµzQ'~ñðŸJÄÕ[¾þ~¿O·¶²z{ú*oª¡ÈˆúäùE/4mÃl6«]«Ož6¯©é +Óé´ç¨Gô¢KÜÚ¦é÷é~噫˜šVÆ銇¹Ây»rŠo…˯Ç3mz>ŒQäç™J=éZå +ËçÕÚÅXíqÏ 7Ïc¸•ñ‘Cû%^¥ ?¢|ISî‘Ú¹q­J…í(ÆjýÜÐIž?Vò|€Á9ož¿ÙlÒ4>Ïó–Yôi6{ô=f–;Ô¶RŸ‰Óéýƒ¾Kšç·'Ò¡©Ó¡“J^é‡í¬h5¨ÕVf˜§Ãy~ûÆ·lCgžß¹y ÓDò| "œNk³ÖxLO2ñÔWy+®R9éÅçÅ*§ô¦zÊç™ðVåW ¾[9۔ϫáƒ*_*~V: ÑÓ•çùÅóqéëñ‹§ƒ#‡öËci(§|E‘+ÑÞ#ñÝ´GâZá­Ê—*ÿúŸòÀ7Bž?Vò|€Á9ož_‰mãóÝqrZçÓâu1i¸«Í²¬6$i‘ƼEdn®ÍÒíé¹bq·~\óV¶¿3rO?«iª|Yÿ0¿%Òo™Tß™uz†ùµÛЙç´y-ƒM;ª<n\ñ#8›ÍÂÉöî­ðŸxŽmT§ˆp/ÖŠ¯Ôžâ©#Ô\|PüñMãÜbáðÑÅqøˆ¸mq 3¬Õ”ÇeÂGT¶íE×t-®<Ï/~’B[ÅoÄÙJ\¿<þòÇ«ø òÞRÙ¸pñ)a±¸måK¬´Gâ®UÔ¾~±Vù‚-½6€”<¬äùƒsÆÀàœ1ÏOoùã i|=Êšojsì–l¿e“:ç?—ãÓ¦Ûít{úßü¦Ðÿ‘öôs+Ï5Ôå†Íó<Í«ËADÚei|”~J¦)¤QI¡ÓĻҕVJ§>¦ÛYžLØžçW>=‹I¿`Ӟг›:²tÿé\Šp)†\ço…ÿô|¾,œLÂùªX+œâ:,Ba±bù°bÓð_1nß –×jú -çù•Ï +ßèˆÇÜ*ž1> +_omiÞÐq±GÚ¯Žè—(´dø òÞRÛ¶¡Úbœ·ügŸ)ÿö•?+8âÉGn™<¬äùƒsÆ<¿2ñ¯2¼’ú†?[ªª Ø$|P¸«mº“­ “›L§ÓôÖûzòü4I¨ÌµKç–§-YÞ€J§„Õk›1ÒKGj*i!¥_ތʷ¨M?ÒÌ¿¥¡ZöðÚ¾«l^vÈ]ª<ŸJžvâ£'Ó4– ‡’ç•2Ààœ+ÏÏó¼=×MgA·Ï +Ûn·iÜÅ7Mœ ]ûŒyËtýr¬}=y~g÷•g­7U7 ÿC¡a›fà÷œÜž.7£Rye(J·6~ÐAy~¨?Ǫږ4_QžœÅß¾þúó,+Ê—/_>ïÆÈó{ +={-|©+ÜBy>ç"Ï+y>Ààœ+ÏOço6›òýÓã²ív»\.{û“ɤi–~±…‹Å¢g°_¾óPžŸnXKž:¨O_¨´[8ÿé³ÿ¤#M›úú®AÓÖÞPéŠñ ‘°ña¯hùÖOÖMò|àó,‹qÊï>úøy7FžßÓõ'œò|ngoç8ò|€Á9Wž?›Í:gYW–™N¸bÜívëõº3Û¯<Pk»ÝfYÖ™íÇ)èéHDX·çf‡%z*¡²ÍóÓ »ÿ~“¦×Sý7£§øeÛ*Ïó>ƒ8¡§*#POÙMò|@ž?Dò|n‡<¬äùƒs–O.¤­7#´aå­PgZCøÄÊqZ*}«v¸!ýOÜMò|@ž?DNn‡½}¬äùƒS´ö£ìJ&\NÔkµÏ…NÓÑ°@S¤^oÉÌÓ:lj:Cûñm¤¼\.+ ¯V«ö +>.#Øï÷iø_ Òûx‚íÙÞPµV´mOÐMM‡aùQ`ÜäùC$áävØÛÇJž08'æùiÛ'¸®¬þ¬,pD¤ß”™é·Ì¥?"Ò?.Ì|ª<ÿ &jj™Îþ +Ö¹=#ýétZyt¢³¡ÚÒ‹'è¦,ËäùpãäùC$áävØÛÇJž08§äùéÔît†|­4¹ UU–Ùï÷ý·- H˦N§Ó>õL&“tKRi:}܆µ{²<ÿñí,ýö& +-Óþ]Z"ý"!ï¹íãaKGú4TgÍÅwì|ºäBÝÔ4N$χÛ!Ï" '·ÃÞ>Vò|€ÁY¯×wGÙï÷›Í¦òbmH› +‹UVlJÑw»Ýjµjš^ϲ¬2[»IøˆårÙ”Z/‹Ðý'Ò‡%ÃG78´aMÂê•Vêì¾´ýÓJZ¶*ÔÚ¡ÜÚ¡¹Âw ߥOË„eBýqõÉdj‹›tèf”{*lCØ ÂÎptC›jû@ew +Úûg隸‹†¯9/9ôa`¸äùC$áävØÛÇJžÀåìv»íÏš¢Ýž¶%'¦îçÝ0n“<ˆ$œÜ{ûXÉó€èþþþó,‹¥çbåòåË—Mkýíë¯›Ö +o5­Õ´J(a3ݼs•rVöÞ;ïž½þÐ ×SþúÅåø誶í òáûÄoñ—?ýy(›ýððàÔÄ¡äùc%Ï¢žAAe±ri™¬^žÓ^)-qSÓ*E°|èæ)ÊÍ–¦c³åxi:0[Žeå¢=Ø¿üö׿)9´®rÍ¥<.Y¤Ê—/_¾|®aåûûû¦Ušf\?:µåÍë×M«„·šÖjZ¥²m®ð€±’ç+Š<_ž¯(Š¢t^n÷º®å²üÀQ¥ô¼æt…ŒÕEóüÏ>ùTž¯(ò|EQEž/Ï8ÝEóü–Û1y¾¢ÈóEQyþAM«Èó€1¬<ÿáááÐÍSy~ÿãEž¯(Š¢Èó®Ö°òü#6OQäùýy¾¢(Š"ϸZò|E‘çËóEQy>Àõ{óúu¸iŠ¥çbåòÙ'Ÿ6­ÞjZëË—/+ o6›»»»ívÛ´Êq›7”"=PäùŠ¢(Š<ÿQžpõÖëõ‹Ÿm6 Â-{óúõß¾þúôê©­ÿáá¡i•ûûûÚUÂëgÙ$¥ùêիϳLQŠ2ô1kåŒå½wÞ•çwn›k €‹úß~øß&“¢ü×bqhÐÑBgÔ2딉dÀÉóàúÉóàúýßÿú?ÿó¿ÿ¢ü¯ÿüÏß}ôñAåÍë×Ú.m>Ÿ¿øÙÝÝ€+$Ï€ë'Ï€ë'ÏžÑ~ÿãrùÝ‹ÿ¯(áÿáÍ)y>ð\v»&“ob˜_”ðŠHRò|àYl6yæe6{£} Bž<½õú_µI~,«Õ½V€2y>ðIJìûö0¿(›M®­ ’çOi¹ü®O˜ÊdòMžÿ¤Å  ÏžLÿ0¿(óù· €´Ûí¶Ûí~¿/¿(Ïž@žÿ4›½9(Ì/ÊÝÝ?µ5k·Û¥oÕ&öåÓÐ^ž\ÚÑa~Q¶ÛkCèo¿ÿ15¡ìv?hJˬV÷óù·E ÿ¿»ûgKɲtàhEö¾ÝnÓ·jûöwåùÀEív?L§?:Ì%¬žç?iIh±ßÿ¸^ÿk¹ü®r¸ÍçßJõ Yöý‰'¢Í&׌Jž Ån÷ÃdòÍ)ZQ‹hLH¯,û>íGYx׈Øf“Ÿ~"ò¸G烰Ýþû,a~Q²ì{M +=3üJY.¿»ñv;ñ)¡ò,};!‘ç?¯Í&_,þ1ŸÊrùÝ~ÿ£6Ôzý¯žùØlöf·û!PK†Å4,7(üÐÜÝýóÐ ßásÄé¨O }aŸ ?yþ3Z.¿«Ü×O&߸µ‡ŠƒÂü<ÿ)¬þíÌ*ãÂp;V«û³¤Ðóù·7ۆ皜÷ˆ.'Üçn6›»_ +/îv; ”<ÿ¹dÙ÷Mw÷Óéß·Ûk"x¬öj ˱X8ˆ:W •kanǹÂü¢l6ù ¶áy'ç;\BžçY–Íf³­&“Éb±X¯×Z yþ³è„|sö¸qýÃüÚ@¬OzFíÌ-ØïæŽÎ#n6{£µ·íöß—H¡ÃÁuSÏ‘]hr~Q6›ÜŽ +pŠív[žrŸeYí¤µh·Û…ef³Y\Ë,}`äùO)Ïêœ-l$<öŽû<À²Ùäõ¬V÷Úœ»\ÝòtÌÈtNÎï[l_=ô‘à‹Å¢¸Ͳì Ãòq@3×o~šÊc‰òüv‹Å?N‰MÂÍþvûo͈ƒ¥˜Ü:ërù]çñåàb¬²ìûCg݇0¬µÛýðØc,àFŽövè“ƯV÷î.§¸ ],G¬»Z­ŠÕÛ§ôŒ<¿EŸD±OY,þ‘ç?iOF¬s"ëdòM‘4öÔçјP§#‹ñ {uØ·ûŒ‡©˜á—u>,3Ÿ;úf¼»ûg{#ô^ìì g!€£m·Ûâ&t³Ù±ú~¿w Ü&y~“õú_g óã-–}¯U«öèìÐ0¿Vé<²n!–äÖtÎ  ì÷?¶WöJÂo܈۰3‡ïêèX.¿³Ó!æùGO°w Ü&y~­ÎÉÇ•ùüÛ#RMžWžÿtw÷ÏÐwE1.Sk:ý{Ëžt£…;«Ð;ÚŸÑèÆ +ÇZŸz:™ õŒxbyg~åû×Ö~~ Å/;Àbž¿^¯XÝü|àfÉóSáƼ}^_œ!Ù9‹ò\•yÆa6{SéÄðʈs°#l6yûnJs-ÿè<¬SŒFç¼úp¸õ¬ªój¬cagœœ_è<ÅyPà8ÅMèl6;bÝpëzâô~€’çWäùO3ñBY.¿+–¯Í{oyV䘬×ÿj +…âÀcWä~b[õ9$ÃèF༹qg¬ÞÝï_3žwr~¡sœåˆ:X,Å}høOžçýW̲¬Xq2™hFàÖÈóËòü§>á|X¦²b–}ßgJÿègEŽIçÔVMTØï¼tÌjè<¦FKrk:‡®}%ü6õ›³OÎ/„–ï©·j·ÛÅ[ÑÉd²\.7›MK°–ϲl:ƵŸš¸5òü²åò»>a~íìúýþÇöYÊ'Æ2<™žÃ:fcڧž+ãêœp»ZÝßòî}CÍçßÆ$3ìÃáEûçh¥£³÷γÙÈNe—˜œ_è¼BȲïíƇZ¯×/êÌ©œáGËåR—sÐóƒOIžu†¡L&ß´çð›MÞ9Á²i’?×`»ýwÏG-ŒÈÚwøõú_ç;Y}Û~lÞÚŽšeßÿöÍ/ÄŽì<ðzôCD*a‡! Å&Æ,¤À;ì—ÆYðîãZ{`½YÖS/Æ »‚Ç ˜fÈ,fm‡‚dÿqÏNU´ØRÆÊÄÓ‰Ù†3šY:Es©ò¢XL¼Ñg§ÜËáγKiÆ|XzÞîKqÏHÖašë´Dg¤Ï èÁ"åÃF ì@ЧÒä|Žt =Ö ‚ +oÓÃá^¨Wƒü²ÒëÂKý ‚ ˆá0‚.ý_‘•-`YSúðÕqœ¬-zÞùü ˜ª¸²|IwREÜ=ÙF¢h¾TÎs隺¥H%aéYª=»dÒ—&õ£ÛûZ4øëûQÁKHË;£¬:9ŸoJ¢Ç:ADKA^ö ‚ ¢‡¸®ÛG<÷Þð wguunÍ4M~›Q%ÿ°, þäû~͵*g/ôÜç+ŠÜÜþVš.‡çé_èfQ—ùЛ$E9¸=ƒV­¿³òÅÝ4$ gåÊ| +EiK=~XåaÔêpX=Éù iü¥”ÀAQ'ð"¬"7~ãÉßþÜK¯fôg/ÿ!‚ :Cžïa²{á©øžoÛ6ûÆ4M×u‡ïD€KC=Oî¹Ï—¾•3-EóÜ—ºøҥ¤âÖá8;Š.Ô4×KO8o5Ð õgƒC±ølêÏÒ”ï(¸ 5Ï£5;>wà°íQ{›±žä|†t£ô) l‚ ˆrñ}õ1ƒÁÞÍK/ñù8ýëO?ÿM8à›G¯Ì?øÙWß~'õ€?µQל>}úÌ™3O=õ™«¶C]I]IèÆ“O>Ùê®ìÀÿžç±{IýçATâŽãÄ„ý°ƒb@¡Ï>_jÚ™,j®Ä¼Ab)¤‚K4]dAÕ§O)' < ·(ŽÉ¬}ï ÛÛÛë999¡¡Øj¨+©+ êÊâ ‡Ã.ù|×uSî ø#ëé_?|+ã8*ç÷ÙçK5»a\)%; g¸j€Ã÷£^5¾Hs,ù±ººGÍöGH‹9ÎNu—vÝ[ŽŽ©,¥äGj¡K‹ ‡w¥Û7ÚØ’u&ç7ÕwA]%Š"ö®-bš&ÓõüE;‰a1ó_Äç_Ü=f®þüÖ~¼<ž">ÿÚGÆææÑýK{÷6'íØ‚½¹¹ÉtÓññ1 ÈVC]Ù666¨+©+›¢c>ŸIï,Ý ÿ„°;õ<¯ñªŠ[U¶"öÖ竸Ü»4á–ÞýkFjc(“! gx»•ÓóêU#3â‡i®«Ÿì8;´ì4H#9Þx$®;\¤!°Šb|5ï­ ‚è*âÛhL×Ã[¶išü7–eÁÉðU¿Ä ‰ŠŠ¾Ÿ>·†q¥‘버Ì6zÈv«`ž´L‘¯kséÇJG*x—Ê¥‡3U6¡´QáöaªÔà íLbyƒÉùŠÓ¶º¸ AD@:KÍÊÀç™l¥¼ƒã>Ÿ |æç/íÝC|þædvq÷XL×'‚ ˆ¶Ð1ŸÏ2LÓ\Í€ÿ³±šMÕ•Œ%ç+¦è÷Óçã&°R¯%5l®{‹ê‚©Jº²º5í!¸¿ª4Vf +®¾ÛÕªž7–ŽÌe‡eÍm{¤®ô¡g)ŒU:èti@¡O¢f“óÒgJëÖ"‚ ˆÚàÆ^c“õ<ùëâqŠ~‰ï°¸Ïçß»ú(cäæÑ}Äç_Ü=ÞœÌÄt}êk‚ ¢-tÌçóç{*­!ü?cFêuñÿpzèó¥£R‘¢â“)¯²i2ÇC9ìðý¨žúÀHƒ¾nWwKZm¡}jRʽHGfî8£J¤@ fÕ6þ{‹t£V=.ÌU·O­DOÎW¬F· AÔ7© öø_µù|Qàßž>€ß >ÿÜèdþÿxíÎ õ5AÑ:æóyz€¶>‰8††aÖ{èóñ ùÒù¤2Ç4×)K¶þ®¯awúWT@†q¥žëG«¬xMv +T}#Åv8¼«É}2-A!ÝÀ_ëi|­¶Ð:$ç3¤‘bx¦ÓÈ'‚HÂïûÈ_uðù€wuŸùùËãG#ç·&ˆÒ?™?? ÃÕÂTZ½¬ä|†ã8YŸí›Ï—ŒrzáÝÞîuÈÏ츈f‡mj¨ €ÔÈB+ü3®­j€¾éàE ¢’?_|] +ÙJs2»¸{̾?{ý€úš ‚h óùšcÛ¶tw@VbCß|¾&úBV¨'²Ðƒ}YþEÌ Œö6c#þéïФÙÚ%î‰í +Q9jsËÐp›<âßÀjìº·à—¾Á¼¨ÓÍV‡tå¯9‘[šâ®s³ã§þð(¾Ѷ;‚ ˆTLÓdï¡A,ûYþ +œã³I¤>ÿòxÊüü…Ñ!üxóè>âó/íÝÛœÌø“=‚ ˆv@>¿‘¦F°,+õã½òùRwQ§ý“æZÖ ïR‚©T™Â µPVV¶Zš‹Ô¼©M%xZ¬þ“oÒ*nA%¶“•zHߤ)뢅ú8Îô;ÜHë<¿tgVý= 'u)øþ!­RY9‚ ˆ.Á-:àºnVZŒ(ŠÇaŸ2M³ÜšdùüÅãœüµ£ÛÓðýÉü!âóÏoMÄ®Ý9¡¾&‚ Zùüz€fxVƒ”T]ß+Ÿ+ôš#£h.u;ôú_O;ÃáûQmUÒMè)¢g*¯´V:oyð¼q#a&•W¬¥Oè8X—ªrØöHÿ Mxì‰ÝEýµ’nºÑ³1ñ0DýÉù üYÓÈ&‚ ý±,Kå¥uñ蟇Ðu]ñíð}¿”j¨øüçnDˆÒO¸<Öú¿”ƒƒƒõõõíííùœžS톺’º’ÐýýýÖueß|~žç9Ž³òø`0DQTõuyfB*|"'¹±?>Þ£qwT¿<÷ýHê©ô—Tš#Í®¿ëñ*i›¢‡Ã¬6žÝݔٓ†3©Íö¼qEW‡õPejÄZ²¸„ƒ}ËÚ(EãWt¨¹»›Úk€W¬Îmkê©gKRŠ>ADà•9öÒšõNšÜ–oÜeU#‡Ï¿¸{Œøü›G÷oOœßš¬íÌêÜë9>>¦Ùj¨+©+ êÊâôÇçAKà†Q©!‡`øµÇñ}?öOÎâqƒçy<íÁ4ÍX”¡ŸEsÏÛöøFÏ 4ib#ÕÆU¤Îv7FΠ…g‡™:¨¶#WÐMåÄJÓtõL)×VúIãbz®HR^ÃÜ—Åä&¦ÜFÕ°>”•ß"ùÌ.õ š^mCum¬0>¯)EŸ " x…÷YöÒªâóá6™¨V„>s2C|þ¥½{miü›7o2Ý4›ÍÚRgE¢( l[†™çya"Ÿ‚¡5DÁÇ>”QQæg‡»2uA`99G§ÔÐÀöö6ôãÆƆJW€„̶m>ÎáG|ï’Ê(Uo‡Ó¤?,Õ•úL®>ø|˜#†aœBKª˜æ0;àÒ0UÅIŸ/ž2Ó4aš‹¿/îóƒ`S4ð£†Y妹®a¯t×€æ ÆÌá#mkÛ£¦’f¥©’pXÖFývEÚé +4i8LçÙ]]–{n JÒlózrŒa­Æ[¯ y†»€›]öE×½¥[w‡w¥’5¯¶éîY輡@Ú׎O‚ ˆ¶†!“T¸ŒÍGŸ2ˆøüó[“µíññqÇ pEŽã – e¥kÆR7¡üÔ¡ÈÇ\EÑE÷¼+³XÊ7f,öˆçyÒr`̈©¢—êJXMÓDFi–âS¥¶mgÝ£ÊÇYª‹z´…ÖÍÊ>ø|X½¹Ì‡o\×eòÀ`01…^ +©ÿÉ >?ëƒ}~–™¬MF)È»Úú +iv±VJ?¦l/ÆRy¶¦¹îº·êläd˜)u”6x’æEëÓN7Tx{ÂðÓª1a"Hg1XÆa…YÊ™Ãx€6g|~L=ªÎÆGL}² ¡&ÒpFSA϶LpÍc‹ …­7ºÅG‚ ú’wÍ^Þ?øÁJ}þÉÉÉ|þË3Î^?@”¾´>bQYÀ pµTQ,õQE6ƒd9*>Ÿ— +(šR¯õà²EáÖ+V”ŠÏ·,KZ”ëºY>¿þ¶Â#Vbä(iÔsŒÒX­Ô?žÌp¦Ñ®yQ}ðù|‡Ir +ÃíêJQñùYw‘Ïç#Y¦ZüýºñthÛé¬ôó9ü¬¦®!yruuO¥ª ¦qJSôµÚ”¡ú®´†Ãáݶ,GM­H¾5¥ß«8Ùz“µiØÝ1ô—äŠÓG‡<¤ùÚî¹#‚è61—Êúúúk¯½†²··çlll°d˵#ÄçÿôŸßQ/*øœ§ÁÉT”bQ¯¿þº(óÇ¥+üõÙgŸ=}ú4’bÍ ÉÓO?½š—õÆo<ùä“<+8™<ÏÊÓ>ô¡qKÎä†ä•W^ɺÜp8äAÏóÄ?qS +ßdÝ \‘ÛN¸õ`Ž¢ë•,*õd^_b]+ +†Sì|îókn«¯}ík*I¹/¼ð?-k”ž9s&«Vb~òÇ>ö±X­’Mº¿¿+j0$cÌã7˜,**J½¨ÍÍMiQìœsçÎuÛçû¾Ï&r”ábgÖÓZù|n÷ù¸è{≷©UìL©åËJ)¯¨Vp¡’u-knœÅ} +Ú•o¿¸„Š„3w>Òýÿü™ŸÖ_«Ôq¥(úšõùÒœØWÿþûü ˜J§UjØ®ÎUô³Ï¼Ù „‡öYYÙ‚Ã4׋—CWTúõ¯íÒ½ÐÚŸ ¢aò¤PÅ(æçç;ßA +a)Ž›››óù£÷—ÉlŽøüW¶"õ¢RáÙ’± p**«¨3gÎdYúXQpEžkSܬ­­!µúÊW¾’šü,ú|äa óÇΡ\ª(•ü|^žŸ=ȃeYHQ| q'5?¿ž¶‚Í +ßøÆ7ð¢ž}öYƒH¥Ï=÷R+Q0Æj•lÒÔämÅ¡i½ª¨¨ñx¬R”J~þ+¯¼ÒmŸÏÆrßJ*Y;¹J§~ŸÓ\_4íóß~† ´/=ûtðù ó“ªôK¯UÎkRâá8;ÏÿùbÆUÑ®À§>þñ«_ë‰'ÞŠ]¨)ç#MÑOæi×P«Ø¸‚ ‚Û×Fj•:Úq|æOÞhÜç[ÖÞãÜšÖY«d~ûÅ*îs)7º‹‹îq` +ü…w ágŸy7¿o]þÝß{kY¥Ïùš×vߤkQƒOœØ¸:ÿ7?TYŽšõùxl1ù4ojm_çìõƒ,Ÿï]ݧžªÑsª¸ž<ëtnHðBø D|>^žüœz!ø¥çy,hUMî5è9K­Y'óä®> ìB¸óç]œÚq0á÷<àèû>Rf ‹[‰µU¥xÓIÛŸ§7§ÖF5ŒmÖP0ÚkP¦„ +¥?auƒ|¾¢ï6ëó¿ðÅ˸êI:ä¦ìJÍ¥º/©ôË­•çkHËÇ,ÏüÉ0®Tì +ôÝgŸy76`ªÜ;T˜ å/;J¡Î©éýêíŸö‚ßóx–Üâ}ÕÑyŸÏVïä¨F&~¹Q9i³çðù_þò—áµ”wŽ²>ÂÏažËmÛ£“““ØGøñàAú8põÔóÕkÅßú­©ÞŸþiØH­ MRÏçw¥ +(¦ô˪Õ÷‡{ð×4ùIûúÌ3ëçßÊj«o}k7G +ñK/Ý®´—íùRô«®W0*Ô«W[­²z0Šæxmÿê¯nÕ_+4”T>ýëÿ\s­¤ãêoÿöê|ðtðýBs0¦Š &Ÿ~úzk»tjÃí7þĉ+XT¥›qê¯?ð'TêÓ¼Áµ}¡¢¸Ù›A‘ +¼b§šØÜäöù—ÇSÄç_»sBUŽãàJVEŸoÛ6;MÔ¤‹e|>³¢¿å‰âYP3£\Ÿ¿ÒïSKø³|~ª æ†+}<íŸWÏìùV<|”ÂTâñˆ|íÏ£lb؋Dz΢R:ïóy Jú°`ë<,57{ŸŸoÖø~”CHÖƒÎuË"¦ŠMÌÒ/ˆT=5x@k8ÎÜlÍßçwñ(’J2¹6+IÎýzÀ}ô‚ní‰WضGMU .N “Ñ|Ó-ë0ÍuÏ—µöªokb³‰/#•"Í͆Y¯áÓÀ—£:¥7©†í)]ÞµõA=dYŸíÎÉ¥½{'ó‡·§Ÿ¿¶sDm[ܦ4ÞRŸÏÒ°³ö(šR®nD1Ë ÅŠYÊð{>jážPºÏ}²Ñö§ŠwþKè) ž‚~ä#_^T|>7áC™*£Ôó<¶×¾&ÛD±ýùlââÚ„; ø`†Fãµ¢¸Un&³ùÍ£û é¼Ïç#“ ¬sxŒ‡ªÔˆÏ¼¸a’««{ÍõÑ–žr§N¥×R·aˆ›‚Æô¼ñpxwñXb@ÅŠ›j?¤-’ùŒ|)ú5 h ʽì5ð®†)­•¶v—³»øü…ÉË–ˆrG.á¬K5(}i¤ÁÇ"¬“zúgm+†#]Þ5\E ‚ úÉR>s2cºþÂè~ô®îgùü³×ô¿÷ù|>wwwÇažMg †Yj…ŸSPwsCbYÖJ1¾O^KÅ”ÞÔbæ3×G©J9kG@¬+³®ëºß7Œ¿œ™ïQ4Ç ‰¢ÃG*rœÅ©îXYÙÒY–j›¢‡Nšš×R4 /Jc[0´ŸâtÎÒæ0ÅRBÐàpˆûk®± ¹—Màf¥ж—µMƒ×vãŽty×y0AôŠ¥|þµ;'ÜØÃF‡HŠþdöè_ “ùÛG÷Ù÷º±½½½¾¾þÔSOinòERefYJ4$80lŸ/5¥ISÄÿšª‚ `%dù|Ö•ÀÉÉIò¯®û}ÍM¾x¬¬|ï¦|#'µ>ëÅ$ü÷7ÝûR÷S}~Ö~ të»T79PlVW*îþP_ñ¤Ø¶ƒÀã)Ü…&kË/-î@‰M@ žŒèÚجYY.wÙsçüÖ¤H9}ðù !´„G‘9[.Mù|ék#ïÚ¸Þ±¬ ÍG—¢Ò‡sr¸©áð.®=³Ì´*îð3fʾ4aµŠ*¬sÔ†£aŠ>Lê–îwÀËõÛ3if»¶©Å­C*Ò .›ŠGºnk¾(áku#ïYmc‹ JÑ'‚hKùüÉlÎuýædviïâó¯ÝyäpÎ݈à{ï꾆Jssóõ×_o‘ÌÏrõû|&íc¶GÝ”&MÏg†ord„BW2s˜š Ü"™ÏŽ0Äœd>?æí91ÏŸêóù†‹ÜVM,vcc#µ+ë÷ùl &CHêeÚó |hÏÚLiƒdueœ½~@ùùËÞi,ö„/ïUW¦Ÿ¿ÐOžKmd+Þ «PúùÒò¡‹ë¯0œ­®îåˆ#äÛ>ЊœgÞ2øíÔŸ¢¯aˆA}„ã³Æ÷#}*£sK¶XØÕ7Uñ®®¶=Ò¿ u“熖Zð§¥èAp|߇Rx?µ,+öZ ¿´mÛó¼Š^®—òù‹÷k“›G÷ŸÏ¼ +ÿñòxªS“?âðððµ×^#ŸÏá†D´µ"0a(rkšfêXB€îºnÒØÇ|óYÕHíÊíííÝÝÝÔ¿¶Îçö:¿Tw+ú|èYöhv±»c¿Lõùb¿ÃØpg0,µ^‰Å²®ÜÛÛË:§,ŸŸUN†Pq)ŽÅ8T¢0€“Iø0ìùÜasê·œ#€Õ +²º²tbæ"EuÌçóÑžu u˜°\ìØdó·æz6èó¥B²æŒDÜFjžÎ'RDéC§@³Ã­‡ëÞZYÙR—]¼døl¹7åû‘mª“ùp§Q¤ãnV<"V³õ•Zèúã %6fBUjwKŸ\„âšYÅH†KK—ÓV,MZm¸“þw¡DLºs¤EÑg‚ ˆŠ€÷PÑðH3¢KÑ^Öç¯í1mrîF´t}ò`'œßš°/Œõì$GQCR»‰»Ç‚A©ÏgDQÄM+•:˜Û/â_<3¦µ“n0&îÔX¾ïóñPÊŠ'¥|ÏH,;ˆï…šºà0· ÉÖKýýåñ”?w +^¢o>_ôù Y]ÍO‡k—C“:"nŠ  à°¬²Ä8”V*‰¢¹çña£U…+E«ýö&ç+N™zê/­,S­ <µeÍT_á̲zAºšµEÛâq(¸ÍÞV&7øÿ$m ôATAEÉl|àS%æs.ëó7'3nN&³9×õ©œÀM‹wUÓMâA¨‡TšÅ4ÍT£ÅÅc2%8 .Å}>ày^RuÏ † %§Î è£ÜÁ¬ ›æ‹­ù†ñ—xrþ¢2ŸŸ´÷IßåóÓÚ¡„TY-ŽÛÜ>Ÿoëƒ&P¥üŠ±}(Å}/TŒÏÙІôpL…­N°$F‡ì)Ï£‚W!ŸßÍú|ß4q€Ò\¸Ö)_é•~Æ•ÚÔSÍággÙ½15ZóÒÑ$E¿íÉù \çÖ“¢/µ»5ç9÷ +ÆêJ?uÓ²HWi¨O[ZO«”x­6 T7pîFÄäÉÚÎÑÍ£ûˆÏ‡‚l¹´wº¾ +DÙ¥¢:y&¶˜·¼XÆçÃP¬ÔçÇٲ†}«©Èç/ÞŸŸL×_¨ù|‘ xDYè‹]jDQÄï]Ü„¢>JÅr·¿"lgJêvBÉü|ñ4¾ðo?)´Á|~#4îó=oÜø«÷px·KRE¤¥}TµçT$ g0œl{$Íiì’‘êÇF/®%ëÉl/ŽÔ¯šæzu#J–ƤŠ'„¥Ì©R4µô*­‹#k"Ò5 +”‚ôŸJÑ'¢‡0o–TRà|®ô“Tqrøü‹»ÇLžœ½~?">Ÿ°¶sÄ~<¿5¡®¯.7bŠ> žçÓ§ê>Ÿ›U×u“c)‡]a™Øbi±a¿ì(í0Õù|Ñá‹n?ÙÅ|„ð|û,]ÏC?ȨPôù¢ô}*ü^b÷¨>JáŽø®Üí«RlÇA û A dÿêyôOo/ΟZ\,´DÏo„Æ}~Íñ×Õò¨q¯ÒöœØJ•¾m4tãP%ß [cz¶ÁMÕ!MÑ7ÍõfX‹ÂaRÅZ ”îqhé.¡–²Ô² ψe—Aé^Œ–¦^㱞æÒõ°u<<ÑÆ;"‚(Ϧö?>„Rר¤xç]“ÞÉõ +YîÔÓþù5 Qúâ•©8J¡pöŠ­´E|>û ´ 2 àº4ȳ·dÓñýbO?dþfèû˺VšNœY¹©¹‹ñù ™C³¬J[@úú_ƒ‚¨š*”¾i®·ÂÓÁÔóÆЖR ]i'žUÞ®p˜t5¨(I®‹‹Ð–ÚÝVãûÞ)±õPe`À9®{KºXµÚØhpwÍ®W t¤)úé#¢WðW×ÜoÊ%¾Ãæðù'ó‡ÜÏßž>¸´wñù×îœLfsþã愸UÁ»’õfR| ®(á›äþnH<ÏK;P‚hQbéôE|>ÿ¬ã81¥?r½\J «íTçóB"tê& Tñ.›Xiðq©Aö©û| â†ÆŠ…mÛ΢±‘–:Èaâðñ–§Èí{ùÊe&[ZOë'¼;`p&ÿÊ.þÄ»Ð'wðtÕ硆zêàóƒ`Ú`~/ž[unsm”«ô]÷ÙE}€¾hÊw)9_eA¨(ÂhÛ£NÚݶÏ&ènÅUfYVð7 gЃ*¿í›ÂOo|ƒ@PŠ>A§í>¸vçäüÖäâî1|óè>âó×vŽàœ³×Øì#DEˆ’w+CüeVnsì489&Þ‹øü˜§…Y} |ß•Þ7*õù<‡<µÁSÅ»èâLÓ„Xßá^]Zlbæ<¿(ä±`Dª_ÊpBÉ™RÄsŠS Ú‡54¯yj ­Ïˆ+Cê(bå/¼}àôÃÇ>ÿÝ"—#Ÿß[Ÿ¿½®V—~&¡•&6×>&÷ú“–ß7¤[Ñ$êRr>_¤Þµ\».Í¿íLT±ÀxF[²Lã«G*ÝRøÓÜuoUwi<¼Ïú–6©4ç¡ÒV%‚Њ0 UW¾ï—˜«œÏçÇ@|þÙëpÂÅÝcöãù­ €Já³IŸ% }¾iš©þ¤ˆÏ_¤yZ˲báƒÞR©Ï‡^àIæÛg‰wX‹#M8_Êç/;^1XR²ò±ká° Rê+â9¡@¾a!õ¢©¶>#­¬Æ‰þÁÞ`ÇÊÊõ"—ëªÏ_)@ õÔÄçK³|+J?ƒ·`üºËBwœee h«–&7ö©….]v/9Ÿ!ì†q¥ÄIÚqAkœ¥‚¡¶=‚©!ͩ•JõꞪ †ªv·wCADx6æ²öFÔA¥¤q–âó/Œ¥?™ÍoOœ½~à]Ýßœh´ëàà`}}}{{{>ïÚ–íÁ``Û¶˜® ýëº.>ÞàS«(žç!% ‡CvZî'0¼á㢨1 nDºêpW¦ÎYF‘“Ù/S–$¹Âð.Nþ ~ã8Ž(«aøÁoTƒX¬zWÂÉ0¤ÅÑWd£ ýðk!àu^ªý³&T[Œ^Á0¹:±*eVòÀ ²=ÇöW>ÿöKEêÜUŸ¯y=5ñù ™Ôª"O^jíªÛÐ ¾‰MmW˜®‡›…F†šŽV'ˆöèY|<—î|ðÄãVg•K#_¶=*åBž7®çBDñù…oæ*å¨Tw×ÞPÅ…ÃpÖHV@=àwG>Ÿ ˆ^!戦ʱTƒ7´eeÍ•âó/§ˆÏ¿vçDÏ^ØØØXÌññ1ÉVC]I]It¯+ù^¶ÔÝ"¿ä pÿ½÷žÏ?|ËûŸEêL>¿-TäóñHøRúà6²í¯ÿD‘¦û~TÖµ¤á°Vï戢¹TÞoL•«Ð*¤A0•n¦(xtc¾ñ ž¼õ_´Æ 2zÞ˜¦'A½BLdeɇ®ë²ÔP–2mÛ¶˜Ì ß—’œ¿(Éçßž>@|þÚΑž]póæM¦›f3úOµÝPWv†íímèÇ êJêJÑ®gn^¸¶jþfÈ|þïœú_ó%·¼!Wì@Ï_–(š×):ðð%¼m$¦ø¨.1g´:9Ÿ Ž´1 ¦RKwT±/‰(ô¸4j–ûèÌCGš*_Åþ¯F6Ôܪ©÷Ø=AKE‘mÛ§–Ç4Í ˜²)ÅçÞÕý,ŸÒ¶ŽIvêJêJ¢{]麮eY™Éù‹ÅÎËÎ{Éù‹ÿj¾T°ÂäóÛBE>!³[%&õe½‹Çpx—–¢uàIªe)ân'çs¤æZ;wá*ÁÒt-e9Ûu©»ñ¹Ïúr/‡GߪØß×°hÄþu«ŽA´ß÷Å×RÃ0à½53M1eùü £C$Eÿöôõ5AQ.ƒÏÿÊç¿â|³`iäóÛBu>_*¸Êrì•j:‚h(šã±*økÚw>9Ÿ!M3.’i,]…|?¢ñ¬-ƒÁ¾4(¬rÀdÇMñ)©aûà«P¹Á |6uéíæycÛÁßPÈ " CÏóÇWTÃ0bÙøðKx]õ}¿ŠK—åó/§ˆÏ‡¿R/AåbÿÇè=Ÿÿó_ ¾[°4òù2 àF kÄ_Vçóµ$õù~„ Ú½N´Ïã#¼à<êIr>cuu¿Ù|û†pÛ ¬„4’5'™,½¬Æïvf5Þ8%®Ò¸[÷Â%A„”åóoO >ÿÂèšš ‚(Ãøerþïœúá÷ý( +•Ö1Ÿ·³ú˜VßS÷±»¨ÔçK5WÁsiö2¥ÅÀ4׫ÛêbÛ#<Ö·Æô¼ñ²«´Ìn›ÞÎ]iYêf‡ã씵ÑLs\÷Vé°¢ÐAQeù|À»ºŸåóáOÔÔAD¢(bIÚžç…a(þéÔ©ŸŸ:µøð'ÞýwŸ¿÷ôóGýãéú/ÿïý§,AÇ|~7¨ßç/döluu¯Háø‹?½ûÝ@šBŸ{œKSa ÎÐ66¦a\Y*Î(Íù‡eŠÆp‹pœß·HqmkEm‚ B¤DŸatˆ¤èßž> Ö&‚ –b0†qJÀu]þ×uúò^ŽÄgÍêöÿð¿½Ey®E>_Cñù¸ì*’ýÓr½Ahü•Z› ‚PÇ÷ýSi0¥‹˜ÌçÇÿøVž2ù| iÄçGѼ + XÖFßR‹‰Þ"õƦ¹¾¬7îar>_”ð`E3 hÛ#¼ÏÓèm#A0uœ˜V0T˜Æ§¸ .Û™o‡v+r !ˆµ¬ezÞ ùŠ%mqÝ[åê÷~&ç3¤f‰ÀïáãÒ\eZ…ˆî! „Á˜Ï½nH7ÎІ;‚ ¢: +úüÉlî]ÝÿêÛï\Ü=†Ï^?Ȳ+pµ6A¡H©2ÿ /á™rîFô«GYOœÕäyâÏצ|~Lñ—ôe3úà¥^j†Ã»ÔãD—f•Ã_Õ}Wo“ó9R!ŸLöýHªi":Œ4’‡mr”,W„¥ö'‚ ª£ Ï¿<žŠº~mçIÑ¿=}À>5™Íù÷ 2ŸÏÇãñññ1 ƒ¶ÓÛ®Œ¢h8AЙ; +Ãpmmmk ûnÙuÝ•ÇÀ7ð‘Š* ; VßÃ÷ýê®E³2 tnRæhå?ðgÊ—Ö'NŽ+’Ïצ|þB¦Îgg©Òl{„¿ø/[ A´iV¹úÈ—zé'ç3¤ .äƒ`꺷¤1ÄR¬&AhŽÊΔe£Ò• 8‡Ÿ ‚¨Ž‚>ÿöô¨ë¯Ý9AìÊ¥½{ì#bJƒloo¯?æää¤íýÈåÆp8Ì}²hHÇQ¹®iš5H•^ueŽ~ ü7\HªÌ謓ù²@«Ô ÿH¾Å„ñ£ýJ8}úô/~ñ‹ÔàfùUØ톡2ìÕ‰¢Z@Û"–e‰ ã” (Ú*«ÂâÌÎA* Åg%ôlòöÿèÏ^@ž2üøëËyÔ(ù|mW¹F|¾ôm]]ú~„eW:¯"‰ÞbYÅsÂ¥©þ=‰ˆ­®îáišëp,¥ñsì• ˆ«‡Ê¤€'µb*2&µÀä<—ÇÓÉlŽ–ó[8ÿÒÞ=1¥¿A677™nê@^wé>ß0 i9Aˆž­AŸß¥®TÇ÷ý¤o/Ýç*ùÿ¢z-âó766>ùÉOB!®ë&ÿE\Ȳ,ø†ý& CøQ1è Ül–ɱm›×Aä”2©!3ŸÏà +©ÐèÊ"³’ ï$_Z{[Åç¿~9ÌqQòùÕ1Ì õ¦|þâQÌz÷‡*^Å$PÑééÿ–µ!-Dê±ûã¢óéúÒó“ ¢EÁTÅÀÃiÒ¢Td>M(‚ ¢Šûü £CæOàøñìõıÀ 7î‹)ý Þûáááöööîînú±tŸø¾—㺮&>¿K]©3Û±äüE5>?U­‹ÄÔkŸ]ÉRôSãìB±‘É2öU‚R X`Âó<î¡Y˜ZäF=Y‚øÙ$±HA²aù„ÂSKˆ)}‡èÁÁÌʽ½½¥Ú߶mÇq`xÃ7I™ÿOþ¶ŠÌ‡ãÆFžÕ€|~uœ*FS>_ªáõÎÁ­¾ëÞ YYÙ¢BtÛåi…ál8¼ëûÌ2JÎçHã#9Ó\§-BD·Qñð–µOE™/-‡ ‚ ŠSÜçÇòí×vŽÇróèþâý)ýÔ¥P…ÏO͉ÉÉ}~ogn2/½ +Ÿ/Í~‡¡R–Ï L–Ã*–z*#‡‡HØ-gèy2æ¥68 CÑTÃËNd±±hNgÖ±Øä|ô?¯"óÿûÚF¾ +ϯŽ–ú|xWysG¬¾JN`òŠ‰Þƒ\:‰ß÷#¥M8` Êú¸¢Ì‡ÕŒëAD ÷ù±|ûkwNÍriïÞBHé?¿5¡.(…r}>ó†a …A žL>¿NÂ0dmîy^ìOåú|Þ¹xö;Óàüäâ>Ÿ._Í®EQÁ‹ò¨„eYxilG@ªW´Á<ëAʼn\|ÝÖÞé¬ R¥îç^zUÅçÿõ•wòÕ|~u¬‰>WýèQ÷fLHÆ>nYø§VW÷ôê*‚¨jØ+=«¼‡ÉùŒ(šã–ÊÌ'™Obm‘ÎetÔ<ª Èíýa|àô¯«È|8®Žþ%_Èç·…:}¾J‚}LŽÁ[?û¬ç¥'So=¡DM;\þûŠŠ4ô…ãì´ÎäÍçsšM¥ó½ï}ïàà€¢¬+ŠÓd>AQ'¥øüó[fQÖvŽàdz×Ór2(:ÿÍ íG+r}~EìÇq² +aÂͲ,nÀ’R%îè8†aÀ™mqŒ‚÷N¹>Nzu1¸€\Ú󼤤…3³F,œ i¸T’í Àe~†©ù½1x| +ó"r!ß÷EÕÉ€–WÙéÐì¨f½‰$çøŸQôù{?#Ÿßqêôù/·•#åÕóÆRi0Þ¥Þ$úƒb‚ëRLÏÞ¶gŽ¥ Ûñ˜cë¸zõêÑÑM%¢*azÑÌÃ7*!’ùADÍ”âó/íÝcåìõG‘ýµ#Ä´0Ï? )×çÃ÷,íÙ0ŒÔ‚ àÉÉY>Ÿ ÏTLÓ¤\ý|ð†M5´¥û|îÕ³²Ö™†eZ;µ´(Š² -¢ãx +zR°û¾Ï. +’Ž"$Þ$ÂkˆìIQAÑóËÅZUq"óÐIìBÉðY,z¢ÿ¨fõL­ÿÓÏ“=5V°Q +*±E˜20_HæAÚRŠÏ¿ytŸ»øqs2CdËÅÝc8¾Š!¢ ¥û|®×Rõ&OfÃ0Õ—Âï™q…¯pòð=àž¤mYu\X¨…5~ò¯¥û|îÕSÓàaxˆÁ…ÔÒøhßÃil$À7¢|Nfl¨Ä‚J¬4(J1¤èó˲¸*åˆ ’o"óé)–ÀûÚÚø%\Ž§¾ã{„8à›ä>Æç^zUÅçÿý›Û¹«A>¿-ÔìóäûÛÅAä`8¼KÉù%²ºº'Ý+亷ÂvCÄûpœ•†d>A¡-¥ø|àÜè«o¿s~kߟÌ"²… |ÑùOfM¿ÒÞòo:‹‹+Z?q·‡YwÀå†ã8«2¸.C|>ONfG/Þ­LȧúRn,“ZRÌÖ.˜ ­ÔîƸÎÔP¥=XÓemàÝ}$ ܨ#>ñžk…“—ã%@·.Ò|>H©+ ÷Ò©Á¹àIìlcHê˜Ìîz¹Ï­àHcjƒ‹ñ,Öh©sñùð'îç=Ïã¿gÝJ íÆ?’ükãðý>l£GÖþ‚â3ð¼øÒÚÁ^ŽGÌ7îX(Èç·ƒú}þãáq^íËòƒÁ>õ#ÑOT4%ç«cÛ£TÁíLŽ‘ JÙ.D2Ÿ ‚hŠ²|> jy¦÷³v&ÿñæÑÿgßÜ£âªÎþŸ?»Þµº^úÇûG»Ö»Þù½ï]ËÚMâ-ÈÜu !$$“û ¹z‰bÔÞMÆK¶VÆKÒX'*jm©£F£fLˆ¤Da A,r ad~ÏœÍl7ç²çÀœ3ÃÀ÷³ž•3‡3ûìËs2Ÿýœ+©ì‚3%‘ÃcÒ&jý†!Ê ëH|~$fSõÞ˜Ë7æ }©æTx!q²ê*#Ôt y—ðÎ7[°¢´ŽÜçÓ@k¼:‡Ybš*ìWýÙâêt¾¹#ÉNÜZÓ+ô‰•F˜iêAùüÄӠŧ«Ðwf$ÞÆœ×ëåÝÅvÄ«–_‚d‹-åð]!êñ© =Þ….Ïd¿äæRrì˾6,àóÓ…”øüØ$±Á꣨ŒfB¡+%¯Ø³NII3“Ô±nwm   Oˆ‹¢„ÏEXnR…>_äxÓ%‰r9ÙÝÅ®hìdåúÝá¾”]’N2Ÿâ¨qý°>Ÿ×Nkªè¹ …B‘x>?ɦŌŒtòùrÈ{›+t³lôù4Ðý6Õëãû24UØ+Ÿïr¹Ø„±ßGà³H2ÏÍ4õðôùfM²¾õ;q»bxŸà`»ò«>–9gQäæò豄j5áóÓ…úüØTIÈê‡B=D0š))iZ,­;·»–þ‹8Á`v¤)ùü‹]½åRVÛ>®½µµµá£§ÓÌç6¶L\nø|¾Êxð_¹ÏçžÍãñˆ‡¹\.z‘NÂ~5ô¥|/€I­2¬F¶q(«ªªêêêÂá°þÝô’ùˬ™ÂâÃAÝw&pa.÷ù‘X= ½x·¯¼JÜðllÂðêë@  ˜WP‹C©×ì4‹Ì®e¸Õ盵“š!ÖØkZeÑç»Ýnýæˆ(ÃéZƒƒÝ@IæªÔw>ë ÉUS¿Èž·³SrsÙ±ÿr"m†ÏORîócf(V¿¤¤ #€DéÓ²¢ðz/Ð1ô_Zh°÷‡ðû[ ó¤#ù|ÂwºÅL¹Ð[ÃáÚ«‰OßaõùVJsÍÖø|Âív3 Ë_ ƒ|〽bæK Kmé#œpû4’U*úwÓ«>_èlÙ‚ëó­¬h³ƒõ>Ÿ›qìhbhž0<ý ;RÄårº}q(‡ Ù³upyNŸ¨—]A³a1,Ú`ÞŸÔ3bXÙ˜3;'GÜ)àçO•Û—¯J±ÙlzÐ|з_äÁ¯Ð»»¼Uâó7nUi3|~º0L|~lÚ Âê»\UŠÆ‰Þ|{|¾æ’’&ú—Öú|<žzÈ|i‡s>¿¬¶]b]:®¤üÚªªªš+6¥“Ï¿0¼‡|>/³ú?×ëõ²W¸”Ô?Ó[lGÀPìÛhõÙP==\~:ù|j­•›dŸÏ7Mö +M öŠ_h±ÙG+ŠBçä…úá,^K]]cuu5 å|þ˜AÂ/p°—®ˆo +6 æ‹k° Ù3+îñx$OFØŽ8”q;“²Ÿcf(óL¹ñÉm¥èˆò”ïX"m†ÏO†•ÏMž»\Uq Œ%0ÜÈ̬†Ì^8çóÏ|Ý-/Ãáò;;;£®ébeäLIµÓ‡|¾¢(ܲW˜’ÍÌÌäÇH|>?I  wEÃD®5ÃýCi](µnøGÜÑK•ÏÄü3¯`çÏ_ˆŠ8îGƒAŸÏG«qû|›@Êdú|>9E».og Ùçeâ>ŸA+Ëï÷S¯jܾ¸r&ËW¥¾WhˆÛíV^vO(è’ÜV¦¯oU^žH›áóÓ…aèóô_bõÝîZŒ0ÜP”pFƧùÒç|~[OX"^JÏ)è|qÈç¬À>###¢ÊXv€ÏçãÄõù"Š¢ˆõâÅV žO•Ïçͬ )Á,«ø‡ƒJ&tQáêKLJàó%×(ŸŸüê,~ðD3‡‡‰Ï …Btul¼¬oX$ÃÇ7DgëYôTáÙc_ TDNxi|~º0l}>ÃÐêgfV+Jc C‚Á.È|púº]¢’ îðz½Ù*ÌMZœóùDé9Eâ^ºÃ}˜ÏváœÏ÷ûý\rû*ÖÕúR¶Héo @îܬÙðÞÖˆtý¶û|>j4 xuºfˆõgãÛìY ^篟º|î%âë,ú|~uVßØÒ¬…È`|>ßÕûpÈ>Ÿš!¿3ÚÒ™ÎÁg”!*ÔU’Jɱï¬}‘Z¿-ë >˜S°8ÿÿþÇ5äøàĉ$4’¾õ»ÝµÙÙçé_`˜C7k‰Ì÷xêÑE†5*cHÎãDdZ÷§fµ¢±S¢_Î|ÝùlÎù|EQØ‹‡Ðfffj–›~I²#YU¿!ðùC#îVˆs>?SÐ4¸\ÂkŠêõgãY|¦ÃÊg‰o™ý­¬??Â/Šæ­dŸ—.™«xúÉ×ón¡Ïû0Ÿoq£gxú|±ÜZË'ÿ;î°ä†Rx ½rï5‘ÎP"Í€ÏOÒÂç ½ðxê!óÀ!¬ø|+ßÇáó5ýé„Y­ië‘è—òúÌg»pÎçn·›‰GC¹jè ¹54±ôbâžvÔÂÂl¯ÄQŸÏŽµA¯ŽõgãžÙåriäDuã’­6ñˆDž¢²î±ycX{ Ÿ.¡³‰Çè¯(î݇®…¯}«¹1ñ†v—-éâß?og©ä†2v~säõÌ[ŸŸ.ÀçÀ ôJßë½€n€ÄÏw¨?ª”–èßi<~nŽú|^KÌ…B⻆¾TttZ:{d†~àŸb¨CA\¸˜Õ „f8œðùïª7Þ†gëÞ½^/~Š~æ›D†ù<îSVT]z0äMbM½]¢B­åeù’þ1ƒAó¨K$±“¸N©ÏëgŸÏÇUÿð|"FÜà0“ùDÑ‘JÉ eåüÒÈ'Þ[ŸŸ.ÀçÀ!*+ÿ]RÒÄ"êA‡€-Àç;ÔŸyž²Úv‰¹ØÕ‹)m Žú|EQ$ÒÌ—jv4˜éPÞ±fäÎù|BtÚfÕéš³Ñaâ_éñx<ú¶ñ½Ãw­3(ŸÏ>—/‰‡7›½Öe¾×ëMp!ë‘‹qjö0ÜA£&‰{(¾óÝÿœºp)ýð½ü·äV²»¼u磕ý½!Á{ +|~ºPýÙgœ81ähooG@Ò€Ïw¨?íòùÝá¾ÃçÛ~qê_Ç›.ѯ'›»$†Çëõf«X‘äfó×%¢wÈt³·hqéÕhFF†Çã1¬-VàþÓívëßåÃa¨‹-Ì£0œNü-3møµ™R^ÛfffîJD„m‹@ HwIæ§úPþ„½(?Ov#ÙøûÞþ»äØt§XûÄѱóó%·t÷I¤1ðù€íÀç;ÔŸvùü†Ž+\­Ð¯»zs/ ]¨Œš|[àeØÃÓÐJ…B|2ÈÏJú].WjL36§.õ-ïça¾w¦ß}àL(XÏo…ž‘ÜJJŽ}É~(«M¨î>°ø|‡úÓ.ŸßÖ接¦­‡^9x¶UâaºÃ}tÌ™¯»égßé–†Ž+I»öp8ÜÒÒÒÙÙ‰e•îÐP677ž¡ …BlÙú|¾9”ï¾û.»ÀAÕƒ´[•¢?×ÃþÚ'ŽZ‘ù'›»i3|>`;ðùõ§]>?"üŠÆ¨É)¯ï¨æüŸoc¿ÒÁI»öººº*•îîn¬¬´f¥×ëåë å-·ÜboRÃdUúý~š´4²ìé þ¤‰žï|÷?ùmBîóÅhë 'Òføütáþ}÷,ÎrTöú’|¾Cýi£:ã¿ôœB¿Ö´õHô øì׃g[“ví555L7¡D?Ý…C©(JFFÆÈ«`¯®®~óÍ7‘œGÆPjV%Ÿ´ìÑþ˜‰!cçç[ôù¼>?ñÛGÊ}>uõ ÝŽyG™!ù/Ðh `qþÿýkÈñÁ‰X¡4àóêO}þ™¯»¹ié÷QHT 30 Wø+»z“sííííuuuXVéÎèÊ@ 0òJôi(,X@×åõz1±ÓšÖÖVZ•MMMü~»!‚Á ø«ž…ûaw„¢#•»ËOY)ÎgO„%Bj}>õ -ç1րχÏ€t>ß¡þ´Ñç‹¿¦­‡^)=§H$L[O˜Žá¿žlîÂ<À +,¤}V³‘‘¡( +Æw$!ç³Û¼½äØìŽp×s/[)Îç·›DH¡Ïû>?.ðùFÀç;ÔŸ6úüˆ ðËë;è×ãM—$B† ü²Úvöëáóm˜çXAQÊ`Á`pÄ\Q(¢+¢1¸# ±Ÿ†Øï÷KdõUÙ³ù ¢ìØ3}~âL¡Ï÷z½ìs].u–€ÑçÓÏù|ƒŠ .  iÀç;ÔŸöúüŠÆN&Xžm¥_/võJ„LYm;s²¹‹¿ÒîÃT€ƒ¦8Ÿß‚ Y¸ï‘þ;ȇ§J߯”Ü>v—‡ÄûH‚¤Ðç»\.&óñdŠDŸÿχ€á |¾Cýi¯Ï¯iëá¾¥­'L¯øN·Hœ @‡ñ_éÏ1Õ`d )΃c¤ì.?Åîw=sÚŠÌçÏy%H +}>ûP¿ß? +§G(òx<™™™Ôô¿‘¸'Àç@ŸïPÚëó»Ã}\³4t\¡WÊë;$Z† üƒg[Ù¯t0¦:ŒB¡¦8ßãñHd>Ão ÷Énwªã;Ålã8ARîóGáHü~?Ÿø|Iˆþ¹Äþ•°Äöl;|¾C>Ÿ(«m5Ë™¯»%Z¦¢±“Ž¡Ù¯϶bªÀÀív‹ÅùŠ¢èý­ˆßïg÷‚]‡ë ´Kno~úÕÅ®ÞãM—ìz¤+…>ŸÕQ57B¡ïpÇS©âõzãþa‚>ÿÅ^ ¿B ,>8ñCk}‹@ #/ðí04D]o ðùùüîp_CÇ^3I?H´ ø5m=üLõQ-F¶Ýæ÷ûEA‡€Ä¡‰T#nÑïÈ# ú|>ZSôoJ.Ÿ +ÛH¼›xFFFÿ_žð¸Ç$w’c-Á`»í)(U>Ÿ’ž7âaRÊÃIÐç‹Ž@ ò=èÐGß"ÄÈ‹Ñö} +`ðùõg4Bé9E"g.võòcè_LõAáõz³U‚Áàæ¯>k†Äãñð?ñûýCn¿¢(™™™­7Êצ€fñÒ˜²á°âÇ̦¡äÃÊl\hÂð?¬šs‚P(DÍàÏa‰óŠ•Ç]f¸Ýn‰»Î ú[ævÜŠn.K9¾¤WÔpŸO=¯¨È‹óé–ÔŸžr]•Ý#¹eøÊöM¿ú|‚åÀá°|’Ÿ ƒÝÀ…ÏG àóŸH#àóêÏ$øüãM—$ræds;Œ‰}0(˜Ù³8ŸÍæ¯.Wü;u(2qC€‰GŸÏǬ5,33“ @ ®Ô9ÌW‹ãÈ…¤•mv°&ÍZ©ëÍyÊkŒ­Ü&hÊÎ.qÈ1ô®ÖïPôA No6|Ôó†çaõÞt™løè_·Û’[^ à[ôƒ¼[ú'Û…€½gá¾É-cìüË••—ímjj}>ßÖdÛ£•RFÀÃ&üBW=Ø¿…ÏG àóŸ£–dúü‹]½9sø|[’¯½µµµººº®®.§û8Úî󉸥þ>ŸÏ.ŸÏÄ£ø ++ëµXó?’†Ò:LjV®>?nQ7¯ÁN<™ÐPVUU%2”š¢tjLI ·Û-‡gffêM¸uŸ¯Ÿ´‘Aî86` ßpéÑ[ú]9öxBÒ¬f(5;€²þ<áq ì.o•Ü2¾ó]꼑ãóÙƒ!ò‡ìʷÄA%+ 6úüŽýÑfŒ¿zÆøçŒÿIÎøŸª‘™3þš™ã¯9~ìÌñã¢1nü¬h\§Æõ³ÆÝ0{ܳÇޤƄÙc'RÌ;iÎØÉs®¥Èšsmöœk§ÌÆÔ¹×PL›{ÍtŠyј¡FN42gª1k~4fÏÏœ£ÆÜhü”bÞÍ?‹›Õ¸E 7Å-?¡¸U±ÈÃ…Ñø1‹E±Èb1[£‘¯‹%ѸÚ, +îqËÀ¸™Ç æˆ%óÆÜ1g`̳ÆÌ‘30f1Ý ò£ñ“hLSÆ”‘=0²„˜¬‹Ic¢úc1‹›DÞM?e±hB,T#W (&RdÞªÆsO>æÐ2ÏɺvF,¦ŒiÙј‹)Ñ›‹,Š)ј‹I±˜¨ÆŠ©ã(nŠÅ±¸AëYLw],ÆGc¼ã(¦‹kcqM,2cñS5~‹ÇâêéÑBñ#5®šq ö+{ëêœh†añ!Õ°l™ÑœÃÒε±ä3VHAãfõg!<]KJ7Ì{c,nÏQ,MMRÓOVY±”•=·?k©‰ëÛÜÕŸ¾bLŸÇ4©Œe³Ù&9MŸÖÌ2Û­²ÌfœÓX*Ò—Qš²š…ÔD4Ø\do:Òd¤¸IÉƼd˜$©IŸÌ”>G¦©Üþ4õm¦¢pÇâ–XÜL1©?æÇb^\37s(&÷ÇìXÌŠÅÌXäPdQ\+É]†é‹g0yÓç1ÃT¦Ïf† í:]BëÏi&iM’Ùâæ·«&fÂçÀp#™>Ÿðn‘ø™îp_2¯½ºººJ¥³³3ÝÇÑ ŸoX~,ÂJI÷KÌêÍëÖÏ9’†Ò"\jÑ Ÿ·zVStH2Ip(Å–¸ÝnÃfñêô“\¾”E¡‰*®ÍaüäfS7 Š HÐÊòÔ_©ÙÕ%íé ýPj¶ZL‹ó‰2¾ÿCÙþoÑ%óªÛÛœBŸ?¨$ø|}þ5[æM{sÏÌ¿ì™ó×Ýó+vßZ±sáßv.~kgAåŽÂ··{Ž¯9V¼þïÆw¼[ßÝæ}·hû{E»ßÛzÛû[ï<±åî6ßóÁæû>Üüó7ýêäÆß|´ñÀGúxÃ#Ÿl8øÉúÇO­{âÔÚ'ƒkŸútí3Ÿ®=tzÍ‘Ó«Ÿ;½ú…3«ÊªV=»ê•³+_=»òõ³ž?æùKõŠŠs+Þ:·¢òÜòwÎ-?þ÷Â÷j +OÔ,ûðü²Î/ûøü²Sç—~úùÒÓŸ/­ú¢àìÕµKÎÕ.©©]r¾vÉuKjëòëBùõ¡ü†úÅê7Ö/þ²>¯©>ïŸõyÍ ÑøWC^Ë?Q|ýEÊŠ…mþ[Ž ¹r/5F£«1·[Ë_F£çËÜ+ÑXÐÛÔa5¾Q£/·j"b_Þi¼5ráÖ>Š,èkXÐW¯FhA_Ý‚¾Z5¾XÐ÷ù‚¾ó¹}5¹}Ïí;§Fuî7Ÿå~sVªÜoNÇâÓÜo‚¹ßœÊ ’þ87üQ,N.  Æ‰…½ï/ì}Owö_ØûŽÇõ¾½¨·R·õþmQo…]Ôû—E½o.ºòfÞ•?ç]y#ïÊëj¼–w¥<ïÊ«Ñèy9¯çh,y=/åõ”åõ¼˜×óBÞåçcñÜâËGÔøãâˇ_>¤Æ³‹/?³øòÓj<•ÙŸ¹4ÝOæwÿ!¿û 5~Ÿßý»üîÇ—Dã±%]Æâ·KºYÒõ𒮇–t=¸¤Ë·ä‹K.=Ðüû‚öýÊþ‚ÖK[,ý—oéW¾e;eÿô-kò-k|pÙ…—ýã¡Âú‡ +CÖ>\øÅÃË?xùù‡—·|ph™}ríK¥kËJ×¾PºîùÒuò¯;â_ÿGÿúCO­ö© Ï<½áé§7øŸÞPúô†?<½á‰g6üþ™?»ñ±g7<´é·‡6=rhÓÇ6?xx³ïðæ‡7?ðÇÍ¿ùãæ_ÙüË#[~qdËÏl¹ï¹­ûžÛzÏŸŠJþTt×óE{Ÿ/ºãù¢ÛŸ/ºí…m{^ضëÅm;_ܶýEoq™×[æ-*+ÞZV¼ù¥âM/o|©xC xÝÑâµG·¯>º}ÕÑí+îXñòŽå/ï(|eçÒWv¼²sÉ«;¿º3ïÕ‹^Ý™[¾kAù.÷k»nym÷ͯïžÿúï™óúžY¯ï™ùÆžœ7öLÿóžiÞ3åÍÛXPb™þæžœ¿DÓˬ¿F3̼Šh’¹¹b—»b¥š‹f›¼·¢‘_¹cI厥•;–Un_þööoo_ùvñªcÅ«¯}‡RPñ5 m>¾mËñmEïnÛönQñ{Ñt´ã½¢ïíyoëž÷·ÞþþÖ;NlÙ{bË]'6³ìt/%¨6ßÿá&ÊQ¿8MS¿þhãmØÿÑJV¾7W3[ˆe¶Ëlߦµ¯(­©9­õ‹(›µ«ÙŒ¥².5ƒQîb)«O’…bYÈZ"êã‰È,iÒÑÉÜð‡æé¨?#©éh°éµþŒMJ¯y‰'%5/]æyéO&y闞ΗšòYjú6;ýv`ve§ýÆ JÙ¿ôk£%¤©eõj¦ª‹fªå_¨iŠâï¬8§Æg¿]qö·+ª]qZࣞSz>yÔóÑAŠ•>¶òƒÇVžxlÕ{GãÝÇW½£ÆÛ¿[Uù»UoýnuÅï£ñ—'V¿ùÄš??±æu5^ûÃÚWÕxùɵ”¸OFWYéºþÜUÍ]ÑôõÔ€ôõ”š¾¢ì™o3X4‰Úô¨Ä:ÔŸÄöÿ±?ýú¥²þ<ö³#[îWSÙ½ÑT¶•RÙݱlv§šÐn{¾ˆ²Ùn]BÛf”ÓÖGÓÚv1­y^îÏlË„Ì–¯f6Š…±ävëkÑüvókÑä6/–ßf«ùbÒC«àó`¸‘dŸ_^ß!Q45m=ɼö††¦›zz’ú¹N`¯Ïg¢^_Ü+Â}2·úCöKŠ¢PK4…ÊLõX¬ÏIC9¨×›v{}>\C1Ρ©"œH2©««£q¬®®ÂPŠ2V>sè]3!oq)ñÃ4åîq}>ƒ?Û’‘‘‘àL`Ý®ïsj¿fÔh‰%³>_3”VŠóy*»§¯¿$¹YL(èº'wS¤5ho›S^Ÿo‹¹qx"yŒÅbö€Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï€QK’}~M[DÑ”×w$ùò;;;G†¶×çsÙ ÍNÂá?ØX/J ËPÑHþÑ0”ûÇÌZÛëóÅQ6; MÍÁ &“!%ŸÀq-‰µâ¿mq)y×Å]4½ã®2+ð½ yƒC¡3ÿVR„-„Ãaq(­ç³Rϸ³*‹Ž(’›Å÷Øüùÿ‹ô(ö¶9…>TŸŸŸŸŸŸŸŸŸŸ`È$Ùçw‡û$ŠÆwº#24ìõù¼’VâEy ?7`z©(Šßï§ÓruIÇ»ÝnI#飙÷£?IÐsŽ`¨Yé÷;ìõùt¯½7; MÍ´1ühMY^ÃÏ£²²eS©"Ÿ|[Áâ6?^óŠÅ¥·ëâú|³쪡ã 7&Ĩ1ìl©*ê¶RœÏ·HˆïýàkÉbwy«ë¿>ŒTØÏ…>?ú4D `ø½Îg©ÐÙø ¥…ÊÓ>|>|>|>|>|>|>|>|>|>|>`dC_ékc‰ +}?¥/’èN’}>qø|›DÔ\ìêÅ  {}~DÐõ†g…¿™Ï§uÇT°!n·[#]éWf†322,jÞÑ ÷·Ô‡úwm÷ù¢®7<‰(üÍ>šŸD ·™NäX¹"Þf3­mxùŒ!,%®"5{^ úüÁ®Ûß!ôïR;™É§nIá½ÏJq>ï1c~0vþç’ÛļÞYû"ç|¶·sú|6“iÖi&îC$îRZoá¿ðùðùðùðùðùðùðùðùðùðù€4…Õ1z½^ú2hXvÈ‹KõtÃê3’ïóO6wIDÍñ¦K”!`»ÏçºÒ°ZR|×ÐçÓÚäK/33³$† ìxW®1aòãÂ=›ÏÈbÙîóy»áÇiÞ5<Ÿ-4èl&Ð|†Ä}ÃÊñ©• r´²”èöÁ‹ç5·‹>Ÿoʈ~°«FßÃâ}ÎÆþÐív§ö~g¥8_<Æã).<ð‰ä6qUvO ø¦HkÐö¦ŽBŸÏ&‰f^‰3œ¦"Ÿ~loÃçÃçÃçÃçÃçÃçÃçÃçÃçÃçF ¼ìÐLžV—‰E¡ëÙ$ßç·õ„%¢¦ôœ’üNèS”ÞÊÊá}æ"…ûZ•ñ`µ÷rŸ/Vàë?N¬Þ7ôù\0ê%0­;¾rù¤:º$»Ã} W†P;ã^ /Æ6Î|8¨KãÎ>LŸX¯AS½ox66ÜúàˆP¶mø¬ÇJŽÒOª¡!_J@€.™–~Ù¢Ïç.öê`W~ÐE+ˆÆp§;ÉX)Ρy"¹G”kÉø†ÈQG¾J$ÍçÓ Òœ·/i¤Jƒ•­[+î‚ñáàS‘ïÜÙ8£àóáóáóáóáóáóáóáóáóáó£ +½ÐȱºL¢ôQ œ|ŸO<Û*Ñ5m=ádö@8T22ZÇŒþAí ›¸J±‚×:Ÿ(í5‹KTý†>_s* |¯ý 3Evé)=»z}§[$Snøµ“Z+¿^Âmø®($­#÷ùi¯o —Òú³Në—cvZ³c×°Ö—’¡Øä]G7)Ã=:@|jLô¨ƒZ5†—/®VºÁÉ÷’ƒ•â|ºSkÿwÜ„ïÿðjúµ¦­G²F +´çו}üNÜ•2’æóùÿO¸0l·kpõ÷6ú-<öÿ.Ã'Dìmø|ø|ø|ø|ø|ø|ø|ø|ø|ø|Àˆ‡1Šf^£VDáOßI¹3aEq¶#N_’ãó/võ>ßVVÛÎ\}Ec§Dלùº;™=.2ŸÅ¿M†É ŸÏš¦XóºÜçZzEQ˜Ûd~X¿¢í]¡¥ç”´ù,žm•_ŽÜ7:áóyi®¦n\ÿºÄç›e: › q/y¸ù|ºïè éy×YA£Fµjä—χ&îXÛˆ_Eó¢•â|êÆy;ïgóÿd}sy}‡Ôçeq¥ äû|þTª|>k‰8p|kF“½nãüχχχχχχχχχÏŒxå÷!z¹AÇð\.—¾Ÿ]E‰~r|þáómÌÀT4vÒ¯òò˲Úö¤]~8L#™ÏÂðB¸ ¢Q^,÷ùš:|Ž¦nßÐç‹V“þC_·¯?›˜±éÏý~ÿRnJ|¾ÙRr»Ýâ=H³:¬û|½Ôª1k6û+³A7|¬ÀÆ[‰x]’mqG#:W}Á&ÿñ¦Kò§i¶>þñðù4 +4‹hEðµC¯” »hbÔ¶0iÈØô¦ ‡>>>>ß:ðùðùðùðùðùðùÀ ï¼ü붙—qáJÓ!¹‘.$ÇçózËÒs +{E¢k|§[Ø1¬ŒÿàÙÖîpŸC û&J/™¯è C^Ùkñ`ÏèÔ}ÄHòú|EQØߊÅÌt~:fP–ÒÒÎçK&|\6(Efv°ÞçëÕ}ÄHòžMLÚ\ì{<C·oh5%;¼…ܱ'¸Ekq)‰î]ì1£š™XºC62‘U3¨ `;¢·w»ÝúVIŠó©7®ÊžÍ'ÿÉæ.ÉÒ¸û•O~xJܶ—¤ùüá¿d6Ùø:Òï71ó¯y¨Ä–†Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡ÏŒlÄâI³c¸zÊ0‘Ÿ„Ïç‹{žÑ@r|¾XßÖ¦WÊjÛ%Ò†Žöds—­ +‡Ã---_]}ùüK‹õëÂ^ŸÏ— ׉úW }~D•“ôŠXÉ,ZJzËÆGcØPvvû=¶1”.!>%U>Ÿ [_Lé_‰˜ÒÓyÌÔ.½.ÎøجÊ}B›ïˆBÞúyøÓ †O¦èu¨†¼jRèó©I|\Ì ú}Ãâ|·Û]xà^r/_­÷=úWþsCÇÛ¯eú|q&‹;núQfÓÒÆø|ø|ø|ø|ø|ø|ø|ø|ø|ø|À(Á°$R/q 5$òEr$‘ŸßîãæÌ×Ýô +ý+‘6¬ðòðù6+†sÈÔÕÕUUU}öþûJA’‘1ÌM~›ËÕenòùúj|}ž™Ïçús½§¥SÙ¥ôÙPÝÝ݆oºtðlë07ù¾Ó-4óåO£¤ÊçGtÕø†ûò¦#}>¥eQÿjž“š4iÒÐ|>oϲÜã'ç¡õ¥Ä¯7AŸ?äU“BŸ/Ú`~Õ\ÿÊ‹óéÈüÂåâÖ­|î|ºV󗽤ÐçƒAútÉl… ËífÛFl¶Ó»6îÃÂçÃçÃçÃçÃçÃçÃçÃçÃçÃçF¼"TRx,\ìŒÂ2<=Éñùœoë K¤ÍÁ³­tÌÉæ.þŠMª©©aج®;pÈçG +|½ÞXðù"@ÀãñpÑ缇ñC)'…>_#ð5zŸaý£™Ûç{¯<¥¿ôÒK¥*o¼ñFe ®²+upÿÉíº¸Ù$WkŽ·¾” {Ï.Ÿ?ØU“*ŸÏ»]Ó|¶È‹ó#÷vÅ'¹ôQt¤~ÿ‰²ŸËë;]_ÉÿA+Ó†­'˜EE±wvÁçÃçÃçÃçÃçÃçÃçÃçÃçÃçFV¾ý‰ßǃÁ älðù‘$ú|.çy]eé9E¢nÚz»zù¯ WloR{{{]]]ccãGç|¾Ïçã«IüY¿âD¿Ä\«Ù´ý阑4”q‘[kç|>ßN¥i þ¬o›x¶P(Ä&ƒYY¯f6²¡ljj’ŸÖn¼yµ¿•U ñ¢Ö—_âƒ`‰øüDV ß±±|:.4¸¼Ïé¾·"Þ… ˼ù ôã`EÍYÉMaÿß.hžó²´ðùìÈðh!|>|>|>|>|>|>|>|>|>|>`4`åÛ×)q¿ÃçG’èóõr¾¢±S¢nN6wÑ1϶²_7]Âü—àœÏkòÅZ}ýªM³|’Jéä̺ 7¨†ï:çó#BM¾¦V_2¬\z›9v³ÏÂl᧢.’oæòV‰byPK‰þŠõ†æÒñù‰¬šäßΨø&ø[âë†ðm ñA­3åù¥ïWJn +÷má?w‡ûœ¸¨4ªÏ‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï‡Ï¤V¾ýq#ÿ†È-%|~ÒÌ*—ó‘†_eµítLy}Géæ9ó_‚s>?ÓGÜ^z½^ÃU)š(·Û-iÿÍ©À ÆZãÒ5}ë„Ï矋}Í õgã•üfíá—#),·xE¢aÎÈÈ0[ ➯Og­,%z‹F¿'âó‡¼jøí,™Ž—·Vó„ß+1Cœ6ü¹-Šæ²«%w„ÝåMOžúJ¼;8Á0÷ù4ÃùûÜèä4vÔ ùŽ¡½-™·~¿ŸÞÕÏy}þU3®»eÞø­ó®ß:÷†­so*š3±hΤms²¶ÍÎöΞâ=Ý;k†wVŽw֬♳‹gÎÝž3_[väܺ#gÁŽœ…;)fäíš±x׌%»¦ìž¾t÷ôe»§bÏ4Ïž©«ÔX½gêÚÛ¦¬»mÊúÛ¦l¸}ÊÆÛ§lº={óÙ[îÈÞzGÖ6Š;³¼wfß™µýά{³vîÍÚµ7k÷Þ¬=wM¦¸í®É·ß5ùŽ»&Ýy÷¤½wOºëîIwGc"EÉÝïQc_ÉÄ{K&ÞW2ñþ’ ?cqÏ„Ÿ«ñ‹{nú¥¿Ú_«ñ›hÜøŽßÆþXˆ…/ˆ¼/Å{c±O{nŒF‰wRÜ¥Æ^5îŒÅjÜ®Æmjì»ÕØ‹7EcÇM>ŠíjÇÂ+ĶX©±U-Ñ8°yBlRc£b±^uj¬Æ~Š5j¬¦˜UB¬TËj,W£Pe±XÚP¨±$ùj,ž¼X,ŠÆoÔøuÞ¤_åMúeÞdŠ_äMþùâÉ?‹Åý‹³îËϺ7?kŸ÷äg•,ɺ[·^ô;´Ì7.ŸF±aù´õ+¢±nÅ´µ+¦¯Y1}µ'«ÔX©†gåô+g,_9£Pe«f,휂U9KVåä¯ÊY¬FÞªœE«r®îÜÕ9 (Öäܺ&ǽ&ç–53o¦X;s¾óÔ˜»vÖœu³f¯›5K™ëf嬧˜M1cýìéfOÛ0{ªS6ÌÎÞ0;kã“7Ι¤ÆÄs&lœ{Óƹ7nœ{æþ¸>ó®Û4oüæyã6ϫƵ[æ]³%úïX5Æm¦—ëb&Eso,Š¦Š ”p¶EÎd5çDÃÛŸy¦ª1Í;‹¥ –…rŠgÎ,žÉrÑœh:Šf¤y±¤DqóŽhjrDzӂ9¹j‚¢XD±«?SåïšÎ’ËWjÊšN)‹by⚶rÏÔ•BúZË`ýIì¶hS#[HeÙEwd© Í{gˆ9Í0­‰™MLn,³í˜ÙÄ´&æ4–Íx*ÛK\ÑLeœ…,'¢½‘<iÒËEšt´Ý(y¦#ž‘Ô¤t`ËÀŒ¤IJ&%!/í—&šæ¥•ó’&5jSSüì´x@vÒ$¨_Å”>Gݟߟ¦î¥)1SQÜ¥ÆÞ‚¬;Õ¸£ ëvŠ¥Ù·-ÍÞ‹ÝjìZš½séŠK§lW£xÙo,¶©QT8•bkáÔ-jl.œº‰bùT–¸ús×rž» ÒË`!ƒ±$¶l@›Á’˜>-ZmœÊx6»eí·ÙL“ÐxN›©Ëi<­M‹¥5}f›Ël<¹EóÛ&ãüF‘™?> ô}Sþ][<@þ½8èÝÂ($™>_/ç}§[$§;Üwæën§ 2GŽú| ÓT>ú|þbFF½ÎÍ3ý@¿r_dh¤Å5+VDë{Þ ŸÏå¼™ 7<›¸Ç*¶™~æoy<I;­_µÏ.–ÞéZ*cÐÏ|[ÊìCy“èo³Ï ï¢D|þW ¿ áC‡†8¨£ø^ ý ö¿!b¡{Kï[o˜»¦Ir;øÍ¡jÍÓ[NdŸwïC‚Ù/Cn‰~àÄhÖÑ@Ó1öÎ"¶¦ 7vÅ]3ýÚ·Ñç#ˆ‡|:”åз1òbø_ O¸K1ô–ô ×L³hðx¿¦­‡ ö +7ü†AÇ·õ„Å_1ÿÍpÔ狳hª‘#&>_\bÉñQ£®RÍ$˜s>?"d`C±lx6c7,Ø–çGãóÙÇq (ÁìÙ¾ +âbø@">È«†?7¡Ùksîíé_qìâ¶_Óíü¡­«²{ŠŽ(’ÛÁËÇÿÅ÷é¾àÐu%Ùçk6ȬcoŸ?,ÛÝØÚ7ÜFtö°»ûÀç#ðù€Ï¤5\~ŸåßCåUdâwöQ.“éó»Ã}LÈпì±ü^åõ¡€³¢±óß G}>Á©Þ‚šù|6» E®ËåJš‘0±¦ß[‰8ïó¹ú3ÌÀfÍ +q Í$¥t¹Ì Òç3|>Ÿ¦žãv»%Ë$®Ï§)Mg ‡a³ôùC[5lyÎç…BÔb'ˆ7V³®ÓtÚÅ®ÞÃÁOŸ=üè÷~ðä^PrìËP¨>Þt©¡ãŠs•dŸ¸Afe ‰æ§oðúÚbàë°hÚ'ó>Uàóø|@ÀçÒ±T˜Õnñ·ÄÊ@IÕ½X,jïÃãéH2}>ÑÖ>ÙÜÅ«+»Ã}‡sðl+SÑØÉ~=|¾ ó?íP¥²²²$†ÏçKZ ñ†º1Éõض@­õûý|2¸&ßÞOÔø瑱jxwÒD«Y›ãªiãÝóŠì{rï™PÐ%¹Ü´19W‘|ŸÏaIÉDö'Íöœa°ÿ-¸Ýî$·Ð Ÿÿ¾{é ‚EÙ /8´~Ñ·1òbø™ [ÄgÃÙ÷Pú®§)hÔ—_*ŠDçâüHÒ}¾^~o»z:® >Êf,ãI6.Á(ÝÔô¥ï)i†ã[Lg(rxŒë¿B…Ú%7‚9+{’s£Ð糇;4~H|~òÿ«à„Ï|Øsßfè·ÖòÃF!)÷ùÇ›.I4ÎÉ殈ZÕ±«ƒ€få¦Üâ‚ÔÂwv|)Uš@`L<Œ18SR¹7û;ß•=¨Ur¬e̘Ëɹú|ö ‰¾ÁiØÅjÒ|>'0Tôf–^0d¾¦gRåó/võJLÎáóm# q¹\))èÖÀi&¤° ¡PHó|œÓYzÔå™ì;ÿ²ä.°p_‡ËÕœœkI¡ÏOm±âóYý›äÂçÀH" +ù|>úv™­âõzÍjÛDŸŸ™™©y´|4“rŸOøN·HdNw¸Ï¡Ïmmm­®®®«« ‡Ã˜ iÍèJæGX‰> eUUV¥xq~ò‹ºEè–*—ù.—‹MÑ`0èñxèNÝ?c[ƒÊÿ¡h—ÜÆοì]ûa2×Ô¨òùÌÒûý~ñE}ðÉ–ü Dø|ЗtúJßXC¡zCd8øüòú‰Ì©iëqès««««T:;;1ÒšQ;”g„•ècUZ‡eïÔ>köÿÙ7ûà6ª{ïëOÊ 3âþhfîTÓçÎô™¹£ççÂ-5}á5¡KH€„„n)ÜR¨!ô¦´æ¥o’JHÀ"“@J‚ LE0o /Â/ØØoLŒ¯C­ŒËŠ…õü¼':9ìJÇ+k­]IßÏ|ÇcÉ«ÝÕžõ9»Ÿýp8ì›gŸ}–-L£ {Ge6\:é”iIÿO¡¢«O¯Ì×ñ‚ÏÇãÔ² R‚Á Sÿõt]$>saXohÚ½ +ø|@Ä >¿óHZ"sZŽÏÓv™9Ìd29PÍÔmSêºNÿÂj é¬jÇžžüWÎ +µ;µ¾‹³3Dû]ŒÅ‹³¦æglÃYúw2’þå†1ÿÉ}¹ÝÊ#Wþù#Yqð)^ `JŸOôí{n8× ´ Út±'ðù€ˆ|~:+«ÏlêNÌߦS©´am€¦DSÑu]UÕH$"YÀï÷Ës0eËsSMŸbÏ t}ÒçË-¹S6?ëôE“¡³ïͽ®Ì·vÑçÓ1¡ÃeÇäÓbt0¹{/Ÿx<Λ2p{O—Š¢ð?Ñ/ŽçG£Qö4cÝ|> âŸO4÷ê¥321…–€Ê ºåbJßN%9w³´kay,ö™Ï÷^ã¾QIçÒ)ÓÑÕgæFb•ùâ.ú|>+ŠÂ\=;¢·WUÕï÷MÓœÝ:µ”üimÔq™ÏˆXç›Ì·ÏÿäËáø‘5œKJâx:l¤ÓœO)]_O·ýÓ„ôé=žO(S’3é3ÒŸÏ'F>Mö:6“FŒhcý R¾ìûÌÈ¡/û†Œ|>Þ7<þ1åÆ?ÿøpj&_¤>þWªw4Õ{„r´7q´W?Ú›<Ú36ÑóåDÏøDOj¢çhú£‰ôGéôG“鎥»§&»³“Ý_MvOgºs™®šJöð|um5v ê$“ÅÒ=“´½LHst¶¤º§g͸4_Ζ1IJ£Ï–„4GldT–¯(ÿbù¨p¾°—ÃÒŒHó?ö2,Íç³eÈFÍ–ÏÇ‚{%ÀÜ {ÛFGqü¾¸ºðˆÏo>*Q:ûOàÌ€ +`*W ÉR>pHà+ù€°¡Éï5<.éùoÚ®ûOÌíôWì»»èó™½b«ÏÏíó7^G"ëc:¨¹­šÝ©CMçfDß®à’ÖG eú|ñã‚< Þ?O=Ž-‚ Hí·K€¹aG#”„ƒ“Ö«úxºëóG&¦$V§¥?‰3æ›x<ÎÝ;s¹V‘+ÛCQ¾¼X†m¶{v·Kzþ³–O„ξ7÷v¨b_ßEŸo ÁŽ›Uq³§-Õ·ƒ§AÌÀqÏ¡3DòÀhVàó>AÏTðùót<Ýõù„Ú1*;éì4N~˜?"‘Ȭ2ß$ü øECN£L_2ÓÒŸlJ±¿Ê»ýo~gê·Ûö?ÛÙ921U™#àºÏ/HØè‡MK²÷C!gs°‰Šâs„J~ß9gø|ÏGAàóU„Éç7”uw}ÏÊûü‘‰©æ^Â\MëÁq‰ØéKfpòÀ<‡Mös“ù&)Ø›ôAMÓ¸À?Ö÷ÅaIŸÓö‘…k>g¿ÓèP™ƒà¢ÏgV21µëãAIŸ¿~ÃÃMÿü€ýÎëùç}>kõëjší‰©xžµ‚SCv0dS**ùeùqö‚Ïÿ÷+ÎùÞƒ×Ô@δæ¯39ËFþCÈ÷çjÊÙùü€òЉ4äseãÕ?4ò£!–ùÉÆйWQÎÛ¸ê|–¦U4­º°iÕEMW-Ü4“E›®ºxÓJŠòðL.yxåâGV^úÈÊ¥F.Û¼âòÍ+–ÍäÊ囯\±ùÊ•[®¼jËòУ˯~tù5.ûÙcË~þز뚗]ß¼ìÍWÜÐ|ÅÍWü*ry8rù-_¶æñËnÛºô×Û–®Û¶ôömKŸXrÇKî~òÒ?<¹øÏ-‹ïyê’û¶_¢nWØ®<´CiÚñÓGž¹øÑg.Žì\´mç–gnßµpçs=½pOô‚Öèßs~ÛÞóc{Ïko=÷­ÖŸ¼S[êß6Oÿì5v ê+ÏÙ+dO>»ó‰Zò\>»fòö³Bv²œ{"Ïäót>;òÙ~î[¦åé{n¨üü,}>;VŠ¢ˆoÒU BûFW8¼±ÔÒ%vAØ,¢2—Oš¦ÑOŒXž’&K:èóÿÏ/6¼ôk/çœòò×nó#!?¶ä'/ϹFÎrþ+ÇsÁ+·]øÊZ–‹(mk¶­]4“[)·ÝúÓ¶[#—´­YüêšK,yuÍÒ¬¹ìk.ÿÇš+bk–ÅnY»åÊØ-+b7¯ŒÝ|Õk7¯zíæ«_[};Õÿ¹oõµ¯Ïäº×Ã׿¾¡ò«ßøÕ¯Þ¸iõ7ÝüæMkÞ¼éÖ7o¼í­×½õËÛßþåoß¹¡ñîz熻ÿyÃÿù‹{öÿ×½ïþ×}ï^¯¾{ýƒï]¿ñýëþàç›?¸ö±øµxíþì©Žÿ|ºóšg»®ÙÝ}ÍóÝW¿ðQ襞U¯ö®Ú×{Õ¯|§Å{ý+>üäÊîO—|`ÙeƒÚ埼ì‹Áˇ–ŽZ2ùù¥_ /Î _RSß1_ÿó5v ê$Ÿ2rh&Ó,Ÿ-žÉ ‘ƒB´|Œò©‘OŒô³\:“>#éÒ“ÏG—~EéÒe¤ÓH‡Ä|0“,ËûFÞËç]!ûüsÉLÞ9‘©·¼eäM!oi7òº}Kgòš‘Ø×ó#¯iòŠ‘—¼4“c/]6“¿yÑÈ Bþ–O«‘ç…ì½,CÙcd·¨‘çŒìò¬‘3™¤<#äi#;.ŸÉv!Oi1ò¤'Œl3²UÌ“‰i>‘ôcF5²EÈf#y˜eÙñl2Ò´l‚²QÈCFþjäA!¹ßˆ:“£<ŒÜgä/È\òZø"ø|€SÐ-!ÝBì—‹>dbJ¬Õ¤wZú“½CËì?<Á~oîÕÑvP>4h²Q sªŠ¢Ì*ói=º®›>HC ÈlµÔoóùVƒ½’Þþw{?nkû½øÀ·2¸èó骆m—öA|“·Î¬‡zΰ§´Î +\8™¦XJÉχχχÏGàóáóáóáóáóÕ Ä~™¸èó µc”›¶¡½äº¾`è¯}É ™ÌdËÜz6›M¥R8 ª4e-5åáÇє•$‰PÿOÃe1EÌ«Äå2ßô,ÀÔ”ÔcóÞ»óHº¹S“ôöϼ¬5}p€ËÿŠ +}>këózǤô­‡º|èJ)°g:áp¸±8âã†9ŸŸŸŸÀçÃçÃçÃçÃçGÓ4º e7¤ûöq×ç·gƦ©;‘ûzž5-ýÉtvZ4Ben}`` Ë Nç@5ƒ¦DS‚y‚VŸ "‘ˆ¼)©Ç>1Ùê_ŸHºzÊkí‡øï}ÉLž¬»>¿º®«ªª( + Óô‹ƒ•ù­ÓW +tÍààqžó…|>|>|>|>ŸŸŸŸŸ¨%âñ8ľ}ÜõùÖzû¦î„Dò¤³ÓͽºSE›}}}L7¡¸ÚASÖ ===hJï`§2¿ Ì·6å®c¬ën~/þn׋’~þ/Ïõ· ¥ØïjÇh%¿¯7}þ¼ŸŸŸŸŸÀçÃçÃç#ðùï ûlF¹ã3Ö«w}>ÁÎþÃ9¡b¿`ú’™öá£bI9Œ á4¨vД5C"‘ ¦Æ¡p›2Ÿ³Ó”jÇ(ëºÛ_^ÛôÏ$ýü‡ï÷:øܶ$êÐçG"‘ÆR Cäàq†Ï‡Ï‡Ï‡ÏGàóáóáóáóáó  r±_çVßuŸ¢h³WÏ}½bßšÖƒãƒãÇøË‘‰)œÞà8eÊ|b¿}×;$|ã¾Ïµ¾Qñn%¿uú|W€Ï‡Ï‡Ï‡ÏGàóáóáóáóáóÀ&ž#ÅfÕ‹ë>¿óHš«›d&›ÎNKT«É7•ôp +]×mÊü`0hs|^Uã¾Ñ…kR’N~ÏîvêØùK*ùÝ=âói7f-›¯êKø|ø|ø|ø|>>>>>ìFM¦>ß]Ÿ/ +üÁñcôNKRb{F&¦xI?Óû¬P÷N{8¶ÿ]׃Á M™O Û\í»½¬Ó^rçxã¾QI¯uõóbþÖƒã>b®û|j2¿ßoçøÓ’Õ{fÂçÃçÃçÃç#ðùðùðùðùðù0+Lã¼M†Ïw×ççŸÌdé¥Xœi ýU,陘Âé "4ä‰3Ñlsöe> ¦š¦•°C;ý¿¹ûÁ³–ž¾hRÒ½?ÔúÁ´ñŒ`püuõ.ÎϹíómN‹€ÏÏÁçÃçÃçÃç#ðùðùðùðùðù€ÚE¢ñ@8ŽÇãu~ˆ¼àóÓÙéÁñcLæ#SáÓÒŸ¤eÔŽãžíÃGqž#‰Pgnïì¸w ÅGr™_ÚÐy ’kñN[çó^r縤{_ÿä»GÏEŸO '^ŸÐ¥K£§JèB¨¡h?<Îðùðùðùðù|>|>|>|>|>0 ñíãŸo¥©;!q>´@ÛPŠý>8~ ‘HÄ*äƒÁ ñKŸ-8bÚ”ù4àÒRt`}!¹î ŸoóI§LK:vÊ© ¾*]Í:‰‹>ŸÏŒP+{¬O*0/>>>>χχχχÏ4þð¦Ïo=(«áìKfh™Áñc#ShA@CݸÕäÓ;6K©iÜ´érƒÁ ®ë¦ÓØ*DFb¹_ð[«}¾O_4)éØoÚ®û|ô]&]<’.ú|¶Q:˜Þ®}ŸOgêóáóáóáóKn>>>>>Š_ÞôùGÒíÓ6”BÃ@îë +Z4ùVñnEÓ4^>7™Oã/_@Q”ÛاÄnÿ_>ßzŸ¯ûÚ-IIÇ~Öò ŸvÉ+³Â›fµ3™ÂYè)&EUUv}åHe¾é8ÃçÃçÃçÃç#ðùðùðùðùðù€º‚nBÃá°µ(¿$¼éóÓÙi‰öiêN á ÷u í—OÓ >·/óiåk _ +¹ûåŒÏ·þÔG%½:å¤S¦ƒßz'—Ñ=r0+¼iö`%zð£¦g»§–nÎåÇ>>>>χχχχÏÔš¦Aã;ˆ7}>ÑÜ«KÌO2“-‰D¢§§g`` ›Ízê»4e=7eWWš²$TU¥ž¼¤ÒnÞóÛF«Ì§wÄØú5åÏ·Åù[ÏZ>!éÒWnóùr‘ëB¹‘˜‹GÒEŸOXtŽƒ ++vX4'fPØñù´!É)í Ïÿ÷+ÎùÞƒ×Ô@δæ¯39ËFþCÈ÷çjÊÙùü€òЉ4äseãÕ?4ò£!–ùÉÆйWQÎÛ¸ê|–¦U4­º°iÕEMW-Ü4“E›®ºxÓJŠòðL.yxåâGV^úÈÊ¥F.Û¼âòÍ+–ÍäÊ囯\±ùÊ•[®¼jËòУ˯~tù5.ûÙcË~þز뚗]ß¼ìÍWÜÐ|ÅÍWü*ry8rù-_¶æñËnÛºô×Û–®Û¶ôömKŸXrÇKî~òÒ?<¹øÏ-‹ïyê’û¶_¢nWØ®<´CiÚñÓGž¹øÑg.Žì\´mç–gnßµpçs=½pOô‚Öèßs~ÛÞóc{Ïko=÷­ÖŸ¼S[êß6O]G¨úÊóFö +Ù“Ïî|¢–<—Ï®™¼ý¬,çžÈ3ù<ÏŽ|¶Ÿû–)Oia9o&OyBȶãy“gk>çɧù|s3ò¨-ùl¶ä‘|6²IH“‘…ò‘¿žÈyÀ’û…¨F6äsŸ%¹àDÖ¹WÈ=Fþ|<í<ÊçBþ`ä÷–Ü=“×Yî2r§;X.<žF!¿3ò[!·ù%ëX.šÉùõEûXn³d­[¬rËL^s³‘Õù„‘Ò²yE|> |¬ß‘ãé5Ÿß>,+æì<’.===]©T +gBUƒ¦DS›Äb±‚Ä‹ +…¬+áÛ’eXSþô§O>ÿ͵­ I—~ú¢Iÿɺþx nëósùý‚Ó 8X¢/ñùš¦ÑgŽÐKëã$}>‚ ¨÷ÏS¿c‹ R{Áý`n˜|¾¢(åáH±Y O¯ùüÁñcù³ëÀ˜›dæ0“Éà?«ªASÖ ÔŽ===hÊX,fÕ˜å@k ‡Ã¾R å ®G”ùÅÆÖ” <äó­?uA»¤?oÜ7êóåBgGro‡\?æ.ú|:°t0y•‚üÒ¥¤éŽÀöÍ‘KºîbßÂ:­ƒþD_ŸÞ× Ø´ëFáó>AÏTÖúü2©üM±7§×|>¡vŒó?ô'G6‘J¥  k4emÍfë¹)u]F£¼>™~:¥ôK-˧M[]+ƒv/ ‹í!kÊo|Åç[ú¢$>Éã>_.ºZÉÄÜ=þîúü\)W8´d…÷?¸T0QŠ¢ÐvM¥ðùŸ ‚Àçªøüy:žôù»ŒIÐàø1ü;jMÓTUeõÏŽP´rfDí ãñxÁµE";2_$´tÓÊ Ý’Îü» ™ÀiZn·ûwîú|qÖƒ×|>o÷P¨Òs(ØUŠé>AàóAø|@A7• ŽRÌZÔ ^öùGÒÔ6”¿ zÑu=KÊæm +sÉú©‡g¥þöQE²QîuíÎÈèÓÖ5î+:ÙŠþäóåÂ竹^ÕõqÑ竪*¶;R*VŠ@gd›µ1Сp¼>¨^¼ì󓙬Äç7÷êh>@õR° ŸëÜ2Ÿ5ÏÁäª 5JËØÙ½‘‰©]Æz¥û» »%=ùÊ c'2ý‡è‡ô{ûðQw[ÄEŸÏŠó©É¢Ñ¨NÂbgfå…Ž‰u»ðùê¯ùüd&ÛÔP;Fû’zÙÜ«KDP:;T)&ß®(Šªª¦:ä9‰D$5ÿÅ q¶ä{×±|þç’nüêköÞ|ÛÓü¥»-â¢Ïg¥¹ÂÛµïóËœ-27Ø%Šõ|>€ºÅk>¿}ø¨X~ß6”’ˆ Î#iþÁd&KAƒª…H$Bo(rª${n&Ÿ=Jp\Õª£’Þ›'Ñôo-oìöȬ+×}¾³Tì0«Ïƒž¢%A¥ ­[ÿŸ nñšÏïKf¸çIf²âKkZŽ›>Ūú ~Ðuzò¹™|¿ß?ªvdbÊŽÌß²7–|æßøËý‡'Ü=’.ú|æÕ]ÑæÞ$ÓÉYlR|>‹ÅÂápƒ¢(š¦9¾¯ùütvÚT~/qAjÇ(ûTK’½³ëÀÎ@@ƒB(òûý¾9ACŒãeùŒý‡'ìøü—žòÝö?ñ—Ôÿ»{<]ôù‘HÄ;±ëÈe~>PÓPHãÑ< Ð`Î4Ðý{Á¿Òõ+Õ³Bï;kõ½æós9O?%:hdb*÷uw”Ìdq‚j›h4ª(Šo®X,æünˆäzÕ\F—÷ÛdbJ4<âKkZú“ìS¦ª~; t¤Óiœ“U šMYÛP‡¯ªªX³77Eqv†× 2zn§Ÿùü‘¿/´Sœÿôs¯· ¥ØïjǨŽ³‹>¿Ø¤¼bØ1ðö·kgmlI:…\9¦=„ÏÔl––”èx„b +=‰ð‹7Õr‹‹Å¸ÕwêžÚƒ>ŸhêN0ÉÓ6”_L:;³TõÛ¡¯¯™CW;hÊš¡§§§š’n½©kUËÖŒñxÜô0wÎPo§¢;Ò’4¾”lxq~‹ïÝ®íøü×^ý˜—ñ·÷BÃÁçϺ¤G.àóµG±À© Y LŠ)tEQŠÉ|†®ëÜí8R­áMŸßzpœIž¦î„ø²`ú’Z&™ÉšÞ™•±±±¡¡!œÕš²fH$Ô”ÃÃÃÕûâñ8/¤Ÿ›Ò§;÷p8\~5>ƒ† ›*€6:G]lçGWÿoÿÉwN[wß«‡ìøü—^îá¿LLy¡í\ôù‘H¤±œÒ;6}>?2ðù0Oˆ£°È|M¬%Rì¾Øï÷Óû@@òÙh4ê`µ†7}~_2Ã=O2“_Zà ;MUýPaâñ8ëÆKõùº®G"‘P($~¼Lh(¡uÚÙº¦i¦Y4ДðµßçZ|ÓÖù|ë)û>ŸUæ¯ß½÷sñ¹­pÑçW:+ò𫎆âˆç†ê yŸ¨=h,¶^85#”O1…ÎއÒÏêº>—úÉ"xÓ秳Ó\ûtI‹/­á.¨m(å5;¨"‘ˆx'Nꬳ¨èæ]UUV#í ´B›&?g<#w›~·ÿÙRZ®Å¹î &ómúügZ»G&¦ÔŽQÖÉ{¤ëÄç‹_³$èÜpdb`ùÀçjêŸÅÙy¡PÈ#½.ÈÍæógõ5ïó‰]Ƙö™˜¢—-ýI‰Jf²9KU?N3@ňD"¢ù¤{ðY—ïÙ‚¶[ÒÔ­p8,~< ÆãñÒ¾y[ƒXœOùæw[¹¡{mkBÒi¿Öþ…±N|~.?°$EÑ4Í#ûŸ¨ah ¦ñ&ÀkSèlV;êóƒãǸ–o>*QCûO°Åø;ôYœf€Ê`’ùòΙnÒYWï ~¿? +•¤[­»1—:ÀCÑ\‹O]ù}.óóy±qßh±›þt$®y®=ãói7è2€ÏÚô»ªªº&‹ø9À£äG<ó|>€ +SL¡³RIºy—|–‹£h4ZþžxÙç‹ŒLLI|~s¯ÎcÚŸ^¦³Ó8ÍÀTâN]t±%u]…BΚü`0H[,Õôjšfz Ùm»ú–oøO¾Ëäó¿}F\Òc¯Ü0VÊ‚ÊáºÏ§vä¿àSÕiwÍ6çHy@%Ï€*BÓ´˜£¸2™‘ß›‡ÃaºæõoôíèMúS±{vÚÛ@ À>^R)f1ªÅçjǨDñJ~¨¼ UæS¯ÎºwG €†9¢¸ƒs/Ànñ…ξÜRœ¿~ášÏ%Ýõé‹&ÝxK;,•ß:ïvÎP(äàFÙD€9>Íqø|¨"Lò¤|bn” J ¿·–ßÓ;Á`ÐYý^E>¿õà¸Dµ ¥ðߨ0¼šZRâN£ ïºË„¶ +…ʶt]W…Fœ2 ³ãÛ~a•ù>ß曶ë’îúœ ¿òfkºëóÅs‰ÚE|ÈB;&Îì¨:ýî8ðùPEԆϧoA÷æüæ½ &ÍbZxîå”EŽ§÷}~_2#DMÝ üw*L4õ듳 Ö‡¼®ÓаÃêóO]Ð*é«oÚ®—÷ aqÑçG"¶]EQŠM¤sŒ=ñ§ŸuþŸ¨a¨·wk +9À_„®Öhè^ž¾ÝÈso/ñùÖæU‘Ï'ÔŽQ‰&™˜Â?À#°ør†§`0‡zzë8±Øg…Šóן¾è=IG½pMÊíQWò\óù¬ü>ÈßÃùx¸C+o”Bg£G¦ÀçjêÛi à#õº°ú¨yølt¿ßO×?tgªiÿ+ýN×Hô>+oóøŒuºxw>—÷ùôÓÙÕåóÛ†RMD-im‰D¢§§g`` ›ÍâߧªAS¢)½F<ƒsÓøÔ«ªj<ˆ¦% úü•I:êoŸq̳ßÈEŸÏŽËöˆ.fÜ:] ðK#9Þ˜\Ÿ¨=èÊÁÚë:ÛÛx ºÚá&D^É@åæßËJß]ãÍG…Fuùü‘‰)‰&jêN”´¶žžž.ƒT*åýïДhÊj!Ú´£Zž&ú`uUâÅbŸ56¾Xp¯èó÷HER/×|¾ý ƒlÔvpÈæWDv@}>ÌÅzc”è VÑ4]ðƒA›×<ü’Éû5óJuù|¢©;!Qú#SöW588ÈÌa&“Á?QUƒ¦¬¨{zzª·)y§jßä;åHiøSU•:óJ–óÅZ_eþ7¿ó˜¤‹^¹aÌËòµ}>{lÓ@€ÖL;Àæ•Ð‰ËÃfÐOï8%ø|@íÁæb[qvj6€wàþ$ÚüÝ–²„B!º*òùmC)‰,¢¿–´¶T*\ )kƒl6[½MIÃJ±›ñb„ÃaG©¦i4–‰“*vûÿƒÿ÷gÑ矵üo’.úôE“ñ¸w[ÐEŸÏÎ;b˜owê‘ Ûn àç!{Çtþ°K…J>'’Ÿ¨=ødsu^{€†+”9|Šnc]Üsºe…B´\ªÏZ¨É ¼#;Pu>dbJ"‹šºøwT]×™hµ u¹q'Ôv4-ø!^on*Χ¬Ü𾤋>ó’ÉÁñcžmD}>‹ý~¿ÜÛðrzûÕ rØ3 UPâ¬ßú<ˆ]¨Ä½ñ<>P{Pÿ/>—gPŸŒ#€Z¥Ÿ_ùÛvN±2Œ`0(¹e®sŸO4u'$¾¨/‰"m@E¡›?–º[Ÿõ¹­-ÒRp£Ô™W¾8ÿ¤S8}Q”"éœç<‘ªb¸èó5Mã§G±æSU•-#–Ó—‰u6»* Ÿ¦%Ù‹GJôáó5 õÆâÈ +…œêí<7ó%UŽñw÷¹˜ð)výV‡>?™É6u'ÔŽQæêÛ†RSÔzpÿ€òá–^®ßi1kA]1‚Á`ù÷æÑh´à¨A7þòêng‰<ôKKÒ›-î¢ÏÏ Ã1+ÈTU5–‡þ$§Šós…|>›`½$`»ç‘Kø|@ C×Ô-Ãä æáwÁ¡PÈæGøm{0¬ü³ûe.Òé%íÝ¡Óþ‹ïË¿¬³‡ÎË>¿}ø(³@ͽ:½™˜’˜"µc”0™ÉRð(S/]l±’d¾ýJŽ8R°jmêÉç÷Æ?¥ÍD@×'ýþ¹Ï_ÛªÙ÷ùÔ¥{³ÑÝõùÖ–-Hù“;DXi¸N:‘ +H°%áó8Ýu–t«+ë¤ò + ‹ím,ãû¦ºK­CŸßy$ÍEóóͽºD±2~ú)¾›˜´j±a"Ú—ùjX¶]Vï`©vQDr-¾™:±­;nmá2ÿÔ›ìË|ÊÈÄ”7ÛÝuŸÏW,Å7=¸q¼¹Ãá°õIS÷t‚±º}]×ù¥-ï…–‚Ï€€Ý~òHMÓ +.ÆnK¹¡_\™Ì(WètÃ.Ù½:ôùéì4AGÒôÎþÃYÔzpŸhéO2´ëÀ½Lf²³ú"kU?HˆÇãâ0á÷û‹•CÛ—ùÔµÚyj¬išjàÊ#æ¢dôÜ Áã2Ÿ2co7œõ°èóWnxß¾ÏgÏ[½‰w|~%¡Ë :ñL¢¾àîà“2Ï€Ú@×uEQ¼_0Éäi}>‰À´ŸõéóyA>¯ílîÕ%ʨ/™±Võ@1¨Cæ½.Šüyë¬XÈš MÐÚh[ö?RQÞçZ|ñ?.PÎ….¸M×'é½è“/‹2Ÿb_æ{¼7vÑç³R|:j ºå¤›b¹É…B.Ö@Úñù9¡:ÎdÚëÓçLL‰®>'~I (wþ¬ªßD6›M¥Rø¯©vДhÊ2‰F£¦é]ÅÆ>‘ùš¦ªEñJcˆäZ|ú–oN[Ǽ½ª¾§ë“÷Š2ÿ» O—äóÓÙiÏž~.úüªˆ½|> &¡kºx`RéR¤Ø$A€Z….‡"‘H8nhll¤ë"M>ß7vç>k%]ȱ%Å˹úôùDSw‚é ¶¡×—Ìd%ÊHíMg§Eço]áÀÀ@—A:êýêM‰¦,Q­óð4vÈ‹¨Å#­‡w¼V™ïÖÄ13‰x®ÅGQÎqu‰tݱîSqþÂ5ûìËüæ^Ý˧Ÿ‹>ŸÍ.ôûýè쟨=ÄÙÙv.'@… ìÎ]þp»Z’KžºõùmC)f„šºì^~_0GÒ¢ógUý"}}}Ì¢®»ÚASÖ ===®4%ï ‹Ý8S_Í°ÎJ$)¶!êÕYÿoš2æ…gÍ'HÄs;ý¹_äº3¸·ohØ¡õ šd>em«fßç·õòéç¢Ï§!žm—NEwý 4x¹¥àóµG8.8¯GÀ#pw éöY²$¿´ãJ¿n}~_2Ã¥P2“¥wÄò{kZŽç„ª~öRdlll```hh'dµƒ¦¬‰5åððpå7M¬¦iÅþd-™›ƒÌ'Lë¡ÞCŸ‘Ñs»¹_ü ü'ߍ½ßÿ ¦%• #&™ê‚Möe>edbÊ˧Ÿ‹>Ÿ 3‡tV;ç 6gÄtršˆF£Þ)…ÏÔÅæÊojvãI7§Š¢4pÁB¿ðBww÷P¼qƒ¡P¨`9œ©(4dPŸ>ŸàRhÿá z)–ß[£vŒæ„ª~öJ¾̧Åh葯¯Šº\/ FèUs->}Ë7§­ãÞ>ý$Öúºµ8ÿÛgeáš}×né—ôÃk[ M¯ŠævÑç+Ë,FÁ€9@\æ³Çü ÜC”èÃçjq ‹¾pdPÛHª(M>Ÿ¹× +{ú î³dIú +¦oçÈ>T—Ï'Çq™Oì?P“ð>™Pœ€ÚF×uQwÓpÃï|M~F¼uÚ º~›õöœ¾c$¡¯ÀÊõÙtÕù|ÉLVâ‘š{uZ¦óHš~oêNÐÂøOÌ +u¶öý*uÈ´|Í|wU}‹ú`p«®OF6·Kd>åÇ×i’~ø–û&«å»»èóãñx¬œšcÈÎsÓåGÁ#À®¿T /N6lÒŠ}mŸ¨U¨{gw…ÑhG5õbá=¿7ïUéMnþ@·j÷ù9¡ü¾`àð%Çih°)ó©ç¬%™Ÿ›Þd–ÞïPÓ’Zß ÿ令>óµ[’’Nxõº¯ªå»»èóÝ‚]™Dze|¾¦iÖ§f6? ŸÕÝr™/Þ–ôù¹¯ósù_«Ð—eeawÓ+V¬X´h‘d%Ùlvtt4•JÉ·E Ðb´p%Wõü'£•Ôy$íÊ^aUXVå‘UE£Ñ‚unWE#‚8ÕKN(ª½Ã·Rè—\F§_äÅù>ß‹’xmkÂ4ÆzùXµµµÕ›Ï/øe ¾‡ôùtÙÆÿÑèZm0´¿ò2}þ³;wÒ§ayçíw橇Á±E©½ÔÉE2 2¨ªZÐÛóù9CÚ°?)ŠRÛÇZÿf¥«««££C²’.ƒt:]l™T*Å–¬äª^éøDb“žüè°+{…UaUX•VÅ$¤ÕO\Ÿ¯dZsÍö;Ö½0›Ì_ÿ|@Ò/¹s\Óæå ҟ쬊þjU[·n­7ŸÏ®ìÔçƒAñ´/>§’®Áø ûS]ÊôùâÇy@½žz[AÚK\$*ݲCÓ=©ÄççòÓÌï‘ìÔšvuu HVÒÓÓÃt‡¤Êqtt”-SùUýåƒ/$BÉ­½Âª°*¬ÊÅU½õÖ[gžy¦ØÑIV¥ë:Œv'v% ;{Õ××7ëôÔªb/uÎ*óC¡/½í¨¤û½ôÆ´g¿ uUÍÍÍõæóÙ/>Ó„a=üjÊ‘)ôïÆ+óí;|ø|ÏGAàóÕ/A7½/÷ùÅ>åeâñxC›¡»ï†â:ÍÍÍkÖ¬‘¬$‘H I–Éf³ƒƒƒ´˜D›ÌÓªv“¥}½]Ù+¬ +«ÂªÜZÕž={N9åîfý~¿ÉCŠ«ÒuÕÛVF­«¢-.X°@RÀìñÃNË‹ïëúd`Á½r™ nU”îk·$%Ýïêu_Ü«±±±9ìÕ|¯jïÞ½®û|:QEaC³„‚W5s@Ó4¶BU°â¦#@ÿŸ}³’¢¼÷ýþ­JÝηêƪS™:§NYÇœh+˜_`xµ£øÆ‹´ ¢Øˆb≎c£¶r_0Û®q±MÜ@<‡ã\B¼$\“,îÞÅ°Í!ìÉ:=›v˜0÷7ýì>ôÎKOÏìÌÎtÏ÷S¿¢všž~yúy~Ïô§ÍŽ§lýžÿmVö ’ðù|>@ àó~§q|>?£J6µ Ûš÷uÈþφ\„RÛá¼ßŠÅbÝÝÝ.žø\J\J'ªª:Íg(ÊzuË w•^E1ï¦h¡óM¨\é:­hq¾®ÚÔô‘Kî]Ó{î¹>ÊŠÏ°%QRW¬”ÏO”賟š¦qÃωvÄûv¥vÊx”½Á +úü '|ù¢_ F|yÆå—L¿ü²é—_>íò¯M›ø©¯š2aÒ” áð„©á˦O¾lÆäË®™té¬I—^7éÒ믾töÕâ W‹7^%Þt•(]%~ó*ñæ«.¹ùÊKn‰9vÜÊãŠKn·ÇÅUˆÌöoµ€ Û7íã¼ÉŽ탟}uæDèt®µÏ‹Înæ¤Ké4§Ä´ðetîS™F˜l·ÆÕS&P³\9eÂS3MDñõ©©¹¾:m"µÅÄé—O°›±h\ê9Doq‰·¸Ø[|Å[üëôË7¼ùZ•ÒšÿÇTV\^øW/1Ý-¾Rz\ì9¼ôÉ¢}»èqh +ÇDgL;——™±Ÿ_ã1u8¾žßÈWŒŽ+1…"“²âêÑ1itLæÎDxtL9”è2éÎÓx8²bnÌpÄÌáÈäÒk1Ë×:â:v6æ1{8D6Ñ°¸‘ÇH&¿id’F¦!7çLI·äLOÎjôÄtq=Ÿ+³çPgÜz…c¶uœàœ-iœ‘¶â ˜™GæG{Š¯Ï™%3¥}­³fIê]|Šdó#u{63ÒøºøÊKàóUB–evoH÷¡Îåî>Ÿ×›ùèLáóó2”:ëâ”6ˆåýVGGG»{ý*¨p)q)9|:àÀ.ź®;=¼;…6•%ó Õç×û#é]R:fúíµÝEe¾ª~LñßvɽsÖ|ðA—Fe }>u-ï]±²>?wÔä…Ö©ÔîêÊç_zÿìðß +FÌØñè7ùÈ‚_¬^¦¯ZýŽòøÛ+ŸÞ|¿Úºâ•Ÿ,×Z–ýT[º­ùÞ÷__òÁ¦{>|uñîWýöå»?Þx÷7È^ZØùï ®¿ëÐú»¿¸àÈ‹ó½0ÿ¸:ÿ„:¿WÿWu^ßóó>{~žõÅÜøssûŸ›û·g‡c w&ì8Y¹ ÍÒ¾h¿t~aþ‘t¯_@GHÇIG»oƒüûòï^¾ûÿ¼²èׯ,Š¾ºhçk‹µéž_¾¾äç?^ònó’·›ïݬ-}ëeo´,ûñ›Ë^ýÉò oÝ·þ­û¨5žÝ¼â›ïjËkö5Ñco¯|tëƒÔ\Ê6åþwW-×W-yï¡Eï=´ðç«yÜÅâ«dâaŠù£cžsߎ;sâ;n‰ÛFÇ­#1§â‘[râf;¾IñËLH£bÍM#q#Åö57äÄ쑸>^7:®Ýþè[ÿ³J™mÊxuþ)Œ_‹©Ùñ(ibº{ìÈÄŒÑ1st\S(¶?:Ë×:âº|q}&ØE?ײ»ë6vðŽ4ªƒ±Ž7Ò oÎêœï?2‡ú­£;;6ëí¬ó;‡ÃÜ_d‚ç8ZðóÕ F†›sÊï­¾ÛŽEöØd±ø½‡î±cÉHÜ«¯¢Xª¯Z64œ—¿»ê>;VŒÄýÛV=°mÕÊ‘xp›BAÃÕH<ôŽ²:>lÇ#ï<¸fk&µã[[W~ëí•ß¶SÅ¿Ùñ·W>nÇo¯Œü,Of"“dÖmyà»#ñÔæ¾·ùþ§íøþæû)ýÐŽg6¯xæ§+~ôÓÏÚñ\ëŠç[W¨v¼ÐºâÅ·V¬ÏÄ}ÿþÖ}/½uß;6¾ußË?YþŠ¯¾¹üµ7—ozsÅë-Ëší œOٯŎ7[–ýäeo½A)qi«¶t³[´¥?k¾÷m;¶6ß»-™ä©ÿxÉ{?Î$Ò_¼¾ä};Ú^_²}Å=;6ÝCi–fÿØ´ø?_[LY÷¿^[L³ eàÿýê¢]v6¦øÍ+‹>²c=ËP¢Þ»ñîÿ›‰LÞþÃÙØ Ó¼³oÃÂý¶¿”I韼´°ãß3ÓÐÿ³g"Š?Ùó¥}óÅ4+õÐÄôÂü£/d¦š›øôôßê|š&(bö •™žì‰©²óQI‘pÄÀpd&Ê¿9‚²ßžL)¬áÈœÂgö¹PüõùyÿmŸ`¯}¦ì”ÿl·µCÝ&Ô8ÔDŸÚÍEM×a·$5é7,¤F¦§–ßc_>KÒµ£ëH×”.ñ;Í÷nÉÌ’K©Ÿ¼þæ2êH/ÙS$õCêŸÔ©WS·§A£†Æ—ôÜ]ðù€*¡iZÞ{CŸÏ+Ðüå±é°##TdƒÁðùDs§å¢•N žÉýJOO3‡ÉdƒÈ×àR†îînºŽå]Ê,-éž'ùÄá…B–>ë‰@gUHZéátkS&ÞËÿkÜøÍïŠÊüpxK:£ O-^û.‰÷†e+ûRÖ„ú|>Sw¢¿³ŠÆêÉ…Þ CRKwæ…;’þà?i¨ñ½o>>>>>>>>>>àwxaýk_îâóùí$Ý]6rÓÆçï>~ÒE+ííÌû­D" p)ƒA*•*ûR:ý<ÍîzÐKA2ßT¡i"ë‰@½Ëü˜‘qøLæSlsW1Œ^AXï.óiË:•YûD´õ7ï¹$^å™ÄßOù¨ûÕÐçó¿a*m–fù¢/P ЯI’Â6´¾®ë.o¸” +ÿé5Æ7àóáóáóáóáóáóáóáóáóáóÀYÛÆ5N^Ÿoš&¿£¤;h´[0|þ‰Á3.Z©¹Ó Øp»î.Ei +EÑ»Ì/´©,™_Ô”Ö˜C7ùÖ¦óoº4£÷GcY§Ä~²hq~4z„òmÏÀéôþˆKÖõcϯö#!UUiûÔó³–S÷¦³·×h˜Ð þ"ý¡¤â +ø|ø|ø|ø|ø|ø|ø|ø|ø|ø|@0pÖ}I’¤Úð{d^uæ40%½ßH|íó·êÿþþÚz0Î>n<sÑJC©³#Êù”Ó\䤮ëìe./ˆ¢X¨29«¼¿ÞßóÚ#s™¯-È´|$òѨu’–(¶•ùŠòaW<É]}QŸOá£þSCŸÏºeI5ê%Áæú܉žýpªÞ~]f,û…χχχχχχχχχÏ˲²t½{Õe:…èhª½G_û|âIúØvxÀÅ)íÿlˆ}k(u¶gàt<™Â q ìª(J“gdY.$ó ÃðÌOZéí"—ùʬ¹™‡·8W”çþ´¨ÌÅ–ôȃTú|°_/Õ{˃•7侓ŸŸŸŸŸŸŸŸŸŸŸ¨9š¦ñW¹ A7°†aÔÉÓ‘°7Ð]=°× \ŠNËÆ×>Ÿä· ¼j4o°uø·Ô}}¨Ø A 4+Š¢w™ï®U)óä\×/yÅŒôV™|kÓyáYæ”óšÖÎW|ò‘Ö¢2_ÖF/­LÉÓ»Ïßy,á£~RCŸÏvM¿^ +=EûજËáóáóáóáóáóáóáóáóáóáóáóu‚®ëtÓš%pè¾UQ”ú1ù¦iºhüB%£•µú¾öù;%˜2R÷õ¥íÂ{­ÄÖI;ªúyÅ> Àhš&‚÷4ë¥Þ>Rò¬Æ3ÖJ²Kb2ßxú‚Ðÿ|ÌiæuýSGû´•ùì+îMsƒ½<åjèó öþH–o¯ ü÷ ÚKĆÕ?ÐE¼Q‘XðùðùðùðùðùðùðùðùðùðùàG Ã(I19Ëõ+øHÂ×>ÿÄà™,k´íP¿‹Yê8Më4wZYû€ ÂiM²kíÙI·6iK' +ç¯ãZ^[X™=Ãøð/2ŸóSÚ,Éçûë5¨qðù–eE Ô»(Šš¦E])ãYRÙ¿:œT¤’>>>>>>>>>>|݉;o«%Ibeo¹*‰Ö¤åªªÒ:ÕN¾öùÄÆ1§œßÛ;èb–vKÐ:»ŸÌªØ˲JzJÅ@É|›ï|©å%I·¬Sü?pªþB!Ë;øW(mz—ùÍ–¿šk|¾sãïÕé…,Ëðùðùðùðùðùðùðùðùðùðùðù€šcFØFÓ4_¡5ÙWj"pø µ$IÞ«ì,ËâV¿RúÝï>籄SÎÇ“©¢rÉYÕÏ*öƒ{(òn))µR‚ X#(ʇN-‰|äü_Mk÷"ó%Iç_éŠ'K*ÎgP}Dà}>ƒ½#±aÄ~D¼A_{#ÀçÃçÃçÃçÃçÃçÃçÃçÃçÃç¿Aö~o8öÛɱÀŠóEQ,㻼â´"O"üîór¾+ž¤%Í–‹_Š'SiG‰éûŸö%>3N —T*ÕׇKðKÉ^VòòTÓ4ç PEQK÷¾ ÞÂœ¼ ¬×õOG7Q{Q“O!Š-¬žß0zé¶Ã%ùüß™'ü5*ÇÁçóòƒ1â½z¡X' ÿ!ø|ø|ø|ø|ø|ø|ø|ø|ø|ø|(Ãçó +ùñ÷ùt;Ïv]Þý8ÿzE”ß}>±ñ@Œ¹£¶ÃiGÅ~ÞØÛ;Hëp+µÁøK{{ûÐБ¯éîîn·Á¥ ê¥Ôu)zú×} <§y! +Õä­ñ!S/¬ÅÃèÍZîEæÓw™Ì—åì#ê1þÐþ‰¿Få8øüzCQ” +>ð|>|>|>|>|>|>|>|>|>|> ᯊ3¸œ÷øÎ8ÝÀVä¥õ²žíºì÷Ö+xäðù\à«ûúècÏÀi¿ÔÜiÑ:û?:gø÷w ®Ûïtuu1 ŒKéw:::r/¥3c»ˆV˲$Iò.óiâ ¯4Z {—ùì)€ª~Ì–\þYI2Ÿ=-õרl@Ÿ_àóáóáóáóáóáóáóáóáóáó HI˜îèº>ÎÏAy»¶, >ßɉÁ3Ü õ œ¦%îE¤ñdj(u–üõ¡¿`@ùþþþîîîcÇŽ¡)üN,£KyüøqöÑ4MQ³$|Þ/RbÌZÓA\ +’)+R>ÿ©að(ó)týÓtæu°^AXÏ–\9÷—^4þ÷ÚºYþøÈ_—ÒÀçðùðùðùðùðùðùðùðùðùðù€¤R>¿&› yI’Êøº¦i|ŸOl;ÔÏkÃ.ºioï ­Óz0Î>Òw1 ¨C(Å ‚àE—$óiMÃ0 +픿í<£ûäcÛ=Ê|Mkg_žpËc×µ}ztÃÞøœµn öÍöoÕÐçSߦž©SÓ¦iR …B¾~µ>>>>>>>>>>ЀÐoØ79t“ö†$I.õ™Õ†°Zâ}¨a\pUäv>>?‹®xÒE71í¿·w}l=Ç€ ÞPÅ£„/IæS¢+”9³¶C™¶®(i¥wI™H˜E×µ¬S’¤—*óey_¨Ìº1ÝÚ”>U”ô’Mq—»cû_ýÛëjèóé7‰Ëë'NèwNM^-¬ uåó/šñÕK˜¸bö˯/¿næÒY×/™%Ý3sÎâ™w.š¹àîwËÓïY8mÙ]ÓV,˜ºrÁTeþ”Õó¦<2/üè¼ð·çNþ·¹“¿sòwN~òŽÉkîŽÉOÝ>ù{·O¢xúöIß¿-?¸mÒ3qõ3,n½úGŽx¶ÒAÛ¤}Ñ~鞺}ÛöAÒÑ>6wò·æ…×Ì Ó)Љ¬š?…ΈÎëþSï»kêò»¦-]8mÉÂé‹åé‹äéòÝÓïº{ÆüE3æ-šA­qû¢™·.δÌÍ÷̤&ºqÉ57,¹æú%×\{ï¬kî5séµ3–^;uÙµSf±œÅu“½Å¤œ¸:'®Ê×_™W8ã¾ë¿‘/¾î!¾–‰ÙYñÕûfoúek•{™Ërc…טPJL,%./öÅÊ_+™‹þuo‘·_}#«ûåtÎ|}xT'Ïn£†µÑbª#¦9bº#f,=3³ƒ†ö¬k–fÆ8Ŭ‘¸Ö×%O;®™=7äÄ#qÓ=,2É„Å7G‚2ÌÍ‹gÞ2sFe¡[eâ6;n‰;ì¸s$æÚ1/3xP6›÷ŒvÜeÇÂáȤ;Yž~·‹±ØŽ{2A&–dbÚ½vP¶\zWfv X~.2¹ô¾SWØA©õ;VÚñ …uyP~h^&VÛñ°ØYz=Ñð Ôým{ÞyÌÊçß±ƒæ 6 ±ˆØó›’جô];ì¹éÜôÄf¨ ÏPÃÓS5¦¤²'²¼Aè3#GûÃá>‹Ü6<ç²³ûž#èÜY#¬³Û„µOd¤Å¨õ¾c·ç·íùñÑ‘)òaûº(ŽYr…=KÒå¦>°xáð,I}‰O‘l~¤ŽM]ýºÌ´8‹Æ×·M†ÏT ~^ö½á8CwâN¿¤iZQ9o†³pTQ”ŠI }>¡îës1Nñdj(u¶õ`|ãXW<‰@ýëç)õÊ”™Þô‚KÚ4M3Kæ»Ôðמ„™Þ.f;Åž"Ø0zeöe~$ò_(~i•µé¼ôVöû¿þá¬Kjìê«ÐÔTjèóY7öRfÀ~ øå×N^êÊç#ˆÕª4ØѶ¼ðño}@ýá;ŸŸ¹%Ï*@ ‡Ã‘ÑÐj´×äó5+RœŸ®Ïo;<à"ööbÔPŸð¤Ä¼º‹át¾¯äNIÛqy .ˆµÎd>Åïݺ®*ëK•ùô_(œ¿Îxú‚ÌŽŽfJÂ/ +»½ý4g퀇óú¥†>Ÿí”Àãñõ”mšfÔ†þ(o ðù|>@ àó~‡n ™ýör/\?¨ªêQF9‘$©R2?\Ÿßw“NÍVN€ A‰Ñ‹W/Iæ»lGÓ´,™_Á[y²dþv1,x´Î{÷„õÑè‘‘†íuþ×°Ìß%¥3¡ÓsÖº=*½(œôP`^¿Àç×ôÓ®ÐÈ…ÏG àóŸhL4M£ûb­¦ö=‰…BM~ÅXÕçê¾>ïO¦0¨C,ËRm\¼ºw™ïîç)ÿ;W–뼸Ü!óµ¥™o×õOóµá)IÒ½Ë|Ãèåß ‡·œ«Ø_:1³»÷Bì© ¤×´Å\òêç>¶Ü‚뺠†>Ÿý ðòƒ„½ÜTŸ¶Ñuÿ.¢?r­þ}þSk×Ѫ“¯¼Šá¥_¹¸Ú»CT$èJñ«FW°qN|ÛÖwª4¢ÑÕ§cœ}íuEקuœ_Aú"0¥Ö[ò'(À_Ð=#+ݬ‡ƒ¡ÛUö|A’¤°ºsgïT©d4À>¿í°[éÞÞA üˆ®ëe¾»Ÿ§¬ë\YQ”º>í|2Ÿ"ù(kEÓŒ‹bKy2?ÑÅ;Ø=yËÌÌîh§´ë̳ô/<ã’T—l¢ýú»kÕÐçÓÔïe"¦_¬óÓÜÈÑM- ØÐ0gW„}Ìú 4FŸ?ÐQ9}Q /Vð¨ÿ~Ð@N9ÿÛ={Š®Oë ÌØw`J€FÀ4MfÅ‹¢(J­nÛëŠûü®xÒE=5wZ/øŽ¬Šú²e~z´Ï¯í‹ZÅ) ósëó£Ñ#‚°¾l™OXÝ¿¥]諾Ìv—>4Ü2’”ž¾ô¤KR½rî`?)J }>ïØî]‘ÿtaº;x°B 竈ªªæ6 |>¨P¸ÁwÀç7˜R ðp5]¡PCOåöù„º¯ÏÅ>Å“)Œ|DeþpŠPUI’œò°I˜…d¾¦µ>=š| +Ql±¬Syv·K6ù*_LSÄÊÍ–KFýâ…gê¼!‹RCŸOЯ¶kµ€;â2?À¿[˜ÏϽ(Yï#Àçƒj… Ð||~#€)‚®ëMeQïe™U&Ø>¿íð€‹}ú¯?õvtttww§Rûþ&‹áRþR:_ªªˆÌ÷ '¢Ee¾e’åÞe>­\pw{äa™¿gT3¾ülÌ%®i‹ ‚ïGem}¾ógL(¢Ù9:u~nû\œŸ†Ï5 + 3øøüFS*ç­®(ŠtKÈ—ÐáAà«Ñ ²iš ÞnÁöù]ñ¤‹€Ú`ü¥Ý&‘H`ùšŽŽ\Ê:GÓ4–“Ýe{¡KIßò(ó³¼_HZéí¢‹Ì7͸(¶x—ùYUýyv·?â¬Ìgüñ÷.étÎÚIòý¨¬­ÏO{{…~º8QÀ烅 Ð||~#€) ¿Á0 ¾œÝŠ¢è\Y×ufõ³–7&Áöù„º¯ÏÅAíÝŸ1NÉd=Á×ôôô0sˆKYo˜¦IIÆù ÕÝ”vwwÓuìèèp^Jï2?¨ï[iZ{!!o½‚°Þ£É§5iýòŽÁýu§‹Âɬ¶Ï{)뜚û|v ì§K.¡P(À•ù ø|PC p:ƒï€Ïo0¥@€áR:ëŽ/·,˹Ü0ŒÀVr–ÛtAòùñdªgà4ûÛÝAí>ƒ‰D—²®ˆF£y=¼{ªI¥RÎKI©[Å—ù†Ñ[HæGÛ~-œ¿Î£ÌÅË:å}¿C©³”?)(£¦‹=ìÊüïÞÞÁB—Ò/¶æ>ä¢4;óW éïÀ›||>¨!P¸ÁwÀç7˜R ÀH’ÄnÀÅùi»Ÿ-§ûÁ¬¯pmšf#7]ð|~ÏÀiæ—vKÐÇ®xÒÅA5wZ>TMÓòJxZX’r§|žUØ߀2?ñ™GòÊü¬¢}÷å¥îw÷ñ“,On;ÔbðŒK"åÑz0î󦮟߰À烅 Ð||~#€) 9=k9¿7Ï­Ã7M“ý—ÚØ?Ò‚çó¹ƒR÷õ±%îe¥¬ôt(u¶gà4ûP6ykòiaîCUw4MóhòA(uã¾#ù(Þ¢ëŸ:Ú§™¯ª—±Sž9Y•¾Ÿ¿íP¿¯Û>¿æ(Š’õkÄ0 Z’õÀΩÚÊ/ÎgŒ@>ø(\€Îà;àóL©` +ù|˲ØrºCÌýV( +’Ç.àù|giÏÀiZân¢ööÒ:ÄØ#€¡ÔY (ʆgcfÚ)ÔñTÞ‡…d~ÖkY Jþ’$ÑÁäý_¿ã]æ ÂúhôÈè–9¥ªG"Ñ.»ØÿÙ3‘º?åAßòuÃÂçûø|Pí~…‹Î€Îà àóL©`¸AÊG.²ºÐS€†"x>?="ç)vKÐÇ®xÒE@5wZ´ÿH+c@P6š¦ ‚ ŠbV=­G,Ë¢ïŽQæÓBú¯àe¶‘ö*óE±Å4ãÎïÒGZÈþW–w¸ì¥õ`œ¥DJ§î)Ô~ +ŸïàóAµû.::ƒ/€Ïo0¥@€áR:× 15$Bî·àóÓõù¼ ã[â^\O¦š;-ö7} +€šF¹‡/ +åv˲r7Â(ðÕdYR©êÇe¾,ïȪÀ7Œ^AXï\¡Ð^(%:ß`rÅ)ëÙ¨ß{ |¾/€ÏÕîWP¸è è ¾>¿À” +Æ0ŒBåš’$±ÿÒuݹܲ,ܶ§êóÕ¤ñd*í0üycoïàÎc ö·º¯ +'”TUU-¯ÞÞ#”EiòŒ‹Ìw®&ËrÞÕꎄ™>-º–,ïð(óUõ㜖UÕ/þó“Y¶ß O˜”)…º?å±ûøI¿wuø|¿ÐñÉ'¿Ý³§ìèïï¯öB>ø(\€Îà;àóL©lB¡¿ ‡Ã\=q½C+8ÅŽ,ËÁóØeHŸO8]}z´áÏÖƒñƒgøGZ +48ÌáK’ä¬uW«sK«ëº3…ŽÊ‹ÌWÅm}HK·6eâ÷nì]ækZ»ûwåI·[›ÎKïÉÿæÂPê,øm‡ö6äEæSPõ{·‡Ï•òÁ@átߟß`J€`ã¼ wÚi˲¸¢?E‰D"¢(ò5«ZtZÿÕço;ÔÏ]=[â^b:”:»ñ@ŒýMßÅ€¥JJ†”!)é”.*¾Sþ +•G +C–Ì÷Mbé­Â°ÏßY0 —-ó-ë”(¶8Wxò–™î»s +üƒgx.uÊŸðù R@>ø(\€Îà;àóL©x4MãêÞi§UU-¤†DQlðF ªÏw*©¡ÔYZÒvxÀEFÑú»ŸÌú +ð ©Tª¯¯/‘H )ʆ¿²äRošf÷¨ëº³ø¿(´2}%廬 ó)i.'™/ë£Ñ#Î/Fo(ôÚ¹Î_§¯úò¹ÝÍߘÍKƒOüÊúÁ³g=çS‚ À¨„Ï•òÁ@átߟß`J€FÀ²,UU%IRŹœ>æÚ¡p8Lë7x‹ÕçÇ“)§«§%]ñ¤‹ŒÚv¨?÷+À/tww·Û á•InY¾ ´RD4­ì¾hƒ.ozöjFÞ­™¦éw™o¾ð…è+«-ëTîZÞe¾aôæ\Ó-|ñK«Œ§/6ù´ß˜Qè¸xœpÃ) +—´ù@ó¹Ò}J°•ðù R8åÃ¥_¹xîíw ê?èJñ«¶lɽèÆŒÓçO¾ò*ŒŽº1ú|4 /‚Æ |>42¦i*Š¶‘e¹Pg£TŸŸvT™î>~’>¥Ü +MÕ}}ίl;Ô¾á#ººº˜9D‰¾˲¢Ñ¨Ç§–”C¡Kªª’çc„òpÑò¾àrN뙟´ÒÛEfק/Î_×Ôô£P赬µÆ"ó IÒÙ +ÒDÙÚtް̧ý&ݺKƒ+7[MMé%›â.i³eÛ ¶2ý›»ŽŽßJø|P)œ>áÇ€2jp²D1ÂQ†ÏG 9>%À>¿+žT÷õm<‹'SlɶCý.nŠÖßÛ;È?òoú§¿¿¿»»ûرchŠh4ªªª,Ë¢(òÊöz80˲ò¾'UÊQE7Nç +…ü(ó­Mç‰_ZÅÍüè““ÌOgžžÄŸ¼ãVuÁÕÃ&Ÿbì.óÓö£ÏžÓŸûüÙ/\ðw—„IñÉÎnZŸVλX,F£òøñãþ>ðù "ÀçC_ŸŸ@rê™ûü\ö6äâ¦Ú8køO žA÷õiš4Š?%úU‚öNG(B©&? +E£Ñ^³™O!M”¹™W”ù*c—ùöGΙ| +úè MK75¥¯œ;è’0<ß_ÓnUàóA¥€Ï‡2¾>>ä Ô3 åóãÉ”‹žÚx –¶ëÁøîã'Ñ7@ýcšfQ+.IR­¯l“O(ŠbϧG9ö'o™Éͼ(¶ðU*#ó‰]Ò𾶠+飺÷c¤Ù ©)½r³å’0'Üpªv=«ZÀçƒJñÛ={^TÕ‰5«vÊ–`œÔ;[·¢72Ô‚=l'_y•S㤎=ZôÊÒ:HÈHÎ@h(ŸO4wº*ÔäáÔAh8+Š¢ëz­”¸iš²,—gò[–ÏØfŽ]_õe§™·¬Sìÿ+&󉘑ÙÝ.)ó‡g ##ó¿pÁß]RedW­¼I>€2ȪwEƒPÿ8_@xQUÑ  @ÝÂýs¥²8*¥=Äçïít‘T;%0Ä@m1 CUUMÓ<®/IR(¢ñKcY×uÓ4k{üÌä—é,‚Y–Ï9ª§· +ÆÓç¯ãrž›ùJÊür‘åŒÏŸýpÂ%UÎY;@ëOÀçPÐGøøü ‚„  nϯR{6ˆÏ?1xÆER5wZb`œ1MSÓ4EQh :S“ê·Û+:‹¬S( Q Ãh„+nY§B¡×¸œ×´v¶¼d¾e¥!ãó×´Å\RåEá$­¼ËŸ@@à;àóƒ +2€º>¿JíÙ >ŸØxÀÍSÅ“)Œ2Pm,Ë¢¡GƒN—Ju_œ‹išŠ¢¸œHQ軾{x1Âá-\Î+ʇ™EI«d>Aס©)ýÅ Ýž{FvõÑ:¡ Þ#ÂçPÐGøøü ‚„  n1M3ZY–¥ž‘HDÓ4þ¿¬––;Ë_i¹eYÜž èówK¸¨ª½½ƒe ÚH’䮸iÊuu~º®¥ Ÿ™|JA–„¹œ‡·d>'-ù¦ï—!ó5­×öW +šššÒ³vK’ô¿´Ž¢ðÒÀçPÐGøøü ‚„ ÀwhšÆ‘{É=ý/³ú´¦a Þn èó{N»¨ªÖƒqŒ&Pmr58%%EQ(ÕRÒu]–å±ä3h#ŸY¨ª$í/Š-MM?¢-ë”w™ +½æ”ù¼ž_U?®à±ÉrÆç¯is{‰é‹ž¡uêþqS9ÀçPÐGøøü ‚„ À_X–ÅäýëEÑú\é£>¿Ñ|>¡îës±UC©³SÀ;ÑhT×õˆûÃDŽa’$ɲÌÞòÅiVJã³lãñ±ÏÕÌÿ¨ÏÉÈütZžûS/2Xþ·É©px ÿ¯Hä£ +XÊ0ZÂßvIkÚbMMiQ ìX†Ï T ððùA €¿PU•Ý€kšæñ+¦i²¯D"‘FnºÆôùm‡\„Õþφ0¦üE,ëèèèîîN¥RUÝå ¦îeY¦!“+·iI–Η²«$IM‚Íýù…óR† +…øwé0ÖoßøáKeÈ|VÞÏBÖ;‹öÇΙhtóóoº¤ÇÙ'ššÒ^nýÇmTVø|ÊúߟTø ®›J*¶geŸbP ½Ñ˜>¿+žtVÛõcLù‹ŽŽŽv›D"Q½½8]Ÿ ~oLÊ¢¬ßéÒÇmÐKM>¿”mmmÎÇ%”¨ö.•ñî3c”ùâ—VO_îTÇr»Ÿ¤Œwbð ûO¦\r#Å/:×O$…d¾³Ì»Y[Ë mŠ% Qi¼Ð1ÐñÐKJ;õ9‚$I^Ú§ h³´ýR§¯¯oÉ’%Y‚Ö¹iâ—VUFæSü^)û@6ˆeù|u_ŸKb|èñ¿<þîpæl=wßx*•*4*ëyPÀçP*ÐGøøü ‚„ À_(ŠÂnÀ#‘ˆÇ¯˜¦É¾ +5ôLÇ}¾ eT,³Æ»â}SYUÓ¹¨žpjšÍãïþši¨çö˜ôñ»?Þ⢭Ú°íœ<Óz0N#…1 ÃãQÑšQW¼ËO^s>öM9*ï zqݯ ÇÎàQÂ{iy§ s1Ï>uò%Aç¨ë:°MÕ„¶O°Œ#¤ šõ‚€êë{ÌùNÌ'Ý^1™¿§ü‡¼8Ÿ‚½¸ä\’‘]}Ñ>ãw?¼1Ÿ@@à;àóƒ +2¡ë:÷r^ŸeYÜ°ø³¸Ï/¯bÙ‹,­ì¦¼\_Z'÷‹n¸ƒ›¨/\ð.æJÝ×Ç6Õz0ΖÐ×]ŽÊ‹ Î{Tå‰e/ºÛ㦼•ÇÿÎàeSÎÁ +…ø“øüE€e>š¦it²üu¤êA]Žv4–Æt>h ­•÷P .HZéíbÆ·ïýÞSÌИ^’Ì·‡Ã‘ŠË|¢¹ÓbÉmãXÖ’¼ñÝ–£NáO¦‚7^àó(è#||~PABà;¸­*jè†ÝYÚu¹.¸øüq¶Á7UvIöç>ÿ?¸‰š¾t -yâW†‹¼:1x&íðù ž³~u}nª‚Á²¬¼þÙù‰÷÷>ñtø ʨ´Gºjcß|sŠpþº¢>_×?ÍݤñáÑïüS¥d~Úñ¤’ç·pɇo:|¸÷ïY‚|>e}€ï€Ï*HÈüˆa%Õ£Bæ§>ߣþõ5]ñ¤³üžÂÅ_1ÍO¦¯°€‰F£”ÁdY.úd§þ5~ HZé­Â°u§?#­Ô©†ÿeYQ™‰|”³|›•ùÎRüÝÇOÒ’¡ÔY÷âüWßèu>ܤõƒ:¬àó(è#||~PABàS,ËŠD"E+TC¡÷¢ñ`ÓP>ŸP÷õ9Ëï7ˆ¹(¬žÓ´Ns§Å>n;ÔjE >AIU’$MÓ ñ‹°K:'Þ;UË:e½é„];¡¨Ì—$½àf+'óÓŽâ|ʇÌÌï>~Ò%®i‹uV#dBø|ÊúߟTø˲4MË_ápXQ˜|'æóÛ8ËïwK¸X,Z™Öi„ªTP‡ÔVàó´@)Â0 \OÕω÷]’e„õQÿ ¥hq¾(¶Ðú·|HK \ No newline at end of file diff --git a/external/snappy-1.1.9/testdata/plrabn12.txt b/external/snappy-1.1.9/testdata/plrabn12.txt new file mode 100644 index 0000000..34088b8 --- /dev/null +++ b/external/snappy-1.1.9/testdata/plrabn12.txt @@ -0,0 +1,10699 @@ + +This is the February 1992 Project Gutenberg release of: + +Paradise Lost by John Milton + +The oldest etext known to Project Gutenberg (ca. 1964-1965) +(If you know of any older ones, please let us know.) + + +Introduction (one page) + +This etext was originally created in 1964-1965 according to Dr. +Joseph Raben of Queens College, NY, to whom it is attributed by +Project Gutenberg. We had heard of this etext for years but it +was not until 1991 that we actually managed to track it down to +a specific location, and then it took months to convince people +to let us have a copy, then more months for them actually to do +the copying and get it to us. Then another month to convert to +something we could massage with our favorite 486 in DOS. After +that is was only a matter of days to get it into this shape you +will see below. The original was, of course, in CAPS only, and +so were all the other etexts of the 60's and early 70's. Don't +let anyone fool you into thinking any etext with both upper and +lower case is an original; all those original Project Gutenberg +etexts were also in upper case and were translated or rewritten +many times to get them into their current condition. They have +been worked on by many people throughout the world. + +In the course of our searches for Professor Raben and his etext +we were never able to determine where copies were or which of a +variety of editions he may have used as a source. We did get a +little information here and there, but even after we received a +copy of the etext we were unwilling to release it without first +determining that it was in fact Public Domain and finding Raben +to verify this and get his permission. Interested enough, in a +totally unrelated action to our searches for him, the professor +subscribed to the Project Gutenberg listserver and we happened, +by accident, to notice his name. (We don't really look at every +subscription request as the computers usually handle them.) The +etext was then properly identified, copyright analyzed, and the +current edition prepared. + +To give you an estimation of the difference in the original and +what we have today: the original was probably entered on cards +commonly known at the time as "IBM cards" (Do Not Fold, Spindle +or Mutilate) and probably took in excess of 100,000 of them. A +single card could hold 80 characters (hence 80 characters is an +accepted standard for so many computer margins), and the entire +original edition we received in all caps was over 800,000 chars +in length, including line enumeration, symbols for caps and the +punctuation marks, etc., since they were not available keyboard +characters at the time (probably the keyboards operated at baud +rates of around 113, meaning the typists had to type slowly for +the keyboard to keep up). + +This is the second version of Paradise Lost released by Project +Gutenberg. The first was released as our October, 1991 etext. + + + + + +Paradise Lost + + + + +Book I + + +Of Man's first disobedience, and the fruit +Of that forbidden tree whose mortal taste +Brought death into the World, and all our woe, +With loss of Eden, till one greater Man +Restore us, and regain the blissful seat, +Sing, Heavenly Muse, that, on the secret top +Of Oreb, or of Sinai, didst inspire +That shepherd who first taught the chosen seed +In the beginning how the heavens and earth +Rose out of Chaos: or, if Sion hill +Delight thee more, and Siloa's brook that flowed +Fast by the oracle of God, I thence +Invoke thy aid to my adventurous song, +That with no middle flight intends to soar +Above th' Aonian mount, while it pursues +Things unattempted yet in prose or rhyme. +And chiefly thou, O Spirit, that dost prefer +Before all temples th' upright heart and pure, +Instruct me, for thou know'st; thou from the first +Wast present, and, with mighty wings outspread, +Dove-like sat'st brooding on the vast Abyss, +And mad'st it pregnant: what in me is dark +Illumine, what is low raise and support; +That, to the height of this great argument, +I may assert Eternal Providence, +And justify the ways of God to men. + Say first--for Heaven hides nothing from thy view, +Nor the deep tract of Hell--say first what cause +Moved our grand parents, in that happy state, +Favoured of Heaven so highly, to fall off +From their Creator, and transgress his will +For one restraint, lords of the World besides. +Who first seduced them to that foul revolt? + Th' infernal Serpent; he it was whose guile, +Stirred up with envy and revenge, deceived +The mother of mankind, what time his pride +Had cast him out from Heaven, with all his host +Of rebel Angels, by whose aid, aspiring +To set himself in glory above his peers, +He trusted to have equalled the Most High, +If he opposed, and with ambitious aim +Against the throne and monarchy of God, +Raised impious war in Heaven and battle proud, +With vain attempt. Him the Almighty Power +Hurled headlong flaming from th' ethereal sky, +With hideous ruin and combustion, down +To bottomless perdition, there to dwell +In adamantine chains and penal fire, +Who durst defy th' Omnipotent to arms. + Nine times the space that measures day and night +To mortal men, he, with his horrid crew, +Lay vanquished, rolling in the fiery gulf, +Confounded, though immortal. But his doom +Reserved him to more wrath; for now the thought +Both of lost happiness and lasting pain +Torments him: round he throws his baleful eyes, +That witnessed huge affliction and dismay, +Mixed with obdurate pride and steadfast hate. +At once, as far as Angels ken, he views +The dismal situation waste and wild. +A dungeon horrible, on all sides round, +As one great furnace flamed; yet from those flames +No light; but rather darkness visible +Served only to discover sights of woe, +Regions of sorrow, doleful shades, where peace +And rest can never dwell, hope never comes +That comes to all, but torture without end +Still urges, and a fiery deluge, fed +With ever-burning sulphur unconsumed. +Such place Eternal Justice has prepared +For those rebellious; here their prison ordained +In utter darkness, and their portion set, +As far removed from God and light of Heaven +As from the centre thrice to th' utmost pole. +Oh how unlike the place from whence they fell! +There the companions of his fall, o'erwhelmed +With floods and whirlwinds of tempestuous fire, +He soon discerns; and, weltering by his side, +One next himself in power, and next in crime, +Long after known in Palestine, and named +Beelzebub. To whom th' Arch-Enemy, +And thence in Heaven called Satan, with bold words +Breaking the horrid silence, thus began:-- + "If thou beest he--but O how fallen! how changed +From him who, in the happy realms of light +Clothed with transcendent brightness, didst outshine +Myriads, though bright!--if he whom mutual league, +United thoughts and counsels, equal hope +And hazard in the glorious enterprise +Joined with me once, now misery hath joined +In equal ruin; into what pit thou seest +From what height fallen: so much the stronger proved +He with his thunder; and till then who knew +The force of those dire arms? Yet not for those, +Nor what the potent Victor in his rage +Can else inflict, do I repent, or change, +Though changed in outward lustre, that fixed mind, +And high disdain from sense of injured merit, +That with the Mightiest raised me to contend, +And to the fierce contentions brought along +Innumerable force of Spirits armed, +That durst dislike his reign, and, me preferring, +His utmost power with adverse power opposed +In dubious battle on the plains of Heaven, +And shook his throne. What though the field be lost? +All is not lost--the unconquerable will, +And study of revenge, immortal hate, +And courage never to submit or yield: +And what is else not to be overcome? +That glory never shall his wrath or might +Extort from me. To bow and sue for grace +With suppliant knee, and deify his power +Who, from the terror of this arm, so late +Doubted his empire--that were low indeed; +That were an ignominy and shame beneath +This downfall; since, by fate, the strength of Gods, +And this empyreal sybstance, cannot fail; +Since, through experience of this great event, +In arms not worse, in foresight much advanced, +We may with more successful hope resolve +To wage by force or guile eternal war, +Irreconcilable to our grand Foe, +Who now triumphs, and in th' excess of joy +Sole reigning holds the tyranny of Heaven." + So spake th' apostate Angel, though in pain, +Vaunting aloud, but racked with deep despair; +And him thus answered soon his bold compeer:-- + "O Prince, O Chief of many throned Powers +That led th' embattled Seraphim to war +Under thy conduct, and, in dreadful deeds +Fearless, endangered Heaven's perpetual King, +And put to proof his high supremacy, +Whether upheld by strength, or chance, or fate, +Too well I see and rue the dire event +That, with sad overthrow and foul defeat, +Hath lost us Heaven, and all this mighty host +In horrible destruction laid thus low, +As far as Gods and heavenly Essences +Can perish: for the mind and spirit remains +Invincible, and vigour soon returns, +Though all our glory extinct, and happy state +Here swallowed up in endless misery. +But what if he our Conqueror (whom I now +Of force believe almighty, since no less +Than such could have o'erpowered such force as ours) +Have left us this our spirit and strength entire, +Strongly to suffer and support our pains, +That we may so suffice his vengeful ire, +Or do him mightier service as his thralls +By right of war, whate'er his business be, +Here in the heart of Hell to work in fire, +Or do his errands in the gloomy Deep? +What can it the avail though yet we feel +Strength undiminished, or eternal being +To undergo eternal punishment?" + Whereto with speedy words th' Arch-Fiend replied:-- +"Fallen Cherub, to be weak is miserable, +Doing or suffering: but of this be sure-- +To do aught good never will be our task, +But ever to do ill our sole delight, +As being the contrary to his high will +Whom we resist. If then his providence +Out of our evil seek to bring forth good, +Our labour must be to pervert that end, +And out of good still to find means of evil; +Which ofttimes may succeed so as perhaps +Shall grieve him, if I fail not, and disturb +His inmost counsels from their destined aim. +But see! the angry Victor hath recalled +His ministers of vengeance and pursuit +Back to the gates of Heaven: the sulphurous hail, +Shot after us in storm, o'erblown hath laid +The fiery surge that from the precipice +Of Heaven received us falling; and the thunder, +Winged with red lightning and impetuous rage, +Perhaps hath spent his shafts, and ceases now +To bellow through the vast and boundless Deep. +Let us not slip th' occasion, whether scorn +Or satiate fury yield it from our Foe. +Seest thou yon dreary plain, forlorn and wild, +The seat of desolation, void of light, +Save what the glimmering of these livid flames +Casts pale and dreadful? Thither let us tend +From off the tossing of these fiery waves; +There rest, if any rest can harbour there; +And, re-assembling our afflicted powers, +Consult how we may henceforth most offend +Our enemy, our own loss how repair, +How overcome this dire calamity, +What reinforcement we may gain from hope, +If not, what resolution from despair." + Thus Satan, talking to his nearest mate, +With head uplift above the wave, and eyes +That sparkling blazed; his other parts besides +Prone on the flood, extended long and large, +Lay floating many a rood, in bulk as huge +As whom the fables name of monstrous size, +Titanian or Earth-born, that warred on Jove, +Briareos or Typhon, whom the den +By ancient Tarsus held, or that sea-beast +Leviathan, which God of all his works +Created hugest that swim th' ocean-stream. +Him, haply slumbering on the Norway foam, +The pilot of some small night-foundered skiff, +Deeming some island, oft, as seamen tell, +With fixed anchor in his scaly rind, +Moors by his side under the lee, while night +Invests the sea, and wished morn delays. +So stretched out huge in length the Arch-fiend lay, +Chained on the burning lake; nor ever thence +Had risen, or heaved his head, but that the will +And high permission of all-ruling Heaven +Left him at large to his own dark designs, +That with reiterated crimes he might +Heap on himself damnation, while he sought +Evil to others, and enraged might see +How all his malice served but to bring forth +Infinite goodness, grace, and mercy, shewn +On Man by him seduced, but on himself +Treble confusion, wrath, and vengeance poured. + Forthwith upright he rears from off the pool +His mighty stature; on each hand the flames +Driven backward slope their pointing spires, and,rolled +In billows, leave i' th' midst a horrid vale. +Then with expanded wings he steers his flight +Aloft, incumbent on the dusky air, +That felt unusual weight; till on dry land +He lights--if it were land that ever burned +With solid, as the lake with liquid fire, +And such appeared in hue as when the force +Of subterranean wind transprots a hill +Torn from Pelorus, or the shattered side +Of thundering Etna, whose combustible +And fuelled entrails, thence conceiving fire, +Sublimed with mineral fury, aid the winds, +And leave a singed bottom all involved +With stench and smoke. Such resting found the sole +Of unblest feet. Him followed his next mate; +Both glorying to have scaped the Stygian flood +As gods, and by their own recovered strength, +Not by the sufferance of supernal Power. + "Is this the region, this the soil, the clime," +Said then the lost Archangel, "this the seat +That we must change for Heaven?--this mournful gloom +For that celestial light? Be it so, since he +Who now is sovereign can dispose and bid +What shall be right: farthest from him is best +Whom reason hath equalled, force hath made supreme +Above his equals. Farewell, happy fields, +Where joy for ever dwells! Hail, horrors! hail, +Infernal world! and thou, profoundest Hell, +Receive thy new possessor--one who brings +A mind not to be changed by place or time. +The mind is its own place, and in itself +Can make a Heaven of Hell, a Hell of Heaven. +What matter where, if I be still the same, +And what I should be, all but less than he +Whom thunder hath made greater? Here at least +We shall be free; th' Almighty hath not built +Here for his envy, will not drive us hence: +Here we may reigh secure; and, in my choice, +To reign is worth ambition, though in Hell: +Better to reign in Hell than serve in Heaven. +But wherefore let we then our faithful friends, +Th' associates and co-partners of our loss, +Lie thus astonished on th' oblivious pool, +And call them not to share with us their part +In this unhappy mansion, or once more +With rallied arms to try what may be yet +Regained in Heaven, or what more lost in Hell?" + So Satan spake; and him Beelzebub +Thus answered:--"Leader of those armies bright +Which, but th' Omnipotent, none could have foiled! +If once they hear that voice, their liveliest pledge +Of hope in fears and dangers--heard so oft +In worst extremes, and on the perilous edge +Of battle, when it raged, in all assaults +Their surest signal--they will soon resume +New courage and revive, though now they lie +Grovelling and prostrate on yon lake of fire, +As we erewhile, astounded and amazed; +No wonder, fallen such a pernicious height!" + He scare had ceased when the superior Fiend +Was moving toward the shore; his ponderous shield, +Ethereal temper, massy, large, and round, +Behind him cast. The broad circumference +Hung on his shoulders like the moon, whose orb +Through optic glass the Tuscan artist views +At evening, from the top of Fesole, +Or in Valdarno, to descry new lands, +Rivers, or mountains, in her spotty globe. +His spear--to equal which the tallest pine +Hewn on Norwegian hills, to be the mast +Of some great ammiral, were but a wand-- +He walked with, to support uneasy steps +Over the burning marl, not like those steps +On Heaven's azure; and the torrid clime +Smote on him sore besides, vaulted with fire. +Nathless he so endured, till on the beach +Of that inflamed sea he stood, and called +His legions--Angel Forms, who lay entranced +Thick as autumnal leaves that strow the brooks +In Vallombrosa, where th' Etrurian shades +High over-arched embower; or scattered sedge +Afloat, when with fierce winds Orion armed +Hath vexed the Red-Sea coast, whose waves o'erthrew +Busiris and his Memphian chivalry, +While with perfidious hatred they pursued +The sojourners of Goshen, who beheld +From the safe shore their floating carcases +And broken chariot-wheels. So thick bestrown, +Abject and lost, lay these, covering the flood, +Under amazement of their hideous change. +He called so loud that all the hollow deep +Of Hell resounded:--"Princes, Potentates, +Warriors, the Flower of Heaven--once yours; now lost, +If such astonishment as this can seize +Eternal Spirits! Or have ye chosen this place +After the toil of battle to repose +Your wearied virtue, for the ease you find +To slumber here, as in the vales of Heaven? +Or in this abject posture have ye sworn +To adore the Conqueror, who now beholds +Cherub and Seraph rolling in the flood +With scattered arms and ensigns, till anon +His swift pursuers from Heaven-gates discern +Th' advantage, and, descending, tread us down +Thus drooping, or with linked thunderbolts +Transfix us to the bottom of this gulf? +Awake, arise, or be for ever fallen!" + They heard, and were abashed, and up they sprung +Upon the wing, as when men wont to watch +On duty, sleeping found by whom they dread, +Rouse and bestir themselves ere well awake. +Nor did they not perceive the evil plight +In which they were, or the fierce pains not feel; +Yet to their General's voice they soon obeyed +Innumerable. As when the potent rod +Of Amram's son, in Egypt's evil day, +Waved round the coast, up-called a pitchy cloud +Of locusts, warping on the eastern wind, +That o'er the realm of impious Pharaoh hung +Like Night, and darkened all the land of Nile; +So numberless were those bad Angels seen +Hovering on wing under the cope of Hell, +'Twixt upper, nether, and surrounding fires; +Till, as a signal given, th' uplifted spear +Of their great Sultan waving to direct +Their course, in even balance down they light +On the firm brimstone, and fill all the plain: +A multitude like which the populous North +Poured never from her frozen loins to pass +Rhene or the Danaw, when her barbarous sons +Came like a deluge on the South, and spread +Beneath Gibraltar to the Libyan sands. +Forthwith, form every squadron and each band, +The heads and leaders thither haste where stood +Their great Commander--godlike Shapes, and Forms +Excelling human; princely Dignities; +And Powers that erst in Heaven sat on thrones, +Though on their names in Heavenly records now +Be no memorial, blotted out and rased +By their rebellion from the Books of Life. +Nor had they yet among the sons of Eve +Got them new names, till, wandering o'er the earth, +Through God's high sufferance for the trial of man, +By falsities and lies the greatest part +Of mankind they corrupted to forsake +God their Creator, and th' invisible +Glory of him that made them to transform +Oft to the image of a brute, adorned +With gay religions full of pomp and gold, +And devils to adore for deities: +Then were they known to men by various names, +And various idols through the heathen world. + Say, Muse, their names then known, who first, who last, +Roused from the slumber on that fiery couch, +At their great Emperor's call, as next in worth +Came singly where he stood on the bare strand, +While the promiscuous crowd stood yet aloof? + The chief were those who, from the pit of Hell +Roaming to seek their prey on Earth, durst fix +Their seats, long after, next the seat of God, +Their altars by his altar, gods adored +Among the nations round, and durst abide +Jehovah thundering out of Sion, throned +Between the Cherubim; yea, often placed +Within his sanctuary itself their shrines, +Abominations; and with cursed things +His holy rites and solemn feasts profaned, +And with their darkness durst affront his light. +First, Moloch, horrid king, besmeared with blood +Of human sacrifice, and parents' tears; +Though, for the noise of drums and timbrels loud, +Their children's cries unheard that passed through fire +To his grim idol. Him the Ammonite +Worshiped in Rabba and her watery plain, +In Argob and in Basan, to the stream +Of utmost Arnon. Nor content with such +Audacious neighbourhood, the wisest heart +Of Solomon he led by fraoud to build +His temple right against the temple of God +On that opprobrious hill, and made his grove +The pleasant valley of Hinnom, Tophet thence +And black Gehenna called, the type of Hell. +Next Chemos, th' obscene dread of Moab's sons, +From Aroar to Nebo and the wild +Of southmost Abarim; in Hesebon +And Horonaim, Seon's real, beyond +The flowery dale of Sibma clad with vines, +And Eleale to th' Asphaltic Pool: +Peor his other name, when he enticed +Israel in Sittim, on their march from Nile, +To do him wanton rites, which cost them woe. +Yet thence his lustful orgies he enlarged +Even to that hill of scandal, by the grove +Of Moloch homicide, lust hard by hate, +Till good Josiah drove them thence to Hell. +With these came they who, from the bordering flood +Of old Euphrates to the brook that parts +Egypt from Syrian ground, had general names +Of Baalim and Ashtaroth--those male, +These feminine. For Spirits, when they please, +Can either sex assume, or both; so soft +And uncompounded is their essence pure, +Not tried or manacled with joint or limb, +Nor founded on the brittle strength of bones, +Like cumbrous flesh; but, in what shape they choose, +Dilated or condensed, bright or obscure, +Can execute their airy purposes, +And works of love or enmity fulfil. +For those the race of Israel oft forsook +Their Living Strength, and unfrequented left +His righteous altar, bowing lowly down +To bestial gods; for which their heads as low +Bowed down in battle, sunk before the spear +Of despicable foes. With these in troop +Came Astoreth, whom the Phoenicians called +Astarte, queen of heaven, with crescent horns; +To whose bright image nigntly by the moon +Sidonian virgins paid their vows and songs; +In Sion also not unsung, where stood +Her temple on th' offensive mountain, built +By that uxorious king whose heart, though large, +Beguiled by fair idolatresses, fell +To idols foul. Thammuz came next behind, +Whose annual wound in Lebanon allured +The Syrian damsels to lament his fate +In amorous ditties all a summer's day, +While smooth Adonis from his native rock +Ran purple to the sea, supposed with blood +Of Thammuz yearly wounded: the love-tale +Infected Sion's daughters with like heat, +Whose wanton passions in the sacred proch +Ezekiel saw, when, by the vision led, +His eye surveyed the dark idolatries +Of alienated Judah. Next came one +Who mourned in earnest, when the captive ark +Maimed his brute image, head and hands lopt off, +In his own temple, on the grunsel-edge, +Where he fell flat and shamed his worshippers: +Dagon his name, sea-monster,upward man +And downward fish; yet had his temple high +Reared in Azotus, dreaded through the coast +Of Palestine, in Gath and Ascalon, +And Accaron and Gaza's frontier bounds. +Him followed Rimmon, whose delightful seat +Was fair Damascus, on the fertile banks +Of Abbana and Pharphar, lucid streams. +He also against the house of God was bold: +A leper once he lost, and gained a king-- +Ahaz, his sottish conqueror, whom he drew +God's altar to disparage and displace +For one of Syrian mode, whereon to burn +His odious offerings, and adore the gods +Whom he had vanquished. After these appeared +A crew who, under names of old renown-- +Osiris, Isis, Orus, and their train-- +With monstrous shapes and sorceries abused +Fanatic Egypt and her priests to seek +Their wandering gods disguised in brutish forms +Rather than human. Nor did Israel scape +Th' infection, when their borrowed gold composed +The calf in Oreb; and the rebel king +Doubled that sin in Bethel and in Dan, +Likening his Maker to the grazed ox-- +Jehovah, who, in one night, when he passed +From Egypt marching, equalled with one stroke +Both her first-born and all her bleating gods. +Belial came last; than whom a Spirit more lewd +Fell not from Heaven, or more gross to love +Vice for itself. To him no temple stood +Or altar smoked; yet who more oft than he +In temples and at altars, when the priest +Turns atheist, as did Eli's sons, who filled +With lust and violence the house of God? +In courts and palaces he also reigns, +And in luxurious cities, where the noise +Of riot ascends above their loftiest towers, +And injury and outrage; and, when night +Darkens the streets, then wander forth the sons +Of Belial, flown with insolence and wine. +Witness the streets of Sodom, and that night +In Gibeah, when the hospitable door +Exposed a matron, to avoid worse rape. + These were the prime in order and in might: +The rest were long to tell; though far renowned +Th' Ionian gods--of Javan's issue held +Gods, yet confessed later than Heaven and Earth, +Their boasted parents;--Titan, Heaven's first-born, +With his enormous brood, and birthright seized +By younger Saturn: he from mightier Jove, +His own and Rhea's son, like measure found; +So Jove usurping reigned. These, first in Crete +And Ida known, thence on the snowy top +Of cold Olympus ruled the middle air, +Their highest heaven; or on the Delphian cliff, +Or in Dodona, and through all the bounds +Of Doric land; or who with Saturn old +Fled over Adria to th' Hesperian fields, +And o'er the Celtic roamed the utmost Isles. + All these and more came flocking; but with looks +Downcast and damp; yet such wherein appeared +Obscure some glimpse of joy to have found their Chief +Not in despair, to have found themselves not lost +In loss itself; which on his countenance cast +Like doubtful hue. But he, his wonted pride +Soon recollecting, with high words, that bore +Semblance of worth, not substance, gently raised +Their fainting courage, and dispelled their fears. +Then straight commands that, at the warlike sound +Of trumpets loud and clarions, be upreared +His mighty standard. That proud honour claimed +Azazel as his right, a Cherub tall: +Who forthwith from the glittering staff unfurled +Th' imperial ensign; which, full high advanced, +Shone like a meteor streaming to the wind, +With gems and golden lustre rich emblazed, +Seraphic arms and trophies; all the while +Sonorous metal blowing martial sounds: +At which the universal host up-sent +A shout that tore Hell's concave, and beyond +Frighted the reign of Chaos and old Night. +All in a moment through the gloom were seen +Ten thousand banners rise into the air, +With orient colours waving: with them rose +A forest huge of spears; and thronging helms +Appeared, and serried shields in thick array +Of depth immeasurable. Anon they move +In perfect phalanx to the Dorian mood +Of flutes and soft recorders--such as raised +To height of noblest temper heroes old +Arming to battle, and instead of rage +Deliberate valour breathed, firm, and unmoved +With dread of death to flight or foul retreat; +Nor wanting power to mitigate and swage +With solemn touches troubled thoughts, and chase +Anguish and doubt and fear and sorrow and pain +From mortal or immortal minds. Thus they, +Breathing united force with fixed thought, +Moved on in silence to soft pipes that charmed +Their painful steps o'er the burnt soil. And now +Advanced in view they stand--a horrid front +Of dreadful length and dazzling arms, in guise +Of warriors old, with ordered spear and shield, +Awaiting what command their mighty Chief +Had to impose. He through the armed files +Darts his experienced eye, and soon traverse +The whole battalion views--their order due, +Their visages and stature as of gods; +Their number last he sums. And now his heart +Distends with pride, and, hardening in his strength, +Glories: for never, since created Man, +Met such embodied force as, named with these, +Could merit more than that small infantry +Warred on by cranes--though all the giant brood +Of Phlegra with th' heroic race were joined +That fought at Thebes and Ilium, on each side +Mixed with auxiliar gods; and what resounds +In fable or romance of Uther's son, +Begirt with British and Armoric knights; +And all who since, baptized or infidel, +Jousted in Aspramont, or Montalban, +Damasco, or Marocco, or Trebisond, +Or whom Biserta sent from Afric shore +When Charlemain with all his peerage fell +By Fontarabbia. Thus far these beyond +Compare of mortal prowess, yet observed +Their dread Commander. He, above the rest +In shape and gesture proudly eminent, +Stood like a tower. His form had yet not lost +All her original brightness, nor appeared +Less than Archangel ruined, and th' excess +Of glory obscured: as when the sun new-risen +Looks through the horizontal misty air +Shorn of his beams, or, from behind the moon, +In dim eclipse, disastrous twilight sheds +On half the nations, and with fear of change +Perplexes monarchs. Darkened so, yet shone +Above them all th' Archangel: but his face +Deep scars of thunder had intrenched, and care +Sat on his faded cheek, but under brows +Of dauntless courage, and considerate pride +Waiting revenge. Cruel his eye, but cast +Signs of remorse and passion, to behold +The fellows of his crime, the followers rather +(Far other once beheld in bliss), condemned +For ever now to have their lot in pain-- +Millions of Spirits for his fault amerced +Of Heaven, and from eteranl splendours flung +For his revolt--yet faithful how they stood, +Their glory withered; as, when heaven's fire +Hath scathed the forest oaks or mountain pines, +With singed top their stately growth, though bare, +Stands on the blasted heath. He now prepared +To speak; whereat their doubled ranks they bend +From wing to wing, and half enclose him round +With all his peers: attention held them mute. +Thrice he assayed, and thrice, in spite of scorn, +Tears, such as Angels weep, burst forth: at last +Words interwove with sighs found out their way:-- + "O myriads of immortal Spirits! O Powers +Matchless, but with th' Almighth!--and that strife +Was not inglorious, though th' event was dire, +As this place testifies, and this dire change, +Hateful to utter. But what power of mind, +Forseeing or presaging, from the depth +Of knowledge past or present, could have feared +How such united force of gods, how such +As stood like these, could ever know repulse? +For who can yet believe, though after loss, +That all these puissant legions, whose exile +Hath emptied Heaven, shall fail to re-ascend, +Self-raised, and repossess their native seat? +For me, be witness all the host of Heaven, +If counsels different, or danger shunned +By me, have lost our hopes. But he who reigns +Monarch in Heaven till then as one secure +Sat on his throne, upheld by old repute, +Consent or custom, and his regal state +Put forth at full, but still his strength concealed-- +Which tempted our attempt, and wrought our fall. +Henceforth his might we know, and know our own, +So as not either to provoke, or dread +New war provoked: our better part remains +To work in close design, by fraud or guile, +What force effected not; that he no less +At length from us may find, who overcomes +By force hath overcome but half his foe. +Space may produce new Worlds; whereof so rife +There went a fame in Heaven that he ere long +Intended to create, and therein plant +A generation whom his choice regard +Should favour equal to the Sons of Heaven. +Thither, if but to pry, shall be perhaps +Our first eruption--thither, or elsewhere; +For this infernal pit shall never hold +Celestial Spirits in bondage, nor th' Abyss +Long under darkness cover. But these thoughts +Full counsel must mature. Peace is despaired; +For who can think submission? War, then, war +Open or understood, must be resolved." + He spake; and, to confirm his words, outflew +Millions of flaming swords, drawn from the thighs +Of mighty Cherubim; the sudden blaze +Far round illumined Hell. Highly they raged +Against the Highest, and fierce with grasped arms +Clashed on their sounding shields the din of war, +Hurling defiance toward the vault of Heaven. + There stood a hill not far, whose grisly top +Belched fire and rolling smoke; the rest entire +Shone with a glossy scurf--undoubted sign +That in his womb was hid metallic ore, +The work of sulphur. Thither, winged with speed, +A numerous brigade hastened: as when bands +Of pioneers, with spade and pickaxe armed, +Forerun the royal camp, to trench a field, +Or cast a rampart. Mammon led them on-- +Mammon, the least erected Spirit that fell +From Heaven; for even in Heaven his looks and thoughts +Were always downward bent, admiring more +The riches of heaven's pavement, trodden gold, +Than aught divine or holy else enjoyed +In vision beatific. By him first +Men also, and by his suggestion taught, +Ransacked the centre, and with impious hands +Rifled the bowels of their mother Earth +For treasures better hid. Soon had his crew +Opened into the hill a spacious wound, +And digged out ribs of gold. Let none admire +That riches grow in Hell; that soil may best +Deserve the precious bane. And here let those +Who boast in mortal things, and wondering tell +Of Babel, and the works of Memphian kings, +Learn how their greatest monuments of fame +And strength, and art, are easily outdone +By Spirits reprobate, and in an hour +What in an age they, with incessant toil +And hands innumerable, scarce perform. +Nigh on the plain, in many cells prepared, +That underneath had veins of liquid fire +Sluiced from the lake, a second multitude +With wondrous art founded the massy ore, +Severing each kind, and scummed the bullion-dross. +A third as soon had formed within the ground +A various mould, and from the boiling cells +By strange conveyance filled each hollow nook; +As in an organ, from one blast of wind, +To many a row of pipes the sound-board breathes. +Anon out of the earth a fabric huge +Rose like an exhalation, with the sound +Of dulcet symphonies and voices sweet-- +Built like a temple, where pilasters round +Were set, and Doric pillars overlaid +With golden architrave; nor did there want +Cornice or frieze, with bossy sculptures graven; +The roof was fretted gold. Not Babylon +Nor great Alcairo such magnificence +Equalled in all their glories, to enshrine +Belus or Serapis their gods, or seat +Their kings, when Egypt with Assyria strove +In wealth and luxury. Th' ascending pile +Stood fixed her stately height, and straight the doors, +Opening their brazen folds, discover, wide +Within, her ample spaces o'er the smooth +And level pavement: from the arched roof, +Pendent by subtle magic, many a row +Of starry lamps and blazing cressets, fed +With naptha and asphaltus, yielded light +As from a sky. The hasty multitude +Admiring entered; and the work some praise, +And some the architect. His hand was known +In Heaven by many a towered structure high, +Where sceptred Angels held their residence, +And sat as Princes, whom the supreme King +Exalted to such power, and gave to rule, +Each in his Hierarchy, the Orders bright. +Nor was his name unheard or unadored +In ancient Greece; and in Ausonian land +Men called him Mulciber; and how he fell +From Heaven they fabled, thrown by angry Jove +Sheer o'er the crystal battlements: from morn +To noon he fell, from noon to dewy eve, +A summer's day, and with the setting sun +Dropt from the zenith, like a falling star, +On Lemnos, th' Aegaean isle. Thus they relate, +Erring; for he with this rebellious rout +Fell long before; nor aught aviled him now +To have built in Heaven high towers; nor did he scape +By all his engines, but was headlong sent, +With his industrious crew, to build in Hell. + Meanwhile the winged Heralds, by command +Of sovereign power, with awful ceremony +And trumpet's sound, throughout the host proclaim +A solemn council forthwith to be held +At Pandemonium, the high capital +Of Satan and his peers. Their summons called +From every band and squared regiment +By place or choice the worthiest: they anon +With hundreds and with thousands trooping came +Attended. All access was thronged; the gates +And porches wide, but chief the spacious hall +(Though like a covered field, where champions bold +Wont ride in armed, and at the Soldan's chair +Defied the best of Paynim chivalry +To mortal combat, or career with lance), +Thick swarmed, both on the ground and in the air, +Brushed with the hiss of rustling wings. As bees +In spring-time, when the Sun with Taurus rides. +Pour forth their populous youth about the hive +In clusters; they among fresh dews and flowers +Fly to and fro, or on the smoothed plank, +The suburb of their straw-built citadel, +New rubbed with balm, expatiate, and confer +Their state-affairs: so thick the airy crowd +Swarmed and were straitened; till, the signal given, +Behold a wonder! They but now who seemed +In bigness to surpass Earth's giant sons, +Now less than smallest dwarfs, in narrow room +Throng numberless--like that pygmean race +Beyond the Indian mount; or faery elves, +Whose midnight revels, by a forest-side +Or fountain, some belated peasant sees, +Or dreams he sees, while overhead the Moon +Sits arbitress, and nearer to the Earth +Wheels her pale course: they, on their mirth and dance +Intent, with jocund music charm his ear; +At once with joy and fear his heart rebounds. +Thus incorporeal Spirits to smallest forms +Reduced their shapes immense, and were at large, +Though without number still, amidst the hall +Of that infernal court. But far within, +And in their own dimensions like themselves, +The great Seraphic Lords and Cherubim +In close recess and secret conclave sat, +A thousand demi-gods on golden seats, +Frequent and full. After short silence then, +And summons read, the great consult began. + + + +Book II + + +High on a throne of royal state, which far +Outshone the wealth or Ormus and of Ind, +Or where the gorgeous East with richest hand +Showers on her kings barbaric pearl and gold, +Satan exalted sat, by merit raised +To that bad eminence; and, from despair +Thus high uplifted beyond hope, aspires +Beyond thus high, insatiate to pursue +Vain war with Heaven; and, by success untaught, +His proud imaginations thus displayed:-- + "Powers and Dominions, Deities of Heaven!-- +For, since no deep within her gulf can hold +Immortal vigour, though oppressed and fallen, +I give not Heaven for lost: from this descent +Celestial Virtues rising will appear +More glorious and more dread than from no fall, +And trust themselves to fear no second fate!-- +Me though just right, and the fixed laws of Heaven, +Did first create your leader--next, free choice +With what besides in council or in fight +Hath been achieved of merit--yet this loss, +Thus far at least recovered, hath much more +Established in a safe, unenvied throne, +Yielded with full consent. The happier state +In Heaven, which follows dignity, might draw +Envy from each inferior; but who here +Will envy whom the highest place exposes +Foremost to stand against the Thunderer's aim +Your bulwark, and condemns to greatest share +Of endless pain? Where there is, then, no good +For which to strive, no strife can grow up there +From faction: for none sure will claim in Hell +Precedence; none whose portion is so small +Of present pain that with ambitious mind +Will covet more! With this advantage, then, +To union, and firm faith, and firm accord, +More than can be in Heaven, we now return +To claim our just inheritance of old, +Surer to prosper than prosperity +Could have assured us; and by what best way, +Whether of open war or covert guile, +We now debate. Who can advise may speak." + He ceased; and next him Moloch, sceptred king, +Stood up--the strongest and the fiercest Spirit +That fought in Heaven, now fiercer by despair. +His trust was with th' Eternal to be deemed +Equal in strength, and rather than be less +Cared not to be at all; with that care lost +Went all his fear: of God, or Hell, or worse, +He recked not, and these words thereafter spake:-- + "My sentence is for open war. Of wiles, +More unexpert, I boast not: them let those +Contrive who need, or when they need; not now. +For, while they sit contriving, shall the rest-- +Millions that stand in arms, and longing wait +The signal to ascend--sit lingering here, +Heaven's fugitives, and for their dwelling-place +Accept this dark opprobrious den of shame, +The prison of his ryranny who reigns +By our delay? No! let us rather choose, +Armed with Hell-flames and fury, all at once +O'er Heaven's high towers to force resistless way, +Turning our tortures into horrid arms +Against the Torturer; when, to meet the noise +Of his almighty engine, he shall hear +Infernal thunder, and, for lightning, see +Black fire and horror shot with equal rage +Among his Angels, and his throne itself +Mixed with Tartarean sulphur and strange fire, +His own invented torments. But perhaps +The way seems difficult, and steep to scale +With upright wing against a higher foe! +Let such bethink them, if the sleepy drench +Of that forgetful lake benumb not still, +That in our porper motion we ascend +Up to our native seat; descent and fall +To us is adverse. Who but felt of late, +When the fierce foe hung on our broken rear +Insulting, and pursued us through the Deep, +With what compulsion and laborious flight +We sunk thus low? Th' ascent is easy, then; +Th' event is feared! Should we again provoke +Our stronger, some worse way his wrath may find +To our destruction, if there be in Hell +Fear to be worse destroyed! What can be worse +Than to dwell here, driven out from bliss, condemned +In this abhorred deep to utter woe! +Where pain of unextinguishable fire +Must exercise us without hope of end +The vassals of his anger, when the scourge +Inexorably, and the torturing hour, +Calls us to penance? More destroyed than thus, +We should be quite abolished, and expire. +What fear we then? what doubt we to incense +His utmost ire? which, to the height enraged, +Will either quite consume us, and reduce +To nothing this essential--happier far +Than miserable to have eternal being!-- +Or, if our substance be indeed divine, +And cannot cease to be, we are at worst +On this side nothing; and by proof we feel +Our power sufficient to disturb his Heaven, +And with perpetual inroads to alarm, +Though inaccessible, his fatal throne: +Which, if not victory, is yet revenge." + He ended frowning, and his look denounced +Desperate revenge, and battle dangerous +To less than gods. On th' other side up rose +Belial, in act more graceful and humane. +A fairer person lost not Heaven; he seemed +For dignity composed, and high exploit. +But all was false and hollow; though his tongue +Dropped manna, and could make the worse appear +The better reason, to perplex and dash +Maturest counsels: for his thoughts were low-- + To vice industrious, but to nobler deeds +Timorous and slothful. Yet he pleased the ear, +And with persuasive accent thus began:-- + "I should be much for open war, O Peers, +As not behind in hate, if what was urged +Main reason to persuade immediate war +Did not dissuade me most, and seem to cast +Ominous conjecture on the whole success; +When he who most excels in fact of arms, +In what he counsels and in what excels +Mistrustful, grounds his courage on despair +And utter dissolution, as the scope +Of all his aim, after some dire revenge. +First, what revenge? The towers of Heaven are filled +With armed watch, that render all access +Impregnable: oft on the bodering Deep +Encamp their legions, or with obscure wing +Scout far and wide into the realm of Night, +Scorning surprise. Or, could we break our way +By force, and at our heels all Hell should rise +With blackest insurrection to confound +Heaven's purest light, yet our great Enemy, +All incorruptible, would on his throne +Sit unpolluted, and th' ethereal mould, +Incapable of stain, would soon expel +Her mischief, and purge off the baser fire, +Victorious. Thus repulsed, our final hope +Is flat despair: we must exasperate +Th' Almighty Victor to spend all his rage; +And that must end us; that must be our cure-- +To be no more. Sad cure! for who would lose, +Though full of pain, this intellectual being, +Those thoughts that wander through eternity, +To perish rather, swallowed up and lost +In the wide womb of uncreated Night, +Devoid of sense and motion? And who knows, +Let this be good, whether our angry Foe +Can give it, or will ever? How he can +Is doubtful; that he never will is sure. +Will he, so wise, let loose at once his ire, +Belike through impotence or unaware, +To give his enemies their wish, and end +Them in his anger whom his anger saves +To punish endless? 'Wherefore cease we, then?' +Say they who counsel war; 'we are decreed, +Reserved, and destined to eternal woe; +Whatever doing, what can we suffer more, +What can we suffer worse?' Is this, then, worst-- +Thus sitting, thus consulting, thus in arms? +What when we fled amain, pursued and struck +With Heaven's afflicting thunder, and besought +The Deep to shelter us? This Hell then seemed +A refuge from those wounds. Or when we lay +Chained on the burning lake? That sure was worse. +What if the breath that kindled those grim fires, +Awaked, should blow them into sevenfold rage, +And plunge us in the flames; or from above +Should intermitted vengeance arm again +His red right hand to plague us? What if all +Her stores were opened, and this firmament +Of Hell should spout her cataracts of fire, +Impendent horrors, threatening hideous fall +One day upon our heads; while we perhaps, +Designing or exhorting glorious war, +Caught in a fiery tempest, shall be hurled, +Each on his rock transfixed, the sport and prey +Or racking whirlwinds, or for ever sunk +Under yon boiling ocean, wrapt in chains, +There to converse with everlasting groans, +Unrespited, unpitied, unreprieved, +Ages of hopeless end? This would be worse. +War, therefore, open or concealed, alike +My voice dissuades; for what can force or guile +With him, or who deceive his mind, whose eye +Views all things at one view? He from Heaven's height +All these our motions vain sees and derides, +Not more almighty to resist our might +Than wise to frustrate all our plots and wiles. +Shall we, then, live thus vile--the race of Heaven +Thus trampled, thus expelled, to suffer here +Chains and these torments? Better these than worse, +By my advice; since fate inevitable +Subdues us, and omnipotent decree, +The Victor's will. To suffer, as to do, +Our strength is equal; nor the law unjust +That so ordains. This was at first resolved, +If we were wise, against so great a foe +Contending, and so doubtful what might fall. +I laugh when those who at the spear are bold +And venturous, if that fail them, shrink, and fear +What yet they know must follow--to endure +Exile, or igominy, or bonds, or pain, +The sentence of their Conqueror. This is now +Our doom; which if we can sustain and bear, +Our Supreme Foe in time may much remit +His anger, and perhaps, thus far removed, +Not mind us not offending, satisfied +With what is punished; whence these raging fires +Will slacken, if his breath stir not their flames. +Our purer essence then will overcome +Their noxious vapour; or, inured, not feel; +Or, changed at length, and to the place conformed +In temper and in nature, will receive +Familiar the fierce heat; and, void of pain, +This horror will grow mild, this darkness light; +Besides what hope the never-ending flight +Of future days may bring, what chance, what change +Worth waiting--since our present lot appears +For happy though but ill, for ill not worst, +If we procure not to ourselves more woe." + Thus Belial, with words clothed in reason's garb, +Counselled ignoble ease and peaceful sloth, +Not peace; and after him thus Mammon spake:-- + "Either to disenthrone the King of Heaven +We war, if war be best, or to regain +Our own right lost. Him to unthrone we then +May hope, when everlasting Fate shall yield +To fickle Chance, and Chaos judge the strife. +The former, vain to hope, argues as vain +The latter; for what place can be for us +Within Heaven's bound, unless Heaven's Lord supreme +We overpower? Suppose he should relent +And publish grace to all, on promise made +Of new subjection; with what eyes could we +Stand in his presence humble, and receive +Strict laws imposed, to celebrate his throne +With warbled hyms, and to his Godhead sing +Forced hallelujahs, while he lordly sits +Our envied sovereign, and his altar breathes +Ambrosial odours and ambrosial flowers, +Our servile offerings? This must be our task +In Heaven, this our delight. How wearisome +Eternity so spent in worship paid +To whom we hate! Let us not then pursue, +By force impossible, by leave obtained +Unacceptable, though in Heaven, our state +Of splendid vassalage; but rather seek +Our own good from ourselves, and from our own +Live to ourselves, though in this vast recess, +Free and to none accountable, preferring +Hard liberty before the easy yoke +Of servile pomp. Our greatness will appear +Then most conspicuous when great things of small, +Useful of hurtful, prosperous of adverse, +We can create, and in what place soe'er +Thrive under evil, and work ease out of pain +Through labour and endurance. This deep world +Of darkness do we dread? How oft amidst +Thick clouds and dark doth Heaven's all-ruling Sire +Choose to reside, his glory unobscured, +And with the majesty of darkness round +Covers his throne, from whence deep thunders roar. +Mustering their rage, and Heaven resembles Hell! +As he our darkness, cannot we his light +Imitate when we please? This desert soil +Wants not her hidden lustre, gems and gold; +Nor want we skill or art from whence to raise +Magnificence; and what can Heaven show more? +Our torments also may, in length of time, +Become our elements, these piercing fires +As soft as now severe, our temper changed +Into their temper; which must needs remove +The sensible of pain. All things invite +To peaceful counsels, and the settled state +Of order, how in safety best we may +Compose our present evils, with regard +Of what we are and where, dismissing quite +All thoughts of war. Ye have what I advise." + He scarce had finished, when such murmur filled +Th' assembly as when hollow rocks retain +The sound of blustering winds, which all night long +Had roused the sea, now with hoarse cadence lull +Seafaring men o'erwatched, whose bark by chance +Or pinnace, anchors in a craggy bay +After the tempest. Such applause was heard +As Mammon ended, and his sentence pleased, +Advising peace: for such another field +They dreaded worse than Hell; so much the fear +Of thunder and the sword of Michael +Wrought still within them; and no less desire +To found this nether empire, which might rise, +By policy and long process of time, +In emulation opposite to Heaven. +Which when Beelzebub perceived--than whom, +Satan except, none higher sat--with grave +Aspect he rose, and in his rising seemed +A pillar of state. Deep on his front engraven +Deliberation sat, and public care; +And princely counsel in his face yet shone, +Majestic, though in ruin. Sage he stood +With Atlantean shoulders, fit to bear +The weight of mightiest monarchies; his look +Drew audience and attention still as night +Or summer's noontide air, while thus he spake:-- + "Thrones and Imperial Powers, Offspring of Heaven, +Ethereal Virtues! or these titles now +Must we renounce, and, changing style, be called +Princes of Hell? for so the popular vote +Inclines--here to continue, and build up here +A growing empire; doubtless! while we dream, +And know not that the King of Heaven hath doomed +This place our dungeon, not our safe retreat +Beyond his potent arm, to live exempt +From Heaven's high jurisdiction, in new league +Banded against his throne, but to remain +In strictest bondage, though thus far removed, +Under th' inevitable curb, reserved +His captive multitude. For he, to be sure, +In height or depth, still first and last will reign +Sole king, and of his kingdom lose no part +By our revolt, but over Hell extend +His empire, and with iron sceptre rule +Us here, as with his golden those in Heaven. +What sit we then projecting peace and war? +War hath determined us and foiled with loss +Irreparable; terms of peace yet none +Vouchsafed or sought; for what peace will be given +To us enslaved, but custody severe, +And stripes and arbitrary punishment +Inflicted? and what peace can we return, +But, to our power, hostility and hate, +Untamed reluctance, and revenge, though slow, +Yet ever plotting how the Conqueror least +May reap his conquest, and may least rejoice +In doing what we most in suffering feel? +Nor will occasion want, nor shall we need +With dangerous expedition to invade +Heaven, whose high walls fear no assault or siege, +Or ambush from the Deep. What if we find +Some easier enterprise? There is a place +(If ancient and prophetic fame in Heaven +Err not)--another World, the happy seat +Of some new race, called Man, about this time +To be created like to us, though less +In power and excellence, but favoured more +Of him who rules above; so was his will +Pronounced among the Gods, and by an oath +That shook Heaven's whole circumference confirmed. +Thither let us bend all our thoughts, to learn +What creatures there inhabit, of what mould +Or substance, how endued, and what their power +And where their weakness: how attempted best, +By force of subtlety. Though Heaven be shut, +And Heaven's high Arbitrator sit secure +In his own strength, this place may lie exposed, +The utmost border of his kingdom, left +To their defence who hold it: here, perhaps, +Some advantageous act may be achieved +By sudden onset--either with Hell-fire +To waste his whole creation, or possess +All as our own, and drive, as we were driven, +The puny habitants; or, if not drive, +Seduce them to our party, that their God +May prove their foe, and with repenting hand +Abolish his own works. This would surpass +Common revenge, and interrupt his joy +In our confusion, and our joy upraise +In his disturbance; when his darling sons, +Hurled headlong to partake with us, shall curse +Their frail original, and faded bliss-- +Faded so soon! Advise if this be worth +Attempting, or to sit in darkness here +Hatching vain empires." Thus beelzebub +Pleaded his devilish counsel--first devised +By Satan, and in part proposed: for whence, +But from the author of all ill, could spring +So deep a malice, to confound the race +Of mankind in one root, and Earth with Hell +To mingle and involve, done all to spite +The great Creator? But their spite still serves +His glory to augment. The bold design +Pleased highly those infernal States, and joy +Sparkled in all their eyes: with full assent +They vote: whereat his speech he thus renews:-- +"Well have ye judged, well ended long debate, +Synod of Gods, and, like to what ye are, +Great things resolved, which from the lowest deep +Will once more lift us up, in spite of fate, +Nearer our ancient seat--perhaps in view +Of those bright confines, whence, with neighbouring arms, +And opportune excursion, we may chance +Re-enter Heaven; or else in some mild zone +Dwell, not unvisited of Heaven's fair light, +Secure, and at the brightening orient beam +Purge off this gloom: the soft delicious air, +To heal the scar of these corrosive fires, +Shall breathe her balm. But, first, whom shall we send +In search of this new World? whom shall we find +Sufficient? who shall tempt with wandering feet +The dark, unbottomed, infinite Abyss, +And through the palpable obscure find out +His uncouth way, or spread his airy flight, +Upborne with indefatigable wings +Over the vast abrupt, ere he arrive +The happy Isle? What strength, what art, can then +Suffice, or what evasion bear him safe, +Through the strict senteries and stations thick +Of Angels watching round? Here he had need +All circumspection: and we now no less +Choice in our suffrage; for on whom we send +The weight of all, and our last hope, relies." + This said, he sat; and expectation held +His look suspense, awaiting who appeared +To second, or oppose, or undertake +The perilous attempt. But all sat mute, +Pondering the danger with deep thoughts; and each +In other's countenance read his own dismay, +Astonished. None among the choice and prime +Of those Heaven-warring champions could be found +So hardy as to proffer or accept, +Alone, the dreadful voyage; till, at last, +Satan, whom now transcendent glory raised +Above his fellows, with monarchal pride +Conscious of highest worth, unmoved thus spake:-- + "O Progeny of Heaven! Empyreal Thrones! +With reason hath deep silence and demur +Seized us, though undismayed. Long is the way +And hard, that out of Hell leads up to light. +Our prison strong, this huge convex of fire, +Outrageous to devour, immures us round +Ninefold; and gates of burning adamant, +Barred over us, prohibit all egress. +These passed, if any pass, the void profound +Of unessential Night receives him next, +Wide-gaping, and with utter loss of being +Threatens him, plunged in that abortive gulf. +If thence he scape, into whatever world, +Or unknown region, what remains him less +Than unknown dangers, and as hard escape? +But I should ill become this throne, O Peers, +And this imperial sovereignty, adorned +With splendour, armed with power, if aught proposed +And judged of public moment in the shape +Of difficulty or danger, could deter +Me from attempting. Wherefore do I assume +These royalties, and not refuse to reign, +Refusing to accept as great a share +Of hazard as of honour, due alike +To him who reigns, and so much to him due +Of hazard more as he above the rest +High honoured sits? Go, therefore, mighty Powers, +Terror of Heaven, though fallen; intend at home, +While here shall be our home, what best may ease +The present misery, and render Hell +More tolerable; if there be cure or charm +To respite, or deceive, or slack the pain +Of this ill mansion: intermit no watch +Against a wakeful foe, while I abroad +Through all the coasts of dark destruction seek +Deliverance for us all. This enterprise +None shall partake with me." Thus saying, rose +The Monarch, and prevented all reply; +Prudent lest, from his resolution raised, +Others among the chief might offer now, +Certain to be refused, what erst they feared, +And, so refused, might in opinion stand +His rivals, winning cheap the high repute +Which he through hazard huge must earn. But they +Dreaded not more th' adventure than his voice +Forbidding; and at once with him they rose. +Their rising all at once was as the sound +Of thunder heard remote. Towards him they bend +With awful reverence prone, and as a God +Extol him equal to the Highest in Heaven. +Nor failed they to express how much they praised +That for the general safety he despised +His own: for neither do the Spirits damned +Lose all their virtue; lest bad men should boast +Their specious deeds on earth, which glory excites, +Or close ambition varnished o'er with zeal. + Thus they their doubtful consultations dark +Ended, rejoicing in their matchless Chief: +As, when from mountain-tops the dusky clouds +Ascending, while the north wind sleeps, o'erspread +Heaven's cheerful face, the louring element +Scowls o'er the darkened landscape snow or shower, +If chance the radiant sun, with farewell sweet, +Extend his evening beam, the fields revive, +The birds their notes renew, and bleating herds +Attest their joy, that hill and valley rings. +O shame to men! Devil with devil damned +Firm concord holds; men only disagree +Of creatures rational, though under hope +Of heavenly grace, and, God proclaiming peace, +Yet live in hatred, enmity, and strife +Among themselves, and levy cruel wars +Wasting the earth, each other to destroy: +As if (which might induce us to accord) +Man had not hellish foes enow besides, +That day and night for his destruction wait! + The Stygian council thus dissolved; and forth +In order came the grand infernal Peers: +Midst came their mighty Paramount, and seemed +Alone th' antagonist of Heaven, nor less +Than Hell's dread Emperor, with pomp supreme, +And god-like imitated state: him round +A globe of fiery Seraphim enclosed +With bright emblazonry, and horrent arms. +Then of their session ended they bid cry +With trumpet's regal sound the great result: +Toward the four winds four speedy Cherubim +Put to their mouths the sounding alchemy, +By herald's voice explained; the hollow Abyss +Heard far adn wide, and all the host of Hell +With deafening shout returned them loud acclaim. +Thence more at ease their minds, and somewhat raised +By false presumptuous hope, the ranged Powers +Disband; and, wandering, each his several way +Pursues, as inclination or sad choice +Leads him perplexed, where he may likeliest find +Truce to his restless thoughts, and entertain +The irksome hours, till his great Chief return. +Part on the plain, or in the air sublime, +Upon the wing or in swift race contend, +As at th' Olympian games or Pythian fields; +Part curb their fiery steeds, or shun the goal +With rapid wheels, or fronted brigades form: +As when, to warn proud cities, war appears +Waged in the troubled sky, and armies rush +To battle in the clouds; before each van +Prick forth the airy knights, and couch their spears, +Till thickest legions close; with feats of arms +From either end of heaven the welkin burns. +Others, with vast Typhoean rage, more fell, +Rend up both rocks and hills, and ride the air +In whirlwind; Hell scarce holds the wild uproar:-- +As when Alcides, from Oechalia crowned +With conquest, felt th' envenomed robe, and tore +Through pain up by the roots Thessalian pines, +And Lichas from the top of Oeta threw +Into th' Euboic sea. Others, more mild, +Retreated in a silent valley, sing +With notes angelical to many a harp +Their own heroic deeds, and hapless fall +By doom of battle, and complain that Fate +Free Virtue should enthrall to Force or Chance. +Their song was partial; but the harmony +(What could it less when Spirits immortal sing?) +Suspended Hell, and took with ravishment +The thronging audience. In discourse more sweet +(For Eloquence the Soul, Song charms the Sense) +Others apart sat on a hill retired, +In thoughts more elevate, and reasoned high +Of Providence, Foreknowledge, Will, and Fate-- +Fixed fate, free will, foreknowledge absolute, +And found no end, in wandering mazes lost. +Of good and evil much they argued then, +Of happiness and final misery, +Passion and apathy, and glory and shame: +Vain wisdom all, and false philosophy!-- +Yet, with a pleasing sorcery, could charm +Pain for a while or anguish, and excite +Fallacious hope, or arm th' obdured breast +With stubborn patience as with triple steel. +Another part, in squadrons and gross bands, +On bold adventure to discover wide +That dismal world, if any clime perhaps +Might yield them easier habitation, bend +Four ways their flying march, along the banks +Of four infernal rivers, that disgorge +Into the burning lake their baleful streams-- +Abhorred Styx, the flood of deadly hate; +Sad Acheron of sorrow, black and deep; +Cocytus, named of lamentation loud +Heard on the rueful stream; fierce Phlegeton, +Whose waves of torrent fire inflame with rage. +Far off from these, a slow and silent stream, +Lethe, the river of oblivion, rolls +Her watery labyrinth, whereof who drinks +Forthwith his former state and being forgets-- +Forgets both joy and grief, pleasure and pain. +Beyond this flood a frozen continent +Lies dark and wild, beat with perpetual storms +Of whirlwind and dire hail, which on firm land +Thaws not, but gathers heap, and ruin seems +Of ancient pile; all else deep snow and ice, +A gulf profound as that Serbonian bog +Betwixt Damiata and Mount Casius old, +Where armies whole have sunk: the parching air +Burns frore, and cold performs th' effect of fire. +Thither, by harpy-footed Furies haled, +At certain revolutions all the damned +Are brought; and feel by turns the bitter change +Of fierce extremes, extremes by change more fierce, +From beds of raging fire to starve in ice +Their soft ethereal warmth, and there to pine +Immovable, infixed, and frozen round +Periods of time,--thence hurried back to fire. +They ferry over this Lethean sound +Both to and fro, their sorrow to augment, +And wish and struggle, as they pass, to reach +The tempting stream, with one small drop to lose +In sweet forgetfulness all pain and woe, +All in one moment, and so near the brink; +But Fate withstands, and, to oppose th' attempt, +Medusa with Gorgonian terror guards +The ford, and of itself the water flies +All taste of living wight, as once it fled +The lip of Tantalus. Thus roving on +In confused march forlorn, th' adventurous bands, +With shuddering horror pale, and eyes aghast, +Viewed first their lamentable lot, and found +No rest. Through many a dark and dreary vale +They passed, and many a region dolorous, +O'er many a frozen, many a fiery alp, +Rocks, caves, lakes, fens, bogs, dens, and shades of death-- +A universe of death, which God by curse +Created evil, for evil only good; +Where all life dies, death lives, and Nature breeds, +Perverse, all monstrous, all prodigious things, +Obominable, inutterable, and worse +Than fables yet have feigned or fear conceived, +Gorgons, and Hydras, and Chimeras dire. + Meanwhile the Adversary of God and Man, +Satan, with thoughts inflamed of highest design, +Puts on swift wings, and toward the gates of Hell +Explores his solitary flight: sometimes +He scours the right hand coast, sometimes the left; +Now shaves with level wing the deep, then soars +Up to the fiery concave towering high. +As when far off at sea a fleet descried +Hangs in the clouds, by equinoctial winds +Close sailing from Bengala, or the isles +Of Ternate and Tidore, whence merchants bring +Their spicy drugs; they on the trading flood, +Through the wide Ethiopian to the Cape, +Ply stemming nightly toward the pole: so seemed +Far off the flying Fiend. At last appear +Hell-bounds, high reaching to the horrid roof, +And thrice threefold the gates; three folds were brass, +Three iron, three of adamantine rock, +Impenetrable, impaled with circling fire, +Yet unconsumed. Before the gates there sat +On either side a formidable Shape. +The one seemed woman to the waist, and fair, +But ended foul in many a scaly fold, +Voluminous and vast--a serpent armed +With mortal sting. About her middle round +A cry of Hell-hounds never-ceasing barked +With wide Cerberean mouths full loud, and rung +A hideous peal; yet, when they list, would creep, +If aught disturbed their noise, into her womb, +And kennel there; yet there still barked and howled +Within unseen. Far less abhorred than these +Vexed Scylla, bathing in the sea that parts +Calabria from the hoarse Trinacrian shore; +Nor uglier follow the night-hag, when, called +In secret, riding through the air she comes, +Lured with the smell of infant blood, to dance +With Lapland witches, while the labouring moon +Eclipses at their charms. The other Shape-- +If shape it might be called that shape had none +Distinguishable in member, joint, or limb; +Or substance might be called that shadow seemed, +For each seemed either--black it stood as Night, +Fierce as ten Furies, terrible as Hell, +And shook a dreadful dart: what seemed his head +The likeness of a kingly crown had on. +Satan was now at hand, and from his seat +The monster moving onward came as fast +With horrid strides; Hell trembled as he strode. +Th' undaunted Fiend what this might be admired-- +Admired, not feared (God and his Son except, +Created thing naught valued he nor shunned), +And with disdainful look thus first began:-- + "Whence and what art thou, execrable Shape, +That dar'st, though grim and terrible, advance +Thy miscreated front athwart my way +To yonder gates? Through them I mean to pass, +That be assured, without leave asked of thee. +Retire; or taste thy folly, and learn by proof, +Hell-born, not to contend with Spirits of Heaven." + To whom the Goblin, full of wrath, replied:-- +"Art thou that traitor Angel? art thou he, +Who first broke peace in Heaven and faith, till then +Unbroken, and in proud rebellious arms +Drew after him the third part of Heaven's sons, +Conjured against the Highest--for which both thou +And they, outcast from God, are here condemned +To waste eternal days in woe and pain? +And reckon'st thou thyself with Spirits of Heaven +Hell-doomed, and breath'st defiance here and scorn, +Where I reign king, and, to enrage thee more, +Thy king and lord? Back to thy punishment, +False fugitive; and to thy speed add wings, +Lest with a whip of scorpions I pursue +Thy lingering, or with one stroke of this dart +Strange horror seize thee, and pangs unfelt before." + So spake the grisly Terror, and in shape, +So speaking and so threatening, grew tenfold, +More dreadful and deform. On th' other side, +Incensed with indignation, Satan stood +Unterrified, and like a comet burned, +That fires the length of Ophiuchus huge +In th' arctic sky, and from his horrid hair +Shakes pestilence and war. Each at the head +Levelled his deadly aim; their fatal hands +No second stroke intend; and such a frown +Each cast at th' other as when two black clouds, +With heaven's artillery fraught, came rattling on +Over the Caspian,--then stand front to front +Hovering a space, till winds the signal blow +To join their dark encounter in mid-air. +So frowned the mighty combatants that Hell +Grew darker at their frown; so matched they stood; +For never but once more was wither like +To meet so great a foe. And now great deeds +Had been achieved, whereof all Hell had rung, +Had not the snaky Sorceress, that sat +Fast by Hell-gate and kept the fatal key, +Risen, and with hideous outcry rushed between. + "O father, what intends thy hand," she cried, +"Against thy only son? What fury, O son, +Possesses thee to bend that mortal dart +Against thy father's head? And know'st for whom? +For him who sits above, and laughs the while +At thee, ordained his drudge to execute +Whate'er his wrath, which he calls justice, bids-- +His wrath, which one day will destroy ye both!" + She spake, and at her words the hellish Pest +Forbore: then these to her Satan returned:-- + "So strange thy outcry, and thy words so strange +Thou interposest, that my sudden hand, +Prevented, spares to tell thee yet by deeds +What it intends, till first I know of thee +What thing thou art, thus double-formed, and why, +In this infernal vale first met, thou call'st +Me father, and that phantasm call'st my son. +I know thee not, nor ever saw till now +Sight more detestable than him and thee." + T' whom thus the Portress of Hell-gate replied:-- +"Hast thou forgot me, then; and do I seem +Now in thine eye so foul?--once deemed so fair +In Heaven, when at th' assembly, and in sight +Of all the Seraphim with thee combined +In bold conspiracy against Heaven's King, +All on a sudden miserable pain +Surprised thee, dim thine eyes and dizzy swum +In darkness, while thy head flames thick and fast +Threw forth, till on the left side opening wide, +Likest to thee in shape and countenance bright, +Then shining heavenly fair, a goddess armed, +Out of thy head I sprung. Amazement seized +All th' host of Heaven; back they recoiled afraid +At first, and called me Sin, and for a sign +Portentous held me; but, familiar grown, +I pleased, and with attractive graces won +The most averse--thee chiefly, who, full oft +Thyself in me thy perfect image viewing, +Becam'st enamoured; and such joy thou took'st +With me in secret that my womb conceived +A growing burden. Meanwhile war arose, +And fields were fought in Heaven: wherein remained +(For what could else?) to our Almighty Foe +Clear victory; to our part loss and rout +Through all the Empyrean. Down they fell, +Driven headlong from the pitch of Heaven, down +Into this Deep; and in the general fall +I also: at which time this powerful key +Into my hands was given, with charge to keep +These gates for ever shut, which none can pass +Without my opening. Pensive here I sat +Alone; but long I sat not, till my womb, +Pregnant by thee, and now excessive grown, +Prodigious motion felt and rueful throes. +At last this odious offspring whom thou seest, +Thine own begotten, breaking violent way, +Tore through my entrails, that, with fear and pain +Distorted, all my nether shape thus grew +Transformed: but he my inbred enemy +Forth issued, brandishing his fatal dart, +Made to destroy. I fled, and cried out Death! +Hell trembled at the hideous name, and sighed +From all her caves, and back resounded Death! +I fled; but he pursued (though more, it seems, +Inflamed with lust than rage), and, swifter far, +Me overtook, his mother, all dismayed, +And, in embraces forcible and foul +Engendering with me, of that rape begot +These yelling monsters, that with ceaseless cry +Surround me, as thou saw'st--hourly conceived +And hourly born, with sorrow infinite +To me; for, when they list, into the womb +That bred them they return, and howl, and gnaw +My bowels, their repast; then, bursting forth +Afresh, with conscious terrors vex me round, +That rest or intermission none I find. +Before mine eyes in opposition sits +Grim Death, my son and foe, who set them on, +And me, his parent, would full soon devour +For want of other prey, but that he knows +His end with mine involved, and knows that I +Should prove a bitter morsel, and his bane, +Whenever that shall be: so Fate pronounced. +But thou, O father, I forewarn thee, shun +His deadly arrow; neither vainly hope +To be invulnerable in those bright arms, +Through tempered heavenly; for that mortal dint, +Save he who reigns above, none can resist." + She finished; and the subtle Fiend his lore +Soon learned, now milder, and thus answered smooth:-- + "Dear daughter--since thou claim'st me for thy sire, +And my fair son here show'st me, the dear pledge +Of dalliance had with thee in Heaven, and joys +Then sweet, now sad to mention, through dire change +Befallen us unforeseen, unthought-of--know, +I come no enemy, but to set free +From out this dark and dismal house of pain +Both him and thee, and all the heavenly host +Of Spirits that, in our just pretences armed, +Fell with us from on high. From them I go +This uncouth errand sole, and one for all +Myself expose, with lonely steps to tread +Th' unfounded Deep, and through the void immense +To search, with wandering quest, a place foretold +Should be--and, by concurring signs, ere now +Created vast and round--a place of bliss +In the purlieus of Heaven; and therein placed +A race of upstart creatures, to supply +Perhaps our vacant room, though more removed, +Lest Heaven, surcharged with potent multitude, +Might hap to move new broils. Be this, or aught +Than this more secret, now designed, I haste +To know; and, this once known, shall soon return, +And bring ye to the place where thou and Death +Shall dwell at ease, and up and down unseen +Wing silently the buxom air, embalmed +With odours. There ye shall be fed and filled +Immeasurably; all things shall be your prey." + He ceased; for both seemed highly pleased, and Death +Grinned horrible a ghastly smile, to hear +His famine should be filled, and blessed his maw +Destined to that good hour. No less rejoiced +His mother bad, and thus bespake her sire:-- + "The key of this infernal Pit, by due +And by command of Heaven's all-powerful King, +I keep, by him forbidden to unlock +These adamantine gates; against all force +Death ready stands to interpose his dart, +Fearless to be o'ermatched by living might. +But what owe I to his commands above, +Who hates me, and hath hither thrust me down +Into this gloom of Tartarus profound, +To sit in hateful office here confined, +Inhabitant of Heaven and heavenly born-- +Here in perpetual agony and pain, +With terrors and with clamours compassed round +Of mine own brood, that on my bowels feed? +Thou art my father, thou my author, thou +My being gav'st me; whom should I obey +But thee? whom follow? Thou wilt bring me soon +To that new world of light and bliss, among +The gods who live at ease, where I shall reign +At thy right hand voluptuous, as beseems +Thy daughter and thy darling, without end." + Thus saying, from her side the fatal key, +Sad instrument of all our woe, she took; +And, towards the gate rolling her bestial train, +Forthwith the huge portcullis high up-drew, +Which, but herself, not all the Stygian Powers +Could once have moved; then in the key-hole turns +Th' intricate wards, and every bolt and bar +Of massy iron or solid rock with ease +Unfastens. On a sudden open fly, +With impetuous recoil and jarring sound, +Th' infernal doors, and on their hinges grate +Harsh thunder, that the lowest bottom shook +Of Erebus. She opened; but to shut +Excelled her power: the gates wide open stood, +That with extended wings a bannered host, +Under spread ensigns marching, mibht pass through +With horse and chariots ranked in loose array; +So wide they stood, and like a furnace-mouth +Cast forth redounding smoke and ruddy flame. +Before their eyes in sudden view appear +The secrets of the hoary Deep--a dark +Illimitable ocean, without bound, +Without dimension; where length, breadth, and height, +And time, and place, are lost; where eldest Night +And Chaos, ancestors of Nature, hold +Eternal anarchy, amidst the noise +Of endless wars, and by confusion stand. +For Hot, Cold, Moist, and Dry, four champions fierce, +Strive here for mastery, and to battle bring +Their embryon atoms: they around the flag +Of each his faction, in their several clans, +Light-armed or heavy, sharp, smooth, swift, or slow, +Swarm populous, unnumbered as the sands +Of Barca or Cyrene's torrid soil, +Levied to side with warring winds, and poise +Their lighter wings. To whom these most adhere +He rules a moment: Chaos umpire sits, +And by decision more embroils the fray +By which he reigns: next him, high arbiter, +Chance governs all. Into this wild Abyss, +The womb of Nature, and perhaps her grave, +Of neither sea, nor shore, nor air, nor fire, +But all these in their pregnant causes mixed +Confusedly, and which thus must ever fight, +Unless th' Almighty Maker them ordain +His dark materials to create more worlds-- +Into this wild Abyss the wary Fiend +Stood on the brink of Hell and looked a while, +Pondering his voyage; for no narrow frith +He had to cross. Nor was his ear less pealed +With noises loud and ruinous (to compare +Great things with small) than when Bellona storms +With all her battering engines, bent to rase +Some capital city; or less than if this frame +Of Heaven were falling, and these elements +In mutiny had from her axle torn +The steadfast Earth. At last his sail-broad vans +He spread for flight, and, in the surging smoke +Uplifted, spurns the ground; thence many a league, +As in a cloudy chair, ascending rides +Audacious; but, that seat soon failing, meets +A vast vacuity. All unawares, +Fluttering his pennons vain, plumb-down he drops +Ten thousand fathom deep, and to this hour +Down had been falling, had not, by ill chance, +The strong rebuff of some tumultuous cloud, +Instinct with fire and nitre, hurried him +As many miles aloft. That fury stayed-- +Quenched in a boggy Syrtis, neither sea, +Nor good dry land--nigh foundered, on he fares, +Treading the crude consistence, half on foot, +Half flying; behoves him now both oar and sail. +As when a gryphon through the wilderness +With winged course, o'er hill or moory dale, +Pursues the Arimaspian, who by stealth +Had from his wakeful custody purloined +The guarded gold; so eagerly the Fiend +O'er bog or steep, through strait, rough, dense, or rare, +With head, hands, wings, or feet, pursues his way, +And swims, or sinks, or wades, or creeps, or flies. +At length a universal hubbub wild +Of stunning sounds, and voices all confused, +Borne through the hollow dark, assaults his ear +With loudest vehemence. Thither he plies +Undaunted, to meet there whatever Power +Or Spirit of the nethermost Abyss +Might in that noise reside, of whom to ask +Which way the nearest coast of darkness lies +Bordering on light; when straight behold the throne +Of Chaos, and his dark pavilion spread +Wide on the wasteful Deep! With him enthroned +Sat sable-vested Night, eldest of things, +The consort of his reign; and by them stood +Orcus and Ades, and the dreaded name +Of Demogorgon; Rumour next, and Chance, +And Tumult, and Confusion, all embroiled, +And Discord with a thousand various mouths. + T' whom Satan, turning boldly, thus:--"Ye Powers +And Spirtis of this nethermost Abyss, +Chaos and ancient Night, I come no spy +With purpose to explore or to disturb +The secrets of your realm; but, by constraint +Wandering this darksome desert, as my way +Lies through your spacious empire up to light, +Alone and without guide, half lost, I seek, +What readiest path leads where your gloomy bounds +Confine with Heaven; or, if some other place, +From your dominion won, th' Ethereal King +Possesses lately, thither to arrive +I travel this profound. Direct my course: +Directed, no mean recompense it brings +To your behoof, if I that region lost, +All usurpation thence expelled, reduce +To her original darkness and your sway +(Which is my present journey), and once more +Erect the standard there of ancient Night. +Yours be th' advantage all, mine the revenge!" + Thus Satan; and him thus the Anarch old, +With faltering speech and visage incomposed, +Answered: "I know thee, stranger, who thou art-- *** +That mighty leading Angel, who of late +Made head against Heaven's King, though overthrown. +I saw and heard; for such a numerous host +Fled not in silence through the frighted Deep, +With ruin upon ruin, rout on rout, +Confusion worse confounded; and Heaven-gates +Poured out by millions her victorious bands, +Pursuing. I upon my frontiers here +Keep residence; if all I can will serve +That little which is left so to defend, +Encroached on still through our intestine broils +Weakening the sceptre of old Night: first, Hell, +Your dungeon, stretching far and wide beneath; +Now lately Heaven and Earth, another world +Hung o'er my realm, linked in a golden chain +To that side Heaven from whence your legions fell! +If that way be your walk, you have not far; +So much the nearer danger. Go, and speed; +Havoc, and spoil, and ruin, are my gain." + He ceased; and Satan stayed not to reply, +But, glad that now his sea should find a shore, +With fresh alacrity and force renewed +Springs upward, like a pyramid of fire, +Into the wild expanse, and through the shock +Of fighting elements, on all sides round +Environed, wins his way; harder beset +And more endangered than when Argo passed +Through Bosporus betwixt the justling rocks, +Or when Ulysses on the larboard shunned +Charybdis, and by th' other whirlpool steered. +So he with difficulty and labour hard +Moved on, with difficulty and labour he; +But, he once passed, soon after, when Man fell, +Strange alteration! Sin and Death amain, +Following his track (such was the will of Heaven) +Paved after him a broad and beaten way +Over the dark Abyss, whose boiling gulf +Tamely endured a bridge of wondrous length, +From Hell continued, reaching th' utmost orb +Of this frail World; by which the Spirits perverse +With easy intercourse pass to and fro +To tempt or punish mortals, except whom +God and good Angels guard by special grace. + But now at last the sacred influence +Of light appears, and from the walls of Heaven +Shoots far into the bosom of dim Night +A glimmering dawn. Here Nature first begins +Her farthest verge, and Chaos to retire, +As from her outmost works, a broken foe, +With tumult less and with less hostile din; +That Satan with less toil, and now with ease, +Wafts on the calmer wave by dubious light, +And, like a weather-beaten vessel, holds +Gladly the port, though shrouds and tackle torn; +Or in the emptier waste, resembling air, +Weighs his spread wings, at leisure to behold +Far off th' empyreal Heaven, extended wide +In circuit, undetermined square or round, +With opal towers and battlements adorned +Of living sapphire, once his native seat; +And, fast by, hanging in a golden chain, +This pendent World, in bigness as a star +Of smallest magnitude close by the moon. +Thither, full fraught with mischievous revenge, +Accursed, and in a cursed hour, he hies. + + + +Book III + + +Hail, holy Light, offspring of Heaven firstborn, +Or of the Eternal coeternal beam +May I express thee unblam'd? since God is light, +And never but in unapproached light +Dwelt from eternity, dwelt then in thee +Bright effluence of bright essence increate. +Or hear"st thou rather pure ethereal stream, +Whose fountain who shall tell? before the sun, +Before the Heavens thou wert, and at the voice +Of God, as with a mantle, didst invest *** +The rising world of waters dark and deep, +Won from the void and formless infinite. +Thee I re-visit now with bolder wing, +Escap'd the Stygian pool, though long detain'd +In that obscure sojourn, while in my flight +Through utter and through middle darkness borne, +With other notes than to the Orphean lyre +I sung of Chaos and eternal Night; +Taught by the heavenly Muse to venture down +The dark descent, and up to re-ascend, +Though hard and rare: Thee I revisit safe, +And feel thy sovran vital lamp; but thou +Revisit'st not these eyes, that roll in vain +To find thy piercing ray, and find no dawn; +So thick a drop serene hath quench'd their orbs, +Or dim suffusion veil'd. Yet not the more +Cease I to wander, where the Muses haunt, +Clear spring, or shady grove, or sunny hill, +Smit with the love of sacred song; but chief +Thee, Sion, and the flowery brooks beneath, +That wash thy hallow'd feet, and warbling flow, +Nightly I visit: nor sometimes forget +So were I equall'd with them in renown, +Thy sovran command, that Man should find grace; +Blind Thamyris, and blind Maeonides, +And Tiresias, and Phineus, prophets old: +Then feed on thoughts, that voluntary move +Harmonious numbers; as the wakeful bird +Sings darkling, and in shadiest covert hid +Tunes her nocturnal note. Thus with the year +Seasons return; but not to me returns +Day, or the sweet approach of even or morn, +Or sight of vernal bloom, or summer's rose, +Or flocks, or herds, or human face divine; +But cloud instead, and ever-during dark +Surrounds me, from the cheerful ways of men +Cut off, and for the book of knowledge fair +Presented with a universal blank +Of nature's works to me expung'd and ras'd, +And wisdom at one entrance quite shut out. +So much the rather thou, celestial Light, +Shine inward, and the mind through all her powers +Irradiate; there plant eyes, all mist from thence +Purge and disperse, that I may see and tell +Of things invisible to mortal sight. +Now had the Almighty Father from above, +From the pure empyrean where he sits +High thron'd above all highth, bent down his eye +His own works and their works at once to view: +About him all the Sanctities of Heaven +Stood thick as stars, and from his sight receiv'd +Beatitude past utterance; on his right +The radiant image of his glory sat, +His only son; on earth he first beheld +Our two first parents, yet the only two +Of mankind in the happy garden plac'd +Reaping immortal fruits of joy and love, +Uninterrupted joy, unrivall'd love, +In blissful solitude; he then survey'd +Hell and the gulf between, and Satan there +Coasting the wall of Heaven on this side Night +In the dun air sublime, and ready now +To stoop with wearied wings, and willing feet, +On the bare outside of this world, that seem'd +Firm land imbosom'd, without firmament, +Uncertain which, in ocean or in air. +Him God beholding from his prospect high, +Wherein past, present, future, he beholds, +Thus to his only Son foreseeing spake. +Only begotten Son, seest thou what rage +Transports our Adversary? whom no bounds +Prescrib'd no bars of Hell, nor all the chains +Heap'd on him there, nor yet the main abyss +Wide interrupt, can hold; so bent he seems +On desperate revenge, that shall redound +Upon his own rebellious head. And now, +Through all restraint broke loose, he wings his way +Not far off Heaven, in the precincts of light, +Directly towards the new created world, +And man there plac'd, with purpose to assay +If him by force he can destroy, or, worse, +By some false guile pervert; and shall pervert; +For man will hearken to his glozing lies, +And easily transgress the sole command, +Sole pledge of his obedience: So will fall +He and his faithless progeny: Whose fault? +Whose but his own? ingrate, he had of me +All he could have; I made him just and right, +Sufficient to have stood, though free to fall. +Such I created all the ethereal Powers +And Spirits, both them who stood, and them who fail'd; +Freely they stood who stood, and fell who fell. +Not free, what proof could they have given sincere +Of true allegiance, constant faith or love, +Where only what they needs must do appear'd, +Not what they would? what praise could they receive? +What pleasure I from such obedience paid, +When will and reason (reason also is choice) +Useless and vain, of freedom both despoil'd, +Made passive both, had serv'd necessity, +Not me? they therefore, as to right belong$ 'd, +So were created, nor can justly accuse +Their Maker, or their making, or their fate, +As if predestination over-rul'd +Their will dispos'd by absolute decree +Or high foreknowledge they themselves decreed +Their own revolt, not I; if I foreknew, +Foreknowledge had no influence on their fault, +Which had no less proved certain unforeknown. +So without least impulse or shadow of fate, +Or aught by me immutably foreseen, +They trespass, authors to themselves in all +Both what they judge, and what they choose; for so +I form'd them free: and free they must remain, +Till they enthrall themselves; I else must change +Their nature, and revoke the high decree +Unchangeable, eternal, which ordain'd +$THeir freedom: they themselves ordain'd their fall. +The first sort by their own suggestion fell, +Self-tempted, self-deprav'd: Man falls, deceiv'd +By the other first: Man therefore shall find grace, +The other none: In mercy and justice both, +Through Heaven and Earth, so shall my glory excel; +But Mercy, first and last, shall brightest shine. +Thus while God spake, ambrosial fragrance fill'd +All Heaven, and in the blessed Spirits elect +Sense of new joy ineffable diffus'd. +Beyond compare the Son of God was seen +Most glorious; in him all his Father shone +Substantially express'd; and in his face +Divine compassion visibly appear'd, +Love without end, and without measure grace, +Which uttering, thus he to his Father spake. +O Father, gracious was that word which clos'd +Thy sovran command, that Man should find grace; +, that Man should find grace; +For which both Heaven and earth shall high extol +Thy praises, with the innumerable sound +Of hymns and sacred songs, wherewith thy throne +Encompass'd shall resound thee ever blest. +For should Man finally be lost, should Man, +Thy creature late so lov'd, thy youngest son, +Fall circumvented thus by fraud, though join'd +With his own folly? that be from thee far, +That far be from thee, Father, who art judge +Of all things made, and judgest only right. +Or shall the Adversary thus obtain +His end, and frustrate thine? shall he fulfill +His malice, and thy goodness bring to nought, +Or proud return, though to his heavier doom, +Yet with revenge accomplish'd, and to Hell +Draw after him the whole race of mankind, +By him corrupted? or wilt thou thyself +Abolish thy creation, and unmake +For him, what for thy glory thou hast made? +So should thy goodness and thy greatness both +Be question'd and blasphem'd without defence. +To whom the great Creator thus replied. +O son, in whom my soul hath chief delight, +Son of my bosom, Son who art alone. +My word, my wisdom, and effectual might, +All hast thou spoken as my thoughts are, all +As my eternal purpose hath decreed; +Man shall not quite be lost, but sav'd who will; +Yet not of will in him, but grace in me +Freely vouchsaf'd; once more I will renew +His lapsed powers, though forfeit; and enthrall'd +By sin to foul exorbitant desires; +Upheld by me, yet once more he shall stand +On even ground against his mortal foe; +By me upheld, that he may know how frail +His fallen condition is, and to me owe +All his deliverance, and to none but me. +Some I have chosen of peculiar grace, +Elect above the rest; so is my will: +The rest shall hear me call, and oft be warn'd +Their sinful state, and to appease betimes +The incensed Deity, while offer'd grace +Invites; for I will clear their senses dark, +What may suffice, and soften stony hearts +To pray, repent, and bring obedience due. +To prayer, repentance, and obedience due, +Though but endeavour'd with sincere intent, +Mine ear shall not be slow, mine eye not shut. +And I will place within them as a guide, +My umpire Conscience; whom if they will hear, +Light after light, well us'd, they shall attain, +And to the end, persisting, safe arrive. +This my long sufferance, and my day of grace, +They who neglect and scorn, shall never taste; +But hard be harden'd, blind be blinded more, +That they may stumble on, and deeper fall; +And none but such from mercy I exclude. +But yet all is not done; Man disobeying, +Disloyal, breaks his fealty, and sins +Against the high supremacy of Heaven, +Affecting God-head, and, so losing all, +To expiate his treason hath nought left, +But to destruction sacred and devote, +He, with his whole posterity, must die, +Die he or justice must; unless for him +Some other able, and as willing, pay +The rigid satisfaction, death for death. +Say, heavenly Powers, where shall we find such love? +Which of you will be mortal, to redeem +Man's mortal crime, and just the unjust to save? +Dwells in all Heaven charity so dear? +And silence was in Heaven: $ on Man's behalf +He ask'd, but all the heavenly quire stood mute, +Patron or intercessour none appear'd, +Much less that durst upon his own head draw +The deadly forfeiture, and ransom set. +And now without redemption all mankind +Must have been lost, adjudg'd to Death and Hell +By doom severe, had not the Son of God, +In whom the fulness dwells of love divine, +His dearest mediation thus renew'd. +Father, thy word is past, Man shall find grace; +And shall grace not find means, that finds her way, +The speediest of thy winged messengers, +To visit all thy creatures, and to all +Comes unprevented, unimplor'd, unsought? +Happy for Man, so coming; he her aid +Can never seek, once dead in sins, and lost; +Atonement for himself, or offering meet, +Indebted and undone, hath none to bring; +Behold me then: me for him, life for life +I offer: on me let thine anger fall; +Account me Man; I for his sake will leave + Thy bosom, and this glory next to thee + Freely put off, and for him lastly die + Well pleased; on me let Death wreak all his rage. + Under his gloomy power I shall not long + Lie vanquished. Thou hast given me to possess + Life in myself for ever; by thee I live; + Though now to Death I yield, and am his due, + All that of me can die, yet, that debt paid, + $ thou wilt not leave me in the loathsome grave + His prey, nor suffer my unspotted soul + For ever with corruption there to dwell; + But I shall rise victorious, and subdue + My vanquisher, spoiled of his vaunted spoil. + Death his death's wound shall then receive, and stoop + Inglorious, of his mortal sting disarmed; + I through the ample air in triumph high + Shall lead Hell captive maugre Hell, and show +The powers of darkness bound. Thou, at the sight + Pleased, out of Heaven shalt look down and smile, + While, by thee raised, I ruin all my foes; + Death last, and with his carcase glut the grave; + Then, with the multitude of my redeemed, + Shall enter Heaven, long absent, and return, + Father, to see thy face, wherein no cloud + Of anger shall remain, but peace assured + And reconcilement: wrath shall be no more + Thenceforth, but in thy presence joy entire. + His words here ended; but his meek aspect + Silent yet spake, and breathed immortal love + To mortal men, above which only shone + Filial obedience: as a sacrifice + Glad to be offered, he attends the will + Of his great Father. Admiration seized + All Heaven, what this might mean, and whither tend, + Wondering; but soon th' Almighty thus replied. + O thou in Heaven and Earth the only peace + Found out for mankind under wrath, O thou + My sole complacence! Well thou know'st how dear + To me are all my works; nor Man the least, + Though last created, that for him I spare + Thee from my bosom and right hand, to save, + By losing thee a while, the whole race lost. + + 00021053 + Thou, therefore, whom thou only canst redeem, + Their nature also to thy nature join; + And be thyself Man among men on Earth, + Made flesh, when time shall be, of virgin seed, + By wondrous birth; be thou in Adam's room +The head of all mankind, though Adam's son. +As in him perish all men, so in thee, +As from a second root, shall be restored +As many as are restored, without thee none. +His crime makes guilty all his sons; thy merit, +Imputed, shall absolve them who renounce +Their own both righteous and unrighteous deeds, +And live in thee transplanted, and from thee +Receive new life. So Man, as is most just, +Shall satisfy for Man, be judged and die, +And dying rise, and rising with him raise +His brethren, ransomed with his own dear life. +So heavenly love shall outdo hellish hate, +Giving to death, and dying to redeem, +So dearly to redeem what hellish hate +So easily destroyed, and still destroys +In those who, when they may, accept not grace. +Nor shalt thou, by descending to assume +Man's nature, lessen or degrade thine own. +Because thou hast, though throned in highest bliss +Equal to God, and equally enjoying +God-like fruition, quitted all, to save +A world from utter loss, and hast been found +By merit more than birthright Son of God, +Found worthiest to be so by being good, +Far more than great or high; because in thee +Love hath abounded more than glory abounds; +Therefore thy humiliation shall exalt +With thee thy manhood also to this throne: +Here shalt thou sit incarnate, here shalt reign +Both God and Man, Son both of God and Man, +Anointed universal King; all power +I give thee; reign for ever, and assume +Thy merits; under thee, as head supreme, +Thrones, Princedoms, Powers, Dominions, I reduce: +All knees to thee shall bow, of them that bide +In Heaven, or Earth, or under Earth in Hell. +When thou, attended gloriously from Heaven, +Shalt in the sky appear, and from thee send +The summoning Arch-Angels to proclaim +Thy dread tribunal; forthwith from all winds, +The living, and forthwith the cited dead +Of all past ages, to the general doom +Shall hasten; such a peal shall rouse their sleep. +Then, all thy saints assembled, thou shalt judge +Bad Men and Angels; they, arraigned, shall sink +Beneath thy sentence; Hell, her numbers full, +Thenceforth shall be for ever shut. Mean while +The world shall burn, and from her ashes spring +New Heaven and Earth, wherein the just shall dwell, +And, after all their tribulations long, +See golden days, fruitful of golden deeds, +With joy and peace triumphing, and fair truth. +Then thou thy regal scepter shalt lay by, +For regal scepter then no more shall need, +God shall be all in all. But, all ye Gods, +Adore him, who to compass all this dies; +Adore the Son, and honour him as me. +No sooner had the Almighty ceased, but all +The multitude of Angels, with a shout +Loud as from numbers without number, sweet +As from blest voices, uttering joy, Heaven rung +With jubilee, and loud Hosannas filled +The eternal regions: Lowly reverent +Towards either throne they bow, and to the ground +With solemn adoration down they cast +Their crowns inwove with amarant and gold; +Immortal amarant, a flower which once +In Paradise, fast by the tree of life, +Began to bloom; but soon for man's offence +To Heaven removed, where first it grew, there grows, +And flowers aloft shading the fount of life, +And where the river of bliss through midst of Heaven +Rolls o'er Elysian flowers her amber stream; +With these that never fade the Spirits elect +Bind their resplendent locks inwreathed with beams; +Now in loose garlands thick thrown off, the bright +Pavement, that like a sea of jasper shone, +Impurpled with celestial roses smiled. +Then, crowned again, their golden harps they took, +Harps ever tuned, that glittering by their side +Like quivers hung, and with preamble sweet +Of charming symphony they introduce +Their sacred song, and waken raptures high; +No voice exempt, no voice but well could join +Melodious part, such concord is in Heaven. +Thee, Father, first they sung Omnipotent, +Immutable, Immortal, Infinite, +Eternal King; the Author of all being, +Fonntain of light, thyself invisible +Amidst the glorious brightness where thou sit'st +Throned inaccessible, but when thou shadest +The full blaze of thy beams, and, through a cloud +Drawn round about thee like a radiant shrine, +Dark with excessive bright thy skirts appear, +Yet dazzle Heaven, that brightest Seraphim +Approach not, but with both wings veil their eyes. +Thee next they sang of all creation first, +Begotten Son, Divine Similitude, +In whose conspicuous countenance, without cloud +Made visible, the Almighty Father shines, +Whom else no creature can behold; on thee +Impressed the effulgence of his glory abides, +Transfused on thee his ample Spirit rests. +He Heaven of Heavens and all the Powers therein +By thee created; and by thee threw down +The aspiring Dominations: Thou that day +Thy Father's dreadful thunder didst not spare, +Nor stop thy flaming chariot-wheels, that shook +Heaven's everlasting frame, while o'er the necks +Thou drovest of warring Angels disarrayed. +Back from pursuit thy Powers with loud acclaim +Thee only extolled, Son of thy Father's might, +To execute fierce vengeance on his foes, +Not so on Man: Him through their malice fallen, +Father of mercy and grace, thou didst not doom +So strictly, but much more to pity incline: +No sooner did thy dear and only Son +Perceive thee purposed not to doom frail Man +So strictly, but much more to pity inclined, +He to appease thy wrath, and end the strife +Of mercy and justice in thy face discerned, +Regardless of the bliss wherein he sat +Second to thee, offered himself to die +For Man's offence. O unexampled love, +Love no where to be found less than Divine! +Hail, Son of God, Saviour of Men! Thy name +Shall be the copious matter of my song +Henceforth, and never shall my heart thy praise +Forget, nor from thy Father's praise disjoin. +Thus they in Heaven, above the starry sphere, +Their happy hours in joy and hymning spent. +Mean while upon the firm opacous globe +Of this round world, whose first convex divides +The luminous inferiour orbs, enclosed +From Chaos, and the inroad of Darkness old, +Satan alighted walks: A globe far off +It seemed, now seems a boundless continent +Dark, waste, and wild, under the frown of Night +Starless exposed, and ever-threatening storms +Of Chaos blustering round, inclement sky; +Save on that side which from the wall of Heaven, +Though distant far, some small reflection gains +Of glimmering air less vexed with tempest loud: +Here walked the Fiend at large in spacious field. +As when a vultur on Imaus bred, +Whose snowy ridge the roving Tartar bounds, +Dislodging from a region scarce of prey +To gorge the flesh of lambs or yeanling kids, +On hills where flocks are fed, flies toward the springs +Of Ganges or Hydaspes, Indian streams; +But in his way lights on the barren plains +Of Sericana, where Chineses drive +With sails and wind their cany waggons light: +So, on this windy sea of land, the Fiend +Walked up and down alone, bent on his prey; +Alone, for other creature in this place, +Living or lifeless, to be found was none; +None yet, but store hereafter from the earth +Up hither like aereal vapours flew +Of all things transitory and vain, when sin +With vanity had filled the works of men: +Both all things vain, and all who in vain things +Built their fond hopes of glory or lasting fame, +Or happiness in this or the other life; +All who have their reward on earth, the fruits +Of painful superstition and blind zeal, +Nought seeking but the praise of men, here find +Fit retribution, empty as their deeds; +All the unaccomplished works of Nature's hand, +Abortive, monstrous, or unkindly mixed, +Dissolved on earth, fleet hither, and in vain, +Till final dissolution, wander here; +Not in the neighbouring moon as some have dreamed; +Those argent fields more likely habitants, +Translated Saints, or middle Spirits hold +Betwixt the angelical and human kind. +Hither of ill-joined sons and daughters born +First from the ancient world those giants came +With many a vain exploit, though then renowned: +The builders next of Babel on the plain +Of Sennaar, and still with vain design, +New Babels, had they wherewithal, would build: +Others came single; he, who, to be deemed +A God, leaped fondly into Aetna flames, +Empedocles; and he, who, to enjoy +Plato's Elysium, leaped into the sea, +Cleombrotus; and many more too long, +Embryos, and idiots, eremites, and friars +White, black, and gray, with all their trumpery. +Here pilgrims roam, that strayed so far to seek +In Golgotha him dead, who lives in Heaven; +And they, who to be sure of Paradise, +Dying, put on the weeds of Dominick, +Or in Franciscan think to pass disguised; +They pass the planets seven, and pass the fixed, +And that crystalling sphere whose balance weighs +The trepidation talked, and that first moved; +And now Saint Peter at Heaven's wicket seems +To wait them with his keys, and now at foot +Of Heaven's ascent they lift their feet, when lo +A violent cross wind from either coast +Blows them transverse, ten thousand leagues awry +Into the devious air: Then might ye see +Cowls, hoods, and habits, with their wearers, tost +And fluttered into rags; then reliques, beads, +Indulgences, dispenses, pardons, bulls, +The sport of winds: All these, upwhirled aloft, +Fly o'er the backside of the world far off +Into a Limbo large and broad, since called +The Paradise of Fools, to few unknown +Long after; now unpeopled, and untrod. +All this dark globe the Fiend found as he passed, +And long he wandered, till at last a gleam +Of dawning light turned thither-ward in haste +His travelled steps: far distant he descries +Ascending by degrees magnificent +Up to the wall of Heaven a structure high; +At top whereof, but far more rich, appeared +The work as of a kingly palace-gate, +With frontispiece of diamond and gold +Embellished; thick with sparkling orient gems +The portal shone, inimitable on earth +By model, or by shading pencil, drawn. +These stairs were such as whereon Jacob saw +Angels ascending and descending, bands +Of guardians bright, when he from Esau fled +To Padan-Aram, in the field of Luz +Dreaming by night under the open sky +And waking cried, This is the gate of Heaven. +Each stair mysteriously was meant, nor stood +There always, but drawn up to Heaven sometimes +Viewless; and underneath a bright sea flowed +Of jasper, or of liquid pearl, whereon +Who after came from earth, failing arrived +Wafted by Angels, or flew o'er the lake +Rapt in a chariot drawn by fiery steeds. +The stairs were then let down, whether to dare +The Fiend by easy ascent, or aggravate +His sad exclusion from the doors of bliss: +Direct against which opened from beneath, +Just o'er the blissful seat of Paradise, +A passage down to the Earth, a passage wide, +Wider by far than that of after-times +Over mount Sion, and, though that were large, +Over the Promised Land to God so dear; +By which, to visit oft those happy tribes, +On high behests his angels to and fro +Passed frequent, and his eye with choice regard +From Paneas, the fount of Jordan's flood, +To Beersaba, where the Holy Land +Borders on Egypt and the Arabian shore; +So wide the opening seemed, where bounds were set +To darkness, such as bound the ocean wave. +Satan from hence, now on the lower stair, +That scaled by steps of gold to Heaven-gate, +Looks down with wonder at the sudden view +Of all this world at once. As when a scout, +Through dark?;nd desart ways with?oeril gone +All?might,?;t?kast by break of cheerful dawn +Obtains the brow of some high-climbing hill, +Which to his eye discovers unaware +The goodly prospect of some foreign land +First seen, or some renowned metropolis +With glistering spires and pinnacles adorned, +Which now the rising sun gilds with his beams: +Such wonder seised, though after Heaven seen, +The Spirit malign, but much more envy seised, +At sight of all this world beheld so fair. +Round he surveys (and well might, where he stood +So high above the circling canopy +Of night's extended shade,) from eastern point +Of Libra to the fleecy star that bears +Andromeda far off Atlantick seas +Beyond the horizon; then from pole to pole +He views in breadth, and without longer pause +Down right into the world's first region throws +His flight precipitant, and winds with ease +Through the pure marble air his oblique way +Amongst innumerable stars, that shone +Stars distant, but nigh hand seemed other worlds; +Or other worlds they seemed, or happy isles, +Like those Hesperian gardens famed of old, +Fortunate fields, and groves, and flowery vales, +Thrice happy isles; but who dwelt happy there +He staid not to inquire: Above them all +The golden sun, in splendour likest Heaven, +Allured his eye; thither his course he bends +Through the calm firmament, (but up or down, +By center, or eccentrick, hard to tell, +Or longitude,) where the great luminary +Aloof the vulgar constellations thick, +That from his lordly eye keep distance due, +Dispenses light from far; they, as they move +Their starry dance in numbers that compute +Days, months, and years, towards his all-cheering lamp +Turn swift their various motions, or are turned +By his magnetick beam, that gently warms +The universe, and to each inward part +With gentle penetration, though unseen, +Shoots invisible virtue even to the deep; +So wonderously was set his station bright. +There lands the Fiend, a spot like which perhaps +Astronomer in the sun's lucent orb +Through his glazed optick tube yet never saw. +The place he found beyond expression bright, +Compared with aught on earth, metal or stone; +Not all parts like, but all alike informed +With radiant light, as glowing iron with fire; +If metal, part seemed gold, part silver clear; +If stone, carbuncle most or chrysolite, +Ruby or topaz, to the twelve that shone +In Aaron's breast-plate, and a stone besides +Imagined rather oft than elsewhere seen, +That stone, or like to that which here below +Philosophers in vain so long have sought, +In vain, though by their powerful art they bind +Volatile Hermes, and call up unbound +In various shapes old Proteus from the sea, +Drained through a limbeck to his native form. +What wonder then if fields and regions here +Breathe forth Elixir pure, and rivers run +Potable gold, when with one virtuous touch +The arch-chemick sun, so far from us remote, +Produces, with terrestrial humour mixed, +Here in the dark so many precious things +Of colour glorious, and effect so rare? +Here matter new to gaze the Devil met +Undazzled; far and wide his eye commands; +For sight no obstacle found here, nor shade, +But all sun-shine, as when his beams at noon +Culminate from the equator, as they now +Shot upward still direct, whence no way round +Shadow from body opaque can fall; and the air, +No where so clear, sharpened his visual ray +To objects distant far, whereby he soon +Saw within ken a glorious Angel stand, +The same whom John saw also in the sun: +His back was turned, but not his brightness hid; +Of beaming sunny rays a golden tiar +Circled his head, nor less his locks behind +Illustrious on his shoulders fledge with wings +Lay waving round; on some great charge employed +He seemed, or fixed in cogitation deep. +Glad was the Spirit impure, as now in hope +To find who might direct his wandering flight +To Paradise, the happy seat of Man, +His journey's end and our beginning woe. +But first he casts to change his proper shape, +Which else might work him danger or delay: +And now a stripling Cherub he appears, +Not of the prime, yet such as in his face +Youth smiled celestial, and to every limb +Suitable grace diffused, so well he feigned: +Under a coronet his flowing hair +In curls on either cheek played; wings he wore +Of many a coloured plume, sprinkled with gold; +His habit fit for speed succinct, and held +Before his decent steps a silver wand. +He drew not nigh unheard; the Angel bright, +Ere he drew nigh, his radiant visage turned, +Admonished by his ear, and straight was known +The Arch-Angel Uriel, one of the seven +Who in God's presence, nearest to his throne, +Stand ready at command, and are his eyes +That run through all the Heavens, or down to the Earth +Bear his swift errands over moist and dry, +O'er sea and land: him Satan thus accosts. +Uriel, for thou of those seven Spirits that stand +In sight of God's high throne, gloriously bright, +The first art wont his great authentick will +Interpreter through highest Heaven to bring, +Where all his sons thy embassy attend; +And here art likeliest by supreme decree +Like honour to obtain, and as his eye +To visit oft this new creation round; +Unspeakable desire to see, and know +All these his wonderous works, but chiefly Man, +His chief delight and favour, him for whom +All these his works so wonderous he ordained, +Hath brought me from the quires of Cherubim +Alone thus wandering. Brightest Seraph, tell +In which of all these shining orbs hath Man +His fixed seat, or fixed seat hath none, +But all these shining orbs his choice to dwell; +That I may find him, and with secret gaze +Or open admiration him behold, +On whom the great Creator hath bestowed +Worlds, and on whom hath all these graces poured; +That both in him and all things, as is meet, +The universal Maker we may praise; +Who justly hath driven out his rebel foes +To deepest Hell, and, to repair that loss, +Created this new happy race of Men +To serve him better: Wise are all his ways. +So spake the false dissembler unperceived; +For neither Man nor Angel can discern +Hypocrisy, the only evil that walks +Invisible, except to God alone, +By his permissive will, through Heaven and Earth: +And oft, though wisdom wake, suspicion sleeps +At wisdom's gate, and to simplicity +Resigns her charge, while goodness thinks no ill +Where no ill seems: Which now for once beguiled +Uriel, though regent of the sun, and held +The sharpest-sighted Spirit of all in Heaven; +Who to the fraudulent impostor foul, +In his uprightness, answer thus returned. +Fair Angel, thy desire, which tends to know +The works of God, thereby to glorify +The great Work-master, leads to no excess +That reaches blame, but rather merits praise +The more it seems excess, that led thee hither +From thy empyreal mansion thus alone, +To witness with thine eyes what some perhaps, +Contented with report, hear only in Heaven: +For wonderful indeed are all his works, +Pleasant to know, and worthiest to be all +Had in remembrance always with delight; +But what created mind can comprehend +Their number, or the wisdom infinite +That brought them forth, but hid their causes deep? +I saw when at his word the formless mass, +This world's material mould, came to a heap: +Confusion heard his voice, and wild uproar +Stood ruled, stood vast infinitude confined; +Till at his second bidding Darkness fled, +Light shone, and order from disorder sprung: +Swift to their several quarters hasted then +The cumbrous elements, earth, flood, air, fire; +And this ethereal quintessence of Heaven +Flew upward, spirited with various forms, +That rolled orbicular, and turned to stars +Numberless, as thou seest, and how they move; +Each had his place appointed, each his course; +The rest in circuit walls this universe. +Look downward on that globe, whose hither side +With light from hence, though but reflected, shines; +That place is Earth, the seat of Man; that light +His day, which else, as the other hemisphere, +Night would invade; but there the neighbouring moon +So call that opposite fair star) her aid +Timely interposes, and her monthly round +Still ending, still renewing, through mid Heaven, +With borrowed light her countenance triform +Hence fills and empties to enlighten the Earth, +And in her pale dominion checks the night. +That spot, to which I point, is Paradise, +Adam's abode; those lofty shades, his bower. +Thy way thou canst not miss, me mine requires. +Thus said, he turned; and Satan, bowing low, +As to superiour Spirits is wont in Heaven, +Where honour due and reverence none neglects, +Took leave, and toward the coast of earth beneath, +Down from the ecliptick, sped with hoped success, +Throws his steep flight in many an aery wheel; +Nor staid, till on Niphates' top he lights. + + + +Book IV + + +O, for that warning voice, which he, who saw +The Apocalypse, heard cry in Heaven aloud, +Then when the Dragon, put to second rout, +Came furious down to be revenged on men, +Woe to the inhabitants on earth! that now, +While time was, our first parents had been warned +The coming of their secret foe, and 'scaped, +Haply so 'scaped his mortal snare: For now +Satan, now first inflamed with rage, came down, +The tempter ere the accuser of mankind, +To wreak on innocent frail Man his loss +Of that first battle, and his flight to Hell: +Yet, not rejoicing in his speed, though bold +Far off and fearless, nor with cause to boast, +Begins his dire attempt; which nigh the birth +Now rolling boils in his tumultuous breast, +And like a devilish engine back recoils +Upon himself; horrour and doubt distract +His troubled thoughts, and from the bottom stir +The Hell within him; for within him Hell +He brings, and round about him, nor from Hell +One step, no more than from himself, can fly +By change of place: Now conscience wakes despair, +That slumbered; wakes the bitter memory +Of what he was, what is, and what must be +Worse; of worse deeds worse sufferings must ensue. +Sometimes towards Eden, which now in his view +Lay pleasant, his grieved look he fixes sad; +Sometimes towards Heaven, and the full-blazing sun, +Which now sat high in his meridian tower: +Then, much revolving, thus in sighs began. +O thou, that, with surpassing glory crowned, +Lookest from thy sole dominion like the God +Of this new world; at whose sight all the stars +Hide their diminished heads; to thee I call, +But with no friendly voice, and add thy name, +Of Sun! to tell thee how I hate thy beams, +That bring to my remembrance from what state +I fell, how glorious once above thy sphere; +Till pride and worse ambition threw me down +Warring in Heaven against Heaven's matchless King: +Ah, wherefore! he deserved no such return +From me, whom he created what I was +In that bright eminence, and with his good +Upbraided none; nor was his service hard. +What could be less than to afford him praise, +The easiest recompence, and pay him thanks, +How due! yet all his good proved ill in me, +And wrought but malice; lifted up so high +I sdeined subjection, and thought one step higher +Would set me highest, and in a moment quit +The debt immense of endless gratitude, +So burdensome still paying, still to owe, +Forgetful what from him I still received, +And understood not that a grateful mind +By owing owes not, but still pays, at once +Indebted and discharged; what burden then +O, had his powerful destiny ordained +Me some inferiour Angel, I had stood +Then happy; no unbounded hope had raised +Ambition! Yet why not some other Power +As great might have aspired, and me, though mean, +Drawn to his part; but other Powers as great +Fell not, but stand unshaken, from within +Or from without, to all temptations armed. +Hadst thou the same free will and power to stand? +Thou hadst: whom hast thou then or what to accuse, +But Heaven's free love dealt equally to all? +Be then his love accursed, since love or hate, +To me alike, it deals eternal woe. +Nay, cursed be thou; since against his thy will +Chose freely what it now so justly rues. +Me miserable! which way shall I fly +Infinite wrath, and infinite despair? +Which way I fly is Hell; myself am Hell; +And, in the lowest deep, a lower deep +Still threatening to devour me opens wide, +To which the Hell I suffer seems a Heaven. +O, then, at last relent: Is there no place +Left for repentance, none for pardon left? +None left but by submission; and that word +Disdain forbids me, and my dread of shame +Among the Spirits beneath, whom I seduced +With other promises and other vaunts +Than to submit, boasting I could subdue +The Omnipotent. Ay me! they little know +How dearly I abide that boast so vain, +Under what torments inwardly I groan, +While they adore me on the throne of Hell. +With diadem and scepter high advanced, +The lower still I fall, only supreme +In misery: Such joy ambition finds. +But say I could repent, and could obtain, +By act of grace, my former state; how soon +Would highth recall high thoughts, how soon unsay +What feigned submission swore? Ease would recant +Vows made in pain, as violent and void. +For never can true reconcilement grow, +Where wounds of deadly hate have pierced so deep: +Which would but lead me to a worse relapse +And heavier fall: so should I purchase dear +Short intermission bought with double smart. +This knows my Punisher; therefore as far +From granting he, as I from begging, peace; +All hope excluded thus, behold, in stead +Mankind created, and for him this world. +So farewell, hope; and with hope farewell, fear; +Farewell, remorse! all good to me is lost; +Evil, be thou my good; by thee at least +Divided empire with Heaven's King I hold, +By thee, and more than half perhaps will reign; +As Man ere long, and this new world, shall know. +Thus while he spake, each passion dimmed his face +Thrice changed with pale, ire, envy, and despair; +Which marred his borrowed visage, and betrayed +Him counterfeit, if any eye beheld. +For heavenly minds from such distempers foul +Are ever clear. Whereof he soon aware, +Each perturbation smoothed with outward calm, +Artificer of fraud; and was the first +That practised falsehood under saintly show, +Deep malice to conceal, couched with revenge: +Yet not enough had practised to deceive +Uriel once warned; whose eye pursued him down + The way he went, and on the Assyrian mount + Saw him disfigured, more than could befall + Spirit of happy sort; his gestures fierce + He marked and mad demeanour, then alone, + As he supposed, all unobserved, unseen. + So on he fares, and to the border comes + Of Eden, where delicious Paradise, + Now nearer, crowns with her enclosure green, + As with a rural mound, the champaign head + Of a steep wilderness, whose hairy sides +Access denied; and overhead upgrew + Insuperable height of loftiest shade, + Cedar, and pine, and fir, and branching palm, + A sylvan scene, and, as the ranks ascend, + Shade above shade, a woody theatre + Of stateliest view. Yet higher than their tops + The verdurous wall of Paradise upsprung; + + 00081429 +Which to our general sire gave prospect large +Into his nether empire neighbouring round. +And higher than that wall a circling row +Of goodliest trees, loaden with fairest fruit, +Blossoms and fruits at once of golden hue, +Appeared, with gay enamelled colours mixed: +On which the sun more glad impressed his beams +Than in fair evening cloud, or humid bow, +When God hath showered the earth; so lovely seemed +That landskip: And of pure now purer air +Meets his approach, and to the heart inspires +Vernal delight and joy, able to drive +All sadness but despair: Now gentle gales, +Fanning their odoriferous wings, dispense +Native perfumes, and whisper whence they stole +Those balmy spoils. As when to them who fail +Beyond the Cape of Hope, and now are past +Mozambick, off at sea north-east winds blow +Sabean odours from the spicy shore +Of Araby the blest; with such delay +Well pleased they slack their course, and many a league +Cheered with the grateful smell old Ocean smiles: +So entertained those odorous sweets the Fiend, +Who came their bane; though with them better pleased +Than Asmodeus with the fishy fume +That drove him, though enamoured, from the spouse +Of Tobit's son, and with a vengeance sent +From Media post to Egypt, there fast bound. +Now to the ascent of that steep savage hill +Satan had journeyed on, pensive and slow; +But further way found none, so thick entwined, +As one continued brake, the undergrowth +Of shrubs and tangling bushes had perplexed +All path of man or beast that passed that way. +One gate there only was, and that looked east +On the other side: which when the arch-felon saw, +Due entrance he disdained; and, in contempt, +At one flight bound high over-leaped all bound +Of hill or highest wall, and sheer within +Lights on his feet. As when a prowling wolf, +Whom hunger drives to seek new haunt for prey, +Watching where shepherds pen their flocks at eve +In hurdled cotes amid the field secure, +Leaps o'er the fence with ease into the fold: +Or as a thief, bent to unhoard the cash +Of some rich burgher, whose substantial doors, +Cross-barred and bolted fast, fear no assault, +In at the window climbs, or o'er the tiles: +So clomb this first grand thief into God's fold; +So since into his church lewd hirelings climb. +Thence up he flew, and on the tree of life, +The middle tree and highest there that grew, +Sat like a cormorant; yet not true life +Thereby regained, but sat devising death +To them who lived; nor on the virtue thought +Of that life-giving plant, but only used +For prospect, what well used had been the pledge +Of immortality. So little knows +Any, but God alone, to value right +The good before him, but perverts best things +To worst abuse, or to their meanest use. +Beneath him with new wonder now he views, +To all delight of human sense exposed, +In narrow room, Nature's whole wealth, yea more, +A Heaven on Earth: For blissful Paradise +Of God the garden was, by him in the east +Of Eden planted; Eden stretched her line +From Auran eastward to the royal towers +Of great Seleucia, built by Grecian kings, +Of where the sons of Eden long before +Dwelt in Telassar: In this pleasant soil +His far more pleasant garden God ordained; +Out of the fertile ground he caused to grow +All trees of noblest kind for sight, smell, taste; +And all amid them stood the tree of life, +High eminent, blooming ambrosial fruit +Of vegetable gold; and next to life, +Our death, the tree of knowledge, grew fast by, +Knowledge of good bought dear by knowing ill. +Southward through Eden went a river large, +Nor changed his course, but through the shaggy hill +Passed underneath ingulfed; for God had thrown +That mountain as his garden-mould high raised +Upon the rapid current, which, through veins +Of porous earth with kindly thirst up-drawn, +Rose a fresh fountain, and with many a rill +Watered the garden; thence united fell +Down the steep glade, and met the nether flood, +Which from his darksome passage now appears, +And now, divided into four main streams, +Runs diverse, wandering many a famous realm +And country, whereof here needs no account; +But rather to tell how, if Art could tell, +How from that sapphire fount the crisped brooks, +Rolling on orient pearl and sands of gold, +With mazy errour under pendant shades +Ran nectar, visiting each plant, and fed +Flowers worthy of Paradise, which not nice Art +In beds and curious knots, but Nature boon +Poured forth profuse on hill, and dale, and plain, +Both where the morning sun first warmly smote +The open field, and where the unpierced shade +Imbrowned the noontide bowers: Thus was this place +A happy rural seat of various view; +Groves whose rich trees wept odorous gums and balm, +Others whose fruit, burnished with golden rind, +Hung amiable, Hesperian fables true, +If true, here only, and of delicious taste: +Betwixt them lawns, or level downs, and flocks +Grazing the tender herb, were interposed, +Or palmy hillock; or the flowery lap +Of some irriguous valley spread her store, +Flowers of all hue, and without thorn the rose: +Another side, umbrageous grots and caves +Of cool recess, o'er which the mantling vine +Lays forth her purple grape, and gently creeps +Luxuriant; mean while murmuring waters fall +Down the slope hills, dispersed, or in a lake, +That to the fringed bank with myrtle crowned +Her crystal mirrour holds, unite their streams. +The birds their quire apply; airs, vernal airs, +Breathing the smell of field and grove, attune +The trembling leaves, while universal Pan, +Knit with the Graces and the Hours in dance, +Led on the eternal Spring. Not that fair field +Of Enna, where Proserpine gathering flowers, +Herself a fairer flower by gloomy Dis +Was gathered, which cost Ceres all that pain +To seek her through the world; nor that sweet grove +Of Daphne by Orontes, and the inspired +Castalian spring, might with this Paradise +Of Eden strive; nor that Nyseian isle +Girt with the river Triton, where old Cham, +Whom Gentiles Ammon call and Libyan Jove, +Hid Amalthea, and her florid son +Young Bacchus, from his stepdame Rhea's eye; +Nor where Abassin kings their issue guard, +Mount Amara, though this by some supposed +True Paradise under the Ethiop line +By Nilus' head, enclosed with shining rock, +A whole day's journey high, but wide remote +From this Assyrian garden, where the Fiend +Saw, undelighted, all delight, all kind +Of living creatures, new to sight, and strange +Two of far nobler shape, erect and tall, +Godlike erect, with native honour clad +In naked majesty seemed lords of all: +And worthy seemed; for in their looks divine +The image of their glorious Maker shone, +Truth, wisdom, sanctitude severe and pure, +(Severe, but in true filial freedom placed,) +Whence true authority in men; though both +Not equal, as their sex not equal seemed; +For contemplation he and valour formed; +For softness she and sweet attractive grace; +He for God only, she for God in him: +His fair large front and eye sublime declared +Absolute rule; and hyacinthine locks +Round from his parted forelock manly hung +Clustering, but not beneath his shoulders broad: +She, as a veil, down to the slender waist +Her unadorned golden tresses wore +Dishevelled, but in wanton ringlets waved +As the vine curls her tendrils, which implied +Subjection, but required with gentle sway, +And by her yielded, by him best received, +Yielded with coy submission, modest pride, +And sweet, reluctant, amorous delay. +Nor those mysterious parts were then concealed; +Then was not guilty shame, dishonest shame +Of nature's works, honour dishonourable, +Sin-bred, how have ye troubled all mankind +With shows instead, mere shows of seeming pure, +And banished from man's life his happiest life, +Simplicity and spotless innocence! +So passed they naked on, nor shunned the sight +Of God or Angel; for they thought no ill: +So hand in hand they passed, the loveliest pair, +That ever since in love's embraces met; +Adam the goodliest man of men since born +His sons, the fairest of her daughters Eve. +Under a tuft of shade that on a green +Stood whispering soft, by a fresh fountain side +They sat them down; and, after no more toil +Of their sweet gardening labour than sufficed +To recommend cool Zephyr, and made ease +More easy, wholesome thirst and appetite +More grateful, to their supper-fruits they fell, +Nectarine fruits which the compliant boughs +Yielded them, side-long as they sat recline +On the soft downy bank damasked with flowers: +The savoury pulp they chew, and in the rind, +Still as they thirsted, scoop the brimming stream; +Nor gentle purpose, nor endearing smiles +Wanted, nor youthful dalliance, as beseems +Fair couple, linked in happy nuptial league, +Alone as they. About them frisking played +All beasts of the earth, since wild, and of all chase +In wood or wilderness, forest or den; +Sporting the lion ramped, and in his paw +Dandled the kid; bears, tigers, ounces, pards, +Gambolled before them; the unwieldy elephant, +To make them mirth, used all his might, and wreathed +His?kithetmroboscis; close the serpent sly, +Insinuating, wove with Gordian twine +His braided train, and of his fatal guile +Gave proof unheeded; others on the grass +Couched, and now filled with pasture gazing sat, +Or bedward ruminating; for the sun, +Declined, was hasting now with prone career +To the ocean isles, and in the ascending scale +Of Heaven the stars that usher evening rose: +When Satan still in gaze, as first he stood, +Scarce thus at length failed speech recovered sad. +O Hell! what do mine eyes with grief behold! +Into our room of bliss thus high advanced +Creatures of other mould, earth-born perhaps, +Not Spirits, yet to heavenly Spirits bright +Little inferiour; whom my thoughts pursue +With wonder, and could love, so lively shines +In them divine resemblance, and such grace +The hand that formed them on their shape hath poured. +Ah! gentle pair, ye little think how nigh +Your change approaches, when all these delights +Will vanish, and deliver ye to woe; +More woe, the more your taste is now of joy; +Happy, but for so happy ill secured +Long to continue, and this high seat your Heaven +Ill fenced for Heaven to keep out such a foe +As now is entered; yet no purposed foe +To you, whom I could pity thus forlorn, +Though I unpitied: League with you I seek, +And mutual amity, so strait, so close, +That I with you must dwell, or you with me +Henceforth; my dwelling haply may not please, +Like this fair Paradise, your sense; yet such +Accept your Maker's work; he gave it me, +Which I as freely give: Hell shall unfold, +To entertain you two, her widest gates, +And send forth all her kings; there will be room, +Not like these narrow limits, to receive +Your numerous offspring; if no better place, +Thank him who puts me loth to this revenge +On you who wrong me not for him who wronged. +And should I at your harmless innocence +Melt, as I do, yet publick reason just, +Honour and empire with revenge enlarged, +By conquering this new world, compels me now +To do what else, though damned, I should abhor. +So spake the Fiend, and with necessity, +The tyrant's plea, excused his devilish deeds. +Then from his lofty stand on that high tree +Down he alights among the sportful herd +Of those four-footed kinds, himself now one, +Now other, as their shape served best his end +Nearer to view his prey, and, unespied, +To mark what of their state he more might learn, +By word or action marked. About them round +A lion now he stalks with fiery glare; +Then as a tiger, who by chance hath spied +In some purlieu two gentle fawns at play, +Straight couches close, then, rising, changes oft +His couchant watch, as one who chose his ground, +Whence rushing, he might surest seize them both, +Griped in each paw: when, Adam first of men +To first of women Eve thus moving speech, +Turned him, all ear to hear new utterance flow. +Sole partner, and sole part, of all these joys, +Dearer thyself than all; needs must the Power +That made us, and for us this ample world, +Be infinitely good, and of his good +As liberal and free as infinite; +That raised us from the dust, and placed us here +In all this happiness, who at his hand +Have nothing merited, nor can perform +Aught whereof he hath need; he who requires +From us no other service than to keep +This one, this easy charge, of all the trees +In Paradise that bear delicious fruit +So various, not to taste that only tree +Of knowledge, planted by the tree of life; +So near grows death to life, whate'er death is, +Some dreadful thing no doubt; for well thou knowest +God hath pronounced it death to taste that tree, +The only sign of our obedience left, +Among so many signs of power and rule +Conferred upon us, and dominion given +Over all other creatures that possess +Earth, air, and sea. Then let us not think hard +One easy prohibition, who enjoy +Free leave so large to all things else, and choice +Unlimited of manifold delights: +But let us ever praise him, and extol +His bounty, following our delightful task, +To prune these growing plants, and tend these flowers, +Which were it toilsome, yet with thee were sweet. +To whom thus Eve replied. O thou for whom +And from whom I was formed, flesh of thy flesh, +And without whom am to no end, my guide +And head! what thou hast said is just and right. +For we to him indeed all praises owe, +And daily thanks; I chiefly, who enjoy +So far the happier lot, enjoying thee +Pre-eminent by so much odds, while thou +Like consort to thyself canst no where find. +That day I oft remember, when from sleep +I first awaked, and found myself reposed +Under a shade on flowers, much wondering where +And what I was, whence thither brought, and how. +Not distant far from thence a murmuring sound +Of waters issued from a cave, and spread +Into a liquid plain, then stood unmoved +Pure as the expanse of Heaven; I thither went +With unexperienced thought, and laid me down +On the green bank, to look into the clear +Smooth lake, that to me seemed another sky. +As I bent down to look, just opposite +A shape within the watery gleam appeared, +Bending to look on me: I started back, +It started back; but pleased I soon returned, +Pleased it returned as soon with answering looks +Of sympathy and love: There I had fixed +Mine eyes till now, and pined with vain desire, +Had not a voice thus warned me; 'What thou seest, +'What there thou seest, fair Creature, is thyself; +'With thee it came and goes: but follow me, +'And I will bring thee where no shadow stays +'Thy coming, and thy soft embraces, he +'Whose image thou art; him thou shalt enjoy +'Inseparably thine, to him shalt bear +'Multitudes like thyself, and thence be called +'Mother of human race.' What could I do, +But follow straight, invisibly thus led? +Till I espied thee, fair indeed and tall, +Under a platane; yet methought less fair, +Less winning soft, less amiably mild, +Than that smooth watery image: Back I turned; +Thou following cryedst aloud, 'Return, fair Eve; +'Whom flyest thou? whom thou flyest, of him thou art, +'His flesh, his bone; to give thee being I lent +'Out of my side to thee, nearest my heart, +'Substantial life, to have thee by my side +'Henceforth an individual solace dear; +'Part of my soul I seek thee, and thee claim +'My other half:' With that thy gentle hand +Seised mine: I yielded;and from that time see +How beauty is excelled by manly grace, +And wisdom, which alone is truly fair. +So spake our general mother, and with eyes +Of conjugal attraction unreproved, +And meek surrender, half-embracing leaned +On our first father; half her swelling breast +Naked met his, under the flowing gold +Of her loose tresses hid: he in delight +Both of her beauty, and submissive charms, +Smiled with superiour love, as Jupiter +On Juno smiles, when he impregns the clouds +That shed Mayflowers; and pressed her matron lip +With kisses pure: Aside the Devil turned +For envy; yet with jealous leer malign +Eyed them askance, and to himself thus plained. +Sight hateful, sight tormenting! thus these two, +Imparadised in one another's arms, +The happier Eden, shall enjoy their fill +Of bliss on bliss; while I to Hell am thrust, +Where neither joy nor love, but fierce desire, +Among our other torments not the least, +Still unfulfilled with pain of longing pines. +Yet let me not forget what I have gained +From their own mouths: All is not theirs, it seems; +One fatal tree there stands, of knowledge called, +Forbidden them to taste: Knowledge forbidden +Suspicious, reasonless. Why should their Lord +Envy them that? Can it be sin to know? +Can it be death? And do they only stand +By ignorance? Is that their happy state, +The proof of their obedience and their faith? +O fair foundation laid whereon to build +Their ruin! hence I will excite their minds +With more desire to know, and to reject +Envious commands, invented with design +To keep them low, whom knowledge might exalt +Equal with Gods: aspiring to be such, +They taste and die: What likelier can ensue +But first with narrow search I must walk round +This garden, and no corner leave unspied; +A chance but chance may lead where I may meet +Some wandering Spirit of Heaven by fountain side, +Or in thick shade retired, from him to draw +What further would be learned. Live while ye may, +Yet happy pair; enjoy, till I return, +Short pleasures, for long woes are to succeed! +So saying, his proud step he scornful turned, +But with sly circumspection, and began +Through wood, through waste, o'er hill, o'er dale, his roam +Mean while in utmost longitude, where Heaven +With earth and ocean meets, the setting sun +Slowly descended, and with right aspect +Against the eastern gate of Paradise +Levelled his evening rays: It was a rock +Of alabaster, piled up to the clouds, +Conspicuous far, winding with one ascent +Accessible from earth, one entrance high; +The rest was craggy cliff, that overhung +Still as it rose, impossible to climb. +Betwixt these rocky pillars Gabriel sat, +Chief of the angelick guards, awaiting night; +About him exercised heroick games +The unarmed youth of Heaven, but nigh at hand +Celestial armoury, shields, helms, and spears, +Hung high with diamond flaming, and with gold. +Thither came Uriel, gliding through the even +On a sun-beam, swift as a shooting star +In autumn thwarts the night, when vapours fired +Impress the air, and shows the mariner +From what point of his compass to beware +Impetuous winds: He thus began in haste. +Gabriel, to thee thy course by lot hath given +Charge and strict watch, that to this happy place +No evil thing approach or enter in. +This day at highth of noon came to my sphere +A Spirit, zealous, as he seemed, to know +More of the Almighty's works, and chiefly Man, +God's latest image: I described his way +Bent all on speed, and marked his aery gait; +But in the mount that lies from Eden north, +Where he first lighted, soon discerned his looks +Alien from Heaven, with passions foul obscured: +Mine eye pursued him still, but under shade +Lost sight of him: One of the banished crew, +I fear, hath ventured from the deep, to raise +New troubles; him thy care must be to find. +To whom the winged warriour thus returned. +Uriel, no wonder if thy perfect sight, +Amid the sun's bright circle where thou sitst, +See far and wide: In at this gate none pass +The vigilance here placed, but such as come +Well known from Heaven; and since meridian hour +No creature thence: If Spirit of other sort, +So minded, have o'er-leaped these earthly bounds +On purpose, hard thou knowest it to exclude +Spiritual substance with corporeal bar. +But if within the circuit of these walks, +In whatsoever shape he lurk, of whom +Thou tellest, by morrow dawning I shall know. +So promised he; and Uriel to his charge +Returned on that bright beam, whose point now raised +Bore him slope downward to the sun now fallen +Beneath the Azores; whether the prime orb, +Incredible how swift, had thither rolled +Diurnal, or this less volubil earth, +By shorter flight to the east, had left him there +Arraying with reflected purple and gold +The clouds that on his western throne attend. +Now came still Evening on, and Twilight gray +Had in her sober livery all things clad; +Silence accompanied; for beast and bird, +They to their grassy couch, these to their nests +Were slunk, all but the wakeful nightingale; +She all night long her amorous descant sung; +Silence was pleased: Now glowed the firmament +With living sapphires: Hesperus, that led +The starry host, rode brightest, till the moon, +Rising in clouded majesty, at length +Apparent queen unveiled her peerless light, +And o'er the dark her silver mantle threw. +When Adam thus to Eve. Fair Consort, the hour +Of night, and all things now retired to rest, +Mind us of like repose; since God hath set +Labour and rest, as day and night, to men +Successive; and the timely dew of sleep, +Now falling with soft slumbrous weight, inclines +Our eye-lids: Other creatures all day long +Rove idle, unemployed, and less need rest; +Man hath his daily work of body or mind +Appointed, which declares his dignity, +And the regard of Heaven on all his ways; +While other animals unactive range, +And of their doings God takes no account. +To-morrow, ere fresh morning streak the east +With first approach of light, we must be risen, +And at our pleasant labour, to reform +Yon flowery arbours, yonder alleys green, +Our walk at noon, with branches overgrown, +That mock our scant manuring, and require +More hands than ours to lop their wanton growth: +Those blossoms also, and those dropping gums, +That lie bestrown, unsightly and unsmooth, +Ask riddance, if we mean to tread with ease; +Mean while, as Nature wills, night bids us rest. +To whom thus Eve, with perfect beauty adorned +My Author and Disposer, what thou bidst +Unargued I obey: So God ordains; +God is thy law, thou mine: To know no more +Is woman's happiest knowledge, and her praise. +With thee conversing I forget all time; +All seasons, and their change, all please alike. +Sweet is the breath of Morn, her rising sweet, +With charm of earliest birds: pleasant the sun, +When first on this delightful land he spreads +His orient beams, on herb, tree, fruit, and flower, +Glistering with dew; fragrant the fertile earth +After soft showers; and sweet the coming on +Of grateful Evening mild; then silent Night, +With this her solemn bird, and this fair moon, +And these the gems of Heaven, her starry train: +But neither breath of Morn, when she ascends +With charm of earliest birds; nor rising sun +On this delightful land; nor herb, fruit, flower, +Glistering with dew; nor fragrance after showers; +Nor grateful Evening mild; nor silent Night, +With this her solemn bird, nor walk by moon, +Or glittering star-light, without thee is sweet. +But wherefore all night long shine these? for whom +This glorious sight, when sleep hath shut all eyes? +To whom our general ancestor replied. +Daughter of God and Man, accomplished Eve, +These have their course to finish round the earth, +By morrow evening, and from land to land +In order, though to nations yet unborn, +Ministring light prepared, they set and rise; +Lest total Darkness should by night regain +Her old possession, and extinguish life +In Nature and all things; which these soft fires +Not only enlighten, but with kindly heat +Of various influence foment and warm, +Temper or nourish, or in part shed down +Their stellar virtue on all kinds that grow +On earth, made hereby apter to receive +Perfection from the sun's more potent ray. +These then, though unbeheld in deep of night, +Shine not in vain; nor think, though men were none, +That Heaven would want spectators, God want praise: +Millions of spiritual creatures walk the earth +Unseen, both when we wake, and when we sleep: +All these with ceaseless praise his works behold +Both day and night: How often from the steep +Of echoing hill or thicket have we heard +Celestial voices to the midnight air, +Sole, or responsive each to others note, +Singing their great Creator? oft in bands +While they keep watch, or nightly rounding walk, +With heavenly touch of instrumental sounds +In full harmonick number joined, their songs +Divide the night, and lift our thoughts to Heaven. +Thus talking, hand in hand alone they passed +On to their blissful bower: it was a place +Chosen by the sovran Planter, when he framed +All things to Man's delightful use; the roof +Of thickest covert was inwoven shade +Laurel and myrtle, and what higher grew +Of firm and fragrant leaf; on either side +Acanthus, and each odorous bushy shrub, +Fenced up the verdant wall; each beauteous flower, +Iris all hues, roses, and jessamin, +Reared high their flourished heads between, and wrought +Mosaick; underfoot the violet, +Crocus, and hyacinth, with rich inlay +Broidered the ground, more coloured than with stone +Of costliest emblem: Other creature here, +Bird, beast, insect, or worm, durst enter none, +Such was their awe of Man. In shadier bower +More sacred and sequestered, though but feigned, +Pan or Sylvanus never slept, nor Nymph +Nor Faunus haunted. Here, in close recess, +With flowers, garlands, and sweet-smelling herbs, +Espoused Eve decked first her nuptial bed; +And heavenly quires the hymenaean sung, +What day the genial Angel to our sire +Brought her in naked beauty more adorned, +More lovely, than Pandora, whom the Gods +Endowed with all their gifts, and O! too like +In sad event, when to the unwiser son +Of Japhet brought by Hermes, she ensnared +Mankind with her fair looks, to be avenged +On him who had stole Jove's authentick fire. +Thus, at their shady lodge arrived, both stood, +Both turned, and under open sky adored +The God that made both sky, air, earth, and heaven, +Which they beheld, the moon's resplendent globe, +And starry pole: Thou also madest the night, +Maker Omnipotent, and thou the day, +Which we, in our appointed work employed, +Have finished, happy in our mutual help +And mutual love, the crown of all our bliss +Ordained by thee; and this delicious place +For us too large, where thy abundance wants +Partakers, and uncropt falls to the ground. +But thou hast promised from us two a race +To fill the earth, who shall with us extol +Thy goodness infinite, both when we wake, +And when we seek, as now, thy gift of sleep. +This said unanimous, and other rites +Observing none, but adoration pure +Which God likes best, into their inmost bower +Handed they went; and, eased the putting off +These troublesome disguises which we wear, +Straight side by side were laid; nor turned, I ween, +Adam from his fair spouse, nor Eve the rites +Mysterious of connubial love refused: +Whatever hypocrites austerely talk +Of purity, and place, and innocence, +Defaming as impure what God declares +Pure, and commands to some, leaves free to all. +Our Maker bids encrease; who bids abstain +But our Destroyer, foe to God and Man? +Hail, wedded Love, mysterious law, true source +Of human offspring, sole propriety +In Paradise of all things common else! +By thee adulterous Lust was driven from men +Among the bestial herds to range; by thee +Founded in reason, loyal, just, and pure, +Relations dear, and all the charities +Of father, son, and brother, first were known. +Far be it, that I should write thee sin or blame, +Or think thee unbefitting holiest place, +Perpetual fountain of domestick sweets, +Whose bed is undefiled and chaste pronounced, +Present, or past, as saints and patriarchs used. +Here Love his golden shafts employs, here lights +His constant lamp, and waves his purple wings, +Reigns here and revels; not in the bought smile +Of harlots, loveless, joyless, unendeared, +Casual fruition; nor in court-amours, +Mixed dance, or wanton mask, or midnight ball, +Or serenate, which the starved lover sings +To his proud fair, best quitted with disdain. +These, lulled by nightingales, embracing slept, +And on their naked limbs the flowery roof +Showered roses, which the morn repaired. Sleep on, +Blest pair; and O!yet happiest, if ye seek +No happier state, and know to know no more. +Now had night measured with her shadowy cone +Half way up hill this vast sublunar vault, +And from their ivory port the Cherubim, +Forth issuing at the accustomed hour, stood armed +To their night watches in warlike parade; +When Gabriel to his next in power thus spake. +Uzziel, half these draw off, and coast the south +With strictest watch; these other wheel the north; +Our circuit meets full west. As flame they part, +Half wheeling to the shield, half to the spear. +From these, two strong and subtle Spirits he called +That near him stood, and gave them thus in charge. +Ithuriel and Zephon, with winged speed +Search through this garden, leave unsearched no nook; +But chiefly where those two fair creatures lodge, +Now laid perhaps asleep, secure of harm. +This evening from the sun's decline arrived, +Who tells of some infernal Spirit seen +Hitherward bent (who could have thought?) escaped +The bars of Hell, on errand bad no doubt: +Such, where ye find, seise fast, and hither bring. +So saying, on he led his radiant files, +Dazzling the moon; these to the bower direct +In search of whom they sought: Him there they found +Squat like a toad, close at the ear of Eve, +Assaying by his devilish art to reach +The organs of her fancy, and with them forge +Illusions, as he list, phantasms and dreams; +Or if, inspiring venom, he might taint +The animal spirits, that from pure blood arise +Like gentle breaths from rivers pure, thence raise +At least distempered, discontented thoughts, +Vain hopes, vain aims, inordinate desires, +Blown up with high conceits ingendering pride. +Him thus intent Ithuriel with his spear +Touched lightly; for no falshood can endure +Touch of celestial temper, but returns +Of force to its own likeness: Up he starts +Discovered and surprised. As when a spark +Lights on a heap of nitrous powder, laid +Fit for the tun some magazine to store +Against a rumoured war, the smutty grain, +With sudden blaze diffused, inflames the air; +So started up in his own shape the Fiend. +Back stept those two fair Angels, half amazed +So sudden to behold the grisly king; +Yet thus, unmoved with fear, accost him soon. +Which of those rebel Spirits adjudged to Hell +Comest thou, escaped thy prison? and, transformed, +Why sat'st thou like an enemy in wait, +Here watching at the head of these that sleep? +Know ye not then said Satan, filled with scorn, +Know ye not me? ye knew me once no mate +For you, there sitting where ye durst not soar: +Not to know me argues yourselves unknown, +The lowest of your throng; or, if ye know, +Why ask ye, and superfluous begin +Your message, like to end as much in vain? +To whom thus Zephon, answering scorn with scorn. +Think not, revolted Spirit, thy shape the same, +Or undiminished brightness to be known, +As when thou stoodest in Heaven upright and pure; +That glory then, when thou no more wast good, +Departed from thee; and thou resemblest now +Thy sin and place of doom obscure and foul. +But come, for thou, be sure, shalt give account +To him who sent us, whose charge is to keep +This place inviolable, and these from harm. +So spake the Cherub; and his grave rebuke, +Severe in youthful beauty, added grace +Invincible: Abashed the Devil stood, +And felt how awful goodness is, and saw +Virtue in her shape how lovely; saw, and pined +His loss; but chiefly to find here observed +His lustre visibly impaired; yet seemed +Undaunted. If I must contend, said he, +Best with the best, the sender, not the sent, +Or all at once; more glory will be won, +Or less be lost. Thy fear, said Zephon bold, +Will save us trial what the least can do +Single against thee wicked, and thence weak. +The Fiend replied not, overcome with rage; +But, like a proud steed reined, went haughty on, +Champing his iron curb: To strive or fly +He held it vain; awe from above had quelled +His heart, not else dismayed. Now drew they nigh +The western point, where those half-rounding guards +Just met, and closing stood in squadron joined, +A waiting next command. To whom their Chief, +Gabriel, from the front thus called aloud. +O friends! I hear the tread of nimble feet +Hasting this way, and now by glimpse discern +Ithuriel and Zephon through the shade; +And with them comes a third of regal port, +But faded splendour wan; who by his gait +And fierce demeanour seems the Prince of Hell, +Not likely to part hence without contest; +Stand firm, for in his look defiance lours. +He scarce had ended, when those two approached, +And brief related whom they brought, where found, +How busied, in what form and posture couched. +To whom with stern regard thus Gabriel spake. +Why hast thou, Satan, broke the bounds prescribed +To thy transgressions, and disturbed the charge +Of others, who approve not to transgress +By thy example, but have power and right +To question thy bold entrance on this place; +Employed, it seems, to violate sleep, and those +Whose dwelling God hath planted here in bliss! +To whom thus Satan with contemptuous brow. +Gabriel? thou hadst in Heaven the esteem of wise, +And such I held thee; but this question asked +Puts me in doubt. Lives there who loves his pain! +Who would not, finding way, break loose from Hell, +Though thither doomed! Thou wouldst thyself, no doubt +And boldly venture to whatever place +Farthest from pain, where thou mightst hope to change +Torment with ease, and soonest recompense +Dole with delight, which in this place I sought; +To thee no reason, who knowest only good, +But evil hast not tried: and wilt object +His will who bounds us! Let him surer bar +His iron gates, if he intends our stay +In that dark durance: Thus much what was asked. +The rest is true, they found me where they say; +But that implies not violence or harm. +Thus he in scorn. The warlike Angel moved, +Disdainfully half smiling, thus replied. +O loss of one in Heaven to judge of wise +Since Satan fell, whom folly overthrew, +And now returns him from his prison 'scaped, +Gravely in doubt whether to hold them wise +Or not, who ask what boldness brought him hither +Unlicensed from his bounds in Hell prescribed; +So wise he judges it to fly from pain +However, and to 'scape his punishment! +So judge thou still, presumptuous! till the wrath, +Which thou incurrest by flying, meet thy flight +Sevenfold, and scourge that wisdom back to Hell, +Which taught thee yet no better, that no pain +Can equal anger infinite provoked. +But wherefore thou alone? wherefore with thee +Came not all hell broke loose? or thou than they +Less hardy to endure? Courageous Chief! +The first in flight from pain! hadst thou alleged +To thy deserted host this cause of flight, +Thou surely hadst not come sole fugitive. +To which the Fiend thus answered, frowning stern. +Not that I less endure, or shrink from pain, +Insulting Angel! well thou knowest I stood +Thy fiercest, when in battle to thy aid +The blasting vollied thunder made all speed, +And seconded thy else not dreaded spear. +But still thy words at random, as before, +Argue thy inexperience what behoves +From hard assays and ill successes past +A faithful leader, not to hazard all +Through ways of danger by himself untried: +I, therefore, I alone first undertook +To wing the desolate abyss, and spy +This new created world, whereof in Hell +Fame is not silent, here in hope to find +Better abode, and my afflicted Powers +To settle here on earth, or in mid air; +Though for possession put to try once more +What thou and thy gay legions dare against; +Whose easier business were to serve their Lord +High up in Heaven, with songs to hymn his throne, +And practised distances to cringe, not fight, +To whom the warriour Angel soon replied. +To say and straight unsay, pretending first +Wise to fly pain, professing next the spy, +Argues no leader but a liear traced, +Satan, and couldst thou faithful add? O name, +O sacred name of faithfulness profaned! +Faithful to whom? to thy rebellious crew? +Army of Fiends, fit body to fit head. +Was this your discipline and faith engaged, +Your military obedience, to dissolve +Allegiance to the acknowledged Power supreme? +And thou, sly hypocrite, who now wouldst seem +Patron of liberty, who more than thou +Once fawned, and cringed, and servily adored +Heaven's awful Monarch? wherefore, but in hope +To dispossess him, and thyself to reign? +But mark what I arreed thee now, Avant; +Fly neither whence thou fledst! If from this hour +Within these hallowed limits thou appear, +Back to the infernal pit I drag thee chained, +And seal thee so, as henceforth not to scorn +The facile gates of Hell too slightly barred. +So threatened he; but Satan to no threats +Gave heed, but waxing more in rage replied. +Then when I am thy captive talk of chains, +Proud limitary Cherub! but ere then +Far heavier load thyself expect to feel +From my prevailing arm, though Heaven's King +Ride on thy wings, and thou with thy compeers, +Us'd to the yoke, drawest his triumphant wheels +In progress through the road of Heaven star-paved. +While thus he spake, the angelick squadron bright +Turned fiery red, sharpening in mooned horns +Their phalanx, and began to hem him round +With ported spears, as thick as when a field +Of Ceres ripe for harvest waving bends +Her bearded grove of ears, which way the wind +Sways them; the careful plowman doubting stands, +Left on the threshing floor his hopeless sheaves +Prove chaff. On the other side, Satan, alarmed, +Collecting all his might, dilated stood, +Like Teneriff or Atlas, unremoved: +His stature reached the sky, and on his crest +Sat Horrour plumed; nor wanted in his grasp +What seemed both spear and shield: Now dreadful deeds +Might have ensued, nor only Paradise +In this commotion, but the starry cope +Of Heaven perhaps, or all the elements +At least had gone to wrack, disturbed and torn +With violence of this conflict, had not soon +The Eternal, to prevent such horrid fray, +Hung forth in Heaven his golden scales, yet seen +Betwixt Astrea and the Scorpion sign, +Wherein all things created first he weighed, +The pendulous round earth with balanced air +In counterpoise, now ponders all events, +Battles and realms: In these he put two weights, +The sequel each of parting and of fight: +The latter quick up flew, and kicked the beam, +Which Gabriel spying, thus bespake the Fiend. +Satan, I know thy strength, and thou knowest mine; +Neither our own, but given: What folly then +To boast what arms can do? since thine no more +Than Heaven permits, nor mine, though doubled now +To trample thee as mire: For proof look up, +And read thy lot in yon celestial sign; +Where thou art weighed, and shown how light, how weak, +If thou resist. The Fiend looked up, and knew +His mounted scale aloft: Nor more;but fled +Murmuring, and with him fled the shades of night. + + + +Book V + + +Now Morn, her rosy steps in the eastern clime +Advancing, sowed the earth with orient pearl, +When Adam waked, so customed; for his sleep +Was aery-light, from pure digestion bred, +And temperate vapours bland, which the only sound +Of leaves and fuming rills, Aurora's fan, +Lightly dispersed, and the shrill matin song +Of birds on every bough; so much the more +His wonder was to find unwakened Eve +With tresses discomposed, and glowing cheek, +As through unquiet rest: He, on his side +Leaning half raised, with looks of cordial love +Hung over her enamoured, and beheld +Beauty, which, whether waking or asleep, +Shot forth peculiar graces; then with voice +Mild, as when Zephyrus on Flora breathes, +Her hand soft touching, whispered thus. Awake, +My fairest, my espoused, my latest found, +Heaven's last best gift, my ever new delight! +Awake: The morning shines, and the fresh field +Calls us; we lose the prime, to mark how spring +Our tender plants, how blows the citron grove, +What drops the myrrh, and what the balmy reed, +How nature paints her colours, how the bee +Sits on the bloom extracting liquid sweet. +Such whispering waked her, but with startled eye +On Adam, whom embracing, thus she spake. +O sole in whom my thoughts find all repose, +My glory, my perfection! glad I see +Thy face, and morn returned; for I this night +(Such night till this I never passed) have dreamed, +If dreamed, not, as I oft am wont, of thee, +Works of day past, or morrow's next design, +But of offence and trouble, which my mind +Knew never till this irksome night: Methought, +Close at mine ear one called me forth to walk +With gentle voice; I thought it thine: It said, +'Why sleepest thou, Eve? now is the pleasant time, +'The cool, the silent, save where silence yields +'To the night-warbling bird, that now awake +'Tunes sweetest his love-laboured song; now reigns +'Full-orbed the moon, and with more pleasing light +'Shadowy sets off the face of things; in vain, +'If none regard; Heaven wakes with all his eyes, +'Whom to behold but thee, Nature's desire? +'In whose sight all things joy, with ravishment +'Attracted by thy beauty still to gaze.' +I rose as at thy call, but found thee not; +To find thee I directed then my walk; +And on, methought, alone I passed through ways +That brought me on a sudden to the tree +Of interdicted knowledge: fair it seemed, +Much fairer to my fancy than by day: +And, as I wondering looked, beside it stood +One shaped and winged like one of those from Heaven +By us oft seen; his dewy locks distilled +Ambrosia; on that tree he also gazed; +And 'O fair plant,' said he, 'with fruit surcharged, +'Deigns none to ease thy load, and taste thy sweet, +'Nor God, nor Man? Is knowledge so despised? +'Or envy, or what reserve forbids to taste? +'Forbid who will, none shall from me withhold +'Longer thy offered good; why else set here? +This said, he paused not, but with venturous arm +He plucked, he tasted; me damp horrour chilled +At such bold words vouched with a deed so bold: +But he thus, overjoyed; 'O fruit divine, +'Sweet of thyself, but much more sweet thus cropt, +'Forbidden here, it seems, as only fit +'For Gods, yet able to make Gods of Men: +'And why not Gods of Men; since good, the more +'Communicated, more abundant grows, +'The author not impaired, but honoured more? +'Here, happy creature, fair angelick Eve! +'Partake thou also; happy though thou art, +'Happier thou mayest be, worthier canst not be: +'Taste this, and be henceforth among the Gods +'Thyself a Goddess, not to earth confined, +'But sometimes in the air, as we, sometimes +'Ascend to Heaven, by merit thine, and see +'What life the Gods live there, and such live thou!' +So saying, he drew nigh, and to me held, +Even to my mouth of that same fruit held part +Which he had plucked; the pleasant savoury smell +So quickened appetite, that I, methought, +Could not but taste. Forthwith up to the clouds +With him I flew, and underneath beheld +The earth outstretched immense, a prospect wide +And various: Wondering at my flight and change +To this high exaltation; suddenly +My guide was gone, and I, methought, sunk down, +And fell asleep; but O, how glad I waked +To find this but a dream! Thus Eve her night +Related, and thus Adam answered sad. +Best image of myself, and dearer half, +The trouble of thy thoughts this night in sleep +Affects me equally; nor can I like +This uncouth dream, of evil sprung, I fear; +Yet evil whence? in thee can harbour none, +Created pure. But know that in the soul +Are many lesser faculties, that serve +Reason as chief; among these Fancy next +Her office holds; of all external things +Which the five watchful senses represent, +She forms imaginations, aery shapes, +Which Reason, joining or disjoining, frames +All what we affirm or what deny, and call +Our knowledge or opinion; then retires +Into her private cell, when nature rests. +Oft in her absence mimick Fancy wakes +To imitate her; but, misjoining shapes, +Wild work produces oft, and most in dreams; +Ill matching words and deeds long past or late. +Some such resemblances, methinks, I find +Of our last evening's talk, in this thy dream, +But with addition strange; yet be not sad. +Evil into the mind of God or Man +May come and go, so unreproved, and leave +No spot or blame behind: Which gives me hope +That what in sleep thou didst abhor to dream, +Waking thou never will consent to do. +Be not disheartened then, nor cloud those looks, +That wont to be more cheerful and serene, +Than when fair morning first smiles on the world; +And let us to our fresh employments rise +Among the groves, the fountains, and the flowers +That open now their choisest bosomed smells, +Reserved from night, and kept for thee in store. +So cheered he his fair spouse, and she was cheered; +But silently a gentle tear let fall +From either eye, and wiped them with her hair; +Two other precious drops that ready stood, +Each in their crystal sluice, he ere they fell +Kissed, as the gracious signs of sweet remorse +And pious awe, that feared to have offended. +So all was cleared, and to the field they haste. +But first, from under shady arborous roof +Soon as they forth were come to open sight +Of day-spring, and the sun, who, scarce up-risen, +With wheels yet hovering o'er the ocean-brim, +Shot parallel to the earth his dewy ray, +Discovering in wide landskip all the east +Of Paradise and Eden's happy plains, +Lowly they bowed adoring, and began +Their orisons, each morning duly paid +In various style; for neither various style +Nor holy rapture wanted they to praise +Their Maker, in fit strains pronounced, or sung +Unmeditated; such prompt eloquence +Flowed from their lips, in prose or numerous verse, +More tuneable than needed lute or harp +To add more sweetness; and they thus began. +These are thy glorious works, Parent of good, +Almighty! Thine this universal frame, +Thus wonderous fair; Thyself how wonderous then! +Unspeakable, who sitst above these heavens +To us invisible, or dimly seen +In these thy lowest works; yet these declare +Thy goodness beyond thought, and power divine. +Speak, ye who best can tell, ye sons of light, +Angels; for ye behold him, and with songs +And choral symphonies, day without night, +Circle his throne rejoicing; ye in Heaven +On Earth join all ye Creatures to extol +Him first, him last, him midst, and without end. +Fairest of stars, last in the train of night, +If better thou belong not to the dawn, +Sure pledge of day, that crownest the smiling morn +With thy bright circlet, praise him in thy sphere, +While day arises, that sweet hour of prime. +Thou Sun, of this great world both eye and soul, +Acknowledge him thy greater; sound his praise +In thy eternal course, both when thou climbest, +And when high noon hast gained, and when thou fallest. +Moon, that now meetest the orient sun, now flyest, +With the fixed Stars, fixed in their orb that flies; +And ye five other wandering Fires, that move +In mystick dance not without song, resound +His praise, who out of darkness called up light. +Air, and ye Elements, the eldest birth +Of Nature's womb, that in quaternion run +Perpetual circle, multiform; and mix +And nourish all things; let your ceaseless change +Vary to our great Maker still new praise. +Ye Mists and Exhalations, that now rise +From hill or steaming lake, dusky or gray, +Till the sun paint your fleecy skirts with gold, +In honour to the world's great Author rise; +Whether to deck with clouds the uncoloured sky, +Or wet the thirsty earth with falling showers, +Rising or falling still advance his praise. +His praise, ye Winds, that from four quarters blow, +Breathe soft or loud; and, wave your tops, ye Pines, +With every plant, in sign of worship wave. +Fountains, and ye that warble, as ye flow, +Melodious murmurs, warbling tune his praise. +Join voices, all ye living Souls: Ye Birds, +That singing up to Heaven-gate ascend, +Bear on your wings and in your notes his praise. +Ye that in waters glide, and ye that walk +The earth, and stately tread, or lowly creep; +Witness if I be silent, morn or even, +To hill, or valley, fountain, or fresh shade, +Made vocal by my song, and taught his praise. +Hail, universal Lord, be bounteous still +To give us only good; and if the night +Have gathered aught of evil, or concealed, +Disperse it, as now light dispels the dark! +So prayed they innocent, and to their thoughts +Firm peace recovered soon, and wonted calm. +On to their morning's rural work they haste, +Among sweet dews and flowers; where any row +Of fruit-trees over-woody reached too far +Their pampered boughs, and needed hands to check +Fruitless embraces: or they led the vine +To wed her elm; she, spoused, about him twines +Her marriageable arms, and with him brings +Her dower, the adopted clusters, to adorn +His barren leaves. Them thus employed beheld +With pity Heaven's high King, and to him called +Raphael, the sociable Spirit, that deigned +To travel with Tobias, and secured +His marriage with the seventimes-wedded maid. +Raphael, said he, thou hearest what stir on Earth +Satan, from Hell 'scaped through the darksome gulf, +Hath raised in Paradise; and how disturbed +This night the human pair; how he designs +In them at once to ruin all mankind. +Go therefore, half this day as friend with friend +Converse with Adam, in what bower or shade +Thou findest him from the heat of noon retired, +To respite his day-labour with repast, +Or with repose; and such discourse bring on, +As may advise him of his happy state, +Happiness in his power left free to will, +Left to his own free will, his will though free, +Yet mutable; whence warn him to beware +He swerve not, too secure: Tell him withal +His danger, and from whom; what enemy, +Late fallen himself from Heaven, is plotting now +The fall of others from like state of bliss; +By violence? no, for that shall be withstood; +But by deceit and lies: This let him know, +Lest, wilfully transgressing, he pretend +Surprisal, unadmonished, unforewarned. +So spake the Eternal Father, and fulfilled +All justice: Nor delayed the winged Saint +After his charge received; but from among +Thousand celestial Ardours, where he stood +Veiled with his gorgeous wings, up springing light, +Flew through the midst of Heaven; the angelick quires, +On each hand parting, to his speed gave way +Through all the empyreal road; till, at the gate +Of Heaven arrived, the gate self-opened wide +On golden hinges turning, as by work +Divine the sovran Architect had framed. +From hence no cloud, or, to obstruct his sight, +Star interposed, however small he sees, +Not unconformed to other shining globes, +Earth, and the garden of God, with cedars crowned +Above all hills. As when by night the glass +Of Galileo, less assured, observes +Imagined lands and regions in the moon: +Or pilot, from amidst the Cyclades +Delos or Samos first appearing, kens +A cloudy spot. Down thither prone in flight +He speeds, and through the vast ethereal sky +Sails between worlds and worlds, with steady wing +Now on the polar winds, then with quick fan +Winnows the buxom air; till, within soar +Of towering eagles, to all the fowls he seems +A phoenix, gazed by all as that sole bird, +When, to enshrine his reliques in the Sun's +Bright temple, to Egyptian Thebes he flies. +At once on the eastern cliff of Paradise +He lights, and to his proper shape returns +A Seraph winged: Six wings he wore, to shade +His lineaments divine; the pair that clad +Each shoulder broad, came mantling o'er his breast +With regal ornament; the middle pair +Girt like a starry zone his waist, and round +Skirted his loins and thighs with downy gold +And colours dipt in Heaven; the third his feet +Shadowed from either heel with feathered mail, +Sky-tinctured grain. Like Maia's son he stood, +And shook his plumes, that heavenly fragrance filled +The circuit wide. Straight knew him all the bands +Of Angels under watch; and to his state, +And to his message high, in honour rise; +For on some message high they guessed him bound. +Their glittering tents he passed, and now is come +Into the blissful field, through groves of myrrh, +And flowering odours, cassia, nard, and balm; +A wilderness of sweets; for Nature here +Wantoned as in her prime, and played at will +Her virgin fancies pouring forth more sweet, +Wild above rule or art, enormous bliss. +Him through the spicy forest onward come +Adam discerned, as in the door he sat +Of his cool bower, while now the mounted sun +Shot down direct his fervid rays to warm +Earth's inmost womb, more warmth than Adam needs: +And Eve within, due at her hour prepared +For dinner savoury fruits, of taste to please +True appetite, and not disrelish thirst +Of nectarous draughts between, from milky stream, +Berry or grape: To whom thus Adam called. +Haste hither, Eve, and worth thy sight behold +Eastward among those trees, what glorious shape +Comes this way moving; seems another morn +Risen on mid-noon; some great behest from Heaven +To us perhaps he brings, and will vouchsafe +This day to be our guest. But go with speed, +And, what thy stores contain, bring forth, and pour +Abundance, fit to honour and receive +Our heavenly stranger: Well we may afford +Our givers their own gifts, and large bestow +From large bestowed, where Nature multiplies +Her fertile growth, and by disburthening grows +More fruitful, which instructs us not to spare. +To whom thus Eve. Adam, earth's hallowed mould, +Of God inspired! small store will serve, where store, +All seasons, ripe for use hangs on the stalk; +Save what by frugal storing firmness gains +To nourish, and superfluous moist consumes: +But I will haste, and from each bough and brake, +Each plant and juciest gourd, will pluck such choice +To entertain our Angel-guest, as he +Beholding shall confess, that here on Earth +God hath dispensed his bounties as in Heaven. +So saying, with dispatchful looks in haste +She turns, on hospitable thoughts intent +What choice to choose for delicacy best, +What order, so contrived as not to mix +Tastes, not well joined, inelegant, but bring +Taste after taste upheld with kindliest change; +Bestirs her then, and from each tender stalk +Whatever Earth, all-bearing mother, yields +In India East or West, or middle shore +In Pontus or the Punick coast, or where +Alcinous reigned, fruit of all kinds, in coat +Rough, or smooth rind, or bearded husk, or shell, +She gathers, tribute large, and on the board +Heaps with unsparing hand; for drink the grape +She crushes, inoffensive must, and meaths +From many a berry, and from sweet kernels pressed +She tempers dulcet creams; nor these to hold +Wants her fit vessels pure; then strows the ground +With rose and odours from the shrub unfumed. +Mean while our primitive great sire, to meet +His God-like guest, walks forth, without more train +Accompanied than with his own complete +Perfections; in himself was all his state, +More solemn than the tedious pomp that waits +On princes, when their rich retinue long +Of horses led, and grooms besmeared with gold, +Dazzles the croud, and sets them all agape. +Nearer his presence Adam, though not awed, +Yet with submiss approach and reverence meek, +As to a superiour nature bowing low, +Thus said. Native of Heaven, for other place +None can than Heaven such glorious shape contain; +Since, by descending from the thrones above, +Those happy places thou hast deigned a while +To want, and honour these, vouchsafe with us +Two only, who yet by sovran gift possess +This spacious ground, in yonder shady bower +To rest; and what the garden choicest bears +To sit and taste, till this meridian heat +Be over, and the sun more cool decline. +Whom thus the angelick Virtue answered mild. +Adam, I therefore came; nor art thou such +Created, or such place hast here to dwell, +As may not oft invite, though Spirits of Heaven, +To visit thee; lead on then where thy bower +O'ershades; for these mid-hours, till evening rise, +I have at will. So to the sylvan lodge +They came, that like Pomona's arbour smiled, +With flowerets decked, and fragrant smells; but Eve, +Undecked save with herself, more lovely fair +Than Wood-Nymph, or the fairest Goddess feigned +Of three that in mount Ida naked strove, +Stood to entertain her guest from Heaven; no veil +She needed, virtue-proof; no thought infirm +Altered her cheek. On whom the Angel Hail +Bestowed, the holy salutation used +Long after to blest Mary, second Eve. +Hail, Mother of Mankind, whose fruitful womb +Shall fill the world more numerous with thy sons, +Than with these various fruits the trees of God +Have heaped this table!--Raised of grassy turf +Their table was, and mossy seats had round, +And on her ample square from side to side +All autumn piled, though spring and autumn here +Danced hand in hand. A while discourse they hold; +No fear lest dinner cool; when thus began +Our author. Heavenly stranger, please to taste +These bounties, which our Nourisher, from whom +All perfect good, unmeasured out, descends, +To us for food and for delight hath caused +The earth to yield; unsavoury food perhaps +To spiritual natures; only this I know, +That one celestial Father gives to all. +To whom the Angel. Therefore what he gives +(Whose praise be ever sung) to Man in part +Spiritual, may of purest Spirits be found +No ingrateful food: And food alike those pure +Intelligential substances require, +As doth your rational; and both contain +Within them every lower faculty +Of sense, whereby they hear, see, smell, touch, taste, +Tasting concoct, digest, assimilate, +And corporeal to incorporeal turn. +For know, whatever was created, needs +To be sustained and fed: Of elements +The grosser feeds the purer, earth the sea, +Earth and the sea feed air, the air those fires +Ethereal, and as lowest first the moon; +Whence in her visage round those spots, unpurged +Vapours not yet into her substance turned. +Nor doth the moon no nourishment exhale +From her moist continent to higher orbs. +The sun that light imparts to all, receives +From all his alimental recompence +In humid exhalations, and at even +Sups with the ocean. Though in Heaven the trees +Of life ambrosial fruitage bear, and vines +Yield nectar; though from off the boughs each morn +We brush mellifluous dews, and find the ground +Covered with pearly grain: Yet God hath here +Varied his bounty so with new delights, +As may compare with Heaven; and to taste +Think not I shall be nice. So down they sat, +And to their viands fell; nor seemingly +The Angel, nor in mist, the common gloss +Of Theologians; but with keen dispatch +Of real hunger, and concoctive heat +To transubstantiate: What redounds, transpires +Through Spirits with ease; nor wonder;if by fire +Of sooty coal the empirick alchemist +Can turn, or holds it possible to turn, +Metals of drossiest ore to perfect gold, +As from the mine. Mean while at table Eve +Ministered naked, and their flowing cups +With pleasant liquours crowned: O innocence +Deserving Paradise! if ever, then, +Then had the sons of God excuse to have been +Enamoured at that sight; but in those hearts +Love unlibidinous reigned, nor jealousy +Was understood, the injured lover's hell. +Thus when with meats and drinks they had sufficed, +Not burdened nature, sudden mind arose +In Adam, not to let the occasion pass +Given him by this great conference to know +Of things above his world, and of their being +Who dwell in Heaven, whose excellence he saw +Transcend his own so far; whose radiant forms, +Divine effulgence, whose high power, so far +Exceeded human; and his wary speech +Thus to the empyreal minister he framed. +Inhabitant with God, now know I well +Thy favour, in this honour done to Man; +Under whose lowly roof thou hast vouchsafed +To enter, and these earthly fruits to taste, +Food not of Angels, yet accepted so, +As that more willingly thou couldst not seem +At Heaven's high feasts to have fed: yet what compare +To whom the winged Hierarch replied. +O Adam, One Almighty is, from whom +All things proceed, and up to him return, +If not depraved from good, created all +Such to perfection, one first matter all, +Endued with various forms, various degrees +Of substance, and, in things that live, of life; +But more refined, more spiritous, and pure, +As nearer to him placed, or nearer tending +Each in their several active spheres assigned, +Till body up to spirit work, in bounds +Proportioned to each kind. So from the root +Springs lighter the green stalk, from thence the leaves +More aery, last the bright consummate flower +Spirits odorous breathes: flowers and their fruit, +Man's nourishment, by gradual scale sublimed, +To vital spirits aspire, to animal, +To intellectual; give both life and sense, +Fancy and understanding; whence the soul +Reason receives, and reason is her being, +Discursive, or intuitive; discourse +Is oftest yours, the latter most is ours, +Differing but in degree, of kind the same. +Wonder not then, what God for you saw good +If I refuse not, but convert, as you +To proper substance. Time may come, when Men +With Angels may participate, and find +No inconvenient diet, nor too light fare; +And from these corporal nutriments perhaps +Your bodies may at last turn all to spirit, +Improved by tract of time, and, winged, ascend +Ethereal, as we; or may, at choice, +Here or in heavenly Paradises dwell; +If ye be found obedient, and retain +Unalterably firm his love entire, +Whose progeny you are. Mean while enjoy +Your fill what happiness this happy state +Can comprehend, incapable of more. +To whom the patriarch of mankind replied. +O favourable Spirit, propitious guest, +Well hast thou taught the way that might direct +Our knowledge, and the scale of nature set +From center to circumference; whereon, +In contemplation of created things, +By steps we may ascend to God. But say, +What meant that caution joined, If ye be found +Obedient? Can we want obedience then +To him, or possibly his love desert, +Who formed us from the dust and placed us here +Full to the utmost measure of what bliss +Human desires can seek or apprehend? +To whom the Angel. Son of Heaven and Earth, +Attend! That thou art happy, owe to God; +That thou continuest such, owe to thyself, +That is, to thy obedience; therein stand. +This was that caution given thee; be advised. +God made thee perfect, not immutable; +And good he made thee, but to persevere +He left it in thy power; ordained thy will +By nature free, not over-ruled by fate +Inextricable, or strict necessity: +Our voluntary service he requires, +Not our necessitated; such with him +Finds no acceptance, nor can find; for how +Can hearts, not free, be tried whether they serve +Willing or no, who will but what they must +By destiny, and can no other choose? +Myself, and all the angelick host, that stand +In sight of God, enthroned, our happy state +Hold, as you yours, while our obedience holds; +On other surety none: Freely we serve, +Because we freely love, as in our will +To love or not; in this we stand or fall: +And some are fallen, to disobedience fallen, +And so from Heaven to deepest Hell; O fall +From what high state of bliss, into what woe! +To whom our great progenitor. Thy words +Attentive, and with more delighted ear, +Divine instructer, I have heard, than when +Cherubick songs by night from neighbouring hills +Aereal musick send: Nor knew I not +To be both will and deed created free; +Yet that we never shall forget to love +Our Maker, and obey him whose command +Single is yet so just, my constant thoughts +Assured me, and still assure: Though what thou tellest +Hath passed in Heaven, some doubt within me move, +But more desire to hear, if thou consent, +The full relation, which must needs be strange, +Worthy of sacred silence to be heard; +And we have yet large day, for scarce the sun +Hath finished half his journey, and scarce begins +His other half in the great zone of Heaven. +Thus Adam made request; and Raphael, +After short pause assenting, thus began. +High matter thou enjoinest me, O prime of men, +Sad task and hard: For how shall I relate +To human sense the invisible exploits +Of warring Spirits? how, without remorse, +The ruin of so many glorious once +And perfect while they stood? how last unfold +The secrets of another world, perhaps +Not lawful to reveal? yet for thy good +This is dispensed; and what surmounts the reach +Of human sense, I shall delineate so, +By likening spiritual to corporal forms, +As may express them best; though what if Earth +Be but a shadow of Heaven, and things therein +Each to other like, more than on earth is thought? +As yet this world was not, and Chaos wild +Reigned where these Heavens now roll, where Earth now rests +Upon her center poised; when on a day +(For time, though in eternity, applied +To motion, measures all things durable +By present, past, and future,) on such day +As Heaven's great year brings forth, the empyreal host +Of Angels by imperial summons called, +Innumerable before the Almighty's throne +Forthwith, from all the ends of Heaven, appeared +Under their Hierarchs in orders bright: +Ten thousand thousand ensigns high advanced, +Standards and gonfalons 'twixt van and rear +Stream in the air, and for distinction serve +Of hierarchies, of orders, and degrees; +Or in their glittering tissues bear imblazed +Holy memorials, acts of zeal and love +Recorded eminent. Thus when in orbs +Of circuit inexpressible they stood, +Orb within orb, the Father Infinite, +By whom in bliss imbosomed sat the Son, +Amidst as from a flaming mount, whose top +Brightness had made invisible, thus spake. +Hear, all ye Angels, progeny of light, +Thrones, Dominations, Princedoms, Virtues, Powers; +Hear my decree, which unrevoked shall stand. +This day I have begot whom I declare +My only Son, and on this holy hill +Him have anointed, whom ye now behold +At my right hand; your head I him appoint; +And by myself have sworn, to him shall bow +All knees in Heaven, and shall confess him Lord: +Under his great vice-gerent reign abide +United, as one individual soul, +For ever happy: Him who disobeys, +Me disobeys, breaks union, and that day, +Cast out from God and blessed vision, falls +Into utter darkness, deep ingulfed, his place +Ordained without redemption, without end. +So spake the Omnipotent, and with his words +All seemed well pleased; all seemed, but were not all. +That day, as other solemn days, they spent +In song and dance about the sacred hill; +Mystical dance, which yonder starry sphere +Of planets, and of fixed, in all her wheels +Resembles nearest, mazes intricate, +Eccentrick, intervolved, yet regular +Then most, when most irregular they seem; +And in their motions harmony divine +So smooths her charming tones, that God's own ear +Listens delighted. Evening now approached, +(For we have also our evening and our morn, +We ours for change delectable, not need;) +Forthwith from dance to sweet repast they turn +Desirous; all in circles as they stood, +Tables are set, and on a sudden piled +With Angels food, and rubied nectar flows +In pearl, in diamond, and massy gold, +Fruit of delicious vines, the growth of Heaven. +On flowers reposed, and with fresh flowerets crowned, +They eat, they drink, and in communion sweet +Quaff immortality and joy, secure +Of surfeit, where full measure only bounds +Excess, before the all-bounteous King, who showered +With copious hand, rejoicing in their joy. +Now when ambrosial night with clouds exhaled +From that high mount of God, whence light and shade +Spring both, the face of brightest Heaven had changed +To grateful twilight, (for night comes not there +In darker veil,) and roseat dews disposed +All but the unsleeping eyes of God to rest; +Wide over all the plain, and wider far +Than all this globous earth in plain outspread, +(Such are the courts of God) the angelick throng, +Dispersed in bands and files, their camp extend +By living streams among the trees of life, +Pavilions numberless, and sudden reared, +Celestial tabernacles, where they slept +Fanned with cool winds; save those, who, in their course, +Melodious hymns about the sovran throne +Alternate all night long: but not so waked +Satan; so call him now, his former name +Is heard no more in Heaven; he of the first, +If not the first Arch-Angel, great in power, +In favour and pre-eminence, yet fraught +With envy against the Son of God, that day +Honoured by his great Father, and proclaimed +Messiah King anointed, could not bear +Through pride that sight, and thought himself impaired. +Deep malice thence conceiving and disdain, +Soon as midnight brought on the dusky hour +Friendliest to sleep and silence, he resolved +With all his legions to dislodge, and leave +Unworshipt, unobeyed, the throne supreme, +Contemptuous; and his next subordinate +Awakening, thus to him in secret spake. +Sleepest thou, Companion dear? What sleep can close +Thy eye-lids? and rememberest what decree +Of yesterday, so late hath passed the lips +Of Heaven's Almighty. Thou to me thy thoughts +Wast wont, I mine to thee was wont to impart; +Both waking we were one; how then can now +Thy sleep dissent? New laws thou seest imposed; +New laws from him who reigns, new minds may raise +In us who serve, new counsels to debate +What doubtful may ensue: More in this place +To utter is not safe. Assemble thou +Of all those myriads which we lead the chief; +Tell them, that by command, ere yet dim night +Her shadowy cloud withdraws, I am to haste, +And all who under me their banners wave, +Homeward, with flying march, where we possess +The quarters of the north; there to prepare +Fit entertainment to receive our King, +The great Messiah, and his new commands, +Who speedily through all the hierarchies +Intends to pass triumphant, and give laws. +So spake the false Arch-Angel, and infused +Bad influence into the unwary breast +Of his associate: He together calls, +Or several one by one, the regent Powers, +Under him Regent; tells, as he was taught, +That the Most High commanding, now ere night, +Now ere dim night had disincumbered Heaven, +The great hierarchal standard was to move; +Tells the suggested cause, and casts between +Ambiguous words and jealousies, to sound +Or taint integrity: But all obeyed +The wonted signal, and superiour voice +Of their great Potentate; for great indeed +His name, and high was his degree in Heaven; +His countenance, as the morning-star that guides +The starry flock, allured them, and with lies +Drew after him the third part of Heaven's host. +Mean while the Eternal eye, whose sight discerns +Abstrusest thoughts, from forth his holy mount, +And from within the golden lamps that burn +Nightly before him, saw without their light +Rebellion rising; saw in whom, how spread +Among the sons of morn, what multitudes +Were banded to oppose his high decree; +And, smiling, to his only Son thus said. +Son, thou in whom my glory I behold +In full resplendence, Heir of all my might, +Nearly it now concerns us to be sure +Of our Omnipotence, and with what arms +We mean to hold what anciently we claim +Of deity or empire: Such a foe +Is rising, who intends to erect his throne +Equal to ours, throughout the spacious north; +Nor so content, hath in his thought to try +In battle, what our power is, or our right. +Let us advise, and to this hazard draw +With speed what force is left, and all employ +In our defence; lest unawares we lose +This our high place, our sanctuary, our hill. +To whom the Son with calm aspect and clear, +Lightning divine, ineffable, serene, +Made answer. Mighty Father, thou thy foes +Justly hast in derision, and, secure, +Laughest at their vain designs and tumults vain, +Matter to me of glory, whom their hate +Illustrates, when they see all regal power +Given me to quell their pride, and in event +Know whether I be dextrous to subdue +Thy rebels, or be found the worst in Heaven. +So spake the Son; but Satan, with his Powers, +Far was advanced on winged speed; an host +Innumerable as the stars of night, +Or stars of morning, dew-drops, which the sun +Impearls on every leaf and every flower. +Regions they passed, the mighty regencies +Of Seraphim, and Potentates, and Thrones, +In their triple degrees; regions to which +All thy dominion, Adam, is no more +Than what this garden is to all the earth, +And all the sea, from one entire globose +Stretched into longitude; which having passed, +At length into the limits of the north +They came; and Satan to his royal seat +High on a hill, far blazing, as a mount +Raised on a mount, with pyramids and towers +From diamond quarries hewn, and rocks of gold; +The palace of great Lucifer, (so call +That structure in the dialect of men +Interpreted,) which not long after, he +Affecting all equality with God, +In imitation of that mount whereon +Messiah was declared in sight of Heaven, +The Mountain of the Congregation called; +For thither he assembled all his train, +Pretending so commanded to consult +About the great reception of their King, +Thither to come, and with calumnious art +Of counterfeited truth thus held their ears. +Thrones, Dominations, Princedoms, Virtues, Powers; +If these magnifick titles yet remain +Not merely titular, since by decree +Another now hath to himself engrossed +All power, and us eclipsed under the name +Of King anointed, for whom all this haste +Of midnight-march, and hurried meeting here, +This only to consult how we may best, +With what may be devised of honours new, +Receive him coming to receive from us +Knee-tribute yet unpaid, prostration vile! +Too much to one! but double how endured, +To one, and to his image now proclaimed? +But what if better counsels might erect +Our minds, and teach us to cast off this yoke? +Will ye submit your necks, and choose to bend +The supple knee? Ye will not, if I trust +To know ye right, or if ye know yourselves +Natives and sons of Heaven possessed before +By none; and if not equal all, yet free, +Equally free; for orders and degrees +Jar not with liberty, but well consist. +Who can in reason then, or right, assume +Monarchy over such as live by right +His equals, if in power and splendour less, +In freedom equal? or can introduce +Law and edict on us, who without law +Err not? much less for this to be our Lord, +And look for adoration, to the abuse +Of those imperial titles, which assert +Our being ordained to govern, not to serve. +Thus far his bold discourse without controul +Had audience; when among the Seraphim +Abdiel, than whom none with more zeal adored +The Deity, and divine commands obeyed, +Stood up, and in a flame of zeal severe +The current of his fury thus opposed. +O argument blasphemous, false, and proud! +Words which no ear ever to hear in Heaven +Expected, least of all from thee, Ingrate, +In place thyself so high above thy peers. +Canst thou with impious obloquy condemn +The just decree of God, pronounced and sworn, +That to his only Son, by right endued +With regal scepter, every soul in Heaven +Shall bend the knee, and in that honour due +Confess him rightful King? unjust, thou sayest, +Flatly unjust, to bind with laws the free, +And equal over equals to let reign, +One over all with unsucceeded power. +Shalt thou give law to God? shalt thou dispute +With him the points of liberty, who made +Thee what thou art, and formed the Powers of Heaven +Such as he pleased, and circumscribed their being? +Yet, by experience taught, we know how good, +And of our good and of our dignity +How provident he is; how far from thought +To make us less, bent rather to exalt +Our happy state, under one head more near +United. But to grant it thee unjust, +That equal over equals monarch reign: +Thyself, though great and glorious, dost thou count, +Or all angelick nature joined in one, +Equal to him begotten Son? by whom, +As by his Word, the Mighty Father made +All things, even thee; and all the Spirits of Heaven +By him created in their bright degrees, +Crowned them with glory, and to their glory named +Thrones, Dominations, Princedoms, Virtues, Powers, +Essential Powers; nor by his reign obscured, +But more illustrious made; since he the head +One of our number thus reduced becomes; +His laws our laws; all honour to him done +Returns our own. Cease then this impious rage, +And tempt not these; but hasten to appease +The incensed Father, and the incensed Son, +While pardon may be found in time besought. +So spake the fervent Angel; but his zeal +None seconded, as out of season judged, +Or singular and rash: Whereat rejoiced +The Apostate, and, more haughty, thus replied. +That we were formed then sayest thou? and the work +Of secondary hands, by task transferred +From Father to his Son? strange point and new! +Doctrine which we would know whence learned: who saw +When this creation was? rememberest thou +Thy making, while the Maker gave thee being? +We know no time when we were not as now; +Know none before us, self-begot, self-raised +By our own quickening power, when fatal course +Had circled his full orb, the birth mature +Of this our native Heaven, ethereal sons. +Our puissance is our own; our own right hand +Shall teach us highest deeds, by proof to try +Who is our equal: Then thou shalt behold +Whether by supplication we intend +Address, and to begirt the almighty throne +Beseeching or besieging. This report, +These tidings carry to the anointed King; +And fly, ere evil intercept thy flight. +He said; and, as the sound of waters deep, +Hoarse murmur echoed to his words applause +Through the infinite host; nor less for that +The flaming Seraph fearless, though alone +Encompassed round with foes, thus answered bold. +O alienate from God, O Spirit accursed, +Forsaken of all good! I see thy fall +Determined, and thy hapless crew involved +In this perfidious fraud, contagion spread +Both of thy crime and punishment: Henceforth +No more be troubled how to quit the yoke +Of God's Messiah; those indulgent laws +Will not be now vouchsafed; other decrees +Against thee are gone forth without recall; +That golden scepter, which thou didst reject, +Is now an iron rod to bruise and break +Thy disobedience. Well thou didst advise; +Yet not for thy advice or threats I fly +These wicked tents devoted, lest the wrath +Impendent, raging into sudden flame, +Distinguish not: For soon expect to feel +His thunder on thy head, devouring fire. +Then who created thee lamenting learn, +When who can uncreate thee thou shalt know. +So spake the Seraph Abdiel, faithful found +Among the faithless, faithful only he; +Among innumerable false, unmoved, +Unshaken, unseduced, unterrified, +His loyalty he kept, his love, his zeal; +Nor number, nor example, with him wrought +To swerve from truth, or change his constant mind, +Though single. From amidst them forth he passed, +Long way through hostile scorn, which he sustained +Superiour, nor of violence feared aught; +And, with retorted scorn, his back he turned +On those proud towers to swift destruction doomed. + + + +Book VI + + +All night the dreadless Angel, unpursued, +Through Heaven's wide champain held his way; till Morn, +Waked by the circling Hours, with rosy hand +Unbarred the gates of light. There is a cave +Within the mount of God, fast by his throne, +Where light and darkness in perpetual round +Lodge and dislodge by turns, which makes through Heaven +Grateful vicissitude, like day and night; +Light issues forth, and at the other door +Obsequious darkness enters, till her hour +To veil the Heaven, though darkness there might well +Seem twilight here: And now went forth the Morn +Such as in highest Heaven arrayed in gold +Empyreal; from before her vanished Night, +Shot through with orient beams; when all the plain +Covered with thick embattled squadrons bright, +Chariots, and flaming arms, and fiery steeds, +Reflecting blaze on blaze, first met his view: +War he perceived, war in procinct; and found +Already known what he for news had thought +To have reported: Gladly then he mixed +Among those friendly Powers, who him received +With joy and acclamations loud, that one, +That of so many myriads fallen, yet one +Returned not lost. On to the sacred hill +They led him high applauded, and present +Before the seat supreme; from whence a voice, +From midst a golden cloud, thus mild was heard. +Servant of God. Well done; well hast thou fought +The better fight, who single hast maintained +Against revolted multitudes the cause +Of truth, in word mightier than they in arms; +And for the testimony of truth hast borne +Universal reproach, far worse to bear +Than violence; for this was all thy care +To stand approved in sight of God, though worlds +Judged thee perverse: The easier conquest now +Remains thee, aided by this host of friends, +Back on thy foes more glorious to return, +Than scorned thou didst depart; and to subdue +By force, who reason for their law refuse, +Right reason for their law, and for their King +Messiah, who by right of merit reigns. +Go, Michael, of celestial armies prince, +And thou, in military prowess next, +Gabriel, lead forth to battle these my sons +Invincible; lead forth my armed Saints, +By thousands and by millions, ranged for fight, +Equal in number to that Godless crew +Rebellious: Them with fire and hostile arms +Fearless assault; and, to the brow of Heaven +Pursuing, drive them out from God and bliss, +Into their place of punishment, the gulf +Of Tartarus, which ready opens wide +His fiery Chaos to receive their fall. +So spake the Sovran Voice, and clouds began +To darken all the hill, and smoke to roll +In dusky wreaths, reluctant flames, the sign +Of wrath awaked; nor with less dread the loud +Ethereal trumpet from on high 'gan blow: +At which command the Powers militant, +That stood for Heaven, in mighty quadrate joined +Of union irresistible, moved on +In silence their bright legions, to the sound +Of instrumental harmony, that breathed +Heroick ardour to adventurous deeds +Under their God-like leaders, in the cause +Of God and his Messiah. On they move +Indissolubly firm; nor obvious hill, +Nor straitening vale, nor wood, nor stream, divides +Their perfect ranks; for high above the ground +Their march was, and the passive air upbore +Their nimble tread; as when the total kind +Of birds, in orderly array on wing, +Came summoned over Eden to receive +Their names of thee; so over many a tract +Of Heaven they marched, and many a province wide, +Tenfold the length of this terrene: At last, +Far in the horizon to the north appeared +From skirt to skirt a fiery region, stretched +In battailous aspect, and nearer view +Bristled with upright beams innumerable +Of rigid spears, and helmets thronged, and shields +Various, with boastful argument portrayed, +The banded Powers of Satan hasting on +With furious expedition; for they weened +That self-same day, by fight or by surprise, +To win the mount of God, and on his throne +To set the Envier of his state, the proud +Aspirer; but their thoughts proved fond and vain +In the mid way: Though strange to us it seemed +At first, that Angel should with Angel war, +And in fierce hosting meet, who wont to meet +So oft in festivals of joy and love +Unanimous, as sons of one great Sire, +Hymning the Eternal Father: But the shout +Of battle now began, and rushing sound +Of onset ended soon each milder thought. +High in the midst, exalted as a God, +The Apostate in his sun-bright chariot sat, +Idol of majesty divine, enclosed +With flaming Cherubim, and golden shields; +Then lighted from his gorgeous throne, for now +"twixt host and host but narrow space was left, +A dreadful interval, and front to front +Presented stood in terrible array +Of hideous length: Before the cloudy van, +On the rough edge of battle ere it joined, +Satan, with vast and haughty strides advanced, +Came towering, armed in adamant and gold; +Abdiel that sight endured not, where he stood +Among the mightiest, bent on highest deeds, +And thus his own undaunted heart explores. +O Heaven! that such resemblance of the Highest +Should yet remain, where faith and realty +Remain not: Wherefore should not strength and might +There fail where virtue fails, or weakest prove +Where boldest, though to fight unconquerable? +His puissance, trusting in the Almighty's aid, +I mean to try, whose reason I have tried +Unsound and false; nor is it aught but just, +That he, who in debate of truth hath won, +Should win in arms, in both disputes alike +Victor; though brutish that contest and foul, +When reason hath to deal with force, yet so +Most reason is that reason overcome. +So pondering, and from his armed peers +Forth stepping opposite, half-way he met +His daring foe, at this prevention more +Incensed, and thus securely him defied. +Proud, art thou met? thy hope was to have reached +The highth of thy aspiring unopposed, +The throne of God unguarded, and his side +Abandoned, at the terrour of thy power +Or potent tongue: Fool!not to think how vain +Against the Omnipotent to rise in arms; +Who out of smallest things could, without end, +Have raised incessant armies to defeat +Thy folly; or with solitary hand +Reaching beyond all limit, at one blow, +Unaided, could have finished thee, and whelmed +Thy legions under darkness: But thou seest +All are not of thy train; there be, who faith +Prefer, and piety to God, though then +To thee not visible, when I alone +Seemed in thy world erroneous to dissent +From all: My sect thou seest;now learn too late +How few sometimes may know, when thousands err. +Whom the grand foe, with scornful eye askance, +Thus answered. Ill for thee, but in wished hour +Of my revenge, first sought for, thou returnest +From flight, seditious Angel! to receive +Thy merited reward, the first assay +Of this right hand provoked, since first that tongue, +Inspired with contradiction, durst oppose +A third part of the Gods, in synod met +Their deities to assert; who, while they feel +Vigour divine within them, can allow +Omnipotence to none. But well thou comest +Before thy fellows, ambitious to win +From me some plume, that thy success may show +Destruction to the rest: This pause between, +(Unanswered lest thou boast) to let thee know, +At first I thought that Liberty and Heaven +To heavenly souls had been all one; but now +I see that most through sloth had rather serve, +Ministring Spirits, trained up in feast and song! +Such hast thou armed, the minstrelsy of Heaven, +Servility with freedom to contend, +As both their deeds compared this day shall prove. +To whom in brief thus Abdiel stern replied. +Apostate! still thou errest, nor end wilt find +Of erring, from the path of truth remote: +Unjustly thou depravest it with the name +Of servitude, to serve whom God ordains, +Or Nature: God and Nature bid the same, +When he who rules is worthiest, and excels +Them whom he governs. This is servitude, +To serve the unwise, or him who hath rebelled +Against his worthier, as thine now serve thee, +Thyself not free, but to thyself enthralled; +Yet lewdly darest our ministring upbraid. +Reign thou in Hell, thy kingdom; let me serve +In Heaven God ever blest, and his divine +Behests obey, worthiest to be obeyed; +Yet chains in Hell, not realms, expect: Mean while +From me returned, as erst thou saidst, from flight, +This greeting on thy impious crest receive. +So saying, a noble stroke he lifted high, +Which hung not, but so swift with tempest fell +On the proud crest of Satan, that no sight, +Nor motion of swift thought, less could his shield, +Such ruin intercept: Ten paces huge +He back recoiled; the tenth on bended knee +His massy spear upstaid; as if on earth +Winds under ground, or waters forcing way, +Sidelong had pushed a mountain from his seat, +Half sunk with all his pines. Amazement seised +The rebel Thrones, but greater rage, to see +Thus foiled their mightiest; ours joy filled, and shout, +Presage of victory, and fierce desire +Of battle: Whereat Michael bid sound +The Arch-Angel trumpet; through the vast of Heaven +It sounded, and the faithful armies rung +Hosanna to the Highest: Nor stood at gaze +The adverse legions, nor less hideous joined +The horrid shock. Now storming fury rose, +And clamour such as heard in Heaven till now +Was never; arms on armour clashing brayed +Horrible discord, and the madding wheels +Of brazen chariots raged; dire was the noise +Of conflict; over head the dismal hiss +Of fiery darts in flaming vollies flew, +And flying vaulted either host with fire. +So under fiery cope together rushed +Both battles main, with ruinous assault +And inextinguishable rage. All Heaven +Resounded; and had Earth been then, all Earth +Had to her center shook. What wonder? when +Millions of fierce encountering Angels fought +On either side, the least of whom could wield +These elements, and arm him with the force +Of all their regions: How much more of power +Army against army numberless to raise +Dreadful combustion warring, and disturb, +Though not destroy, their happy native seat; +Had not the Eternal King Omnipotent, +From his strong hold of Heaven, high over-ruled +And limited their might; though numbered such +As each divided legion might have seemed +A numerous host; in strength each armed hand +A legion; led in fight, yet leader seemed +Each warriour single as in chief, expert +When to advance, or stand, or turn the sway +Of battle, open when, and when to close +The ridges of grim war: No thought of flight, +None of retreat, no unbecoming deed +That argued fear; each on himself relied, +As only in his arm the moment lay +Of victory: Deeds of eternal fame +Were done, but infinite; for wide was spread +That war and various; sometimes on firm ground +A standing fight, then, soaring on main wing, +Tormented all the air; all air seemed then +Conflicting fire. Long time in even scale +The battle hung; till Satan, who that day +Prodigious power had shown, and met in arms +No equal, ranging through the dire attack +Of fighting Seraphim confused, at length +Saw where the sword of Michael smote, and felled +Squadrons at once; with huge two-handed sway +Brandished aloft, the horrid edge came down +Wide-wasting; such destruction to withstand +He hasted, and opposed the rocky orb +Of tenfold adamant, his ample shield, +A vast circumference. At his approach +The great Arch-Angel from his warlike toil +Surceased, and glad, as hoping here to end +Intestine war in Heaven, the arch-foe subdued +Or captive dragged in chains, with hostile frown +And visage all inflamed first thus began. +Author of evil, unknown till thy revolt, +Unnamed in Heaven, now plenteous as thou seest +These acts of hateful strife, hateful to all, +Though heaviest by just measure on thyself, +And thy adherents: How hast thou disturbed +Heaven's blessed peace, and into nature brought +Misery, uncreated till the crime +Of thy rebellion! how hast thou instilled +Thy malice into thousands, once upright +And faithful, now proved false! But think not here +To trouble holy rest; Heaven casts thee out +From all her confines. Heaven, the seat of bliss, +Brooks not the works of violence and war. +Hence then, and evil go with thee along, +Thy offspring, to the place of evil, Hell; +Thou and thy wicked crew! there mingle broils, +Ere this avenging sword begin thy doom, +Or some more sudden vengeance, winged from God, +Precipitate thee with augmented pain. +So spake the Prince of Angels; to whom thus +The Adversary. Nor think thou with wind +Of aery threats to awe whom yet with deeds +Thou canst not. Hast thou turned the least of these +To flight, or if to fall, but that they rise +Unvanquished, easier to transact with me +That thou shouldst hope, imperious, and with threats +To chase me hence? err not, that so shall end +The strife which thou callest evil, but we style +The strife of glory; which we mean to win, +Or turn this Heaven itself into the Hell +Thou fablest; here however to dwell free, +If not to reign: Mean while thy utmost force, +And join him named Almighty to thy aid, +I fly not, but have sought thee far and nigh. +They ended parle, and both addressed for fight +Unspeakable; for who, though with the tongue +Of Angels, can relate, or to what things +Liken on earth conspicuous, that may lift +Human imagination to such highth +Of Godlike power? for likest Gods they seemed, +Stood they or moved, in stature, motion, arms, +Fit to decide the empire of great Heaven. +Now waved their fiery swords, and in the air +Made horrid circles; two broad suns their shields +Blazed opposite, while Expectation stood +In horrour: From each hand with speed retired, +Where erst was thickest fight, the angelick throng, +And left large field, unsafe within the wind +Of such commotion; such as, to set forth +Great things by small, if, nature's concord broke, +Among the constellations war were sprung, +Two planets, rushing from aspect malign +Of fiercest opposition, in mid sky +Should combat, and their jarring spheres confound. +Together both with next to almighty arm +Up-lifted imminent, one stroke they aimed +That might determine, and not need repeat, +As not of power at once; nor odds appeared +In might or swift prevention: But the sword +Of Michael from the armoury of God +Was given him tempered so, that neither keen +Nor solid might resist that edge: it met +The sword of Satan, with steep force to smite +Descending, and in half cut sheer; nor staid, +But with swift wheel reverse, deep entering, shared +All his right side: Then Satan first knew pain, +And writhed him to and fro convolved; so sore +The griding sword with discontinuous wound +Passed through him: But the ethereal substance closed, +Not long divisible; and from the gash +A stream of necturous humour issuing flowed +Sanguine, such as celestial Spirits may bleed, +And all his armour stained, ere while so bright. +Forthwith on all sides to his aid was run +By Angels many and strong, who interposed +Defence, while others bore him on their shields +Back to his chariot, where it stood retired +From off the files of war: There they him laid +Gnashing for anguish, and despite, and shame, +To find himself not matchless, and his pride +Humbled by such rebuke, so far beneath +His confidence to equal God in power. +Yet soon he healed; for Spirits that live throughout +Vital in every part, not as frail man +In entrails, heart of head, liver or reins, +Cannot but by annihilating die; +Nor in their liquid texture mortal wound +Receive, no more than can the fluid air: +All heart they live, all head, all eye, all ear, +All intellect, all sense; and, as they please, +They limb themselves, and colour, shape, or size +Assume, as?kikes them best, condense or rare. +Mean while in other parts like deeds deserved +Memorial, where the might of Gabriel fought, +And with fierce ensigns pierced the deep array +Of Moloch, furious king; who him defied, +And at his chariot-wheels to drag him bound +Threatened, nor from the Holy One of Heaven +Refrained his tongue blasphemous; but anon +Down cloven to the waist, with shattered arms +And uncouth pain fled bellowing. On each wing +Uriel, and Raphael, his vaunting foe, +Though huge, and in a rock of diamond armed, +Vanquished Adramelech, and Asmadai, +Two potent Thrones, that to be less than Gods +Disdained, but meaner thoughts learned in their flight, +Mangled with ghastly wounds through plate and mail. +Nor stood unmindful Abdiel to annoy +The atheist crew, but with redoubled blow +Ariel, and Arioch, and the violence +Of Ramiel scorched and blasted, overthrew. +I might relate of thousands, and their names +Eternize here on earth; but those elect +Angels, contented with their fame in Heaven, +Seek not the praise of men: The other sort, +In might though wonderous and in acts of war, +Nor of renown less eager, yet by doom +Cancelled from Heaven and sacred memory, +Nameless in dark oblivion let them dwell. +For strength from truth divided, and from just, +Illaudable, nought merits but dispraise +And ignominy; yet to glory aspires +Vain-glorious, and through infamy seeks fame: +Therefore eternal silence be their doom. +And now, their mightiest quelled, the battle swerved, +With many an inroad gored; deformed rout +Entered, and foul disorder; all the ground +With shivered armour strown, and on a heap +Chariot and charioteer lay overturned, +And fiery-foaming steeds; what stood, recoiled +O'er-wearied, through the faint Satanick host +Defensive scarce, or with pale fear surprised, +Then first with fear surprised, and sense of pain, +Fled ignominious, to such evil brought +By sin of disobedience; till that hour +Not liable to fear, or flight, or pain. +Far otherwise the inviolable Saints, +In cubick phalanx firm, advanced entire, +Invulnerable, impenetrably armed; +Such high advantages their innocence +Gave them above their foes; not to have sinned, +Not to have disobeyed; in fight they stood +Unwearied, unobnoxious to be pained +By wound, though from their place by violence moved, +Now Night her course began, and, over Heaven +Inducing darkness, grateful truce imposed, +And silence on the odious din of war: +Under her cloudy covert both retired, +Victor and vanquished: On the foughten field +Michael and his Angels prevalent +Encamping, placed in guard their watches round, +Cherubick waving fires: On the other part, +Satan with his rebellious disappeared, +Far in the dark dislodged; and, void of rest, +His potentates to council called by night; +And in the midst thus undismayed began. +O now in danger tried, now known in arms +Not to be overpowered, Companions dear, +Found worthy not of liberty alone, +Too mean pretence! but what we more affect, +Honour, dominion, glory, and renown; +Who have sustained one day in doubtful fight, +(And if one day, why not eternal days?) +What Heaven's Lord had powerfullest to send +Against us from about his throne, and judged +Sufficient to subdue us to his will, +But proves not so: Then fallible, it seems, +Of future we may deem him, though till now +Omniscient thought. True is, less firmly armed, +Some disadvantage we endured and pain, +Till now not known, but, known, as soon contemned; +Since now we find this our empyreal form +Incapable of mortal injury, +Imperishable, and, though pierced with wound, +Soon closing, and by native vigour healed. +Of evil then so small as easy think +The remedy; perhaps more valid arms, +Weapons more violent, when next we meet, +May serve to better us, and worse our foes, +Or equal what between us made the odds, +In nature none: If other hidden cause +Left them superiour, while we can preserve +Unhurt our minds, and understanding sound, +Due search and consultation will disclose. +He sat; and in the assembly next upstood +Nisroch, of Principalities the prime; +As one he stood escaped from cruel fight, +Sore toiled, his riven arms to havock hewn, +And cloudy in aspect thus answering spake. +Deliverer from new Lords, leader to free +Enjoyment of our right as Gods; yet hard +For Gods, and too unequal work we find, +Against unequal arms to fight in pain, +Against unpained, impassive; from which evil +Ruin must needs ensue; for what avails +Valour or strength, though matchless, quelled with pain +Which all subdues, and makes remiss the hands +Of mightiest? Sense of pleasure we may well +Spare out of life perhaps, and not repine, +But live content, which is the calmest life: +But pain is perfect misery, the worst +Of evils, and, excessive, overturns +All patience. He, who therefore can invent +With what more forcible we may offend +Our yet unwounded enemies, or arm +Ourselves with like defence, to me deserves +No less than for deliverance what we owe. +Whereto with look composed Satan replied. +Not uninvented that, which thou aright +Believest so main to our success, I bring. +Which of us who beholds the bright surface +Of this ethereous mould whereon we stand, +This continent of spacious Heaven, adorned +With plant, fruit, flower ambrosial, gems, and gold; +Whose eye so superficially surveys +These things, as not to mind from whence they grow +Deep under ground, materials dark and crude, +Of spiritous and fiery spume, till touched +With Heaven's ray, and tempered, they shoot forth +So beauteous, opening to the ambient light? +These in their dark nativity the deep +Shall yield us, pregnant with infernal flame; +Which, into hollow engines, long and round, +Thick rammed, at the other bore with touch of fire +Dilated and infuriate, shall send forth +From far, with thundering noise, among our foes +Such implements of mischief, as shall dash +To pieces, and o'erwhelm whatever stands +Adverse, that they shall fear we have disarmed +The Thunderer of his only dreaded bolt. +Nor long shall be our labour; yet ere dawn, +Effect shall end our wish. Mean while revive; +Abandon fear; to strength and counsel joined +Think nothing hard, much less to be despaired. +He ended, and his words their drooping cheer +Enlightened, and their languished hope revived. +The invention all admired, and each, how he +To be the inventer missed; so easy it seemed +Once found, which yet unfound most would have thought +Impossible: Yet, haply, of thy race +In future days, if malice should abound, +Some one intent on mischief, or inspired +With devilish machination, might devise +Like instrument to plague the sons of men +For sin, on war and mutual slaughter bent. +Forthwith from council to the work they flew; +None arguing stood; innumerable hands +Were ready; in a moment up they turned +Wide the celestial soil, and saw beneath +The originals of nature in their crude +Conception; sulphurous and nitrous foam +They found, they mingled, and, with subtle art, +Concocted and adusted they reduced +To blackest grain, and into store conveyed: +Part hidden veins digged up (nor hath this earth +Entrails unlike) of mineral and stone, +Whereof to found their engines and their balls +Of missive ruin; part incentive reed +Provide, pernicious with one touch to fire. +So all ere day-spring, under conscious night, +Secret they finished, and in order set, +With silent circumspection, unespied. +Now when fair morn orient in Heaven appeared, +Up rose the victor-Angels, and to arms +The matin trumpet sung: In arms they stood +Of golden panoply, refulgent host, +Soon banded; others from the dawning hills +Look round, and scouts each coast light-armed scour, +Each quarter to descry the distant foe, +Where lodged, or whither fled, or if for fight, +In motion or in halt: Him soon they met +Under spread ensigns moving nigh, in slow +But firm battalion; back with speediest sail +Zophiel, of Cherubim the swiftest wing, +Came flying, and in mid air aloud thus cried. +Arm, Warriours, arm for fight; the foe at hand, +Whom fled we thought, will save us long pursuit +This day; fear not his flight;so thick a cloud +He comes, and settled in his face I see +Sad resolution, and secure: Let each +His adamantine coat gird well, and each +Fit well his helm, gripe fast his orbed shield, +Borne even or high; for this day will pour down, +If I conjecture aught, no drizzling shower, +But rattling storm of arrows barbed with fire. +So warned he them, aware themselves, and soon +In order, quit of all impediment; +Instant without disturb they took alarm, +And onward moved embattled: When behold! +Not distant far with heavy pace the foe +Approaching gross and huge, in hollow cube +Training his devilish enginery, impaled +On every side with shadowing squadrons deep, +To hide the fraud. At interview both stood +A while; but suddenly at head appeared +Satan, and thus was heard commanding loud. +Vanguard, to right and left the front unfold; +That all may see who hate us, how we seek +Peace and composure, and with open breast +Stand ready to receive them, if they like +Our overture; and turn not back perverse: +But that I doubt; however witness, Heaven! +Heaven, witness thou anon! while we discharge +Freely our part: ye, who appointed stand +Do as you have in charge, and briefly touch +What we propound, and loud that all may hear! +So scoffing in ambiguous words, he scarce +Had ended; when to right and left the front +Divided, and to either flank retired: +Which to our eyes discovered, new and strange, +A triple mounted row of pillars laid +On wheels (for like to pillars most they seemed, +Or hollowed bodies made of oak or fir, +With branches lopt, in wood or mountain felled,) +Brass, iron, stony mould, had not their mouths +With hideous orifice gaped on us wide, +Portending hollow truce: At each behind +A Seraph stood, and in his hand a reed +Stood waving tipt with fire; while we, suspense, +Collected stood within our thoughts amused, +Not long; for sudden all at once their reeds +Put forth, and to a narrow vent applied +With nicest touch. Immediate in a flame, +But soon obscured with smoke, all Heaven appeared, +From those deep-throated engines belched, whose roar +Embowelled with outrageous noise the air, +And all her entrails tore, disgorging foul +Their devilish glut, chained thunderbolts and hail +Of iron globes; which, on the victor host +Levelled, with such impetuous fury smote, +That, whom they hit, none on their feet might stand, +Though standing else as rocks, but down they fell +By thousands, Angel on Arch-Angel rolled; +The sooner for their arms; unarmed, they might +Have easily, as Spirits, evaded swift +By quick contraction or remove; but now +Foul dissipation followed, and forced rout; +Nor served it to relax their serried files. +What should they do? if on they rushed, repulse +Repeated, and indecent overthrow +Doubled, would render them yet more despised, +And to their foes a laughter; for in view +Stood ranked of Seraphim another row, +In posture to displode their second tire +Of thunder: Back defeated to return +They worse abhorred. Satan beheld their plight, +And to his mates thus in derision called. +O Friends! why come not on these victors proud +Ere while they fierce were coming; and when we, +To entertain them fair with open front +And breast, (what could we more?) propounded terms +Of composition, straight they changed their minds, +Flew off, and into strange vagaries fell, +As they would dance; yet for a dance they seemed +Somewhat extravagant and wild; perhaps +For joy of offered peace: But I suppose, +If our proposals once again were heard, +We should compel them to a quick result. +To whom thus Belial, in like gamesome mood. +Leader! the terms we sent were terms of weight, +Of hard contents, and full of force urged home; +Such as we might perceive amused them all, +And stumbled many: Who receives them right, +Had need from head to foot well understand; +Not understood, this gift they have besides, +They show us when our foes walk not upright. +So they among themselves in pleasant vein +Stood scoffing, hightened in their thoughts beyond +All doubt of victory: Eternal Might +To match with their inventions they presumed +So easy, and of his thunder made a scorn, +And all his host derided, while they stood +A while in trouble: But they stood not long; +Rage prompted them at length, and found them arms +Against such hellish mischief fit to oppose. +Forthwith (behold the excellence, the power, +Which God hath in his mighty Angels placed!) +Their arms away they threw, and to the hills +(For Earth hath this variety from Heaven +Of pleasure situate in hill and dale,) +Light as the lightning glimpse they ran, they flew; +From their foundations loosening to and fro, +They plucked the seated hills, with all their load, +Rocks, waters, woods, and by the shaggy tops +Up-lifting bore them in their hands: Amaze, +Be sure, and terrour, seized the rebel host, +When coming towards them so dread they saw +The bottom of the mountains upward turned; +Till on those cursed engines' triple-row +They saw them whelmed, and all their confidence +Under the weight of mountains buried deep; +Themselves invaded next, and on their heads +Main promontories flung, which in the air +Came shadowing, and oppressed whole legions armed; +Their armour helped their harm, crushed in and bruised +Into their substance pent, which wrought them pain +Implacable, and many a dolorous groan; +Long struggling underneath, ere they could wind +Out of such prison, though Spirits of purest light, +Purest at first, now gross by sinning grown. +The rest, in imitation, to like arms +Betook them, and the neighbouring hills uptore: +So hills amid the air encountered hills, +Hurled to and fro with jaculation dire; +That under ground they fought in dismal shade; +Infernal noise! war seemed a civil game +To this uproar; horrid confusion heaped +Upon confusion rose: And now all Heaven +Had gone to wrack, with ruin overspread; +Had not the Almighty Father, where he sits +Shrined in his sanctuary of Heaven secure, +Consulting on the sum of things, foreseen +This tumult, and permitted all, advised: +That his great purpose he might so fulfil, +To honour his anointed Son avenged +Upon his enemies, and to declare +All power on him transferred: Whence to his Son, +The Assessour of his throne, he thus began. +Effulgence of my glory, Son beloved, +Son, in whose face invisible is beheld +Visibly, what by Deity I am; +And in whose hand what by decree I do, +Second Omnipotence! two days are past, +Two days, as we compute the days of Heaven, +Since Michael and his Powers went forth to tame +These disobedient: Sore hath been their fight, +As likeliest was, when two such foes met armed; +For to themselves I left them; and thou knowest, +Equal in their creation they were formed, +Save what sin hath impaired; which yet hath wrought +Insensibly, for I suspend their doom; +Whence in perpetual fight they needs must last +Endless, and no solution will be found: +War wearied hath performed what war can do, +And to disordered rage let loose the reins +With mountains, as with weapons, armed; which makes +Wild work in Heaven, and dangerous to the main. +Two days are therefore past, the third is thine; +For thee I have ordained it; and thus far +Have suffered, that the glory may be thine +Of ending this great war, since none but Thou +Can end it. Into thee such virtue and grace +Immense I have transfused, that all may know +In Heaven and Hell thy power above compare; +And, this perverse commotion governed thus, +To manifest thee worthiest to be Heir +Of all things; to be Heir, and to be King +By sacred unction, thy deserved right. +Go then, Thou Mightiest, in thy Father's might; +Ascend my chariot, guide the rapid wheels +That shake Heaven's basis, bring forth all my war, +My bow and thunder, my almighty arms +Gird on, and sword upon thy puissant thigh; +Pursue these sons of darkness, drive them out +From all Heaven's bounds into the utter deep: +There let them learn, as likes them, to despise +God, and Messiah his anointed King. +He said, and on his Son with rays direct +Shone full; he all his Father full expressed +Ineffably into his face received; +And thus the Filial Godhead answering spake. +O Father, O Supreme of heavenly Thrones, +First, Highest, Holiest, Best; thou always seek'st +To glorify thy Son, I always thee, +As is most just: This I my glory account, +My exaltation, and my whole delight, +That thou, in me well pleased, declarest thy will +Fulfilled, which to fulfil is all my bliss. +Scepter and power, thy giving, I assume, +And gladlier shall resign, when in the end +Thou shalt be all in all, and I in thee +For ever; and in me all whom thou lovest: +But whom thou hatest, I hate, and can put on +Thy terrours, as I put thy mildness on, +Image of thee in all things; and shall soon, +Armed with thy might, rid Heaven of these rebelled; +To their prepared ill mansion driven down, +To chains of darkness, and the undying worm; +That from thy just obedience could revolt, +Whom to obey is happiness entire. +Then shall thy Saints unmixed, and from the impure +Far separate, circling thy holy mount, +Unfeigned Halleluiahs to thee sing, +Hymns of high praise, and I among them Chief. +So said, he, o'er his scepter bowing, rose +From the right hand of Glory where he sat; +And the third sacred morn began to shine, +Dawning through Heaven. Forth rushed with whirlwind sound +The chariot of Paternal Deity, +Flashing thick flames, wheel within wheel undrawn, +Itself instinct with Spirit, but convoyed +By four Cherubick shapes; four faces each +Had wonderous; as with stars, their bodies all +And wings were set with eyes; with eyes the wheels +Of beryl, and careering fires between; +Over their heads a crystal firmament, +Whereon a sapphire throne, inlaid with pure +Amber, and colours of the showery arch. +He, in celestial panoply all armed +Of radiant Urim, work divinely wrought, +Ascended; at his right hand Victory +Sat eagle-winged; beside him hung his bow +And quiver with three-bolted thunder stored; +And from about him fierce effusion rolled +Of smoke, and bickering flame, and sparkles dire: +Attended with ten thousand thousand Saints, +He onward came; far off his coming shone; +And twenty thousand (I their number heard) +Chariots of God, half on each hand, were seen; +He on the wings of Cherub rode sublime +On the crystalline sky, in sapphire throned, +Illustrious far and wide; but by his own +First seen: Them unexpected joy surprised, +When the great ensign of Messiah blazed +Aloft by Angels borne, his sign in Heaven; +Under whose conduct Michael soon reduced +His army, circumfused on either wing, +Under their Head imbodied all in one. +Before him Power Divine his way prepared; +At his command the uprooted hills retired +Each to his place; they heard his voice, and went +Obsequious; Heaven his wonted face renewed, +And with fresh flowerets hill and valley smiled. +This saw his hapless foes, but stood obdured, +And to rebellious fight rallied their Powers, +Insensate, hope conceiving from despair. +In heavenly Spirits could such perverseness dwell? +But to convince the proud what signs avail, +Or wonders move the obdurate to relent? +They, hardened more by what might most reclaim, +Grieving to see his glory, at the sight +Took envy; and, aspiring to his highth, +Stood re-embattled fierce, by force or fraud +Weening to prosper, and at length prevail +Against God and Messiah, or to fall +In universal ruin last; and now +To final battle drew, disdaining flight, +Or faint retreat; when the great Son of God +To all his host on either hand thus spake. +Stand still in bright array, ye Saints; here stand, +Ye Angels armed; this day from battle rest: +Faithful hath been your warfare, and of God +Accepted, fearless in his righteous cause; +And as ye have received, so have ye done, +Invincibly: But of this cursed crew +The punishment to other hand belongs; +Vengeance is his, or whose he sole appoints: +Number to this day's work is not ordained, +Nor multitude; stand only, and behold +God's indignation on these godless poured +By me; not you, but me, they have despised, +Yet envied; against me is all their rage, +Because the Father, to whom in Heaven s'preme +Kingdom, and power, and glory appertains, +Hath honoured me, according to his will. +Therefore to me their doom he hath assigned; +That they may have their wish, to try with me +In battle which the stronger proves; they all, +Or I alone against them; since by strength +They measure all, of other excellence +Not emulous, nor care who them excels; +Nor other strife with them do I vouchsafe. +So spake the Son, and into terrour changed +His countenance too severe to be beheld, +And full of wrath bent on his enemies. +At once the Four spread out their starry wings +With dreadful shade contiguous, and the orbs +Of his fierce chariot rolled, as with the sound +Of torrent floods, or of a numerous host. +He on his impious foes right onward drove, +Gloomy as night; under his burning wheels +The stedfast empyrean shook throughout, +All but the throne itself of God. Full soon +Among them he arrived; in his right hand +Grasping ten thousand thunders, which he sent +Before him, such as in their souls infixed +Plagues: They, astonished, all resistance lost, +All courage; down their idle weapons dropt: +O'er shields, and helms, and helmed heads he rode +Of Thrones and mighty Seraphim prostrate, +That wished the mountains now might be again +Thrown on them, as a shelter from his ire. +Nor less on either side tempestuous fell +His arrows, from the fourfold-visaged Four +Distinct with eyes, and from the living wheels +Distinct alike with multitude of eyes; +One Spirit in them ruled; and every eye +Glared lightning, and shot forth pernicious fire +Among the accursed, that withered all their strength, +And of their wonted vigour left them drained, +Exhausted, spiritless, afflicted, fallen. +Yet half his strength he put not forth, but checked +His thunder in mid volley; for he meant +Not to destroy, but root them out of Heaven: +The overthrown he raised, and as a herd +Of goats or timorous flock together thronged +Drove them before him thunder-struck, pursued +With terrours, and with furies, to the bounds +And crystal wall of Heaven; which, opening wide, +Rolled inward, and a spacious gap disclosed +Into the wasteful deep: The monstrous sight +Struck them with horrour backward, but far worse +Urged them behind: Headlong themselves they threw +Down from the verge of Heaven; eternal wrath +Burnt after them to the bottomless pit. +Hell heard the unsufferable noise, Hell saw +Heaven ruining from Heaven, and would have fled +Affrighted; but strict Fate had cast too deep +Her dark foundations, and too fast had bound. +Nine days they fell: Confounded Chaos roared, +And felt tenfold confusion in their fall +Through his wild anarchy, so huge a rout +Incumbered him with ruin: Hell at last +Yawning received them whole, and on them closed; +Hell, their fit habitation, fraught with fire +Unquenchable, the house of woe and pain. +Disburdened Heaven rejoiced, and soon repaired +Her mural breach, returning whence it rolled. +Sole victor, from the expulsion of his foes, +Messiah his triumphal chariot turned: +To meet him all his Saints, who silent stood +Eye-witnesses of his almighty acts, +With jubilee advanced; and, as they went, +Shaded with branching palm, each Order bright, +Sung triumph, and him sung victorious King, +Son, Heir, and Lord, to him dominion given, +Worthiest to reign: He, celebrated, rode +Triumphant through mid Heaven, into the courts +And temple of his Mighty Father throned +On high; who into glory him received, +Where now he sits at the right hand of bliss. +Thus, measuring things in Heaven by things on Earth, +At thy request, and that thou mayest beware +By what is past, to thee I have revealed +What might have else to human race been hid; +The discord which befel, and war in Heaven +Among the angelick Powers, and the deep fall +Of those too high aspiring, who rebelled +With Satan; he who envies now thy state, +Who now is plotting how he may seduce +Thee also from obedience, that, with him +Bereaved of happiness, thou mayest partake +His punishment, eternal misery; +Which would be all his solace and revenge, +As a despite done against the Most High, +Thee once to gain companion of his woe. +But listen not to his temptations, warn +Thy weaker; let it profit thee to have heard, +By terrible example, the reward +Of disobedience; firm they might have stood, +Yet fell; remember, and fear to transgress. + + + +Book VII + + +Descend from Heaven, Urania, by that name +If rightly thou art called, whose voice divine +Following, above the Olympian hill I soar, +Above the flight of Pegasean wing! +The meaning, not the name, I call: for thou +Nor of the Muses nine, nor on the top +Of old Olympus dwellest; but, heavenly-born, +Before the hills appeared, or fountain flowed, +Thou with eternal Wisdom didst converse, +Wisdom thy sister, and with her didst play +In presence of the Almighty Father, pleased +With thy celestial song. Up led by thee +Into the Heaven of Heavens I have presumed, +An earthly guest, and drawn empyreal air, +Thy tempering: with like safety guided down +Return me to my native element: +Lest from this flying steed unreined, (as once +Bellerophon, though from a lower clime,) +Dismounted, on the Aleian field I fall, +Erroneous there to wander, and forlorn. +Half yet remains unsung, but narrower bound +Within the visible diurnal sphere; +Standing on earth, not rapt above the pole, +More safe I sing with mortal voice, unchanged +To hoarse or mute, though fallen on evil days, +On evil days though fallen, and evil tongues; +In darkness, and with dangers compassed round, +And solitude; yet not alone, while thou +Visitest my slumbers nightly, or when morn +Purples the east: still govern thou my song, +Urania, and fit audience find, though few. +But drive far off the barbarous dissonance +Of Bacchus and his revellers, the race +Of that wild rout that tore the Thracian bard +In Rhodope, where woods and rocks had ears +To rapture, till the savage clamour drowned +Both harp and voice; nor could the Muse defend +Her son. So fail not thou, who thee implores: +For thou art heavenly, she an empty dream. +Say, Goddess, what ensued when Raphael, +The affable Arch-Angel, had forewarned +Adam, by dire example, to beware +Apostasy, by what befel in Heaven +To those apostates; lest the like befall +In Paradise to Adam or his race, +Charged not to touch the interdicted tree, +If they transgress, and slight that sole command, +So easily obeyed amid the choice +Of all tastes else to please their appetite, +Though wandering. He, with his consorted Eve, +The story heard attentive, and was filled +With admiration and deep muse, to hear +Of things so high and strange; things, to their thought +So unimaginable, as hate in Heaven, +And war so near the peace of God in bliss, +With such confusion: but the evil, soon +Driven back, redounded as a flood on those +From whom it sprung; impossible to mix +With blessedness. Whence Adam soon repealed +The doubts that in his heart arose: and now +Led on, yet sinless, with desire to know +What nearer might concern him, how this world +Of Heaven and Earth conspicuous first began; +When, and whereof created; for what cause; +What within Eden, or without, was done +Before his memory; as one whose drouth +Yet scarce allayed still eyes the current stream, +Whose liquid murmur heard new thirst excites, +Proceeded thus to ask his heavenly guest. +Great things, and full of wonder in our ears, +Far differing from this world, thou hast revealed, +Divine interpreter! by favour sent +Down from the empyrean, to forewarn +Us timely of what might else have been our loss, +Unknown, which human knowledge could not reach; +For which to the infinitely Good we owe +Immortal thanks, and his admonishment +Receive, with solemn purpose to observe +Immutably his sovran will, the end +Of what we are. But since thou hast vouchsafed +Gently, for our instruction, to impart +Things above earthly thought, which yet concerned +Our knowing, as to highest wisdom seemed, +Deign to descend now lower, and relate +What may no less perhaps avail us known, +How first began this Heaven which we behold +Distant so high, with moving fires adorned +Innumerable; and this which yields or fills +All space, the ambient air wide interfused +Embracing round this floried Earth; what cause +Moved the Creator, in his holy rest +Through all eternity, so late to build +In Chaos; and the work begun, how soon +Absolved; if unforbid thou mayest unfold +What we, not to explore the secrets ask +Of his eternal empire, but the more +To magnify his works, the more we know. +And the great light of day yet wants to run +Much of his race though steep; suspense in Heaven, +Held by thy voice, thy potent voice, he hears, +And longer will delay to hear thee tell +His generation, and the rising birth +Of Nature from the unapparent Deep: +Or if the star of evening and the moon +Haste to thy audience, Night with her will bring, +Silence; and Sleep, listening to thee, will watch; +Or we can bid his absence, till thy song +End, and dismiss thee ere the morning shine. +Thus Adam his illustrious guest besought: +And thus the Godlike Angel answered mild. +This also thy request, with caution asked, +Obtain; though to recount almighty works +What words or tongue of Seraph can suffice, +Or heart of man suffice to comprehend? +Yet what thou canst attain, which best may serve +To glorify the Maker, and infer +Thee also happier, shall not be withheld +Thy hearing; such commission from above +I have received, to answer thy desire +Of knowledge within bounds; beyond, abstain +To ask; nor let thine own inventions hope +Things not revealed, which the invisible King, +Only Omniscient, hath suppressed in night; +To none communicable in Earth or Heaven: +Enough is left besides to search and know. +But knowledge is as food, and needs no less +Her temperance over appetite, to know +In measure what the mind may well contain; +Oppresses else with surfeit, and soon turns +Wisdom to folly, as nourishment to wind. +Know then, that, after Lucifer from Heaven +(So call him, brighter once amidst the host +Of Angels, than that star the stars among,) +Fell with his flaming legions through the deep +Into his place, and the great Son returned +Victorious with his Saints, the Omnipotent +Eternal Father from his throne beheld +Their multitude, and to his Son thus spake. +At least our envious Foe hath failed, who thought +All like himself rebellious, by whose aid +This inaccessible high strength, the seat +Of Deity supreme, us dispossessed, +He trusted to have seised, and into fraud +Drew many, whom their place knows here no more: +Yet far the greater part have kept, I see, +Their station; Heaven, yet populous, retains +Number sufficient to possess her realms +Though wide, and this high temple to frequent +With ministeries due, and solemn rites: +But, lest his heart exalt him in the harm +Already done, to have dispeopled Heaven, +My damage fondly deemed, I can repair +That detriment, if such it be to lose +Self-lost; and in a moment will create +Another world, out of one man a race +Of men innumerable, there to dwell, +Not here; till, by degrees of merit raised, +They open to themselves at length the way +Up hither, under long obedience tried; +And Earth be changed to Heaven, and Heaven to Earth, +One kingdom, joy and union without end. +Mean while inhabit lax, ye Powers of Heaven; +And thou my Word, begotten Son, by thee +This I perform; speak thou, and be it done! +My overshadowing Spirit and Might with thee +I send along; ride forth, and bid the Deep +Within appointed bounds be Heaven and Earth; +Boundless the Deep, because I Am who fill +Infinitude, nor vacuous the space. +Though I, uncircumscribed myself, retire, +And put not forth my goodness, which is free +To act or not, Necessity and Chance +Approach not me, and what I will is Fate. +So spake the Almighty, and to what he spake +His Word, the Filial Godhead, gave effect. +Immediate are the acts of God, more swift +Than time or motion, but to human ears +Cannot without process of speech be told, +So told as earthly notion can receive. +Great triumph and rejoicing was in Heaven, +When such was heard declared the Almighty's will; +Glory they sung to the Most High, good will +To future men, and in their dwellings peace; +Glory to Him, whose just avenging ire +Had driven out the ungodly from his sight +And the habitations of the just; to Him +Glory and praise, whose wisdom had ordained +Good out of evil to create; instead +Of Spirits malign, a better race to bring +Into their vacant room, and thence diffuse +His good to worlds and ages infinite. +So sang the Hierarchies: Mean while the Son +On his great expedition now appeared, +Girt with Omnipotence, with radiance crowned +Of Majesty Divine; sapience and love +Immense, and all his Father in him shone. +About his chariot numberless were poured +Cherub, and Seraph, Potentates, and Thrones, +And Virtues, winged Spirits, and chariots winged +From the armoury of God; where stand of old +Myriads, between two brazen mountains lodged +Against a solemn day, harnessed at hand, +Celestial equipage; and now came forth +Spontaneous, for within them Spirit lived, +Attendant on their Lord: Heaven opened wide +Her ever-during gates, harmonious sound +On golden hinges moving, to let forth +The King of Glory, in his powerful Word +And Spirit, coming to create new worlds. +On heavenly ground they stood; and from the shore +They viewed the vast immeasurable abyss +Outrageous as a sea, dark, wasteful, wild, +Up from the bottom turned by furious winds +And surging waves, as mountains, to assault +Heaven's highth, and with the center mix the pole. +Silence, ye troubled Waves, and thou Deep, peace, +Said then the Omnifick Word; your discord end! +Nor staid; but, on the wings of Cherubim +Uplifted, in paternal glory rode +Far into Chaos, and the world unborn; +For Chaos heard his voice: Him all his train +Followed in bright procession, to behold +Creation, and the wonders of his might. +Then staid the fervid wheels, and in his hand +He took the golden compasses, prepared +In God's eternal store, to circumscribe +This universe, and all created things: +One foot he centered, and the other turned +Round through the vast profundity obscure; +And said, Thus far extend, thus far thy bounds, +This be thy just circumference, O World! +Thus God the Heaven created, thus the Earth, +Matter unformed and void: Darkness profound +Covered the abyss: but on the watery calm +His brooding wings the Spirit of God outspread, +And vital virtue infused, and vital warmth +Throughout the fluid mass; but downward purged +The black tartareous cold infernal dregs, +Adverse to life: then founded, then conglobed +Like things to like; the rest to several place +Disparted, and between spun out the air; +And Earth self-balanced on her center hung. +Let there be light, said God; and forthwith Light +Ethereal, first of things, quintessence pure, +Sprung from the deep; and from her native east +To journey through the aery gloom began, +Sphered in a radiant cloud, for yet the sun +Was not; she in a cloudy tabernacle +Sojourned the while. God saw the light was good; +And light from darkness by the hemisphere +Divided: light the Day, and darkness Night, +He named. Thus was the first day even and morn: +Nor past uncelebrated, nor unsung +By the celestial quires, when orient light +Exhaling first from darkness they beheld; +Birth-day of Heaven and Earth; with joy and shout +The hollow universal orb they filled, +And touched their golden harps, and hymning praised +God and his works; Creator him they sung, +Both when first evening was, and when first morn. +Again, God said, Let there be firmament +Amid the waters, and let it divide +The waters from the waters; and God made +The firmament, expanse of liquid, pure, +Transparent, elemental air, diffused +In circuit to the uttermost convex +Of this great round; partition firm and sure, +The waters underneath from those above +Dividing: for as earth, so he the world +Built on circumfluous waters calm, in wide +Crystalline ocean, and the loud misrule +Of Chaos far removed; lest fierce extremes +Contiguous might distemper the whole frame: +And Heaven he named the Firmament: So even +And morning chorus sung the second day. +The Earth was formed, but in the womb as yet +Of waters, embryon immature involved, +Appeared not: over all the face of Earth +Main ocean flowed, not idle; but, with warm +Prolifick humour softening all her globe, +Fermented the great mother to conceive, +Satiate with genial moisture; when God said, +Be gathered now ye waters under Heaven +Into one place, and let dry land appear. +Immediately the mountains huge appear +Emergent, and their broad bare backs upheave +Into the clouds; their tops ascend the sky: +So high as heaved the tumid hills, so low +Down sunk a hollow bottom broad and deep, +Capacious bed of waters: Thither they +Hasted with glad precipitance, uprolled, +As drops on dust conglobing from the dry: +Part rise in crystal wall, or ridge direct, +For haste; such flight the great command impressed +On the swift floods: As armies at the call +Of trumpet (for of armies thou hast heard) +Troop to their standard; so the watery throng, +Wave rolling after wave, where way they found, +If steep, with torrent rapture, if through plain, +Soft-ebbing; nor withstood them rock or hill; +But they, or under ground, or circuit wide +With serpent errour wandering, found their way, +And on the washy oose deep channels wore; +Easy, ere God had bid the ground be dry, +All but within those banks, where rivers now +Stream, and perpetual draw their humid train. +The dry land, Earth; and the great receptacle +Of congregated waters, he called Seas: +And saw that it was good; and said, Let the Earth +Put forth the verdant grass, herb yielding seed, +And fruit-tree yielding fruit after her kind, +Whose seed is in herself upon the Earth. +He scarce had said, when the bare Earth, till then +Desart and bare, unsightly, unadorned, +Brought forth the tender grass, whose verdure clad +Her universal face with pleasant green; +Then herbs of every leaf, that sudden flowered +Opening their various colours, and made gay +Her bosom, smelling sweet: and, these scarce blown, +Forth flourished thick the clustering vine, forth crept +The swelling gourd, up stood the corny reed +Embattled in her field, and the humble shrub, +And bush with frizzled hair implicit: Last +Rose, as in dance, the stately trees, and spread +Their branches hung with copious fruit, or gemmed +Their blossoms: With high woods the hills were crowned; +With tufts the valleys, and each fountain side; +With borders long the rivers: that Earth now +Seemed like to Heaven, a seat where Gods might dwell, +Or wander with delight, and love to haunt +Her sacred shades: though God had yet not rained +Upon the Earth, and man to till the ground +None was; but from the Earth a dewy mist +Went up, and watered all the ground, and each +Plant of the field; which, ere it was in the Earth, +God made, and every herb, before it grew +On the green stem: God saw that it was good: +So even and morn recorded the third day. +Again the Almighty spake, Let there be lights +High in the expanse of Heaven, to divide +The day from night; and let them be for signs, +For seasons, and for days, and circling years; +And let them be for lights, as I ordain +Their office in the firmament of Heaven, +To give light on the Earth; and it was so. +And God made two great lights, great for their use +To Man, the greater to have rule by day, +The less by night, altern; and made the stars, +And set them in the firmament of Heaven +To illuminate the Earth, and rule the day +In their vicissitude, and rule the night, +And light from darkness to divide. God saw, +Surveying his great work, that it was good: +For of celestial bodies first the sun +A mighty sphere he framed, unlightsome first, +Though of ethereal mould: then formed the moon +Globose, and every magnitude of stars, +And sowed with stars the Heaven, thick as a field: +Of light by far the greater part he took, +Transplanted from her cloudy shrine, and placed +In the sun's orb, made porous to receive +And drink the liquid light; firm to retain +Her gathered beams, great palace now of light. +Hither, as to their fountain, other stars +Repairing, in their golden urns draw light, +And hence the morning-planet gilds her horns; +By tincture or reflection they augment +Their small peculiar, though from human sight +So far remote, with diminution seen, +First in his east the glorious lamp was seen, +Regent of day, and all the horizon round +Invested with bright rays, jocund to run +His longitude through Heaven's high road; the gray +Dawn, and the Pleiades, before him danced, +Shedding sweet influence: Less bright the moon, +But opposite in levelled west was set, +His mirrour, with full face borrowing her light +From him; for other light she needed none +In that aspect, and still that distance keeps +Till night; then in the east her turn she shines, +Revolved on Heaven's great axle, and her reign +With thousand lesser lights dividual holds, +With thousand thousand stars, that then appeared +Spangling the hemisphere: Then first adorned +With their bright luminaries that set and rose, +Glad evening and glad morn crowned the fourth day. +And God said, Let the waters generate +Reptile with spawn abundant, living soul: +And let fowl fly above the Earth, with wings +Displayed on the open firmament of Heaven. +And God created the great whales, and each +Soul living, each that crept, which plenteously +The waters generated by their kinds; +And every bird of wing after his kind; +And saw that it was good, and blessed them, saying. +Be fruitful, multiply, and in the seas, +And lakes, and running streams, the waters fill; +And let the fowl be multiplied, on the Earth. +Forthwith the sounds and seas, each creek and bay, +With fry innumerable swarm, and shoals +Of fish that with their fins, and shining scales, +Glide under the green wave, in sculls that oft +Bank the mid sea: part single, or with mate, +Graze the sea-weed their pasture, and through groves +Of coral stray; or, sporting with quick glance, +Show to the sun their waved coats dropt with gold; +Or, in their pearly shells at ease, attend +Moist nutriment; or under rocks their food +In jointed armour watch: on smooth the seal +And bended dolphins play: part huge of bulk +Wallowing unwieldy, enormous in their gait, +Tempest the ocean: there leviathan, +Hugest of living creatures, on the deep +Stretched like a promontory sleeps or swims, +And seems a moving land; and at his gills +Draws in, and at his trunk spouts out, a sea. +Mean while the tepid caves, and fens, and shores, +Their brood as numerous hatch, from the egg that soon +Bursting with kindly rupture forth disclosed +Their callow young; but feathered soon and fledge +They summed their pens; and, soaring the air sublime, +With clang despised the ground, under a cloud +In prospect; there the eagle and the stork +On cliffs and cedar tops their eyries build: +Part loosely wing the region, part more wise +In common, ranged in figure, wedge their way, +Intelligent of seasons, and set forth +Their aery caravan, high over seas +Flying, and over lands, with mutual wing +Easing their flight; so steers the prudent crane +Her annual voyage, borne on winds; the air +Floats as they pass, fanned with unnumbered plumes: +From branch to branch the smaller birds with song +Solaced the woods, and spread their painted wings +Till even; nor then the solemn nightingale +Ceased warbling, but all night tun'd her soft lays: +Others, on silver lakes and rivers, bathed +Their downy breast; the swan with arched neck, +Between her white wings mantling proudly, rows +Her state with oary feet; yet oft they quit +The dank, and, rising on stiff pennons, tower +The mid aereal sky: Others on ground +Walked firm; the crested cock whose clarion sounds +The silent hours, and the other whose gay train +Adorns him, coloured with the florid hue +Of rainbows and starry eyes. The waters thus +With fish replenished, and the air with fowl, +Evening and morn solemnized the fifth day. +The sixth, and of creation last, arose +With evening harps and matin; when God said, +Let the Earth bring forth soul living in her kind, +Cattle, and creeping things, and beast of the Earth, +Each in their kind. The Earth obeyed, and straight +Opening her fertile womb teemed at a birth +Innumerous living creatures, perfect forms, +Limbed and full grown: Out of the ground up rose, +As from his lair, the wild beast where he wons +In forest wild, in thicket, brake, or den; +Among the trees in pairs they rose, they walked: +The cattle in the fields and meadows green: +Those rare and solitary, these in flocks +Pasturing at once, and in broad herds upsprung. +The grassy clods now calved; now half appeared +The tawny lion, pawing to get free +His hinder parts, then springs as broke from bonds, +And rampant shakes his brinded mane; the ounce, +The libbard, and the tiger, as the mole +Rising, the crumbled earth above them threw +In hillocks: The swift stag from under ground +Bore up his branching head: Scarce from his mould +Behemoth biggest born of earth upheaved +His vastness: Fleeced the flocks and bleating rose, +As plants: Ambiguous between sea and land +The river-horse, and scaly crocodile. +At once came forth whatever creeps the ground, +Insect or worm: those waved their limber fans +For wings, and smallest lineaments exact +In all the liveries decked of summer's pride +With spots of gold and purple, azure and green: +These, as a line, their long dimension drew, +Streaking the ground with sinuous trace; not all +Minims of nature; some of serpent-kind, +Wonderous in length and corpulence, involved +Their snaky folds, and added wings. First crept +The parsimonious emmet, provident +Of future; in small room large heart enclosed; +Pattern of just equality perhaps +Hereafter, joined in her popular tribes +Of commonalty: Swarming next appeared +The female bee, that feeds her husband drone +Deliciously, and builds her waxen cells +With honey stored: The rest are numberless, +And thou their natures knowest, and gavest them names, +Needless to thee repeated; nor unknown +The serpent, subtlest beast of all the field, +Of huge extent sometimes, with brazen eyes +And hairy mane terrifick, though to thee +Not noxious, but obedient at thy call. +Now Heaven in all her glory shone, and rolled +Her motions, as the great first Mover's hand +First wheeled their course: Earth in her rich attire +Consummate lovely smiled; air, water, earth, +By fowl, fish, beast, was flown, was swum, was walked, +Frequent; and of the sixth day yet remained: +There wanted yet the master-work, the end +Of all yet done; a creature, who, not prone +And brute as other creatures, but endued +With sanctity of reason, might erect +His stature, and upright with front serene +Govern the rest, self-knowing; and from thence +Magnanimous to correspond with Heaven, +But grateful to acknowledge whence his good +Descends, thither with heart, and voice, and eyes +Directed in devotion, to adore +And worship God Supreme, who made him chief +Of all his works: therefore the Omnipotent +Eternal Father (for where is not he +Present?) thus to his Son audibly spake. +Let us make now Man in our image, Man +In our similitude, and let them rule +Over the fish and fowl of sea and air, +Beast of the field, and over all the Earth, +And every creeping thing that creeps the ground. +This said, he formed thee, Adam, thee, O Man, +Dust of the ground, and in thy nostrils breathed +The breath of life; in his own image he +Created thee, in the image of God +Express; and thou becamest a living soul. +Male he created thee; but thy consort +Female, for race; then blessed mankind, and said, +Be fruitful, multiply, and fill the Earth; +Subdue it, and throughout dominion hold +Over fish of the sea, and fowl of the air, +And every living thing that moves on the Earth. +Wherever thus created, for no place +Is yet distinct by name, thence, as thou knowest, +He brought thee into this delicious grove, +This garden, planted with the trees of God, +Delectable both to behold and taste; +And freely all their pleasant fruit for food +Gave thee; all sorts are here that all the Earth yields, +Variety without end; but of the tree, +Which, tasted, works knowledge of good and evil, +Thou mayest not; in the day thou eatest, thou diest; +Death is the penalty imposed; beware, +And govern well thy appetite; lest Sin +Surprise thee, and her black attendant Death. +Here finished he, and all that he had made +Viewed, and behold all was entirely good; +So even and morn accomplished the sixth day: +Yet not till the Creator from his work +Desisting, though unwearied, up returned, +Up to the Heaven of Heavens, his high abode; +Thence to behold this new created world, +The addition of his empire, how it showed +In prospect from his throne, how good, how fair, +Answering his great idea. Up he rode +Followed with acclamation, and the sound +Symphonious of ten thousand harps, that tuned +Angelick harmonies: The earth, the air +Resounded, (thou rememberest, for thou heardst,) +The heavens and all the constellations rung, +The planets in their station listening stood, +While the bright pomp ascended jubilant. +Open, ye everlasting gates! they sung, +Open, ye Heavens! your living doors;let in +The great Creator from his work returned +Magnificent, his six days work, a World; +Open, and henceforth oft; for God will deign +To visit oft the dwellings of just men, +Delighted; and with frequent intercourse +Thither will send his winged messengers +On errands of supernal grace. So sung +The glorious train ascending: He through Heaven, +That opened wide her blazing portals, led +To God's eternal house direct the way; +A broad and ample road, whose dust is gold +And pavement stars, as stars to thee appear, +Seen in the galaxy, that milky way, +Which nightly, as a circling zone, thou seest +Powdered with stars. And now on Earth the seventh +Evening arose in Eden, for the sun +Was set, and twilight from the east came on, +Forerunning night; when at the holy mount +Of Heaven's high-seated top, the imperial throne +Of Godhead, fixed for ever firm and sure, +The Filial Power arrived, and sat him down +With his great Father; for he also went +Invisible, yet staid, (such privilege +Hath Omnipresence) and the work ordained, +Author and End of all things; and, from work +Now resting, blessed and hallowed the seventh day, +As resting on that day from all his work, +But not in silence holy kept: the harp +Had work and rested not; the solemn pipe, +And dulcimer, all organs of sweet stop, +All sounds on fret by string or golden wire, +Tempered soft tunings, intermixed with voice +Choral or unison: of incense clouds, +Fuming from golden censers, hid the mount. +Creation and the six days acts they sung: +Great are thy works, Jehovah! infinite +Thy power! what thought can measure thee, or tongue +Relate thee! Greater now in thy return +Than from the giant Angels: Thee that day +Thy thunders magnified; but to create +Is greater than created to destroy. +Who can impair thee, Mighty King, or bound +Thy empire! Easily the proud attempt +Of Spirits apostate, and their counsels vain, +Thou hast repelled; while impiously they thought +Thee to diminish, and from thee withdraw +The number of thy worshippers. Who seeks +To lessen thee, against his purpose serves +To manifest the more thy might: his evil +Thou usest, and from thence createst more good. +Witness this new-made world, another Heaven +From Heaven-gate not far, founded in view +On the clear hyaline, the glassy sea; +Of amplitude almost immense, with stars +Numerous, and every star perhaps a world +Of destined habitation; but thou knowest +Their seasons: among these the seat of Men, +Earth, with her nether ocean circumfused, +Their pleasant dwelling-place. Thrice happy Men, +And sons of Men, whom God hath thus advanced! +Created in his image, there to dwell +And worship him; and in reward to rule +Over his works, on earth, in sea, or air, +And multiply a race of worshippers +Holy and just: Thrice happy, if they know +Their happiness, and persevere upright! +So sung they, and the empyrean rung +With halleluiahs: Thus was sabbath kept. +And thy request think now fulfilled, that asked +How first this world and face of things began, +And what before thy memory was done +From the beginning; that posterity, +Informed by thee, might know: If else thou seekest +Aught, not surpassing human measure, say. + + + +Book VIII + + +The Angel ended, and in Adam's ear +So charming left his voice, that he a while +Thought him still speaking, still stood fixed to hear; +Then, as new waked, thus gratefully replied. +What thanks sufficient, or what recompence +Equal, have I to render thee, divine +Historian, who thus largely hast allayed +The thirst I had of knowledge, and vouchsafed +This friendly condescension to relate +Things, else by me unsearchable; now heard +With wonder, but delight, and, as is due, +With glory attributed to the high +Creator! Something yet of doubt remains, +Which only thy solution can resolve. +When I behold this goodly frame, this world, +Of Heaven and Earth consisting; and compute +Their magnitudes; this Earth, a spot, a grain, +An atom, with the firmament compared +And all her numbered stars, that seem to roll +Spaces incomprehensible, (for such +Their distance argues, and their swift return +Diurnal,) merely to officiate light +Round this opacous Earth, this punctual spot, +One day and night; in all her vast survey +Useless besides; reasoning I oft admire, +How Nature wise and frugal could commit +Such disproportions, with superfluous hand +So many nobler bodies to create, +Greater so manifold, to this one use, +For aught appears, and on their orbs impose +Such restless revolution day by day +Repeated; while the sedentary Earth, +That better might with far less compass move, +Served by more noble than herself, attains +Her end without least motion, and receives, +As tribute, such a sumless journey brought +Of incorporeal speed, her warmth and light; +Speed, to describe whose swiftness number fails. +So spake our sire, and by his countenance seemed +Entering on studious thoughts abstruse; which Eve +Perceiving, where she sat retired in sight, +With lowliness majestick from her seat, +And grace that won who saw to wish her stay, +Rose, and went forth among her fruits and flowers, +To visit how they prospered, bud and bloom, +Her nursery; they at her coming sprung, +And, touched by her fair tendance, gladlier grew. +Yet went she not, as not with such discourse +Delighted, or not capable her ear +Of what was high: such pleasure she reserved, +Adam relating, she sole auditress; +Her husband the relater she preferred +Before the Angel, and of him to ask +Chose rather; he, she knew, would intermix +Grateful digressions, and solve high dispute +With conjugal caresses: from his lip +Not words alone pleased her. O! when meet now +Such pairs, in love and mutual honour joined? +With Goddess-like demeanour forth she went, +Not unattended; for on her, as Queen, +A pomp of winning Graces waited still, +And from about her shot darts of desire +Into all eyes, to wish her still in sight. +And Raphael now, to Adam's doubt proposed, +Benevolent and facile thus replied. +To ask or search, I blame thee not; for Heaven +Is as the book of God before thee set, +Wherein to read his wonderous works, and learn +His seasons, hours, or days, or months, or years: +This to attain, whether Heaven move or Earth, +Imports not, if thou reckon right; the rest +From Man or Angel the great Architect +Did wisely to conceal, and not divulge +His secrets to be scanned by them who ought +Rather admire; or, if they list to try +Conjecture, he his fabrick of the Heavens +Hath left to their disputes, perhaps to move +His laughter at their quaint opinions wide +Hereafter; when they come to model Heaven +And calculate the stars, how they will wield +The mighty frame; how build, unbuild, contrive +To save appearances; how gird the sphere +With centrick and eccentrick scribbled o'er, +Cycle and epicycle, orb in orb: +Already by thy reasoning this I guess, +Who art to lead thy offspring, and supposest +That bodies bright and greater should not serve +The less not bright, nor Heaven such journeys run, +Earth sitting still, when she alone receives +The benefit: Consider first, that great +Or bright infers not excellence: the Earth +Though, in comparison of Heaven, so small, +Nor glistering, may of solid good contain +More plenty than the sun that barren shines; +Whose virtue on itself works no effect, +But in the fruitful Earth; there first received, +His beams, unactive else, their vigour find. +Yet not to Earth are those bright luminaries +Officious; but to thee, Earth's habitant. +And for the Heaven's wide circuit, let it speak +The Maker's high magnificence, who built +So spacious, and his line stretched out so far; +That Man may know he dwells not in his own; +An edifice too large for him to fill, +Lodged in a small partition; and the rest +Ordained for uses to his Lord best known. +The swiftness of those circles attribute, +Though numberless, to his Omnipotence, +That to corporeal substances could add +Speed almost spiritual: Me thou thinkest not slow, +Who since the morning-hour set out from Heaven +Where God resides, and ere mid-day arrived +In Eden; distance inexpressible +By numbers that have name. But this I urge, +Admitting motion in the Heavens, to show +Invalid that which thee to doubt it moved; +Not that I so affirm, though so it seem +To thee who hast thy dwelling here on Earth. +God, to remove his ways from human sense, +Placed Heaven from Earth so far, that earthly sight, +If it presume, might err in things too high, +And no advantage gain. What if the sun +Be center to the world; and other stars, +By his attractive virtue and their own +Incited, dance about him various rounds? +Their wandering course now high, now low, then hid, +Progressive, retrograde, or standing still, +In six thou seest; and what if seventh to these +The planet earth, so stedfast though she seem, +Insensibly three different motions move? +Which else to several spheres thou must ascribe, +Moved contrary with thwart obliquities; +Or save the sun his labour, and that swift +Nocturnal and diurnal rhomb supposed, +Invisible else above all stars, the wheel +Of day and night; which needs not thy belief, +If earth, industrious of herself, fetch day +Travelling east, and with her part averse +From the sun's beam meet night, her other part +Still luminous by his ray. What if that light, +Sent from her through the wide transpicuous air, +To the terrestrial moon be as a star, +Enlightening her by day, as she by night +This earth? reciprocal, if land be there, +Fields and inhabitants: Her spots thou seest +As clouds, and clouds may rain, and rain produce +Fruits in her softened soil for some to eat +Allotted there; and other suns perhaps, +With their attendant moons, thou wilt descry, +Communicating male and female light; +Which two great sexes animate the world, +Stored in each orb perhaps with some that live. +For such vast room in Nature unpossessed +By living soul, desart and desolate, +Only to shine, yet scarce to contribute +Each orb a glimpse of light, conveyed so far +Down to this habitable, which returns +Light back to them, is obvious to dispute. +But whether thus these things, or whether not; +But whether the sun, predominant in Heaven, +Rise on the earth; or earth rise on the sun; +He from the east his flaming road begin; +Or she from west her silent course advance, +With inoffensive pace that spinning sleeps +On her soft axle, while she paces even, +And bears thee soft with the smooth hair along; +Sollicit not thy thoughts with matters hid; +Leave them to God above; him serve, and fear! +Of other creatures, as him pleases best, +Wherever placed, let him dispose; joy thou +In what he gives to thee, this Paradise +And thy fair Eve; Heaven is for thee too high +To know what passes there; be lowly wise: +Think only what concerns thee, and thy being; +Dream not of other worlds, what creatures there +Live, in what state, condition, or degree; +Contented that thus far hath been revealed +Not of Earth only, but of highest Heaven. +To whom thus Adam, cleared of doubt, replied. +How fully hast thou satisfied me, pure +Intelligence of Heaven, Angel serene! +And, freed from intricacies, taught to live +The easiest way; nor with perplexing thoughts +To interrupt the sweet of life, from which +God hath bid dwell far off all anxious cares, +And not molest us; unless we ourselves +Seek them with wandering thoughts, and notions vain. +But apt the mind or fancy is to rove +Unchecked, and of her roving is no end; +Till warned, or by experience taught, she learn, +That, not to know at large of things remote +From use, obscure and subtle; but, to know +That which before us lies in daily life, +Is the prime wisdom: What is more, is fume, +Or emptiness, or fond impertinence: +And renders us, in things that most concern, +Unpractised, unprepared, and still to seek. +Therefore from this high pitch let us descend +A lower flight, and speak of things at hand +Useful; whence, haply, mention may arise +Of something not unseasonable to ask, +By sufferance, and thy wonted favour, deigned. +Thee I have heard relating what was done +Ere my remembrance: now, hear me relate +My story, which perhaps thou hast not heard; +And day is not yet spent; till then thou seest +How subtly to detain thee I devise; +Inviting thee to hear while I relate; +Fond! were it not in hope of thy reply: +For, while I sit with thee, I seem in Heaven; +And sweeter thy discourse is to my ear +Than fruits of palm-tree pleasantest to thirst +And hunger both, from labour, at the hour +Of sweet repast; they satiate, and soon fill, +Though pleasant; but thy words, with grace divine +Imbued, bring to their sweetness no satiety. +To whom thus Raphael answered heavenly meek. +Nor are thy lips ungraceful, Sire of men, +Nor tongue ineloquent; for God on thee +Abundantly his gifts hath also poured +Inward and outward both, his image fair: +Speaking, or mute, all comeliness and grace +Attends thee; and each word, each motion, forms; +Nor less think we in Heaven of thee on Earth +Than of our fellow-servant, and inquire +Gladly into the ways of God with Man: +For God, we see, hath honoured thee, and set +On Man his equal love: Say therefore on; +For I that day was absent, as befel, +Bound on a voyage uncouth and obscure, +Far on excursion toward the gates of Hell; +Squared in full legion (such command we had) +To see that none thence issued forth a spy, +Or enemy, while God was in his work; +Lest he, incensed at such eruption bold, +Destruction with creation might have mixed. +Not that they durst without his leave attempt; +But us he sends upon his high behests +For state, as Sovran King; and to inure +Our prompt obedience. Fast we found, fast shut, +The dismal gates, and barricadoed strong; +But long ere our approaching heard within +Noise, other than the sound of dance or song, +Torment, and loud lament, and furious rage. +Glad we returned up to the coasts of light +Ere sabbath-evening: so we had in charge. +But thy relation now; for I attend, +Pleased with thy words no less than thou with mine. +So spake the Godlike Power, and thus our Sire. +For Man to tell how human life began +Is hard; for who himself beginning knew +Desire with thee still longer to converse +Induced me. As new waked from soundest sleep, +Soft on the flowery herb I found me laid, +In balmy sweat; which with his beams the sun +Soon dried, and on the reeking moisture fed. +Straight toward Heaven my wondering eyes I turned, +And gazed a while the ample sky; till, raised +By quick instinctive motion, up I sprung, +As thitherward endeavouring, and upright +Stood on my feet: about me round I saw +Hill, dale, and shady woods, and sunny plains, +And liquid lapse of murmuring streams; by these, +Creatures that lived and moved, and walked, or flew; +Birds on the branches warbling; all things smiled; +With fragrance and with joy my heart o'erflowed. +Myself I then perused, and limb by limb +Surveyed, and sometimes went, and sometimes ran +With supple joints, as lively vigour led: +But who I was, or where, or from what cause, +Knew not; to speak I tried, and forthwith spake; +My tongue obeyed, and readily could name +Whate'er I saw. Thou Sun, said I, fair light, +And thou enlightened Earth, so fresh and gay, +Ye Hills, and Dales, ye Rivers, Woods, and Plains, +And ye that live and move, fair Creatures, tell, +Tell, if ye saw, how I came thus, how here?-- +Not of myself;--by some great Maker then, +In goodness and in power pre-eminent: +Tell me, how may I know him, how adore, +From whom I have that thus I move and live, +And feel that I am happier than I know.-- +While thus I called, and strayed I knew not whither, +From where I first drew air, and first beheld +This happy light; when, answer none returned, +On a green shady bank, profuse of flowers, +Pensive I sat me down: There gentle sleep +First found me, and with soft oppression seised +My droused sense, untroubled, though I thought +I then was passing to my former state +Insensible, and forthwith to dissolve: +When suddenly stood at my head a dream, +Whose inward apparition gently moved +My fancy to believe I yet had being, +And lived: One came, methought, of shape divine, +And said, 'Thy mansion wants thee, Adam; rise, +'First Man, of men innumerable ordained +'First Father! called by thee, I come thy guide +'To the garden of bliss, thy seat prepared.' +So saying, by the hand he took me raised, +And over fields and waters, as in air +Smooth-sliding without step, last led me up +A woody mountain; whose high top was plain, +A circuit wide, enclosed, with goodliest trees +Planted, with walks, and bowers; that what I saw +Of Earth before scarce pleasant seemed. Each tree, +Loaden with fairest fruit that hung to the eye +Tempting, stirred in me sudden appetite +To pluck and eat; whereat I waked, and found +Before mine eyes all real, as the dream +Had lively shadowed: Here had new begun +My wandering, had not he, who was my guide +Up hither, from among the trees appeared, +Presence Divine. Rejoicing, but with awe, +In adoration at his feet I fell +Submiss: He reared me, and 'Whom thou soughtest I am,' +Said mildly, 'Author of all this thou seest +'Above, or round about thee, or beneath. +'This Paradise I give thee, count it thine +'To till and keep, and of the fruit to eat: +'Of every tree that in the garden grows +'Eat freely with glad heart; fear here no dearth: +'But of the tree whose operation brings +'Knowledge of good and ill, which I have set +'The pledge of thy obedience and thy faith, +'Amid the garden by the tree of life, +'Remember what I warn thee, shun to taste, +'And shun the bitter consequence: for know, +'The day thou eatest thereof, my sole command +'Transgressed, inevitably thou shalt die, +'From that day mortal; and this happy state +'Shalt lose, expelled from hence into a world +'Of woe and sorrow.' Sternly he pronounced +The rigid interdiction, which resounds +Yet dreadful in mine ear, though in my choice +Not to incur; but soon his clear aspect +Returned, and gracious purpose thus renewed. +'Not only these fair bounds, but all the Earth +'To thee and to thy race I give; as lords +'Possess it, and all things that therein live, +'Or live in sea, or air; beast, fish, and fowl. +'In sign whereof, each bird and beast behold +'After their kinds; I bring them to receive +'From thee their names, and pay thee fealty +'With low subjection; understand the same +'Of fish within their watery residence, +'Not hither summoned, since they cannot change +'Their element, to draw the thinner air.' +As thus he spake, each bird and beast behold +Approaching two and two; these cowering low +With blandishment; each bird stooped on his wing. +I named them, as they passed, and understood +Their nature, with such knowledge God endued +My sudden apprehension: But in these +I found not what methought I wanted still; +And to the heavenly Vision thus presumed. +O, by what name, for thou above all these, +Above mankind, or aught than mankind higher, +Surpassest far my naming; how may I +Adore thee, Author of this universe, +And all this good to man? for whose well being +So amply, and with hands so liberal, +Thou hast provided all things: But with me +I see not who partakes. In solitude +What happiness, who can enjoy alone, +Or, all enjoying, what contentment find? +Thus I presumptuous; and the Vision bright, +As with a smile more brightened, thus replied. +What callest thou solitude? Is not the Earth +With various living creatures, and the air +Replenished, and all these at thy command +To come and play before thee? Knowest thou not +Their language and their ways? They also know, +And reason not contemptibly: With these +Find pastime, and bear rule; thy realm is large. +So spake the Universal Lord, and seemed +So ordering: I, with leave of speech implored, +And humble deprecation, thus replied. +Let not my words offend thee, Heavenly Power; +My Maker, be propitious while I speak. +Hast thou not made me here thy substitute, +And these inferiour far beneath me set? +Among unequals what society +Can sort, what harmony, or true delight? +Which must be mutual, in proportion due +Given and received; but, in disparity +The one intense, the other still remiss, +Cannot well suit with either, but soon prove +Tedious alike: Of fellowship I speak +Such as I seek, fit to participate +All rational delight: wherein the brute +Cannot be human consort: They rejoice +Each with their kind, lion with lioness; +So fitly them in pairs thou hast combined: +Much less can bird with beast, or fish with fowl +So well converse, nor with the ox the ape; +Worse then can man with beast, and least of all. +Whereto the Almighty answered, not displeased. +A nice and subtle happiness, I see, +Thou to thyself proposest, in the choice +Of thy associates, Adam! and wilt taste +No pleasure, though in pleasure, solitary. +What thinkest thou then of me, and this my state? +Seem I to thee sufficiently possessed +Of happiness, or not? who am alone +From all eternity; for none I know +Second to me or like, equal much less. +How have I then with whom to hold converse, +Save with the creatures which I made, and those +To me inferiour, infinite descents +Beneath what other creatures are to thee? +He ceased; I lowly answered. To attain +The highth and depth of thy eternal ways +All human thoughts come short, Supreme of things! +Thou in thyself art perfect, and in thee +Is no deficience found: Not so is Man, +But in degree; the cause of his desire +By conversation with his like to help +Or solace his defects. No need that thou +Shouldst propagate, already Infinite; +And through all numbers absolute, though One: +But Man by number is to manifest +His single imperfection, and beget +Like of his like, his image multiplied, +In unity defective; which requires +Collateral love, and dearest amity. +Thou in thy secresy although alone, +Best with thyself accompanied, seekest not +Social communication; yet, so pleased, +Canst raise thy creature to what highth thou wilt +Of union or communion, deified: +I, by conversing, cannot these erect +From prone; nor in their ways complacence find. +Thus I emboldened spake, and freedom used +Permissive, and acceptance found; which gained +This answer from the gracious Voice Divine. +Thus far to try thee, Adam, I was pleased; +And find thee knowing, not of beasts alone, +Which thou hast rightly named, but of thyself; +Expressing well the spirit within thee free, +My image, not imparted to the brute; +Whose fellowship therefore unmeet for thee +Good reason was thou freely shouldst dislike; +And be so minded still: I, ere thou spakest, +Knew it not good for Man to be alone; +And no such company as then thou sawest +Intended thee; for trial only brought, +To see how thou couldest judge of fit and meet: +What next I bring shall please thee, be assured, +Thy likeness, thy fit help, thy other self, +Thy wish exactly to thy heart's desire. +He ended, or I heard no more; for now +My earthly by his heavenly overpowered, +Which it had long stood under, strained to the highth +In that celestial colloquy sublime, +As with an object that excels the sense +Dazzled and spent, sunk down; and sought repair +Of sleep, which instantly fell on me, called +By Nature as in aid, and closed mine eyes. +Mine eyes he closed, but open left the cell +Of fancy, my internal sight; by which, +Abstract as in a trance, methought I saw, +Though sleeping, where I lay, and saw the shape +Still glorious before whom awake I stood: +Who stooping opened my left side, and took +From thence a rib, with cordial spirits warm, +And life-blood streaming fresh; wide was the wound, +But suddenly with flesh filled up and healed: +The rib he formed and fashioned with his hands; +Under his forming hands a creature grew, +Man-like, but different sex; so lovely fair, +That what seemed fair in all the world, seemed now +Mean, or in her summed up, in her contained +And in her looks; which from that time infused +Sweetness into my heart, unfelt before, +And into all things from her air inspired +The spirit of love and amorous delight. +She disappeared, and left me dark; I waked +To find her, or for ever to deplore +Her loss, and other pleasures all abjure: +When out of hope, behold her, not far off, +Such as I saw her in my dream, adorned +With what all Earth or Heaven could bestow +To make her amiable: On she came, +Led by her heavenly Maker, though unseen, +And guided by his voice; nor uninformed +Of nuptial sanctity, and marriage rites: +Grace was in all her steps, Heaven in her eye, +In every gesture dignity and love. +I, overjoyed, could not forbear aloud. +This turn hath made amends; thou hast fulfilled +Thy words, Creator bounteous and benign, +Giver of all things fair! but fairest this +Of all thy gifts! nor enviest. I now see +Bone of my bone, flesh of my flesh, myself +Before me: Woman is her name;of Man +Extracted: for this cause he shall forego +Father and mother, and to his wife adhere; +And they shall be one flesh, one heart, one soul. +She heard me thus; and though divinely brought, +Yet innocence, and virgin modesty, +Her virtue, and the conscience of her worth, +That would be wooed, and not unsought be won, +Not obvious, not obtrusive, but, retired, +The more desirable; or, to say all, +Nature herself, though pure of sinful thought, +Wrought in her so, that, seeing me, she turned: +I followed her; she what was honour knew, +And with obsequious majesty approved +My pleaded reason. To the nuptial bower +I led her blushing like the morn: All Heaven, +And happy constellations, on that hour +Shed their selectest influence; the Earth +Gave sign of gratulation, and each hill; +Joyous the birds; fresh gales and gentle airs +Whispered it to the woods, and from their wings +Flung rose, flung odours from the spicy shrub, +Disporting, till the amorous bird of night +Sung spousal, and bid haste the evening-star +On his hill top, to light the bridal lamp. +Thus have I told thee all my state, and brought +My story to the sum of earthly bliss, +Which I enjoy; and must confess to find +In all things else delight indeed, but such +As, used or not, works in the mind no change, +Nor vehement desire; these delicacies +I mean of taste, sight, smell, herbs, fruits, and flowers, +Walks, and the melody of birds: but here +Far otherwise, transported I behold, +Transported touch; here passion first I felt, +Commotion strange! in all enjoyments else +Superiour and unmoved; here only weak +Against the charm of Beauty's powerful glance. +Or Nature failed in me, and left some part +Not proof enough such object to sustain; +Or, from my side subducting, took perhaps +More than enough; at least on her bestowed +Too much of ornament, in outward show +Elaborate, of inward less exact. +For well I understand in the prime end +Of Nature her the inferiour, in the mind +And inward faculties, which most excel; +In outward also her resembling less +His image who made both, and less expressing +The character of that dominion given +O'er other creatures: Yet when I approach +Her loveliness, so absolute she seems +And in herself complete, so well to know +Her own, that what she wills to do or say, +Seems wisest, virtuousest, discreetest, best: +All higher knowledge in her presence falls +Degraded; Wisdom in discourse with her +Loses discountenanced, and like Folly shows; +Authority and Reason on her wait, +As one intended first, not after made +Occasionally; and, to consummate all, +Greatness of mind and Nobleness their seat +Build in her loveliest, and create an awe +About her, as a guard angelick placed. +To whom the Angel with contracted brow. +Accuse not Nature, she hath done her part; +Do thou but thine; and be not diffident +Of Wisdom; she deserts thee not, if thou +Dismiss not her, when most thou needest her nigh, +By attributing overmuch to things +Less excellent, as thou thyself perceivest. +For, what admirest thou, what transports thee so, +An outside? fair, no doubt, and worthy well +Thy cherishing, thy honouring, and thy love; +Not thy subjection: Weigh with her thyself; +Then value: Oft-times nothing profits more +Than self-esteem, grounded on just and right +Well managed; of that skill the more thou knowest, +The more she will acknowledge thee her head, +And to realities yield all her shows: +Made so adorn for thy delight the more, +So awful, that with honour thou mayest love +Thy mate, who sees when thou art seen least wise. +But if the sense of touch, whereby mankind +Is propagated, seem such dear delight +Beyond all other; think the same vouchsafed +To cattle and each beast; which would not be +To them made common and divulged, if aught +Therein enjoyed were worthy to subdue +The soul of man, or passion in him move. +What higher in her society thou findest +Attractive, human, rational, love still; +In loving thou dost well, in passion not, +Wherein true love consists not: Love refines +The thoughts, and heart enlarges; hath his seat +In reason, and is judicious; is the scale +By which to heavenly love thou mayest ascend, +Not sunk in carnal pleasure; for which cause, +Among the beasts no mate for thee was found. +To whom thus, half abashed, Adam replied. +Neither her outside formed so fair, nor aught +In procreation common to all kinds, +(Though higher of the genial bed by far, +And with mysterious reverence I deem,) +So much delights me, as those graceful acts, +Those thousand decencies, that daily flow +From all her words and actions mixed with love +And sweet compliance, which declare unfeigned +Union of mind, or in us both one soul; +Harmony to behold in wedded pair +More grateful than harmonious sound to the ear. +Yet these subject not; I to thee disclose +What inward thence I feel, not therefore foiled, +Who meet with various objects, from the sense +Variously representing; yet, still free, +Approve the best, and follow what I approve. +To love, thou blamest me not; for Love, thou sayest, +Leads up to Heaven, is both the way and guide; +Bear with me then, if lawful what I ask: +Love not the heavenly Spirits, and how their love +Express they? by looks only? or do they mix +Irradiance, virtual or immediate touch? +To whom the Angel, with a smile that glowed +Celestial rosy red, Love's proper hue, +Answered. Let it suffice thee that thou knowest +Us happy, and without love no happiness. +Whatever pure thou in the body enjoyest, +(And pure thou wert created) we enjoy +In eminence; and obstacle find none +Of membrane, joint, or limb, exclusive bars; +Easier than air with air, if Spirits embrace, +Total they mix, union of pure with pure +Desiring, nor restrained conveyance need, +As flesh to mix with flesh, or soul with soul. +But I can now no more; the parting sun +Beyond the Earth's green Cape and verdant Isles +Hesperian sets, my signal to depart. +Be strong, live happy, and love! But, first of all, +Him, whom to love is to obey, and keep +His great command; take heed lest passion sway +Thy judgement to do aught, which else free will +Would not admit: thine, and of all thy sons, +The weal or woe in thee is placed; beware! +I in thy persevering shall rejoice, +And all the Blest: Stand fast;to stand or fall +Free in thine own arbitrement it lies. +Perfect within, no outward aid require; +And all temptation to transgress repel. +So saying, he arose; whom Adam thus +Followed with benediction. Since to part, +Go, heavenly guest, ethereal Messenger, +Sent from whose sovran goodness I adore! +Gentle to me and affable hath been +Thy condescension, and shall be honoured ever +With grateful memory: Thou to mankind +Be good and friendly still, and oft return! +So parted they; the Angel up to Heaven +From the thick shade, and Adam to his bower. + + + +Book IX + + +No more of talk where God or Angel guest +With Man, as with his friend, familiar us'd, +To sit indulgent, and with him partake +Rural repast; permitting him the while +Venial discourse unblam'd. I now must change +Those notes to tragick; foul distrust, and breach +Disloyal on the part of Man, revolt, +And disobedience: on the part of Heaven +Now alienated, distance and distaste, +Anger and just rebuke, and judgement given, +That brought into this world a world of woe, +Sin and her shadow Death, and Misery +Death's harbinger: Sad talk!yet argument +Not less but more heroick than the wrath +Of stern Achilles on his foe pursued +Thrice fugitive about Troy wall; or rage +Of Turnus for Lavinia disespous'd; +Or Neptune's ire, or Juno's, that so long +Perplexed the Greek, and Cytherea's son: + + 00482129 +If answerable style I can obtain +Of my celestial patroness, who deigns +Her nightly visitation unimplor'd, +And dictates to me slumbering; or inspires +Easy my unpremeditated verse: +Since first this subject for heroick song +Pleas'd me long choosing, and beginning late; +Not sedulous by nature to indite +Wars, hitherto the only argument +Heroick deem'd chief mastery to dissect +With long and tedious havock fabled knights +In battles feign'd; the better fortitude +Of patience and heroick martyrdom +Unsung; or to describe races and games, +Or tilting furniture, imblazon'd shields, +Impresses quaint, caparisons and steeds, +Bases and tinsel trappings, gorgeous knights +At joust and tournament; then marshall'd feast +Serv'd up in hall with sewers and seneshals; +The skill of artifice or office mean, +Not that which justly gives heroick name +To person, or to poem. Me, of these +Nor skill'd nor studious, higher argument +Remains; sufficient of itself to raise +That name, unless an age too late, or cold +Climate, or years, damp my intended wing +Depress'd; and much they may, if all be mine, +Not hers, who brings it nightly to my ear. +The sun was sunk, and after him the star +Of Hesperus, whose office is to bring +Twilight upon the earth, short arbiter +"twixt day and night, and now from end to end +Night's hemisphere had veil'd the horizon round: +When satan, who late fled before the threats +Of Gabriel out of Eden, now improv'd +In meditated fraud and malice, bent +On Man's destruction, maugre what might hap +Of heavier on himself, fearless returned +From compassing the earth; cautious of day, +Since Uriel, regent of the sun, descried +His entrance, and foreworned the Cherubim +That kept their watch; thence full of anguish driven, +The space of seven continued nights he rode +With darkness; thrice the equinoctial line +He circled; four times crossed the car of night +From pole to pole, traversing each colure; +On the eighth returned; and, on the coast averse +From entrance or Cherubick watch, by stealth +Found unsuspected way. There was a place, +Now not, though sin, not time, first wrought the change, +Where Tigris, at the foot of Paradise, +Into a gulf shot under ground, till part +Rose up a fountain by the tree of life: +In with the river sunk, and with it rose +Satan, involved in rising mist; then sought +Where to lie hid; sea he had searched, and land, +From Eden over Pontus and the pool +Maeotis, up beyond the river Ob; +Downward as far antarctick; and in length, +West from Orontes to the ocean barred +At Darien ; thence to the land where flows +Ganges and Indus: Thus the orb he roamed +With narrow search; and with inspection deep +Considered every creature, which of all +Most opportune might serve his wiles; and found +The Serpent subtlest beast of all the field. +Him after long debate, irresolute +Of thoughts revolved, his final sentence chose +Fit vessel, fittest imp of fraud, in whom +To enter, and his dark suggestions hide +From sharpest sight: for, in the wily snake +Whatever sleights, none would suspicious mark, +As from his wit and native subtlety +Proceeding; which, in other beasts observed, +Doubt might beget of diabolick power +Active within, beyond the sense of brute. +Thus he resolved, but first from inward grief +His bursting passion into plaints thus poured. +More justly, seat worthier of Gods, as built +With second thoughts, reforming what was old! +O Earth, how like to Heaven, if not preferred +For what God, after better, worse would build? +Terrestrial Heaven, danced round by other Heavens +That shine, yet bear their bright officious lamps, +Light above light, for thee alone, as seems, +In thee concentring all their precious beams +Of sacred influence! As God in Heaven +Is center, yet extends to all; so thou, +Centring, receivest from all those orbs: in thee, +Not in themselves, all their known virtue appears +Productive in herb, plant, and nobler birth +Of creatures animate with gradual life +Of growth, sense, reason, all summed up in Man. +With what delight could I have walked thee round, +If I could joy in aught, sweet interchange +Of hill, and valley, rivers, woods, and plains, +Now land, now sea and shores with forest crowned, +Rocks, dens, and caves! But I in none of these +Find place or refuge; and the more I see +Pleasures about me, so much more I feel +Torment within me, as from the hateful siege +Of contraries: all good to me becomes +Bane, and in Heaven much worse would be my state. +But neither here seek I, no nor in Heaven +To dwell, unless by mastering Heaven's Supreme; +Nor hope to be myself less miserable +By what I seek, but others to make such +As I, though thereby worse to me redound: +For only in destroying I find ease +To my relentless thoughts; and, him destroyed, +Or won to what may work his utter loss, +For whom all this was made, all this will soon +Follow, as to him linked in weal or woe; +In woe then; that destruction wide may range: +To me shall be the glory sole among +The infernal Powers, in one day to have marred +What he, Almighty styled, six nights and days +Continued making; and who knows how long +Before had been contriving? though perhaps +Not longer than since I, in one night, freed +From servitude inglorious well nigh half +The angelick name, and thinner left the throng +Of his adorers: He, to be avenged, +And to repair his numbers thus impaired, +Whether such virtue spent of old now failed +More Angels to create, if they at least +Are his created, or, to spite us more, +Determined to advance into our room +A creature formed of earth, and him endow, +Exalted from so base original, +With heavenly spoils, our spoils: What he decreed, +He effected; Man he made, and for him built +Magnificent this world, and earth his seat, +Him lord pronounced; and, O indignity! +Subjected to his service angel-wings, +And flaming ministers to watch and tend +Their earthly charge: Of these the vigilance +I dread; and, to elude, thus wrapt in mist +Of midnight vapour glide obscure, and pry +In every bush and brake, where hap may find +The serpent sleeping; in whose mazy folds +To hide me, and the dark intent I bring. +O foul descent! that I, who erst contended +With Gods to sit the highest, am now constrained +Into a beast; and, mixed with bestial slime, +This essence to incarnate and imbrute, +That to the highth of Deity aspired! +But what will not ambition and revenge +Descend to? Who aspires, must down as low +As high he soared; obnoxious, first or last, +To basest things. Revenge, at first though sweet, +Bitter ere long, back on itself recoils: +Let it; I reck not, so it light well aimed, +Since higher I fall short, on him who next +Provokes my envy, this new favourite +Of Heaven, this man of clay, son of despite, +Whom, us the more to spite, his Maker raised +From dust: Spite then with spite is best repaid. +So saying, through each thicket dank or dry, +Like a black mist low-creeping, he held on +His midnight-search, where soonest he might find +The serpent; him fast-sleeping soon he found +In labyrinth of many a round self-rolled, +His head the midst, well stored with subtile wiles: +Not yet in horrid shade or dismal den, +Nor nocent yet; but, on the grassy herb, +Fearless unfeared he slept: in at his mouth +The Devil entered; and his brutal sense, +In heart or head, possessing, soon inspired +With act intelligential; but his sleep +Disturbed not, waiting close the approach of morn. +Now, when as sacred light began to dawn +In Eden on the humid flowers, that breathed +Their morning incense, when all things, that breathe, +From the Earth's great altar send up silent praise +To the Creator, and his nostrils fill +With grateful smell, forth came the human pair, +And joined their vocal worship to the quire +Of creatures wanting voice; that done, partake +The season prime for sweetest scents and airs: +Then commune, how that day they best may ply +Their growing work: for much their work out-grew +The hands' dispatch of two gardening so wide, +And Eve first to her husband thus began. +Adam, well may we labour still to dress +This garden, still to tend plant, herb, and flower, +Our pleasant task enjoined; but, till more hands +Aid us, the work under our labour grows, +Luxurious by restraint; what we by day +Lop overgrown, or prune, or prop, or bind, +One night or two with wanton growth derides +Tending to wild. Thou therefore now advise, +Or bear what to my mind first thoughts present: +Let us divide our labours; thou, where choice +Leads thee, or where most needs, whether to wind +The woodbine round this arbour, or direct +The clasping ivy where to climb; while I, +In yonder spring of roses intermixed +With myrtle, find what to redress till noon: +For, while so near each other thus all day +Our task we choose, what wonder if so near +Looks intervene and smiles, or object new +Casual discourse draw on; which intermits +Our day's work, brought to little, though begun +Early, and the hour of supper comes unearned? +To whom mild answer Adam thus returned. +Sole Eve, associate sole, to me beyond +Compare above all living creatures dear! +Well hast thou motioned, well thy thoughts employed, +How we might best fulfil the work which here +God hath assigned us; nor of me shalt pass +Unpraised: for nothing lovelier can be found +In woman, than to study houshold good, +And good works in her husband to promote. +Yet not so strictly hath our Lord imposed +Labour, as to debar us when we need +Refreshment, whether food, or talk between, +Food of the mind, or this sweet intercourse +Of looks and smiles; for smiles from reason flow, +To brute denied, and are of love the food; +Love, not the lowest end of human life. +For not to irksome toil, but to delight, +He made us, and delight to reason joined. +These paths and bowers doubt not but our joint hands +Will keep from wilderness with ease, as wide +As we need walk, till younger hands ere long +Assist us; But, if much converse perhaps +Thee satiate, to short absence I could yield: +For solitude sometimes is best society, +And short retirement urges sweet return. +But other doubt possesses me, lest harm +Befall thee severed from me; for thou knowest +What hath been warned us, what malicious foe +Envying our happiness, and of his own +Despairing, seeks to work us woe and shame +By sly assault; and somewhere nigh at hand +Watches, no doubt, with greedy hope to find +His wish and best advantage, us asunder; +Hopeless to circumvent us joined, where each +To other speedy aid might lend at need: +Whether his first design be to withdraw +Our fealty from God, or to disturb +Conjugal love, than which perhaps no bliss +Enjoyed by us excites his envy more; +Or this, or worse, leave not the faithful side +That gave thee being, still shades thee, and protects. +The wife, where danger or dishonour lurks, +Safest and seemliest by her husband stays, +Who guards her, or with her the worst endures. +To whom the virgin majesty of Eve, +As one who loves, and some unkindness meets, +With sweet austere composure thus replied. +Offspring of Heaven and Earth, and all Earth's Lord! +That such an enemy we have, who seeks +Our ruin, both by thee informed I learn, +And from the parting Angel over-heard, +As in a shady nook I stood behind, +Just then returned at shut of evening flowers. +But, that thou shouldst my firmness therefore doubt +To God or thee, because we have a foe +May tempt it, I expected not to hear. +His violence thou fearest not, being such +As we, not capable of death or pain, +Can either not receive, or can repel. +His fraud is then thy fear; which plain infers +Thy equal fear, that my firm faith and love +Can by his fraud be shaken or seduced; +Thoughts, which how found they harbour in thy breast, +Adam, mis-thought of her to thee so dear? +To whom with healing words Adam replied. +Daughter of God and Man, immortal Eve! +For such thou art; from sin and blame entire: +Not diffident of thee do I dissuade +Thy absence from my sight, but to avoid +The attempt itself, intended by our foe. +For he who tempts, though in vain, at least asperses +The tempted with dishonour foul; supposed +Not incorruptible of faith, not proof +Against temptation: Thou thyself with scorn +And anger wouldst resent the offered wrong, +Though ineffectual found: misdeem not then, +If such affront I labour to avert +From thee alone, which on us both at once +The enemy, though bold, will hardly dare; +Or daring, first on me the assault shall light. +Nor thou his malice and false guile contemn; +Subtle he needs must be, who could seduce +Angels; nor think superfluous other's aid. +I, from the influence of thy looks, receive +Access in every virtue; in thy sight +More wise, more watchful, stronger, if need were +Of outward strength; while shame, thou looking on, +Shame to be overcome or over-reached, +Would utmost vigour raise, and raised unite. +Why shouldst not thou like sense within thee feel +When I am present, and thy trial choose +With me, best witness of thy virtue tried? +So spake domestick Adam in his care +And matrimonial love; but Eve, who thought +Less attributed to her faith sincere, +Thus her reply with accent sweet renewed. +If this be our condition, thus to dwell +In narrow circuit straitened by a foe, +Subtle or violent, we not endued +Single with like defence, wherever met; +How are we happy, still in fear of harm? +But harm precedes not sin: only our foe, +Tempting, affronts us with his foul esteem +Of our integrity: his foul esteem +Sticks no dishonour on our front, but turns +Foul on himself; then wherefore shunned or feared +By us? who rather double honour gain +From his surmise proved false; find peace within, +Favour from Heaven, our witness, from the event. +And what is faith, love, virtue, unassayed +Alone, without exteriour help sustained? +Let us not then suspect our happy state +Left so imperfect by the Maker wise, +As not secure to single or combined. +Frail is our happiness, if this be so, +And Eden were no Eden, thus exposed. +To whom thus Adam fervently replied. +O Woman, best are all things as the will +Of God ordained them: His creating hand +Nothing imperfect or deficient left +Of all that he created, much less Man, +Or aught that might his happy state secure, +Secure from outward force; within himself +The danger lies, yet lies within his power: +Against his will he can receive no harm. +But God left free the will; for what obeys +Reason, is free; and Reason he made right, +But bid her well be ware, and still erect; +Lest, by some fair-appearing good surprised, +She dictate false; and mis-inform the will +To do what God expressly hath forbid. +Not then mistrust, but tender love, enjoins, +That I should mind thee oft; and mind thou me. +Firm we subsist, yet possible to swerve; +Since Reason not impossibly may meet +Some specious object by the foe suborned, +And fall into deception unaware, +Not keeping strictest watch, as she was warned. +Seek not temptation then, which to avoid +Were better, and most likely if from me +Thou sever not: Trial will come unsought. +Wouldst thou approve thy constancy, approve +First thy obedience; the other who can know, +Not seeing thee attempted, who attest? +But, if thou think, trial unsought may find +Us both securer than thus warned thou seemest, +Go; for thy stay, not free, absents thee more; +Go in thy native innocence, rely +On what thou hast of virtue; summon all! +For God towards thee hath done his part, do thine. +So spake the patriarch of mankind; but Eve +Persisted; yet submiss, though last, replied. +With thy permission then, and thus forewarned +Chiefly by what thy own last reasoning words +Touched only; that our trial, when least sought, +May find us both perhaps far less prepared, +The willinger I go, nor much expect +A foe so proud will first the weaker seek; +So bent, the more shall shame him his repulse. +Thus saying, from her husband's hand her hand +Soft she withdrew; and, like a Wood-Nymph light, +Oread or Dryad, or of Delia's train, +Betook her to the groves; but Delia's self +In gait surpassed, and Goddess-like deport, +Though not as she with bow and quiver armed, +But with such gardening tools as Art yet rude, +Guiltless of fire, had formed, or Angels brought. +To Pales, or Pomona, thus adorned, +Likest she seemed, Pomona when she fled +Vertumnus, or to Ceres in her prime, +Yet virgin of Proserpina from Jove. +Her long with ardent look his eye pursued +Delighted, but desiring more her stay. +Oft he to her his charge of quick return +Repeated; she to him as oft engaged +To be returned by noon amid the bower, +And all things in best order to invite +Noontide repast, or afternoon's repose. +O much deceived, much failing, hapless Eve, +Of thy presumed return! event perverse! +Thou never from that hour in Paradise +Foundst either sweet repast, or sound repose; +Such ambush, hid among sweet flowers and shades, +Waited with hellish rancour imminent +To intercept thy way, or send thee back +Despoiled of innocence, of faith, of bliss! +For now, and since first break of dawn, the Fiend, +Mere serpent in appearance, forth was come; +And on his quest, where likeliest he might find +The only two of mankind, but in them +The whole included race, his purposed prey. +In bower and field he sought, where any tuft +Of grove or garden-plot more pleasant lay, +Their tendance, or plantation for delight; +By fountain or by shady rivulet +He sought them both, but wished his hap might find +Eve separate; he wished, but not with hope +Of what so seldom chanced; when to his wish, +Beyond his hope, Eve separate he spies, +Veiled in a cloud of fragrance, where she stood, +Half spied, so thick the roses blushing round +About her glowed, oft stooping to support +Each flower of slender stalk, whose head, though gay +Carnation, purple, azure, or specked with gold, +Hung drooping unsustained; them she upstays +Gently with myrtle band, mindless the while +Herself, though fairest unsupported flower, +From her best prop so far, and storm so nigh. +Nearer he drew, and many a walk traversed +Of stateliest covert, cedar, pine, or palm; +Then voluble and bold, now hid, now seen, +Among thick-woven arborets, and flowers +Imbordered on each bank, the hand of Eve: +Spot more delicious than those gardens feigned +Or of revived Adonis, or renowned +Alcinous, host of old Laertes' son; +Or that, not mystick, where the sapient king +Held dalliance with his fair Egyptian spouse. +Much he the place admired, the person more. +As one who long in populous city pent, +Where houses thick and sewers annoy the air, +Forth issuing on a summer's morn, to breathe +Among the pleasant villages and farms +Adjoined, from each thing met conceives delight; +The smell of grain, or tedded grass, or kine, +Or dairy, each rural sight, each rural sound; +If chance, with nymph-like step, fair virgin pass, +What pleasing seemed, for her now pleases more; +She most, and in her look sums all delight: +Such pleasure took the Serpent to behold +This flowery plat, the sweet recess of Eve +Thus early, thus alone: Her heavenly form +Angelick, but more soft, and feminine, +Her graceful innocence, her every air +Of gesture, or least action, overawed +His malice, and with rapine sweet bereaved +His fierceness of the fierce intent it brought: +That space the Evil-one abstracted stood +From his own evil, and for the time remained +Stupidly good; of enmity disarmed, +Of guile, of hate, of envy, of revenge: +But the hot Hell that always in him burns, +Though in mid Heaven, soon ended his delight, +And tortures him now more, the more he sees +Of pleasure, not for him ordained: then soon +Fierce hate he recollects, and all his thoughts +Of mischief, gratulating, thus excites. +Thoughts, whither have ye led me! with what sweet +Compulsion thus transported, to forget +What hither brought us! hate, not love;nor hope +Of Paradise for Hell, hope here to taste +Of pleasure; but all pleasure to destroy, +Save what is in destroying; other joy +To me is lost. Then, let me not let pass +Occasion which now smiles; behold alone +The woman, opportune to all attempts, +Her husband, for I view far round, not nigh, +Whose higher intellectual more I shun, +And strength, of courage haughty, and of limb +Heroick built, though of terrestrial mould; +Foe not informidable! exempt from wound, +I not; so much hath Hell debased, and pain +Enfeebled me, to what I was in Heaven. +She fair, divinely fair, fit love for Gods! +Not terrible, though terrour be in love +And beauty, not approached by stronger hate, +Hate stronger, under show of love well feigned; +The way which to her ruin now I tend. +So spake the enemy of mankind, enclosed +In serpent, inmate bad! and toward Eve +Addressed his way: not with indented wave, +Prone on the ground, as since; but on his rear, +Circular base of rising folds, that towered +Fold above fold, a surging maze! his head +Crested aloft, and carbuncle his eyes; +With burnished neck of verdant gold, erect +Amidst his circling spires, that on the grass +Floated redundant: pleasing was his shape +And lovely; never since of serpent-kind +Lovelier, not those that in Illyria changed, +Hermione and Cadmus, or the god +In Epidaurus; nor to which transformed +Ammonian Jove, or Capitoline, was seen; +He with Olympias; this with her who bore +Scipio, the highth of Rome. With tract oblique +At first, as one who sought access, but feared +To interrupt, side-long he works his way. +As when a ship, by skilful steersmen wrought +Nigh river's mouth or foreland, where the wind +Veers oft, as oft so steers, and shifts her sail: +So varied he, and of his tortuous train +Curled many a wanton wreath in sight of Eve, +To lure her eye; she, busied, heard the sound +Of rusling leaves, but minded not, as used +To such disport before her through the field, +From every beast; more duteous at her call, +Than at Circean call the herd disguised. +He, bolder now, uncalled before her stood, +But as in gaze admiring: oft he bowed +His turret crest, and sleek enamelled neck, +Fawning; and licked the ground whereon she trod. +His gentle dumb expression turned at length +The eye of Eve to mark his play; he, glad +Of her attention gained, with serpent-tongue +Organick, or impulse of vocal air, +His fraudulent temptation thus began. +Wonder not, sovran Mistress, if perhaps +Thou canst, who art sole wonder! much less arm +Thy looks, the Heaven of mildness, with disdain, +Displeased that I approach thee thus, and gaze +Insatiate; I thus single;nor have feared +Thy awful brow, more awful thus retired. +Fairest resemblance of thy Maker fair, +Thee all things living gaze on, all things thine +By gift, and thy celestial beauty adore +With ravishment beheld! there best beheld, +Where universally admired; but here +In this enclosure wild, these beasts among, +Beholders rude, and shallow to discern +Half what in thee is fair, one man except, +Who sees thee? and what is one? who should be seen +A Goddess among Gods, adored and served +By Angels numberless, thy daily train. +So glozed the Tempter, and his proem tuned: +Into the heart of Eve his words made way, +Though at the voice much marvelling; at length, +Not unamazed, she thus in answer spake. +What may this mean? language of man pronounced +By tongue of brute, and human sense expressed? +The first, at least, of these I thought denied +To beasts; whom God, on their creation-day, +Created mute to all articulate sound: +The latter I demur; for in their looks +Much reason, and in their actions, oft appears. +Thee, Serpent, subtlest beast of all the field +I knew, but not with human voice endued; +Redouble then this miracle, and say, +How camest thou speakable of mute, and how +To me so friendly grown above the rest +Of brutal kind, that daily are in sight? +Say, for such wonder claims attention due. +To whom the guileful Tempter thus replied. +Empress of this fair world, resplendent Eve! +Easy to me it is to tell thee all +What thou commandest; and right thou shouldst be obeyed: +I was at first as other beasts that graze +The trodden herb, of abject thoughts and low, +As was my food; nor aught but food discerned +Or sex, and apprehended nothing high: +Till, on a day roving the field, I chanced +A goodly tree far distant to behold +Loaden with fruit of fairest colours mixed, +Ruddy and gold: I nearer drew to gaze; +When from the boughs a savoury odour blown, +Grateful to appetite, more pleased my sense +Than smell of sweetest fennel, or the teats +Of ewe or goat dropping with milk at even, +Unsucked of lamb or kid, that tend their play. +To satisfy the sharp desire I had +Of tasting those fair apples, I resolved +Not to defer; hunger and thirst at once, +Powerful persuaders, quickened at the scent +Of that alluring fruit, urged me so keen. +About the mossy trunk I wound me soon; +For, high from ground, the branches would require +Thy utmost reach or Adam's: Round the tree +All other beasts that saw, with like desire +Longing and envying stood, but could not reach. +Amid the tree now got, where plenty hung +Tempting so nigh, to pluck and eat my fill +I spared not; for, such pleasure till that hour, +At feed or fountain, never had I found. +Sated at length, ere long I might perceive +Strange alteration in me, to degree +Of reason in my inward powers; and speech +Wanted not long; though to this shape retained. +Thenceforth to speculations high or deep +I turned my thoughts, and with capacious mind +Considered all things visible in Heaven, +Or Earth, or Middle; all things fair and good: +But all that fair and good in thy divine +Semblance, and in thy beauty's heavenly ray, +United I beheld; no fair to thine +Equivalent or second! which compelled +Me thus, though importune perhaps, to come +And gaze, and worship thee of right declared +Sovran of creatures, universal Dame! +So talked the spirited sly Snake; and Eve, +Yet more amazed, unwary thus replied. +Serpent, thy overpraising leaves in doubt +The virtue of that fruit, in thee first proved: +But say, where grows the tree? from hence how far? +For many are the trees of God that grow +In Paradise, and various, yet unknown +To us; in such abundance lies our choice, +As leaves a greater store of fruit untouched, +Still hanging incorruptible, till men +Grow up to their provision, and more hands +Help to disburden Nature of her birth. +To whom the wily Adder, blithe and glad. +Empress, the way is ready, and not long; +Beyond a row of myrtles, on a flat, +Fast by a fountain, one small thicket past +Of blowing myrrh and balm: if thou accept +My conduct, I can bring thee thither soon +Lead then, said Eve. He, leading, swiftly rolled +In tangles, and made intricate seem straight, +To mischief swift. Hope elevates, and joy +Brightens his crest; as when a wandering fire, +Compact of unctuous vapour, which the night +Condenses, and the cold environs round, +Kindled through agitation to a flame, +Which oft, they say, some evil Spirit attends, +Hovering and blazing with delusive light, +Misleads the amazed night-wanderer from his way +To bogs and mires, and oft through pond or pool; +There swallowed up and lost, from succour far. +So glistered the dire Snake, and into fraud +Led Eve, our credulous mother, to the tree +Of prohibition, root of all our woe; +Which when she saw, thus to her guide she spake. +Serpent, we might have spared our coming hither, +Fruitless to me, though fruit be here to excess, +The credit of whose virtue rest with thee; +Wonderous indeed, if cause of such effects. +But of this tree we may not taste nor touch; +God so commanded, and left that command +Sole daughter of his voice; the rest, we live +Law to ourselves; our reason is our law. +To whom the Tempter guilefully replied. +Indeed! hath God then said that of the fruit +Of all these garden-trees ye shall not eat, +Yet Lords declared of all in earth or air$? +To whom thus Eve, yet sinless. Of the fruit +Of each tree in the garden we may eat; +But of the fruit of this fair tree amidst +The garden, God hath said, Ye shall not eat +Thereof, nor shall ye touch it, lest ye die. +She scarce had said, though brief, when now more bold +The Tempter, but with show of zeal and love +To Man, and indignation at his wrong, +New part puts on; and, as to passion moved, +Fluctuates disturbed, yet comely and in act +Raised, as of some great matter to begin. +As when of old some orator renowned, +In Athens or free Rome, where eloquence +Flourished, since mute! to some great cause addressed, +Stood in himself collected; while each part, +Motion, each act, won audience ere the tongue; +Sometimes in highth began, as no delay +Of preface brooking, through his zeal of right: +So standing, moving, or to highth up grown, +The Tempter, all impassioned, thus began. +O sacred, wise, and wisdom-giving Plant, +Mother of science! now I feel thy power +Within me clear; not only to discern +Things in their causes, but to trace the ways +Of highest agents, deemed however wise. +Queen of this universe! do not believe +Those rigid threats of death: ye shall not die: +How should you? by the fruit? it gives you life +To knowledge; by the threatener? look on me, +Me, who have touched and tasted; yet both live, +And life more perfect have attained than Fate +Meant me, by venturing higher than my lot. +Shall that be shut to Man, which to the Beast +Is open? or will God incense his ire +For such a petty trespass? and not praise +Rather your dauntless virtue, whom the pain +Of death denounced, whatever thing death be, +Deterred not from achieving what might lead +To happier life, knowledge of good and evil; +Of good, how just? of evil, if what is evil +Be real, why not known, since easier shunned? +God therefore cannot hurt ye, and be just; +Not just, not God; not feared then, nor obeyed: +Your fear itself of death removes the fear. +Why then was this forbid? Why, but to awe; +Why, but to keep ye low and ignorant, +His worshippers? He knows that in the day +Ye eat thereof, your eyes that seem so clear, +Yet are but dim, shall perfectly be then +Opened and cleared, and ye shall be as Gods, +Knowing both good and evil, as they know. +That ye shall be as Gods, since I as Man, +Internal Man, is but proportion meet; +I, of brute, human; ye, of human, Gods. +So ye shall die perhaps, by putting off +Human, to put on Gods; death to be wished, +Though threatened, which no worse than this can bring. +And what are Gods, that Man may not become +As they, participating God-like food? +The Gods are first, and that advantage use +On our belief, that all from them proceeds: +I question it; for this fair earth I see, +Warmed by the sun, producing every kind; +Them, nothing: if they all things, who enclosed +Knowledge of good and evil in this tree, +That whoso eats thereof, forthwith attains +Wisdom without their leave? and wherein lies +The offence, that Man should thus attain to know? +What can your knowledge hurt him, or this tree +Impart against his will, if all be his? +Or is it envy? and can envy dwell +In heavenly breasts? These, these, and many more +Causes import your need of this fair fruit. +Goddess humane, reach then, and freely taste! +He ended; and his words, replete with guile, +Into her heart too easy entrance won: +Fixed on the fruit she gazed, which to behold +Might tempt alone; and in her ears the sound +Yet rung of his persuasive words, impregned +With reason, to her seeming, and with truth: +Mean while the hour of noon drew on, and waked +An eager appetite, raised by the smell +So savoury of that fruit, which with desire, +Inclinable now grown to touch or taste, +Solicited her longing eye; yet first +Pausing a while, thus to herself she mused. +Great are thy virtues, doubtless, best of fruits, +Though kept from man, and worthy to be admired; +Whose taste, too long forborn, at first assay +Gave elocution to the mute, and taught +The tongue not made for speech to speak thy praise: +Thy praise he also, who forbids thy use, +Conceals not from us, naming thee the tree +Of knowledge, knowledge both of good and evil; +Forbids us then to taste! but his forbidding +Commends thee more, while it infers the good +By thee communicated, and our want: +For good unknown sure is not had; or, had +And yet unknown, is as not had at all. +In plain then, what forbids he but to know, +Forbids us good, forbids us to be wise? +Such prohibitions bind not. But, if death +Bind us with after-bands, what profits then +Our inward freedom? In the day we eat +Of this fair fruit, our doom is, we shall die! +How dies the Serpent? he hath eaten and lives, +And knows, and speaks, and reasons, and discerns, +Irrational till then. For us alone +Was death invented? or to us denied +This intellectual food, for beasts reserved? +For beasts it seems: yet that one beast which first +Hath tasted envies not, but brings with joy +The good befallen him, author unsuspect, +Friendly to man, far from deceit or guile. +What fear I then? rather, what know to fear +Under this ignorance of good and evil, +Of God or death, of law or penalty? +Here grows the cure of all, this fruit divine, +Fair to the eye, inviting to the taste, +Of virtue to make wise: What hinders then +To reach, and feed at once both body and mind? +So saying, her rash hand in evil hour +Forth reaching to the fruit, she plucked, she eat! +Earth felt the wound; and Nature from her seat, +Sighing through all her works, gave signs of woe, +That all was lost. Back to the thicket slunk +The guilty Serpent; and well might;for Eve, +Intent now wholly on her taste, nought else +Regarded; such delight till then, as seemed, +In fruit she never tasted, whether true +Or fancied so, through expectation high +Of knowledge; not was Godhead from her thought. +Greedily she ingorged without restraint, +And knew not eating death: Satiate at length, +And hightened as with wine, jocund and boon, +Thus to herself she pleasingly began. +O sovran, virtuous, precious of all trees +In Paradise! of operation blest +To sapience, hitherto obscured, infamed. +And thy fair fruit let hang, as to no end +Created; but henceforth my early care, +Not without song, each morning, and due praise, +Shall tend thee, and the fertile burden ease +Of thy full branches offered free to all; +Till, dieted by thee, I grow mature +In knowledge, as the Gods, who all things know; +Though others envy what they cannot give: +For, had the gift been theirs, it had not here +Thus grown. Experience, next, to thee I owe, +Best guide; not following thee, I had remained +In ignorance; thou openest wisdom's way, +And givest access, though secret she retire. +And I perhaps am secret: Heaven is high, +High, and remote to see from thence distinct +Each thing on Earth; and other care perhaps +May have diverted from continual watch +Our great Forbidder, safe with all his spies +About him. But to Adam in what sort +Shall I appear? shall I to him make known +As yet my change, and give him to partake +Full happiness with me, or rather not, +But keeps the odds of knowledge in my power +Without copartner? so to add what wants +In female sex, the more to draw his love, +And render me more equal; and perhaps, +A thing not undesirable, sometime +Superiour; for, inferiour, who is free +This may be well: But what if God have seen, +And death ensue? then I shall be no more! +And Adam, wedded to another Eve, +Shall live with her enjoying, I extinct; +A death to think! Confirmed then I resolve, +Adam shall share with me in bliss or woe: +So dear I love him, that with him all deaths +I could endure, without him live no life. +So saying, from the tree her step she turned; +But first low reverence done, as to the Power +That dwelt within, whose presence had infused +Into the plant sciential sap, derived +From nectar, drink of Gods. Adam the while, +Waiting desirous her return, had wove +Of choicest flowers a garland, to adorn +Her tresses, and her rural labours crown; +As reapers oft are wont their harvest-queen. +Great joy he promised to his thoughts, and new +Solace in her return, so long delayed: +Yet oft his heart, divine of something ill, +Misgave him; he the faltering measure felt; +And forth to meet her went, the way she took +That morn when first they parted: by the tree +Of knowledge he must pass; there he her met, +Scarce from the tree returning; in her hand +A bough of fairest fruit, that downy smiled, +New gathered, and ambrosial smell diffused. +To him she hasted; in her face excuse +Came prologue, and apology too prompt; +Which, with bland words at will, she thus addressed. +Hast thou not wondered, Adam, at my stay? +Thee I have missed, and thought it long, deprived +Thy presence; agony of love till now +Not felt, nor shall be twice; for never more +Mean I to try, what rash untried I sought, +The pain of absence from thy sight. But strange +Hath been the cause, and wonderful to hear: +This tree is not, as we are told, a tree +Of danger tasted, nor to evil unknown +Opening the way, but of divine effect +To open eyes, and make them Gods who taste; +And hath been tasted such: The serpent wise, +Or not restrained as we, or not obeying, +Hath eaten of the fruit; and is become, +Not dead, as we are threatened, but thenceforth +Endued with human voice and human sense, +Reasoning to admiration; and with me +Persuasively hath so prevailed, that I +Have also tasted, and have also found +The effects to correspond; opener mine eyes, +Dim erst, dilated spirits, ampler heart, +And growing up to Godhead; which for thee +Chiefly I sought, without thee can despise. +For bliss, as thou hast part, to me is bliss; +Tedious, unshared with thee, and odious soon. +Thou therefore also taste, that equal lot +May join us, equal joy, as equal love; +Lest, thou not tasting, different degree +Disjoin us, and I then too late renounce +Deity for thee, when Fate will not permit. +Thus Eve with countenance blithe her story told; +But in her cheek distemper flushing glowed. +On the other side Adam, soon as he heard +The fatal trespass done by Eve, amazed, +Astonied stood and blank, while horrour chill +Ran through his veins, and all his joints relaxed; +From his slack hand the garland wreathed for Eve +Down dropt, and all the faded roses shed: +Speechless he stood and pale, till thus at length +First to himself he inward silence broke. +O fairest of Creation, last and best +Of all God's works, Creature in whom excelled +Whatever can to sight or thought be formed, +Holy, divine, good, amiable, or sweet! +How art thou lost! how on a sudden lost, +Defaced, deflowered, and now to death devote! +Rather, how hast thou yielded to transgress +The strict forbiddance, how to violate +The sacred fruit forbidden! Some cursed fraud +Of enemy hath beguiled thee, yet unknown, +And me with thee hath ruined; for with thee +Certain my resolution is to die: +How can I live without thee! how forego +Thy sweet converse, and love so dearly joined, +To live again in these wild woods forlorn! +Should God create another Eve, and I +Another rib afford, yet loss of thee +Would never from my heart: no, no!I feel +The link of Nature draw me: flesh of flesh, +Bone of my bone thou art, and from thy state +Mine never shall be parted, bliss or woe. +So having said, as one from sad dismay +Recomforted, and after thoughts disturbed +Submitting to what seemed remediless, +Thus in calm mood his words to Eve he turned. +Bold deed thou hast presumed, adventurous Eve, +And peril great provoked, who thus hast dared, +Had it been only coveting to eye +That sacred fruit, sacred to abstinence, +Much more to taste it under ban to touch. +But past who can recall, or done undo? +Not God Omnipotent, nor Fate; yet so +Perhaps thou shalt not die, perhaps the fact +Is not so heinous now, foretasted fruit, +Profaned first by the serpent, by him first +Made common, and unhallowed, ere our taste; +Nor yet on him found deadly; yet he lives; +Lives, as thou saidst, and gains to live, as Man, +Higher degree of life; inducement strong +To us, as likely tasting to attain +Proportional ascent; which cannot be +But to be Gods, or Angels, demi-Gods. +Nor can I think that God, Creator wise, +Though threatening, will in earnest so destroy +Us his prime creatures, dignified so high, +Set over all his works; which in our fall, +For us created, needs with us must fail, +Dependant made; so God shall uncreate, +Be frustrate, do, undo, and labour lose; +Not well conceived of God, who, though his power +Creation could repeat, yet would be loth +Us to abolish, lest the Adversary +Triumph, and say; "Fickle their state whom God +"Most favours; who can please him long? Me first +"He ruined, now Mankind; whom will he next?" +Matter of scorn, not to be given the Foe. +However I with thee have fixed my lot, +Certain to undergo like doom: If death +Consort with thee, death is to me as life; +So forcible within my heart I feel +The bond of Nature draw me to my own; +My own in thee, for what thou art is mine; +Our state cannot be severed; we are one, +One flesh; to lose thee were to lose myself. +So Adam; and thus Eve to him replied. +O glorious trial of exceeding love, +Illustrious evidence, example high! +Engaging me to emulate; but, short +Of thy perfection, how shall I attain, +Adam, from whose dear side I boast me sprung, +And gladly of our union hear thee speak, +One heart, one soul in both; whereof good proof +This day affords, declaring thee resolved, +Rather than death, or aught than death more dread, +Shall separate us, linked in love so dear, +To undergo with me one guilt, one crime, +If any be, of tasting this fair fruit; +Whose virtue for of good still good proceeds, +Direct, or by occasion, hath presented +This happy trial of thy love, which else +So eminently never had been known? +Were it I thought death menaced would ensue +This my attempt, I would sustain alone +The worst, and not persuade thee, rather die +Deserted, than oblige thee with a fact +Pernicious to thy peace; chiefly assured +Remarkably so late of thy so true, +So faithful, love unequalled: but I feel +Far otherwise the event; not death, but life +Augmented, opened eyes, new hopes, new joys, +Taste so divine, that what of sweet before +Hath touched my sense, flat seems to this, and harsh. +On my experience, Adam, freely taste, +And fear of death deliver to the winds. +So saying, she embraced him, and for joy +Tenderly wept; much won, that he his love +Had so ennobled, as of choice to incur +Divine displeasure for her sake, or death. +In recompence for such compliance bad +Such recompence best merits from the bough +She gave him of that fair enticing fruit +With liberal hand: he scrupled not to eat, +Against his better knowledge; not deceived, +But fondly overcome with female charm. +Earth trembled from her entrails, as again +In pangs; and Nature gave a second groan; +Sky loured; and, muttering thunder, some sad drops +Wept at completing of the mortal sin +Original: while Adam took no thought, +Eating his fill; nor Eve to iterate +Her former trespass feared, the more to sooth +Him with her loved society; that now, +As with new wine intoxicated both, +They swim in mirth, and fancy that they feel +Divinity within them breeding wings, +Wherewith to scorn the earth: But that false fruit +Far other operation first displayed, +Carnal desire inflaming; he on Eve +Began to cast lascivious eyes; she him +As wantonly repaid; in lust they burn: +Till Adam thus 'gan Eve to dalliance move. +Eve, now I see thou art exact of taste, +And elegant, of sapience no small part; +Since to each meaning savour we apply, +And palate call judicious; I the praise +Yield thee, so well this day thou hast purveyed. +Much pleasure we have lost, while we abstained +From this delightful fruit, nor known till now +True relish, tasting; if such pleasure be +In things to us forbidden, it might be wished, +For this one tree had been forbidden ten. +But come, so well refreshed, now let us play, +As meet is, after such delicious fare; +For never did thy beauty, since the day +I saw thee first and wedded thee, adorned +With all perfections, so inflame my sense +With ardour to enjoy thee, fairer now +Than ever; bounty of this virtuous tree! +So said he, and forbore not glance or toy +Of amorous intent; well understood +Of Eve, whose eye darted contagious fire. +Her hand he seised; and to a shady bank, +Thick over-head with verdant roof imbowered, +He led her nothing loth; flowers were the couch, +Pansies, and violets, and asphodel, +And hyacinth; Earth's freshest softest lap. +There they their fill of love and love's disport +Took largely, of their mutual guilt the seal, +The solace of their sin; till dewy sleep +Oppressed them, wearied with their amorous play, +Soon as the force of that fallacious fruit, +That with exhilarating vapour bland +About their spirits had played, and inmost powers +Made err, was now exhaled; and grosser sleep, +Bred of unkindly fumes, with conscious dreams +Incumbered, now had left them; up they rose +As from unrest; and, each the other viewing, +Soon found their eyes how opened, and their minds +How darkened; innocence, that as a veil +Had shadowed them from knowing ill, was gone; +Just confidence, and native righteousness, +And honour, from about them, naked left +To guilty Shame; he covered, but his robe +Uncovered more. So rose the Danite strong, +Herculean Samson, from the harlot-lap +Of Philistean Dalilah, and waked +Shorn of his strength. They destitute and bare +Of all their virtue: Silent, and in face +Confounded, long they sat, as strucken mute: +Till Adam, though not less than Eve abashed, +At length gave utterance to these words constrained. +O Eve, in evil hour thou didst give ear +To that false worm, of whomsoever taught +To counterfeit Man's voice; true in our fall, +False in our promised rising; since our eyes +Opened we find indeed, and find we know +Both good and evil; good lost, and evil got; +Bad fruit of knowledge, if this be to know; +Which leaves us naked thus, of honour void, +Of innocence, of faith, of purity, +Our wonted ornaments now soiled and stained, +And in our faces evident the signs +Of foul concupiscence; whence evil store; +Even shame, the last of evils; of the first +Be sure then.--How shall I behold the face +Henceforth of God or Angel, erst with joy +And rapture so oft beheld? Those heavenly shapes +Will dazzle now this earthly with their blaze +Insufferably bright. O! might I here +In solitude live savage; in some glade +Obscured, where highest woods, impenetrable +To star or sun-light, spread their umbrage broad +And brown as evening: Cover me, ye Pines! +Ye Cedars, with innumerable boughs +Hide me, where I may never see them more!-- +But let us now, as in bad plight, devise +What best may for the present serve to hide +The parts of each from other, that seem most +To shame obnoxious, and unseemliest seen; +Some tree, whose broad smooth leaves together sewed, +And girded on our loins, may cover round +Those middle parts; that this new comer, Shame, +There sit not, and reproach us as unclean. +So counselled he, and both together went +Into the thickest wood; there soon they chose +The fig-tree; not that kind for fruit renowned, +But such as at this day, to Indians known, +In Malabar or Decan spreads her arms +Branching so broad and long, that in the ground +The bended twigs take root, and daughters grow +About the mother tree, a pillared shade +High over-arched, and echoing walks between: +There oft the Indian herdsman, shunning heat, +Shelters in cool, and tends his pasturing herds +At loop-holes cut through thickest shade: Those leaves +They gathered, broad as Amazonian targe; +And, with what skill they had, together sewed, +To gird their waist; vain covering, if to hide +Their guilt and dreaded shame! O, how unlike +To that first naked glory! Such of late +Columbus found the American, so girt +With feathered cincture; naked else, and wild +Among the trees on isles and woody shores. +Thus fenced, and, as they thought, their shame in part +Covered, but not at rest or ease of mind, +They sat them down to weep; nor only tears +Rained at their eyes, but high winds worse within +Began to rise, high passions, anger, hate, +Mistrust, suspicion, discord; and shook sore +Their inward state of mind, calm region once +And full of peace, now tost and turbulent: +For Understanding ruled not, and the Will +Heard not her lore; both in subjection now +To sensual Appetite, who from beneath +Usurping over sovran Reason claimed +Superiour sway: From thus distempered breast, +Adam, estranged in look and altered style, +Speech intermitted thus to Eve renewed. +Would thou hadst hearkened to my words, and staid +With me, as I besought thee, when that strange +Desire of wandering, this unhappy morn, +I know not whence possessed thee; we had then +Remained still happy; not, as now, despoiled +Of all our good; shamed, naked, miserable! +Let none henceforth seek needless cause to approve +The faith they owe; when earnestly they seek +Such proof, conclude, they then begin to fail. +To whom, soon moved with touch of blame, thus Eve. +What words have passed thy lips, Adam severe! +Imputest thou that to my default, or will +Of wandering, as thou callest it, which who knows +But might as ill have happened thou being by, +Or to thyself perhaps? Hadst thou been there, +Or here the attempt, thou couldst not have discerned +Fraud in the Serpent, speaking as he spake; +No ground of enmity between us known, +Why he should mean me ill, or seek to harm. +Was I to have never parted from thy side? +As good have grown there still a lifeless rib. +Being as I am, why didst not thou, the head, +Command me absolutely not to go, +Going into such danger, as thou saidst? +Too facile then, thou didst not much gainsay; +Nay, didst permit, approve, and fair dismiss. +Hadst thou been firm and fixed in thy dissent, +Neither had I transgressed, nor thou with me. +To whom, then first incensed, Adam replied. +Is this the love, is this the recompence +Of mine to thee, ingrateful Eve! expressed +Immutable, when thou wert lost, not I; +Who might have lived, and joyed immortal bliss, +Yet willingly chose rather death with thee? +And am I now upbraided as the cause +Of thy transgressing? Not enough severe, +It seems, in thy restraint: What could I more +I warned thee, I admonished thee, foretold +The danger, and the lurking enemy +That lay in wait; beyond this, had been force; +And force upon free will hath here no place. +But confidence then bore thee on; secure +Either to meet no danger, or to find +Matter of glorious trial; and perhaps +I also erred, in overmuch admiring +What seemed in thee so perfect, that I thought +No evil durst attempt thee; but I rue +The errour now, which is become my crime, +And thou the accuser. Thus it shall befall +Him, who, to worth in women overtrusting, +Lets her will rule: restraint she will not brook; +And, left to herself, if evil thence ensue, +She first his weak indulgence will accuse. +Thus they in mutual accusation spent +The fruitless hours, but neither self-condemning; +And of their vain contest appeared no end. + + + +Book X + + +Mean while the heinous and despiteful act +Of Satan, done in Paradise; and how +He, in the serpent, had perverted Eve, +Her husband she, to taste the fatal fruit, +Was known in Heaven; for what can 'scape the eye +Of God all-seeing, or deceive his heart +Omniscient? who, in all things wise and just, +Hindered not Satan to attempt the mind +Of Man, with strength entire and free will armed, +Complete to have discovered and repulsed +Whatever wiles of foe or seeming friend. +For still they knew, and ought to have still remembered, +The high injunction, not to taste that fruit, +Whoever tempted; which they not obeying, +(Incurred what could they less?) the penalty; +And, manifold in sin, deserved to fall. +Up into Heaven from Paradise in haste +The angelick guards ascended, mute, and sad, +For Man; for of his state by this they knew, +Much wondering how the subtle Fiend had stolen +Entrance unseen. Soon as the unwelcome news +From Earth arrived at Heaven-gate, displeased +All were who heard; dim sadness did not spare +That time celestial visages, yet, mixed +With pity, violated not their bliss. +About the new-arrived, in multitudes +The ethereal people ran, to hear and know +How all befel: They towards the throne supreme, +Accountable, made haste, to make appear, +With righteous plea, their utmost vigilance +And easily approved; when the Most High +Eternal Father, from his secret cloud, +Amidst in thunder uttered thus his voice. +Assembled Angels, and ye Powers returned +From unsuccessful charge; be not dismayed, +Nor troubled at these tidings from the earth, +Which your sincerest care could not prevent; +Foretold so lately what would come to pass, +When first this tempter crossed the gulf from Hell. +I told ye then he should prevail, and speed +On his bad errand; Man should be seduced, +And flattered out of all, believing lies +Against his Maker; no decree of mine +Concurring to necessitate his fall, +Or touch with lightest moment of impulse +His free will, to her own inclining left +In even scale. But fallen he is; and now +What rests, but that the mortal sentence pass +On his transgression,--death denounced that day? +Which he presumes already vain and void, +Because not yet inflicted, as he feared, +By some immediate stroke; but soon shall find +Forbearance no acquittance, ere day end. +Justice shall not return as bounty scorned. +But whom send I to judge them? whom but thee, +Vicegerent Son? To thee I have transferred +All judgement, whether in Heaven, or Earth, or Hell. +Easy it may be seen that I intend +Mercy colleague with justice, sending thee +Man's friend, his Mediator, his designed +Both ransom and Redeemer voluntary, +And destined Man himself to judge Man fallen. +So spake the Father; and, unfolding bright +Toward the right hand his glory, on the Son +Blazed forth unclouded Deity: He full +Resplendent all his Father manifest +Expressed, and thus divinely answered mild. +Father Eternal, thine is to decree; +Mine, both in Heaven and Earth, to do thy will +Supreme; that thou in me, thy Son beloved, +Mayest ever rest well pleased. I go to judge +On earth these thy transgressours; but thou knowest, +Whoever judged, the worst on me must light, +When time shall be; for so I undertook +Before thee; and, not repenting, this obtain +Of right, that I may mitigate their doom +On me derived; yet I shall temper so +Justice with mercy, as may illustrate most +Them fully satisfied, and thee appease. +Attendance none shall need, nor train, where none +Are to behold the judgement, but the judged, +Those two; the third best absent is condemned, +Convict by flight, and rebel to all law: +Conviction to the serpent none belongs. +Thus saying, from his radiant seat he rose +Of high collateral glory: Him Thrones, and Powers, +Princedoms, and Dominations ministrant, +Accompanied to Heaven-gate; from whence +Eden, and all the coast, in prospect lay. +Down he descended straight; the speed of Gods +Time counts not, though with swiftest minutes winged. +Now was the sun in western cadence low +From noon, and gentle airs, due at their hour, +To fan the earth now waked, and usher in +The evening cool; when he, from wrath more cool, +Came the mild Judge, and Intercessour both, +To sentence Man: The voice of God they heard +Now walking in the garden, by soft winds +Brought to their ears, while day declined; they heard, +And from his presence hid themselves among +The thickest trees, both man and wife; till God, +Approaching, thus to Adam called aloud. +Where art thou, Adam, wont with joy to meet +My coming seen far off? I miss thee here, +Not pleased, thus entertained with solitude, +Where obvious duty ere while appeared unsought: +Or come I less conspicuous, or what change +Absents thee, or what chance detains?--Come forth! +He came; and with him Eve, more loth, though first +To offend; discountenanced both, and discomposed; +Love was not in their looks, either to God, +Or to each other; but apparent guilt, +And shame, and perturbation, and despair, +Anger, and obstinacy, and hate, and guile. +Whence Adam, faltering long, thus answered brief. +I heard thee in the garden, and of thy voice +Afraid, being naked, hid myself. To whom +The gracious Judge without revile replied. +My voice thou oft hast heard, and hast not feared, +But still rejoiced; how is it now become +So dreadful to thee? That thou art naked, who +Hath told thee? Hast thou eaten of the tree, +Whereof I gave thee charge thou shouldst not eat? +To whom thus Adam sore beset replied. +O Heaven! in evil strait this day I stand +Before my Judge; either to undergo +Myself the total crime, or to accuse +My other self, the partner of my life; +Whose failing, while her faith to me remains, +I should conceal, and not expose to blame +By my complaint: but strict necessity +Subdues me, and calamitous constraint; +Lest on my head both sin and punishment, +However insupportable, be all +Devolved; though should I hold my peace, yet thou +Wouldst easily detect what I conceal.-- +This Woman, whom thou madest to be my help, +And gavest me as thy perfect gift, so good, +So fit, so acceptable, so divine, +That from her hand I could suspect no ill, +And what she did, whatever in itself, +Her doing seemed to justify the deed; +She gave me of the tree, and I did eat. +To whom the Sovran Presence thus replied. +Was she thy God, that her thou didst obey +Before his voice? or was she made thy guide, +Superiour, or but equal, that to her +Thou didst resign thy manhood, and the place +Wherein God set thee above her made of thee, +And for thee, whose perfection far excelled +Hers in all real dignity? Adorned +She was indeed, and lovely, to attract +Thy love, not thy subjection; and her gifts +Were such, as under government well seemed; +Unseemly to bear rule; which was thy part +And person, hadst thou known thyself aright. +So having said, he thus to Eve in few. +Say, Woman, what is this which thou hast done? +To whom sad Eve, with shame nigh overwhelmed, +Confessing soon, yet not before her Judge +Bold or loquacious, thus abashed replied. +The Serpent me beguiled, and I did eat. +Which when the Lord God heard, without delay +To judgement he proceeded on the accused +Serpent, though brute; unable to transfer +The guilt on him, who made him instrument +Of mischief, and polluted from the end +Of his creation; justly then accursed, +As vitiated in nature: More to know +Concerned not Man, (since he no further knew) +Nor altered his offence; yet God at last +To Satan first in sin his doom applied, +Though in mysterious terms, judged as then best: +And on the Serpent thus his curse let fall. +Because thou hast done this, thou art accursed +Above all cattle, each beast of the field; +Upon thy belly groveling thou shalt go, +And dust shalt eat all the days of thy life. +Between thee and the woman I will put +Enmity, and between thine and her seed; +Her seed shall bruise thy head, thou bruise his heel. +So spake this oracle, then verified +When Jesus, Son of Mary, second Eve, +Saw Satan fall, like lightning, down from Heaven, +Prince of the air; then, rising from his grave +Spoiled Principalities and Powers, triumphed +In open show; and, with ascension bright, +Captivity led captive through the air, +The realm itself of Satan, long usurped; +Whom he shall tread at last under our feet; +Even he, who now foretold his fatal bruise; +And to the Woman thus his sentence turned. +Thy sorrow I will greatly multiply +By thy conception; children thou shalt bring +In sorrow forth; and to thy husband's will +Thine shall submit; he over thee shall rule. +On Adam last thus judgement he pronounced. +Because thou hast hearkened to the voice of thy wife, +And eaten of the tree, concerning which +I charged thee, saying, Thou shalt not eat thereof: +Cursed is the ground for thy sake; thou in sorrow +Shalt eat thereof, all the days of thy life; +Thorns also and thistles it shall bring thee forth +Unbid; and thou shalt eat the herb of the field; +In the sweat of thy face shalt thou eat bread, +Till thou return unto the ground; for thou +Out of the ground wast taken, know thy birth, +For dust thou art, and shalt to dust return. +So judged he Man, both Judge and Saviour sent; +And the instant stroke of death, denounced that day, +Removed far off; then, pitying how they stood +Before him naked to the air, that now +Must suffer change, disdained not to begin +Thenceforth the form of servant to assume; +As when he washed his servants feet; so now, +As father of his family, he clad +Their nakedness with skins of beasts, or slain, +Or as the snake with youthful coat repaid; +And thought not much to clothe his enemies; +Nor he their outward only with the skins +Of beasts, but inward nakedness, much more. +Opprobrious, with his robe of righteousness, +Arraying, covered from his Father's sight. +To him with swift ascent he up returned, +Into his blissful bosom reassumed +In glory, as of old; to him appeased +All, though all-knowing, what had passed with Man +Recounted, mixing intercession sweet. +Mean while, ere thus was sinned and judged on Earth, +Within the gates of Hell sat Sin and Death, +In counterview within the gates, that now +Stood open wide, belching outrageous flame +Far into Chaos, since the Fiend passed through, +Sin opening; who thus now to Death began. +O Son, why sit we here each other viewing +Idly, while Satan, our great author, thrives +In other worlds, and happier seat provides +For us, his offspring dear? It cannot be +But that success attends him; if mishap, +Ere this he had returned, with fury driven +By his avengers; since no place like this +Can fit his punishment, or their revenge. +Methinks I feel new strength within me rise, +Wings growing, and dominion given me large +Beyond this deep; whatever draws me on, +Or sympathy, or some connatural force, +Powerful at greatest distance to unite, +With secret amity, things of like kind, +By secretest conveyance. Thou, my shade +Inseparable, must with me along; +For Death from Sin no power can separate. +But, lest the difficulty of passing back +Stay his return perhaps over this gulf +Impassable, impervious; let us try +Adventurous work, yet to thy power and mine +Not unagreeable, to found a path +Over this main from Hell to that new world, +Where Satan now prevails; a monument +Of merit high to all the infernal host, +Easing their passage hence, for intercourse, +Or transmigration, as their lot shall lead. +Nor can I miss the way, so strongly drawn +By this new-felt attraction and instinct. +Whom thus the meager Shadow answered soon. +Go, whither Fate, and inclination strong, +Leads thee; I shall not lag behind, nor err +The way, thou leading; such a scent I draw +Of carnage, prey innumerable, and taste +The savour of death from all things there that live: +Nor shall I to the work thou enterprisest +Be wanting, but afford thee equal aid. +So saying, with delight he snuffed the smell +Of mortal change on earth. As when a flock +Of ravenous fowl, though many a league remote, +Against the day of battle, to a field, +Where armies lie encamped, come flying, lured +With scent of living carcasses designed +For death, the following day, in bloody fight: +So scented the grim Feature, and upturned +His nostril wide into the murky air; +Sagacious of his quarry from so far. +Then both from out Hell-gates, into the waste +Wide anarchy of Chaos, damp and dark, +Flew diverse; and with power (their power was great) +Hovering upon the waters, what they met +Solid or slimy, as in raging sea +Tost up and down, together crouded drove, +From each side shoaling towards the mouth of Hell; +As when two polar winds, blowing adverse +Upon the Cronian sea, together drive +Mountains of ice, that stop the imagined way +Beyond Petsora eastward, to the rich +Cathaian coast. The aggregated soil +Death with his mace petrifick, cold and dry, +As with a trident, smote; and fixed as firm +As Delos, floating once; the rest his look +Bound with Gorgonian rigour not to move; +And with Asphaltick slime, broad as the gate, +Deep to the roots of Hell the gathered beach +They fastened, and the mole immense wrought on +Over the foaming deep high-arched, a bridge +Of length prodigious, joining to the wall +Immoveable of this now fenceless world, +Forfeit to Death; from hence a passage broad, +Smooth, easy, inoffensive, down to Hell. +So, if great things to small may be compared, +Xerxes, the liberty of Greece to yoke, +From Susa, his Memnonian palace high, +Came to the sea: and, over Hellespont +Bridging his way, Europe with Asia joined, +And scourged with many a stroke the indignant waves. +Now had they brought the work by wonderous art +Pontifical, a ridge of pendant rock, +Over the vexed abyss, following the track +Of Satan to the self-same place where he +First lighted from his wing, and landed safe +From out of Chaos, to the outside bare +Of this round world: With pins of adamant +And chains they made all fast, too fast they made +And durable! And now in little space +The confines met of empyrean Heaven, +And of this World; and, on the left hand, Hell +With long reach interposed; three several ways +In sight, to each of these three places led. +And now their way to Earth they had descried, +To Paradise first tending; when, behold! +Satan, in likeness of an Angel bright, +Betwixt the Centaur and the Scorpion steering +His zenith, while the sun in Aries rose: +Disguised he came; but those his children dear +Their parent soon discerned, though in disguise. +He, after Eve seduced, unminded slunk +Into the wood fast by; and, changing shape, +To observe the sequel, saw his guileful act +By Eve, though all unweeting, seconded +Upon her husband; saw their shame that sought +Vain covertures; but when he saw descend +The Son of God to judge them, terrified +He fled; not hoping to escape, but shun +The present; fearing, guilty, what his wrath +Might suddenly inflict; that past, returned +By night, and listening where the hapless pair +Sat in their sad discourse, and various plaint, +Thence gathered his own doom; which understood +Not instant, but of future time, with joy +And tidings fraught, to Hell he now returned; +And at the brink of Chaos, near the foot +Of this new wonderous pontifice, unhoped +Met, who to meet him came, his offspring dear. +Great joy was at their meeting, and at sight +Of that stupendious bridge his joy encreased. +Long he admiring stood, till Sin, his fair +Enchanting daughter, thus the silence broke. +O Parent, these are thy magnifick deeds, +Thy trophies! which thou viewest as not thine own; +Thou art their author, and prime architect: +For I no sooner in my heart divined, +My heart, which by a secret harmony +Still moves with thine, joined in connexion sweet, +That thou on earth hadst prospered, which thy looks +Now also evidence, but straight I felt, +Though distant from thee worlds between, yet felt, +That I must after thee, with this thy son; +Such fatal consequence unites us three! +Hell could no longer hold us in our bounds, +Nor this unvoyageable gulf obscure +Detain from following thy illustrious track. +Thou hast achieved our liberty, confined +Within Hell-gates till now; thou us impowered +To fortify thus far, and overlay, +With this portentous bridge, the dark abyss. +Thine now is all this world; thy virtue hath won +What thy hands builded not; thy wisdom gained +With odds what war hath lost, and fully avenged +Our foil in Heaven; here thou shalt monarch reign, +There didst not; there let him still victor sway, +As battle hath adjudged; from this new world +Retiring, by his own doom alienated; +And henceforth monarchy with thee divide +Of all things, parted by the empyreal bounds, +His quadrature, from thy orbicular world; +Or try thee now more dangerous to his throne. +Whom thus the Prince of darkness answered glad. +Fair Daughter, and thou Son and Grandchild both; +High proof ye now have given to be the race +Of Satan (for I glory in the name, +Antagonist of Heaven's Almighty King,) +Amply have merited of me, of all +The infernal empire, that so near Heaven's door +Triumphal with triumphal act have met, +Mine, with this glorious work; and made one realm, +Hell and this world, one realm, one continent +Of easy thorough-fare. Therefore, while I +Descend through darkness, on your road with ease, +To my associate Powers, them to acquaint +With these successes, and with them rejoice; +You two this way, among these numerous orbs, +All yours, right down to Paradise descend; +There dwell, and reign in bliss; thence on the earth +Dominion exercise and in the air, +Chiefly on Man, sole lord of all declared; +Him first make sure your thrall, and lastly kill. +My substitutes I send ye, and create +Plenipotent on earth, of matchless might +Issuing from me: on your joint vigour now +My hold of this new kingdom all depends, +Through Sin to Death exposed by my exploit. +If your joint power prevail, the affairs of Hell +No detriment need fear; go, and be strong! +So saying he dismissed them; they with speed +Their course through thickest constellations held, +Spreading their bane; the blasted stars looked wan, +And planets, planet-struck, real eclipse +Then suffered. The other way Satan went down +The causey to Hell-gate: On either side +Disparted Chaos overbuilt exclaimed, +And with rebounding surge the bars assailed, +That scorned his indignation: Through the gate, +Wide open and unguarded, Satan passed, +And all about found desolate; for those, +Appointed to sit there, had left their charge, +Flown to the upper world; the rest were all +Far to the inland retired, about the walls +Of Pandemonium; city and proud seat +Of Lucifer, so by allusion called +Of that bright star to Satan paragoned; +There kept their watch the legions, while the Grand +In council sat, solicitous what chance +Might intercept their emperour sent; so he +Departing gave command, and they observed. +As when the Tartar from his Russian foe, +By Astracan, over the snowy plains, +Retires; or Bactrin Sophi, from the horns +Of Turkish crescent, leaves all waste beyond +The realm of Aladule, in his retreat +To Tauris or Casbeen: So these, the late +Heaven-banished host, left desart utmost Hell +Many a dark league, reduced in careful watch +Round their metropolis; and now expecting +Each hour their great adventurer, from the search +Of foreign worlds: He through the midst unmarked, +In show plebeian Angel militant +Of lowest order, passed; and from the door +Of that Plutonian hall, invisible +Ascended his high throne; which, under state +Of richest texture spread, at the upper end +Was placed in regal lustre. Down a while +He sat, and round about him saw unseen: +At last, as from a cloud, his fulgent head +And shape star-bright appeared, or brighter; clad +With what permissive glory since his fall +Was left him, or false glitter: All amazed +At that so sudden blaze the Stygian throng +Bent their aspect, and whom they wished beheld, +Their mighty Chief returned: loud was the acclaim: +Forth rushed in haste the great consulting peers, +Raised from their dark Divan, and with like joy +Congratulant approached him; who with hand +Silence, and with these words attention, won. +Thrones, Dominations, Princedoms, Virtues, Powers; +For in possession such, not only of right, +I call ye, and declare ye now; returned +Successful beyond hope, to lead ye forth +Triumphant out of this infernal pit +Abominable, accursed, the house of woe, +And dungeon of our tyrant: Now possess, +As Lords, a spacious world, to our native Heaven +Little inferiour, by my adventure hard +With peril great achieved. Long were to tell +What I have done; what suffered;with what pain +Voyaged th' unreal, vast, unbounded deep +Of horrible confusion; over which +By Sin and Death a broad way now is paved, +To expedite your glorious march; but I +Toiled out my uncouth passage, forced to ride +The untractable abyss, plunged in the womb +Of unoriginal Night and Chaos wild; +That, jealous of their secrets, fiercely opposed +My journey strange, with clamorous uproar +Protesting Fate supreme; thence how I found +The new created world, which fame in Heaven +Long had foretold, a fabrick wonderful +Of absolute perfection! therein Man +Placed in a Paradise, by our exile +Made happy: Him by fraud I have seduced +From his Creator; and, the more to encrease +Your wonder, with an apple; he, thereat +Offended, worth your laughter! hath given up +Both his beloved Man, and all his world, +To Sin and Death a prey, and so to us, +Without our hazard, labour, or alarm; +To range in, and to dwell, and over Man +To rule, as over all he should have ruled. +True is, me also he hath judged, or rather +Me not, but the brute serpent in whose shape +Man I deceived: that which to me belongs, +Is enmity which he will put between +Me and mankind; I am to bruise his heel; +His seed, when is not set, shall bruise my head: +A world who would not purchase with a bruise, +Or much more grievous pain?--Ye have the account +Of my performance: What remains, ye Gods, +But up, and enter now into full bliss? +So having said, a while he stood, expecting +Their universal shout, and high applause, +To fill his ear; when, contrary, he hears +On all sides, from innumerable tongues, +A dismal universal hiss, the sound +Of publick scorn; he wondered, but not long +Had leisure, wondering at himself now more, +His visage drawn he felt to sharp and spare; +His arms clung to his ribs; his legs entwining +Each other, till supplanted down he fell +A monstrous serpent on his belly prone, +Reluctant, but in vain; a greater power +Now ruled him, punished in the shape he sinned, +According to his doom: he would have spoke, +But hiss for hiss returned with forked tongue +To forked tongue; for now were all transformed +Alike, to serpents all, as accessories +To his bold riot: Dreadful was the din +Of hissing through the hall, thick swarming now +With complicated monsters head and tail, +Scorpion, and Asp, and Amphisbaena dire, +Cerastes horned, Hydrus, and Elops drear, +And Dipsas; (not so thick swarmed once the soil +Bedropt with blood of Gorgon, or the isle +Ophiusa,) but still greatest he the midst, +Now Dragon grown, larger than whom the sun +Ingendered in the Pythian vale or slime, +Huge Python, and his power no less he seemed +Above the rest still to retain; they all +Him followed, issuing forth to the open field, +Where all yet left of that revolted rout, +Heaven-fallen, in station stood or just array; +Sublime with expectation when to see +In triumph issuing forth their glorious Chief; +They saw, but other sight instead! a croud +Of ugly serpents; horrour on them fell, +And horrid sympathy; for, what they saw, +They felt themselves, now changing; down their arms, +Down fell both spear and shield; down they as fast; +And the dire hiss renewed, and the dire form +Catched, by contagion; like in punishment, +As in their crime. Thus was the applause they meant, +Turned to exploding hiss, triumph to shame +Cast on themselves from their own mouths. There stood +A grove hard by, sprung up with this their change, +His will who reigns above, to aggravate +Their penance, laden with fair fruit, like that +Which grew in Paradise, the bait of Eve +Used by the Tempter: on that prospect strange +Their earnest eyes they fixed, imagining +For one forbidden tree a multitude +Now risen, to work them further woe or shame; +Yet, parched with scalding thirst and hunger fierce, +Though to delude them sent, could not abstain; +But on they rolled in heaps, and, up the trees +Climbing, sat thicker than the snaky locks +That curled Megaera: greedily they plucked +The fruitage fair to sight, like that which grew +Near that bituminous lake where Sodom flamed; +This more delusive, not the touch, but taste +Deceived; they, fondly thinking to allay +Their appetite with gust, instead of fruit +Chewed bitter ashes, which the offended taste +With spattering noise rejected: oft they assayed, +Hunger and thirst constraining; drugged as oft, +With hatefullest disrelish writhed their jaws, +With soot and cinders filled; so oft they fell +Into the same illusion, not as Man +Whom they triumphed once lapsed. Thus were they plagued +And worn with famine, long and ceaseless hiss, +Till their lost shape, permitted, they resumed; +Yearly enjoined, some say, to undergo, +This annual humbling certain numbered days, +To dash their pride, and joy, for Man seduced. +However, some tradition they dispersed +Among the Heathen, of their purchase got, +And fabled how the Serpent, whom they called +Ophion, with Eurynome, the wide-- +Encroaching Eve perhaps, had first the rule +Of high Olympus; thence by Saturn driven +And Ops, ere yet Dictaean Jove was born. +Mean while in Paradise the hellish pair +Too soon arrived; Sin, there in power before, +Once actual; now in body, and to dwell +Habitual habitant; behind her Death, +Close following pace for pace, not mounted yet +On his pale horse: to whom Sin thus began. +Second of Satan sprung, all-conquering Death! +What thinkest thou of our empire now, though earned +With travel difficult, not better far +Than still at Hell's dark threshold to have sat watch, +Unnamed, undreaded, and thyself half starved? +Whom thus the Sin-born monster answered soon. +To me, who with eternal famine pine, +Alike is Hell, or Paradise, or Heaven; +There best, where most with ravine I may meet; +Which here, though plenteous, all too little seems +To stuff this maw, this vast unhide-bound corps. +To whom the incestuous mother thus replied. +Thou therefore on these herbs, and fruits, and flowers, +Feed first; on each beast next, and fish, and fowl; +No homely morsels! and, whatever thing +The sithe of Time mows down, devour unspared; +Till I, in Man residing, through the race, +His thoughts, his looks, words, actions, all infect; +And season him thy last and sweetest prey. +This said, they both betook them several ways, +Both to destroy, or unimmortal make +All kinds, and for destruction to mature +Sooner or later; which the Almighty seeing, +From his transcendent seat the Saints among, +To those bright Orders uttered thus his voice. +See, with what heat these dogs of Hell advance +To waste and havock yonder world, which I +So fair and good created; and had still +Kept in that state, had not the folly of Man +Let in these wasteful furies, who impute +Folly to me; so doth the Prince of Hell +And his adherents, that with so much ease +I suffer them to enter and possess +A place so heavenly; and, conniving, seem +To gratify my scornful enemies, +That laugh, as if, transported with some fit +Of passion, I to them had quitted all, +At random yielded up to their misrule; +And know not that I called, and drew them thither, +My Hell-hounds, to lick up the draff and filth +Which Man's polluting sin with taint hath shed +On what was pure; til, crammed and gorged, nigh burst +With sucked and glutted offal, at one sling +Of thy victorious arm, well-pleasing Son, +Both Sin, and Death, and yawning Grave, at last, +Through Chaos hurled, obstruct the mouth of Hell +For ever, and seal up his ravenous jaws. +Then Heaven and Earth renewed shall be made pure +To sanctity, that shall receive no stain: +Till then, the curse pronounced on both precedes. +He ended, and the heavenly audience loud +Sung Halleluiah, as the sound of seas, +Through multitude that sung: Just are thy ways, +Righteous are thy decrees on all thy works; +Who can extenuate thee? Next, to the Son, +Destined Restorer of mankind, by whom +New Heaven and Earth shall to the ages rise, +Or down from Heaven descend.--Such was their song; +While the Creator, calling forth by name +His mighty Angels, gave them several charge, +As sorted best with present things. The sun +Had first his precept so to move, so shine, +As might affect the earth with cold and heat +Scarce tolerable; and from the north to call +Decrepit winter; from the south to bring +Solstitial summer's heat. To the blanc moon +Her office they prescribed; to the other five +Their planetary motions, and aspects, +In sextile, square, and trine, and opposite, +Of noxious efficacy, and when to join +In synod unbenign; and taught the fixed +Their influence malignant when to shower, +Which of them rising with the sun, or falling, +Should prove tempestuous: To the winds they set +Their corners, when with bluster to confound +Sea, air, and shore; the thunder when to roll +With terrour through the dark aereal hall. +Some say, he bid his Angels turn ascanse +The poles of earth, twice ten degrees and more, +From the sun's axle; they with labour pushed +Oblique the centrick globe: Some say, the sun +Was bid turn reins from the equinoctial road +Like distant breadth to Taurus with the seven +Atlantick Sisters, and the Spartan Twins, +Up to the Tropick Crab: thence down amain +By Leo, and the Virgin, and the Scales, +As deep as Capricorn; to bring in change +Of seasons to each clime; else had the spring +Perpetual smiled on earth with vernant flowers, +Equal in days and nights, except to those +Beyond the polar circles; to them day +Had unbenighted shone, while the low sun, +To recompense his distance, in their sight +Had rounded still the horizon, and not known +Or east or west; which had forbid the snow +From cold Estotiland, and south as far +Beneath Magellan. At that tasted fruit +The sun, as from Thyestean banquet, turned +His course intended; else, how had the world +Inhabited, though sinless, more than now, +Avoided pinching cold and scorching heat? +These changes in the Heavens, though slow, produced +Like change on sea and land; sideral blast, +Vapour, and mist, and exhalation hot, +Corrupt and pestilent: Now from the north +Of Norumbega, and the Samoed shore, +Bursting their brazen dungeon, armed with ice, +And snow, and hail, and stormy gust and flaw, +Boreas, and Caecias, and Argestes loud, +And Thrascias, rend the woods, and seas upturn; +With adverse blast upturns them from the south +Notus, and Afer black with thunderous clouds +From Serraliona; thwart of these, as fierce, +Forth rush the Levant and the Ponent winds, +Eurus and Zephyr, with their lateral noise, +Sirocco and Libecchio. Thus began +Outrage from lifeless things; but Discord first, +Daughter of Sin, among the irrational +Death introduced, through fierce antipathy: +Beast now with beast 'gan war, and fowl with fowl, +And fish with fish; to graze the herb all leaving, +Devoured each other; nor stood much in awe +Of Man, but fled him; or, with countenance grim, +Glared on him passing. These were from without +The growing miseries, which Adam saw +Already in part, though hid in gloomiest shade, +To sorrow abandoned, but worse felt within; +And, in a troubled sea of passion tost, +Thus to disburden sought with sad complaint. +O miserable of happy! Is this the end +Of this new glorious world, and me so late +The glory of that glory, who now become +Accursed, of blessed? hide me from the face +Of God, whom to behold was then my highth +Of happiness!--Yet well, if here would end +The misery; I deserved it, and would bear +My own deservings; but this will not serve: +All that I eat or drink, or shall beget, +Is propagated curse. O voice, once heard +Delightfully, Encrease and multiply; +Now death to hear! for what can I encrease, +Or multiply, but curses on my head? +Who of all ages to succeed, but, feeling +The evil on him brought by me, will curse +My head? Ill fare our ancestor impure, +For this we may thank Adam! but his thanks +Shall be the execration: so, besides +Mine own that bide upon me, all from me +Shall with a fierce reflux on me rebound; +On me, as on their natural center, light +Heavy, though in their place. O fleeting joys +Of Paradise, dear bought with lasting woes! +Did I request thee, Maker, from my clay +To mould me Man? did I solicit thee +From darkness to promote me, or here place +In this delicious garden? As my will +Concurred not to my being, it were but right +And equal to reduce me to my dust; +Desirous to resign and render back +All I received; unable to perform +Thy terms too hard, by which I was to hold +The good I sought not. To the loss of that, +Sufficient penalty, why hast thou added +The sense of endless woes? Inexplicable +Why am I mocked with death, and lengthened out +To deathless pain? How gladly would I meet +Mortality my sentence, and be earth +Insensible! How glad would lay me down +As in my mother's lap! There I should rest, +And sleep secure; his dreadful voice no more +Would thunder in my ears; no fear of worse +To me, and to my offspring, would torment me +With cruel expectation. Yet one doubt +Pursues me still, lest all I cannot die; +Lest that pure breath of life, the spirit of Man +Which God inspired, cannot together perish +With this corporeal clod; then, in the grave, +Or in some other dismal place, who knows +But I shall die a living death? O thought +Horrid, if true! Yet why? It was but breath +Of life that sinned; what dies but what had life +And sin? The body properly had neither, +All of me then shall die: let this appease +The doubt, since human reach no further knows. +For though the Lord of all be infinite, +Is his wrath also? Be it, Man is not so, +But mortal doomed. How can he exercise +Wrath without end on Man, whom death must end? +Can he make deathless death? That were to make +Strange contradiction, which to God himself +Impossible is held; as argument +Of weakness, not of power. Will he draw out, +For anger's sake, finite to infinite, +In punished Man, to satisfy his rigour, +Satisfied never? That were to extend +His sentence beyond dust and Nature's law; +By which all causes else, according still +To the reception of their matter, act; +Not to the extent of their own sphere. But say +That death be not one stroke, as I supposed, +Bereaving sense, but endless misery +From this day onward; which I feel begun +Both in me, and without me; and so last +To perpetuity;--Ay me!that fear +Comes thundering back with dreadful revolution +On my defenceless head; both Death and I +Am found eternal, and incorporate both; +Nor I on my part single; in me all +Posterity stands cursed: Fair patrimony +That I must leave ye, Sons! O, were I able +To waste it all myself, and leave ye none! +So disinherited, how would you bless +Me, now your curse! Ah, why should all mankind, +For one man's fault, thus guiltless be condemned, +It guiltless? But from me what can proceed, +But all corrupt; both mind and will depraved +Not to do only, but to will the same +With me? How can they then acquitted stand +In sight of God? Him, after all disputes, +Forced I absolve: all my evasions vain, +And reasonings, though through mazes, lead me still +But to my own conviction: first and last +On me, me only, as the source and spring +Of all corruption, all the blame lights due; +So might the wrath! Fond wish!couldst thou support +That burden, heavier than the earth to bear; +Than all the world much heavier, though divided +With that bad Woman? Thus, what thou desirest, +And what thou fearest, alike destroys all hope +Of refuge, and concludes thee miserable +Beyond all past example and future; +To Satan only like both crime and doom. +O Conscience! into what abyss of fears +And horrours hast thou driven me; out of which +I find no way, from deep to deeper plunged! +Thus Adam to himself lamented loud, +Through the still night; not now, as ere Man fell, +Wholesome, and cool, and mild, but with black air +Accompanied; with damps, and dreadful gloom; +Which to his evil conscience represented +All things with double terrour: On the ground +Outstretched he lay, on the cold ground; and oft +Cursed his creation; Death as oft accused +Of tardy execution, since denounced +The day of his offence. Why comes not Death, +Said he, with one thrice-acceptable stroke +To end me? Shall Truth fail to keep her word, +Justice Divine not hasten to be just? +But Death comes not at call; Justice Divine +Mends not her slowest pace for prayers or cries, +O woods, O fountains, hillocks, dales, and bowers! +With other echo late I taught your shades +To answer, and resound far other song.-- +Whom thus afflicted when sad Eve beheld, +Desolate where she sat, approaching nigh, +Soft words to his fierce passion she assayed: +But her with stern regard he thus repelled. +Out of my sight, thou Serpent! That name best +Befits thee with him leagued, thyself as false +And hateful; nothing wants, but that thy shape, +Like his, and colour serpentine, may show +Thy inward fraud; to warn all creatures from thee +Henceforth; lest that too heavenly form, pretended +To hellish falshood, snare them! But for thee +I had persisted happy; had not thy pride +And wandering vanity, when least was safe, +Rejected my forewarning, and disdained +Not to be trusted; longing to be seen, +Though by the Devil himself; him overweening +To over-reach; but, with the serpent meeting, +Fooled and beguiled; by him thou, I by thee +To trust thee from my side; imagined wise, +Constant, mature, proof against all assaults; +And understood not all was but a show, +Rather than solid virtue; all but a rib +Crooked by nature, bent, as now appears, +More to the part sinister, from me drawn; +Well if thrown out, as supernumerary +To my just number found. O! why did God, +Creator wise, that peopled highest Heaven +With Spirits masculine, create at last +This novelty on earth, this fair defect +Of nature, and not fill the world at once +With Men, as Angels, without feminine; +Or find some other way to generate +Mankind? This mischief had not been befallen, +And more that shall befall; innumerable +Disturbances on earth through female snares, +And strait conjunction with this sex: for either +He never shall find out fit mate, but such +As some misfortune brings him, or mistake; +Or whom he wishes most shall seldom gain +Through her perverseness, but shall see her gained +By a far worse; or, if she love, withheld +By parents; or his happiest choice too late +Shall meet, already linked and wedlock-bound +To a fell adversary, his hate or shame: +Which infinite calamity shall cause +To human life, and houshold peace confound. +He added not, and from her turned; but Eve, +Not so repulsed, with tears that ceased not flowing +And tresses all disordered, at his feet +Fell humble; and, embracing them, besought +His peace, and thus proceeded in her plaint. +Forsake me not thus, Adam! witness Heaven +What love sincere, and reverence in my heart +I bear thee, and unweeting have offended, +Unhappily deceived! Thy suppliant +I beg, and clasp thy knees; bereave me not, +Whereon I live, thy gentle looks, thy aid, +Thy counsel, in this uttermost distress, +My only strength and stay: Forlorn of thee, +Whither shall I betake me, where subsist? +While yet we live, scarce one short hour perhaps, +Between us two let there be peace; both joining, +As joined in injuries, one enmity +Against a foe by doom express assigned us, +That cruel Serpent: On me exercise not +Thy hatred for this misery befallen; +On me already lost, me than thyself +More miserable! Both have sinned;but thou +Against God only; I against God and thee; +And to the place of judgement will return, +There with my cries importune Heaven; that all +The sentence, from thy head removed, may light +On me, sole cause to thee of all this woe; +Me, me only, just object of his ire! +She ended weeping; and her lowly plight, +Immoveable, till peace obtained from fault +Acknowledged and deplored, in Adam wrought +Commiseration: Soon his heart relented +Towards her, his life so late, and sole delight, +Now at his feet submissive in distress; +Creature so fair his reconcilement seeking, +His counsel, whom she had displeased, his aid: +As one disarmed, his anger all he lost, +And thus with peaceful words upraised her soon. +Unwary, and too desirous, as before, +So now of what thou knowest not, who desirest +The punishment all on thyself; alas! +Bear thine own first, ill able to sustain +His full wrath, whose thou feelest as yet least part, +And my displeasure bearest so ill. If prayers +Could alter high decrees, I to that place +Would speed before thee, and be louder heard, +That on my head all might be visited; +Thy frailty and infirmer sex forgiven, +To me committed, and by me exposed. +But rise;--let us no more contend, nor blame +Each other, blamed enough elsewhere; but strive +In offices of love, how we may lighten +Each other's burden, in our share of woe; +Since this day's death denounced, if aught I see, +Will prove no sudden, but a slow-paced evil; +A long day's dying, to augment our pain; +And to our seed (O hapless seed!) derived. +To whom thus Eve, recovering heart, replied. +Adam, by sad experiment I know +How little weight my words with thee can find, +Found so erroneous; thence by just event +Found so unfortunate: Nevertheless, +Restored by thee, vile as I am, to place +Of new acceptance, hopeful to regain +Thy love, the sole contentment of my heart +Living or dying, from thee I will not hide +What thoughts in my unquiet breast are risen, +Tending to some relief of our extremes, +Or end; though sharp and sad, yet tolerable, +As in our evils, and of easier choice. +If care of our descent perplex us most, +Which must be born to certain woe, devoured +By Death at last; and miserable it is +To be to others cause of misery, +Our own begotten, and of our loins to bring +Into this cursed world a woeful race, +That after wretched life must be at last +Food for so foul a monster; in thy power +It lies, yet ere conception to prevent +The race unblest, to being yet unbegot. +Childless thou art, childless remain: so Death +Shall be deceived his glut, and with us two +Be forced to satisfy his ravenous maw. +But if thou judge it hard and difficult, +Conversing, looking, loving, to abstain +From love's due rights, nuptial embraces sweet; +And with desire to languish without hope, +Before the present object languishing +With like desire; which would be misery +And torment less than none of what we dread; +Then, both ourselves and seed at once to free +From what we fear for both, let us make short, -- +Let us seek Death; -- or, he not found, supply +With our own hands his office on ourselves: +Why stand we longer shivering under fears, +That show no end but death, and have the power, +Of many ways to die the shortest choosing, +Destruction with destruction to destroy? -- +She ended here, or vehement despair +Broke off the rest: so much of death her thoughts +Had entertained, as dyed her cheeks with pale. +But Adam, with such counsel nothing swayed, +To better hopes his more attentive mind +Labouring had raised; and thus to Eve replied. +Eve, thy contempt of life and pleasure seems +To argue in thee something more sublime +And excellent, than what thy mind contemns; +But self-destruction therefore sought, refutes +That excellence thought in thee; and implies, +Not thy contempt, but anguish and regret +For loss of life and pleasure overloved. +Or if thou covet death, as utmost end +Of misery, so thinking to evade +The penalty pronounced; doubt not but God +Hath wiselier armed his vengeful ire, than so +To be forestalled; much more I fear lest death, +So snatched, will not exempt us from the pain +We are by doom to pay; rather, such acts +Of contumacy will provoke the Highest +To make death in us live: Then let us seek +Some safer resolution, which methinks +I have in view, calling to mind with heed +Part of our sentence, that thy seed shall bruise +The Serpent's head; piteous amends! unless +Be meant, whom I conjecture, our grand foe, +Satan; who, in the serpent, hath contrived +Against us this deceit: To crush his head +Would be revenge indeed! which will be lost +By death brought on ourselves, or childless days +Resolved, as thou proposest; so our foe +Shal 'scape his punishment ordained, and we +Instead shall double ours upon our heads. +No more be mentioned then of violence +Against ourselves; and wilful barrenness, +That cuts us off from hope; and savours only +Rancour and pride, impatience and despite, +Reluctance against God and his just yoke +Laid on our necks. Remember with what mild +And gracious temper he both heard, and judged, +Without wrath or reviling; we expected +Immediate dissolution, which we thought +Was meant by death that day; when lo!to thee +Pains only in child-bearing were foretold, +And bringing forth; soon recompensed with joy, +Fruit of thy womb: On me the curse aslope +Glanced on the ground; with labour I must earn +My bread; what harm? Idleness had been worse; +My labour will sustain me; and, lest cold +Or heat should injure us, his timely care +Hath, unbesought, provided; and his hands +Clothed us unworthy, pitying while he judged; +How much more, if we pray him, will his ear +Be open, and his heart to pity incline, +And teach us further by what means to shun +The inclement seasons, rain, ice, hail, and snow! +Which now the sky, with various face, begins +To show us in this mountain; while the winds +Blow moist and keen, shattering the graceful locks +Of these fair spreading trees; which bids us seek +Some better shroud, some better warmth to cherish +Our limbs benummed, ere this diurnal star +Leave cold the night, how we his gathered beams +Reflected may with matter sere foment; +Or, by collision of two bodies, grind +The air attrite to fire; as late the clouds +Justling, or pushed with winds, rude in their shock, +Tine the slant lightning; whose thwart flame, driven down +Kindles the gummy bark of fir or pine; +And sends a comfortable heat from far, +Which might supply the sun: Such fire to use, +And what may else be remedy or cure +To evils which our own misdeeds have wrought, +He will instruct us praying, and of grace +Beseeching him; so as we need not fear +To pass commodiously this life, sustained +By him with many comforts, till we end +In dust, our final rest and native home. +What better can we do, than, to the place +Repairing where he judged us, prostrate fall +Before him reverent; and there confess +Humbly our faults, and pardon beg; with tears +Watering the ground, and with our sighs the air +Frequenting, sent from hearts contrite, in sign +Of sorrow unfeigned, and humiliation meek + + + +Book XI + + +Undoubtedly he will relent, and turn +From his displeasure; in whose look serene, +When angry most he seemed and most severe, +What else but favour, grace, and mercy, shone? +So spake our father penitent; nor Eve +Felt less remorse: they, forthwith to the place +Repairing where he judged them, prostrate fell +Before him reverent; and both confessed +Humbly their faults, and pardon begged; with tears +Watering the ground, and with their sighs the air +Frequenting, sent from hearts contrite, in sign +Of sorrow unfeigned, and humiliation meek. +Thus they, in lowliest plight, repentant stood +Praying; for from the mercy-seat above +Prevenient grace descending had removed +The stony from their hearts, and made new flesh +Regenerate grow instead; that sighs now breathed +Unutterable; which the Spirit of prayer +Inspired, and winged for Heaven with speedier flight +Than loudest oratory: Yet their port +Not of mean suitors; nor important less +Seemed their petition, than when the ancient pair +In fables old, less ancient yet than these, +Deucalion and chaste Pyrrha, to restore +The race of mankind drowned, before the shrine +Of Themis stood devout. To Heaven their prayers +Flew up, nor missed the way, by envious winds +Blown vagabond or frustrate: in they passed +Dimensionless through heavenly doors; then clad +With incense, where the golden altar fumed, +By their great intercessour, came in sight +Before the Father's throne: them the glad Son +Presenting, thus to intercede began. +See$ Father, what first-fruits on earth are sprung +From thy implanted grace in Man; these sighs +And prayers, which in this golden censer mixed +With incense, I thy priest before thee bring; +Fruits of more pleasing savour, from thy seed +Sown with contrition in his heart, than those +Which, his own hand manuring, all the trees +Of Paradise could have produced, ere fallen +From innocence. Now therefore, bend thine ear +To supplication; hear his sighs, though mute; +Unskilful with what words to pray, let me +Interpret for him; me, his advocate +And propitiation; all his works on me, +Good, or not good, ingraft; my merit those +Shall perfect, and for these my death shall pay. +Accept me; and, in me, from these receive +The smell of peace toward mankind: let him live +Before thee reconciled, at least his days +Numbered, though sad; till death, his doom, (which I +To mitigate thus plead, not to reverse,) +To better life shall yield him: where with me +All my redeemed may dwell in joy and bliss; +Made one with me, as I with thee am one. +To whom the Father, without cloud, serene. +All thy request for Man, accepted Son, +Obtain; all thy request was my decree: +But, longer in that Paradise to dwell, +The law I gave to Nature him forbids: +Those pure immortal elements, that know, +No gross, no unharmonious mixture foul, +Eject him, tainted now; and purge him off, +As a distemper, gross, to air as gross, +And mortal food; as may dispose him best +For dissolution wrought by sin, that first +Distempered all things, and of incorrupt +Corrupted. I, at first, with two fair gifts +Created him endowed; with happiness, +And immortality: that fondly lost, +This other served but to eternize woe; +Till I provided death: so death becomes +His final remedy; and, after life, +Tried in sharp tribulation, and refined +By faith and faithful works, to second life, +Waked in the renovation of the just, +Resigns him up with Heaven and Earth renewed. +But let us call to synod all the Blest, +Through Heaven's wide bounds: from them I will not hide +My judgements; how with mankind I proceed, +As how with peccant Angels late they saw, +And in their state, though firm, stood more confirmed. +He ended, and the Son gave signal high +To the bright minister that watched; he blew +His trumpet, heard in Oreb since perhaps +When God descended, and perhaps once more +To sound at general doom. The angelick blast +Filled all the regions: from their blisful bowers +Of amarantine shade, fountain or spring, +By the waters of life, where'er they sat +In fellowships of joy, the sons of light +Hasted, resorting to the summons high; +And took their seats; till from his throne supreme +The Almighty thus pronounced his sovran will. +O Sons, like one of us Man is become +To know both good and evil, since his taste +Of that defended fruit; but let him boast +His knowledge of good lost, and evil got; +Happier! had it sufficed him to have known +Good by itself, and evil not at all. +He sorrows now, repents, and prays contrite, +My motions in him; longer than they move, +His heart I know, how variable and vain, +Self-left. Lest therefore his now bolder hand +Reach also of the tree of life, and eat, +And live for ever, dream at least to live +For ever, to remove him I decree, +And send him from the garden forth to till +The ground whence he was taken, fitter soil. +Michael, this my behest have thou in charge; +Take to thee from among the Cherubim +Thy choice of flaming warriours, lest the Fiend, +Or in behalf of Man, or to invade +Vacant possession, some new trouble raise: +Haste thee, and from the Paradise of God +Without remorse drive out the sinful pair; +From hallowed ground the unholy; and denounce +To them, and to their progeny, from thence +Perpetual banishment. Yet, lest they faint +At the sad sentence rigorously urged, +(For I behold them softened, and with tears +Bewailing their excess,) all terrour hide. +If patiently thy bidding they obey, +Dismiss them not disconsolate; reveal +To Adam what shall come in future days, +As I shall thee enlighten; intermix +My covenant in the Woman's seed renewed; +So send them forth, though sorrowing, yet in peace: +And on the east side of the garden place, +Where entrance up from Eden easiest climbs, +Cherubick watch; and of a sword the flame +Wide-waving; all approach far off to fright, +And guard all passage to the tree of life: +Lest Paradise a receptacle prove +To Spirits foul, and all my trees their prey; +With whose stolen fruit Man once more to delude. +He ceased; and the arch-angelick Power prepared +For swift descent; with him the cohort bright +Of watchful Cherubim: four faces each +Had, like a double Janus; all their shape +Spangled with eyes more numerous than those +Of Argus, and more wakeful than to drouse, +Charmed with Arcadian pipe, the pastoral reed +Of Hermes, or his opiate rod. Mean while, +To re-salute the world with sacred light, +Leucothea waked; and with fresh dews imbalmed +The earth; when Adam and first matron Eve +Had ended now their orisons, and found +Strength added from above; new hope to spring +Out of despair; joy, but with fear yet linked; +Which thus to Eve his welcome words renewed. +Eve, easily my faith admit, that all +The good which we enjoy from Heaven descends; +But, that from us aught should ascend to Heaven +So prevalent as to concern the mind +Of God high-blest, or to incline his will, +Hard to belief may seem; yet this will prayer +Or one short sigh of human breath, upborne +Even to the seat of God. For since I sought +By prayer the offended Deity to appease; +Kneeled, and before him humbled all my heart; +Methought I saw him placable and mild, +Bending his ear; persuasion in me grew +That I was heard with favour; peace returned +Home to my breast, and to my memory +His promise, that thy seed shall bruise our foe; +Which, then not minded in dismay, yet now +Assures me that the bitterness of death +Is past, and we shall live. Whence hail to thee, +Eve rightly called, mother of all mankind, +Mother of all things living, since by thee +Man is to live; and all things live for Man. +To whom thus Eve with sad demeanour meek. +Ill-worthy I such title should belong +To me transgressour; who, for thee ordained +A help, became thy snare; to me reproach +Rather belongs, distrust, and all dispraise: +But infinite in pardon was my Judge, +That I, who first brought death on all, am graced +The source of life; next favourable thou, +Who highly thus to entitle me vouchsaf'st, +Far other name deserving. But the field +To labour calls us, now with sweat imposed, +Though after sleepless night; for see!the morn, +All unconcerned with our unrest, begins +Her rosy progress smiling: let us forth; +I never from thy side henceforth to stray, +Where'er our day's work lies, though now enjoined +Laborious, till day droop; while here we dwell, +What can be toilsome in these pleasant walks? +Here let us live, though in fallen state, content. +So spake, so wished much humbled Eve; but Fate +Subscribed not: Nature first gave signs, impressed +On bird, beast, air; air suddenly eclipsed, +After short blush of morn; nigh in her sight +The bird of Jove, stooped from his aery tour, +Two birds of gayest plume before him drove; +Down from a hill the beast that reigns in woods, +First hunter then, pursued a gentle brace, +Goodliest of all the forest, hart and hind; +Direct to the eastern gate was bent their flight. +Adam observed, and with his eye the chase +Pursuing, not unmoved, to Eve thus spake. +O Eve, some further change awaits us nigh, +Which Heaven, by these mute signs in Nature, shows +Forerunners of his purpose; or to warn +Us, haply too secure, of our discharge +From penalty, because from death released +Some days: how long, and what till then our life, +Who knows? or more than this, that we are dust, +And thither must return, and be no more? +Why else this double object in our sight +Of flight pursued in the air, and o'er the ground, +One way the self-same hour? why in the east +Darkness ere day's mid-course, and morning-light +More orient in yon western cloud, that draws +O'er the blue firmament a radiant white, +And slow descends with something heavenly fraught? +He erred not; for by this the heavenly bands +Down from a sky of jasper lighted now +In Paradise, and on a hill made halt; +A glorious apparition, had not doubt +And carnal fear that day dimmed Adam's eye. +Not that more glorious, when the Angels met +Jacob in Mahanaim, where he saw +The field pavilioned with his guardians bright; +Nor that, which on the flaming mount appeared +In Dothan, covered with a camp of fire, +Against the Syrian king, who to surprise +One man, assassin-like, had levied war, +War unproclaimed. The princely Hierarch +In their bright stand there left his Powers, to seise +Possession of the garden; he alone, +To find where Adam sheltered, took his way, +Not unperceived of Adam; who to Eve, +While the great visitant approached, thus spake. +Eve$ now expect great tidings, which perhaps +Of us will soon determine, or impose +New laws to be observed; for I descry, +From yonder blazing cloud that veils the hill, +One of the heavenly host; and, by his gait, +None of the meanest; some great Potentate +Or of the Thrones above; such majesty +Invests him coming! yet not terrible, +That I should fear; nor sociably mild, +As Raphael, that I should much confide; +But solemn and sublime; whom not to offend, +With reverence I must meet, and thou retire. +He ended: and the Arch-Angel soon drew nigh, +Not in his shape celestial, but as man +Clad to meet man; over his lucid arms +A military vest of purple flowed, +Livelier than Meliboean, or the grain +Of Sarra, worn by kings and heroes old +In time of truce; Iris had dipt the woof; +His starry helm unbuckled showed him prime +In manhood where youth ended; by his side, +As in a glistering zodiack, hung the sword, +Satan's dire dread; and in his hand the spear. +Adam bowed low; he, kingly, from his state +Inclined not, but his coming thus declared. +Adam, Heaven's high behest no preface needs: +Sufficient that thy prayers are heard; and Death, +Then due by sentence when thou didst transgress, +Defeated of his seisure many days +Given thee of grace; wherein thou mayest repent, +And one bad act with many deeds well done +Mayest cover: Well may then thy Lord, appeased, +Redeem thee quite from Death's rapacious claim; +But longer in this Paradise to dwell +Permits not: to remove thee I am come, +And send thee from the garden forth to till +The ground whence thou wast taken, fitter soil. +He added not; for Adam at the news +Heart-struck with chilling gripe of sorrow stood, +That all his senses bound; Eve, who unseen +Yet all had heard, with audible lament +Discovered soon the place of her retire. +O unexpected stroke, worse than of Death! +Must I thus leave thee$ Paradise? thus leave +Thee, native soil! these happy walks and shades, +Fit haunt of Gods? where I had hope to spend, +Quiet though sad, the respite of that day +That must be mortal to us both. O flowers, +That never will in other climate grow, +My early visitation, and my last + ;t even, which I bred up with tender hand +From the first opening bud, and gave ye names! +Who now shall rear ye to the sun, or rank +Your tribes, and water from the ambrosial fount? +Thee lastly, nuptial bower! by me adorned +With what to sight or smell was sweet! from thee +How shall I part, and whither wander down +Into a lower world; to this obscure +And wild? how shall we breathe in other air +Less pure, accustomed to immortal fruits? +Whom thus the Angel interrupted mild. +Lament not, Eve, but patiently resign +What justly thou hast lost, nor set thy heart, +Thus over-fond, on that which is not thine: +Thy going is not lonely; with thee goes +Thy husband; whom to follow thou art bound; +Where he abides, think there thy native soil. +Adam, by this from the cold sudden damp +Recovering, and his scattered spirits returned, +To Michael thus his humble words addressed. +Celestial, whether among the Thrones, or named +Of them the highest; for such of shape may seem +Prince above princes! gently hast thou told +Thy message, which might else in telling wound, +And in performing end us; what besides +Of sorrow, and dejection, and despair, +Our frailty can sustain, thy tidings bring, +Departure from this happy place, our sweet +Recess, and only consolation left +Familiar to our eyes! all places else +Inhospitable appear, and desolate; +Nor knowing us, nor known: And, if by prayer +Incessant I could hope to change the will +Of Him who all things can, I would not cease +To weary him with my assiduous cries: +But prayer against his absolute decree +No more avails than breath against the wind, +Blown stifling back on him that breathes it forth: +Therefore to his great bidding I submit. +This most afflicts me, that, departing hence, +As from his face I shall be hid, deprived +His blessed countenance: Here I could frequent +With worship place by place where he vouchsafed +Presence Divine; and to my sons relate, +'On this mount he appeared; under this tree +'Stood visible; among these pines his voice +'I heard; here with him at this fountain talked: +So many grateful altars I would rear +Of grassy turf, and pile up every stone +Of lustre from the brook, in memory, +Or monument to ages; and theron +Offer sweet-smelling gums, and fruits, and flowers: +In yonder nether world where shall I seek +His bright appearances, or foot-step trace? +For though I fled him angry, yet recalled +To life prolonged and promised race, I now +Gladly behold though but his utmost skirts +Of glory; and far off his steps adore. +To whom thus Michael with regard benign. +Adam, thou knowest Heaven his, and all the Earth; +Not this rock only; his Omnipresence fills +Land, sea, and air, and every kind that lives, +Fomented by his virtual power and warmed: +All the earth he gave thee to possess and rule, +No despicable gift; surmise not then +His presence to these narrow bounds confined +Of Paradise, or Eden: this had been +Perhaps thy capital seat, from whence had spread +All generations; and had hither come +From all the ends of the earth, to celebrate +And reverence thee, their great progenitor. +But this pre-eminence thou hast lost, brought down +To dwell on even ground now with thy sons: +Yet doubt not but in valley, and in plain, +God is, as here; and will be found alike +Present; and of his presence many a sign +Still following thee, still compassing thee round +With goodness and paternal love, his face +Express, and of his steps the track divine. +Which that thou mayest believe, and be confirmed +Ere thou from hence depart; know, I am sent +To show thee what shall come in future days +To thee, and to thy offspring: good with bad +Expect to hear; supernal grace contending +With sinfulness of men; thereby to learn +True patience, and to temper joy with fear +And pious sorrow; equally inured +By moderation either state to bear, +Prosperous or adverse: so shalt thou lead +Safest thy life, and best prepared endure +Thy mortal passage when it comes.--Ascend +This hill; let Eve (for I have drenched her eyes) +Here sleep below; while thou to foresight wakest; +As once thou sleptst, while she to life was formed. +To whom thus Adam gratefully replied. +Ascend, I follow thee, safe Guide, the path +Thou leadest me; and to the hand of Heaven submit, +However chastening; to the evil turn +My obvious breast; arming to overcome +By suffering, and earn rest from labour won, +If so I may attain. -- So both ascend +In the visions of God. It was a hill, +Of Paradise the highest; from whose top +The hemisphere of earth, in clearest ken, +Stretched out to the amplest reach of prospect lay. +Not higher that hill, nor wider looking round, +Whereon, for different cause, the Tempter set +Our second Adam, in the wilderness; +To show him all Earth's kingdoms, and their glory. +His eye might there command wherever stood +City of old or modern fame, the seat +Of mightiest empire, from the destined walls +Of Cambalu, seat of Cathaian Can, +And Samarchand by Oxus, Temir's throne, +To Paquin of Sinaean kings; and thence +To Agra and Lahor of great Mogul, +Down to the golden Chersonese; or where +The Persian in Ecbatan sat, or since +In Hispahan; or where the Russian Ksar +In Mosco; or the Sultan in Bizance, +Turchestan-born; nor could his eye not ken +The empire of Negus to his utmost port +Ercoco, and the less maritim kings +Mombaza, and Quiloa, and Melind, +And Sofala, thought Ophir, to the realm +Of Congo, and Angola farthest south; +Or thence from Niger flood to Atlas mount +The kingdoms of Almansor, Fez and Sus, +Morocco, and Algiers, and Tremisen; +On Europe thence, and where Rome was to sway +The world: in spirit perhaps he also saw +Rich Mexico, the seat of Montezume, +And Cusco in Peru, the richer seat +Of Atabalipa; and yet unspoiled +Guiana, whose great city Geryon's sons +Call El Dorado. But to nobler sights +Michael from Adam's eyes the film removed, +Which that false fruit that promised clearer sight +Had bred; then purged with euphrasy and rue +The visual nerve, for he had much to see; +And from the well of life three drops instilled. +So deep the power of these ingredients pierced, +Even to the inmost seat of mental sight, +That Adam, now enforced to close his eyes, +Sunk down, and all his spirits became entranced; +But him the gentle Angel by the hand +Soon raised, and his attention thus recalled. +Adam, now ope thine eyes; and first behold +The effects, which thy original crime hath wrought +In some to spring from thee; who never touched +The excepted tree; nor with the snake conspired; +Nor sinned thy sin; yet from that sin derive +Corruption, to bring forth more violent deeds. +His eyes he opened, and beheld a field, +Part arable and tilth, whereon were sheaves +New reaped; the other part sheep-walks and folds; +I' the midst an altar as the land-mark stood, +Rustick, of grassy sord; thither anon +A sweaty reaper from his tillage brought +First fruits, the green ear, and the yellow sheaf, +Unculled, as came to hand; a shepherd next, +More meek, came with the firstlings of his flock, +Choicest and best; then, sacrificing, laid +The inwards and their fat, with incense strowed, +On the cleft wood, and all due rights performed: +His offering soon propitious fire from Heaven +Consumed with nimble glance, and grateful steam; +The other's not, for his was not sincere; +Whereat he inly raged, and, as they talked, +Smote him into the midriff with a stone +That beat out life; he fell;and, deadly pale, +Groaned out his soul with gushing blood effused. +Much at that sight was Adam in his heart +Dismayed, and thus in haste to the Angel cried. +O Teacher, some great mischief hath befallen +To that meek man, who well had sacrificed; +Is piety thus and pure devotion paid? +To whom Michael thus, he also moved, replied. +These two are brethren, Adam, and to come +Out of thy loins; the unjust the just hath slain, +For envy that his brother's offering found +From Heaven acceptance; but the bloody fact +Will be avenged; and the other's faith, approved, +Lose no reward; though here thou see him die, +Rolling in dust and gore. To which our sire. +Alas! both for the deed, and for the cause! +But have I now seen Death? Is this the way +I must return to native dust? O sight +Of terrour, foul and ugly to behold, +Horrid to think, how horrible to feel! +To whom thus Michael. Death thou hast seen +In his first shape on Man; but many shapes +Of Death, and many are the ways that lead +To his grim cave, all dismal; yet to sense +More terrible at the entrance, than within. +Some, as thou sawest, by violent stroke shall die; +By fire, flood, famine, by intemperance more +In meats and drinks, which on the earth shall bring +Diseases dire, of which a monstrous crew +Before thee shall appear; that thou mayest know +What misery the inabstinence of Eve +Shall bring on Men. Immediately a place +Before his eyes appeared, sad, noisome, dark; +A lazar-house it seemed; wherein were laid +Numbers of all diseased; all maladies +Of ghastly spasm, or racking torture, qualms +Of heart-sick agony, all feverous kinds, +Convulsions, epilepsies, fierce catarrhs, +Intestine stone and ulcer, colick-pangs, +Demoniack phrenzy, moaping melancholy, +And moon-struck madness, pining atrophy, +Marasmus, and wide-wasting pestilence, +Dropsies, and asthmas, and joint-racking rheums. +Dire was the tossing, deep the groans; Despair +Tended the sick busiest from couch to couch; +And over them triumphant Death his dart +Shook, but delayed to strike, though oft invoked +With vows, as their chief good, and final hope. +Sight so deform what heart of rock could long +Dry-eyed behold? Adam could not, but wept, +Though not of woman born; compassion quelled +His best of man, and gave him up to tears +A space, till firmer thoughts restrained excess; +And, scarce recovering words, his plaint renewed. +O miserable mankind, to what fall +Degraded, to what wretched state reserved! +Better end here unborn. Why is life given +To be thus wrested from us? rather, why +Obtruded on us thus? who, if we knew +What we receive, would either no accept +Life offered, or soon beg to lay it down; +Glad to be so dismissed in peace. Can thus +The image of God in Man, created once +So goodly and erect, though faulty since, +To such unsightly sufferings be debased +Under inhuman pains? Why should not Man, +Retaining still divine similitude +In part, from such deformities be free, +And, for his Maker's image sake, exempt? +Their Maker's image, answered Michael, then +Forsook them, when themselves they vilified +To serve ungoverned Appetite; and took +His image whom they served, a brutish vice, +Inductive mainly to the sin of Eve. +Therefore so abject is their punishment, +Disfiguring not God's likeness, but their own; +Or if his likeness, by themselves defaced; +While they pervert pure Nature's healthful rules +To loathsome sickness; worthily, since they +God's image did not reverence in themselves. +I yield it just, said Adam, and submit. +But is there yet no other way, besides +These painful passages, how we may come +To death, and mix with our connatural dust? +There is, said Michael, if thou well observe +The rule of Not too much; by temperance taught, +In what thou eatest and drinkest; seeking from thence +Due nourishment, not gluttonous delight, +Till many years over thy head return: +So mayest thou live; till, like ripe fruit, thou drop +Into thy mother's lap; or be with ease +Gathered, nor harshly plucked; for death mature: +This is Old Age; but then, thou must outlive +Thy youth, thy strength, thy beauty; which will change +To withered, weak, and gray; thy senses then, +Obtuse, all taste of pleasure must forego, +To what thou hast; and, for the air of youth, +Hopeful and cheerful, in thy blood will reign +A melancholy damp of cold and dry +To weigh thy spirits down, and last consume +The balm of life. To whom our ancestor. +Henceforth I fly not death, nor would prolong +Life much; bent rather, how I may be quit, +Fairest and easiest, of this cumbrous charge; +Which I must keep till my appointed day +Of rendering up, and patiently attend +My dissolution. Michael replied. +Nor love thy life, nor hate; but what thou livest +Live well; how long, or short, permit to Heaven: +And now prepare thee for another sight. +He looked, and saw a spacious plain, whereon +Were tents of various hue; by some, were herds +Of cattle grazing; others, whence the sound +Of instruments, that made melodious chime, +Was heard, of harp and organ; and, who moved +Their stops and chords, was seen; his volant touch, +Instinct through all proportions, low and high, +Fled and pursued transverse the resonant fugue. +In other part stood one who, at the forge +Labouring, two massy clods of iron and brass +Had melted, (whether found where casual fire +Had wasted woods on mountain or in vale, +Down to the veins of earth; thence gliding hot +To some cave's mouth; or whether washed by stream +From underground;) the liquid ore he drained +Into fit moulds prepared; from which he formed +First his own tools; then, what might else be wrought +Fusil or graven in metal. After these, +But on the hither side, a different sort +From the high neighbouring hills, which was their seat, +Down to the plain descended; by their guise +Just men they seemed, and all their study bent +To worship God aright, and know his works +Not hid; nor those things last, which might preserve +Freedom and peace to Men; they on the plain +Long had not walked, when from the tents, behold! +A bevy of fair women, richly gay +In gems and wanton dress; to the harp they sung +Soft amorous ditties, and in dance came on: +The men, though grave, eyed them; and let their eyes +Rove without rein; till, in the amorous net +Fast caught, they liked; and each his liking chose; +And now of love they treat, till the evening-star, +Love's harbinger, appeared; then, all in heat +They light the nuptial torch, and bid invoke +Hymen, then first to marriage rites invoked: +With feast and musick all the tents resound. +Such happy interview, and fair event +Of love and youth not lost, songs, garlands, flowers, +And charming symphonies, attached the heart +Of Adam, soon inclined to admit delight, +The bent of nature; which he thus expressed. +True opener of mine eyes, prime Angel blest; +Much better seems this vision, and more hope +Of peaceful days portends, than those two past; +Those were of hate and death, or pain much worse; +Here Nature seems fulfilled in all her ends. +To whom thus Michael. Judge not what is best +By pleasure, though to nature seeming meet; +Created, as thou art, to nobler end +Holy and pure, conformity divine. +Those tents thou sawest so pleasant, were the tents +Of wickedness, wherein shall dwell his race +Who slew his brother; studious they appear +Of arts that polish life, inventers rare; +Unmindful of their Maker, though his Spirit +Taught them; but they his gifts acknowledged none. +Yet they a beauteous offspring shall beget; +For that fair female troop thou sawest, that seemed +Of Goddesses, so blithe, so smooth, so gay, +Yet empty of all good wherein consists +Woman's domestick honour and chief praise; +Bred only and completed to the taste +Of lustful appetence, to sing, to dance, +To dress, and troll the tongue, and roll the eye: +To these that sober race of men, whose lives +Religious titled them the sons of God, +Shall yield up all their virtue, all their fame +Ignobly, to the trains and to the smiles +Of these fair atheists; and now swim in joy, +Erelong to swim at large; and laugh, for which +The world erelong a world of tears must weep. +To whom thus Adam, of short joy bereft. +O pity and shame, that they, who to live well +Entered so fair, should turn aside to tread +Paths indirect, or in the mid way faint! +But still I see the tenour of Man's woe +Holds on the same, from Woman to begin. +From Man's effeminate slackness it begins, +Said the Angel, who should better hold his place +By wisdom, and superiour gifts received. +But now prepare thee for another scene. +He looked, and saw wide territory spread +Before him, towns, and rural works between; +Cities of men with lofty gates and towers, +Concourse in arms, fierce faces threatening war, +Giants of mighty bone and bold emprise; +Part wield their arms, part curb the foaming steed, +Single or in array of battle ranged +Both horse and foot, nor idly mustering stood; +One way a band select from forage drives +A herd of beeves, fair oxen and fair kine, +From a fat meadow ground; or fleecy flock, +Ewes and their bleating lambs over the plain, +Their booty; scarce with life the shepherds fly, +But call in aid, which makes a bloody fray; +With cruel tournament the squadrons join; +Where cattle pastured late, now scattered lies +With carcasses and arms the ensanguined field, +Deserted: Others to a city strong +Lay siege, encamped; by battery, scale, and mine, +Assaulting; others from the wall defend +With dart and javelin, stones, and sulphurous fire; +On each hand slaughter, and gigantick deeds. +In other part the sceptered heralds call +To council, in the city-gates; anon +Gray-headed men and grave, with warriours mixed, +Assemble, and harangues are heard; but soon, +In factious opposition; till at last, +Of middle age one rising, eminent +In wise deport, spake much of right and wrong, +Of justice, or religion, truth, and peace, +And judgement from above: him old and young +Exploded, and had seized with violent hands, +Had not a cloud descending snatched him thence +Unseen amid the throng: so violence +Proceeded, and oppression, and sword-law, +Through all the plain, and refuge none was found. +Adam was all in tears, and to his guide +Lamenting turned full sad; O!what are these, +Death's ministers, not men? who thus deal death +Inhumanly to men, and multiply +Ten thousandfold the sin of him who slew +His brother: for of whom such massacre +Make they, but of their brethren; men of men +But who was that just man, whom had not Heaven +Rescued, had in his righteousness been lost? +To whom thus Michael. These are the product +Of those ill-mated marriages thou sawest; +Where good with bad were matched, who of themselves +Abhor to join; and, by imprudence mixed, +Produce prodigious births of body or mind. +Such were these giants, men of high renown; +For in those days might only shall be admired, +And valour and heroick virtue called; +To overcome in battle, and subdue +Nations, and bring home spoils with infinite +Man-slaughter, shall be held the highest pitch +Of human glory; and for glory done +Of triumph, to be styled great conquerours +Patrons of mankind, Gods, and sons of Gods; +Destroyers rightlier called, and plagues of men. +Thus fame shall be achieved, renown on earth; +And what most merits fame, in silence hid. +But he, the seventh from thee, whom thou beheldst +The only righteous in a world preverse, +And therefore hated, therefore so beset +With foes, for daring single to be just, +And utter odious truth, that God would come +To judge them with his Saints; him the Most High +Rapt in a balmy cloud with winged steeds +Did, as thou sawest, receive, to walk with God +High in salvation and the climes of bliss, +Exempt from death; to show thee what reward +Awaits the good; the rest what punishment; +Which now direct thine eyes and soon behold. +He looked, and saw the face of things quite changed; +The brazen throat of war had ceased to roar; +All now was turned to jollity and game, +To luxury and riot, feast and dance; +Marrying or prostituting, as befel, +Rape or adultery, where passing fair +Allured them; thence from cups to civil broils. +At length a reverend sire among them came, +And of their doings great dislike declared, +And testified against their ways; he oft +Frequented their assemblies, whereso met, +Triumphs or festivals; and to them preached +Conversion and repentance, as to souls +In prison, under judgements imminent: +But all in vain: which when he saw, he ceased +Contending, and removed his tents far off; +Then, from the mountain hewing timber tall, +Began to build a vessel of huge bulk; +Measured by cubit, length, and breadth, and highth; +Smeared round with pitch; and in the side a door +Contrived; and of provisions laid in large, +For man and beast: when lo, a wonder strange! +Of every beast, and bird, and insect small, +Came sevens, and pairs; and entered in as taught +Their order: last the sire and his three sons, +With their four wives; and God made fast the door. +Mean while the south-wind rose, and, with black wings +Wide-hovering, all the clouds together drove +From under Heaven; the hills to their supply +Vapour, and exhalation dusk and moist, +Sent up amain; and now the thickened sky +Like a dark cieling stood; down rushed the rain +Impetuous; and continued, till the earth +No more was seen: the floating vessel swum +Uplifted, and secure with beaked prow +Rode tilting o'er the waves; all dwellings else +Flood overwhelmed, and them with all their pomp +Deep under water rolled; sea covered sea, +Sea without shore; and in their palaces, +Where luxury late reigned, sea-monsters whelped +And stabled; of mankind, so numerous late, +All left, in one small bottom swum imbarked. +How didst thou grieve then, Adam, to behold +The end of all thy offspring, end so sad, +Depopulation! Thee another flood, +Of tears and sorrow a flood, thee also drowned, +And sunk thee as thy sons; till, gently reared +By the Angel, on thy feet thou stoodest at last, +Though comfortless; as when a father mourns +His children, all in view destroyed at once; +And scarce to the Angel utter'dst thus thy plaint. +O visions ill foreseen! Better had I +Lived ignorant of future! so had borne +My part of evil only, each day's lot +Enough to bear; those now, that were dispensed +The burden of many ages, on me light +At once, by my foreknowledge gaining birth +Abortive, to torment me ere their being, +With thought that they must be. Let no man seek +Henceforth to be foretold, what shall befall +Him or his children; evil he may be sure, +Which neither his foreknowing can prevent; +And he the future evil shall no less +In apprehension than in substance feel, +Grievous to bear: but that care now is past, +Man is not whom to warn: those few escaped +Famine and anguish will at last consume, +Wandering that watery desart: I had hope, +When violence was ceased, and war on earth, +All would have then gone well; peace would have crowned +With length of happy days the race of Man; +But I was far deceived; for now I see +Peace to corrupt no less than war to waste. +How comes it thus? unfold, celestial Guide, +And whether here the race of Man will end. +To whom thus Michael. Those, whom last thou sawest +In triumph and luxurious wealth, are they +First seen in acts of prowess eminent +And great exploits, but of true virtue void; +Who, having spilt much blood, and done much wast +Subduing nations, and achieved thereby +Fame in the world, high titles, and rich prey; +Shall change their course to pleasure, ease, and sloth, +Surfeit, and lust; till wantonness and pride +Raise out of friendship hostile deeds in peace. +The conquered also, and enslaved by war, +Shall, with their freedom lost, all virtue lose +And fear of God; from whom their piety feigned +In sharp contest of battle found no aid +Against invaders; therefore, cooled in zeal, +Thenceforth shall practice how to live secure, +Worldly or dissolute, on what their lords +Shall leave them to enjoy; for the earth shall bear +More than enough, that temperance may be tried: +So all shall turn degenerate, all depraved; +Justice and temperance, truth and faith, forgot; +One man except, the only son of light +In a dark age, against example good, +Against allurement, custom, and a world +Offended: fearless of reproach and scorn, +The grand-child, with twelve sons encreased, departs +From Canaan, to a land hereafter called +Egypt, divided by the river Nile; +See where it flows, disgorging at seven mouths +Into the sea: To sojourn in that land +He comes, invited by a younger son +In time of dearth; a son, whose worthy deeds +Raise him to be the second in that realm +Of Pharaoh: There he dies, and leaves his race +Growing into a nation, and now grown +Suspected to a sequent king, who seeks +To stop their overgrowth, as inmate guests +Or violence, he of their wicked ways +Shall them admonish; and before them set +The paths of righteousness, how much more safe +And full of peace; denouncing wrath to come +On their impenitence; and shall return +Of them derided, but of God observed +The one just man alive; by his command +Shall build a wonderous ark, as thou beheldst, +To save himself, and houshold, from amidst +A world devote to universal wrack. +No sooner he, with them of man and beast +Select for life, shall in the ark be lodged, +And sheltered round; but all the cataracts +Of Heaven set open on the Earth shall pour +Rain, day and night; all fountains of the deep, +Broke up, shall heave the ocean to usurp +Beyond all bounds; till inundation rise +Above the highest hills: Then shall this mount +Of Paradise by might of waves be moved +Out of his place, pushed by the horned flood, +With all his verdure spoiled, and trees adrift, +Down the great river to the opening gulf, +And there take root an island salt and bare, +The haunt of seals, and orcs, and sea-mews' clang: +To teach thee that God attributes to place +No sanctity, if none be thither brought +By men who there frequent, or therein dwell. +And now, what further shall ensue, behold. +He looked, and saw the ark hull on the flood, +Which now abated; for the clouds were fled, +Driven by a keen north-wind, that, blowing dry, +Wrinkled the face of deluge, as decayed; +And the clear sun on his wide watery glass +Gazed hot, and of the fresh wave largely drew, +As after thirst; which made their flowing shrink +From standing lake to tripping ebb, that stole +With soft foot towards the deep; who now had stopt +His sluces, as the Heaven his windows shut. +The ark no more now floats, but seems on ground, +Fast on the top of some high mountain fixed. +And now the tops of hills, as rocks, appear; +With clamour thence the rapid currents drive, +Towards the retreating sea, their furious tide. +Forthwith from out the ark a raven flies, +And after him, the surer messenger, +A dove sent forth once and again to spy +Green tree or ground, whereon his foot may light: +The second time returning, in his bill +An olive-leaf he brings, pacifick sign: +Anon dry ground appears, and from his ark +The ancient sire descends, with all his train; +Then with uplifted hands, and eyes devout, +Grateful to Heaven, over his head beholds +A dewy cloud, and in the cloud a bow +Conspicuous with three lifted colours gay, +Betokening peace from God, and covenant new. +Whereat the heart of Adam, erst so sad, +Greatly rejoiced; and thus his joy broke forth. +O thou, who future things canst represent +As present, heavenly Instructer! I revive +At this last sight; assured that Man shall live, +With all the creatures, and their seed preserve. +Far less I now lament for one whole world +Of wicked sons destroyed, than I rejoice +For one man found so perfect, and so just, +That God vouchsafes to raise another world +From him, and all his anger to forget. +But say, what mean those coloured streaks in Heaven +Distended, as the brow of God appeased? +Or serve they, as a flowery verge, to bind +The fluid skirts of that same watery cloud, +Lest it again dissolve, and shower the earth? +To whom the Arch-Angel. Dextrously thou aimest; +So willingly doth God remit his ire, +Though late repenting him of Man depraved; +Grieved at his heart, when looking down he saw +The whole earth filled with violence, and all flesh +Corrupting each their way; yet, those removed, +Such grace shall one just man find in his sight, +That he relents, not to blot out mankind; +And makes a covenant never to destroy +The earth again by flood; nor let the sea +Surpass his bounds; nor rain to drown the world, +With man therein or beast; but, when he brings +Over the earth a cloud, will therein set +His triple-coloured bow, whereon to look, +And call to mind his covenant: Day and night, +Seed-time and harvest, heat and hoary frost, +Shall hold their course; till fire purge all things new, +Both Heaven and Earth, wherein the just shall dwell. + + + +Book XII + + +As one who in his journey bates at noon, +Though bent on speed; so here the Arch-Angel paused +Betwixt the world destroyed and world restored, +If Adam aught perhaps might interpose; +Then, with transition sweet, new speech resumes. +Thus thou hast seen one world begin, and end; +And Man, as from a second stock, proceed. +Much thou hast yet to see; but I perceive +Thy mortal sight to fail; objects divine +Must needs impair and weary human sense: +Henceforth what is to come I will relate; +Thou therefore give due audience, and attend. +This second source of Men, while yet but few, +And while the dread of judgement past remains +Fresh in their minds, fearing the Deity, +With some regard to what is just and right +Shall lead their lives, and multiply apace; +Labouring the soil, and reaping plenteous crop, +Corn, wine, and oil; and, from the herd or flock, +Oft sacrificing bullock, lamb, or kid, +With large wine-offerings poured, and sacred feast, +Shall spend their days in joy unblamed; and dwell +Long time in peace, by families and tribes, +Under paternal rule: till one shall rise +Of proud ambitious heart; who, not content +With fair equality, fraternal state, +Will arrogate dominion undeserved +Over his brethren, and quite dispossess +Concord and law of nature from the earth; +Hunting (and men not beasts shall be his game) +With war, and hostile snare, such as refuse +Subjection to his empire tyrannous: +A mighty hunter thence he shall be styled +Before the Lord; as in despite of Heaven, +Or from Heaven, claiming second sovranty; +And from rebellion shall derive his name, +Though of rebellion others he accuse. +He with a crew, whom like ambition joins +With him or under him to tyrannize, +Marching from Eden towards the west, shall find +The plain, wherein a black bituminous gurge +Boils out from under ground, the mouth of Hell: +Of brick, and of that stuff, they cast to build +A city and tower, whose top may reach to Heaven; +And get themselves a name; lest, far dispersed +In foreign lands, their memory be lost; +Regardless whether good or evil fame. +But God, who oft descends to visit men +Unseen, and through their habitations walks +To mark their doings, them beholding soon, +Comes down to see their city, ere the tower +Obstruct Heaven-towers, and in derision sets +Upon their tongues a various spirit, to rase +Quite out their native language; and, instead, +To sow a jangling noise of words unknown: +Forthwith a hideous gabble rises loud, +Among the builders; each to other calls +Not understood; till hoarse, and all in rage, +As mocked they storm: great laughter was in Heaven, +And looking down, to see the hubbub strange, +And hear the din: Thus was the building left +Ridiculous, and the work Confusion named. +Whereto thus Adam, fatherly displeased. +O execrable son! so to aspire +Above his brethren; to himself assuming +Authority usurped, from God not given: +He gave us only over beast, fish, fowl, +Dominion absolute; that right we hold +By his donation; but man over men +He made not lord; such title to himself +Reserving, human left from human free. +But this usurper his encroachment proud +Stays not on Man; to God his tower intends +Siege and defiance: Wretched man!what food +Will he convey up thither, to sustain +Himself and his rash army; where thin air +Above the clouds will pine his entrails gross, +And famish him of breath, if not of bread? +To whom thus Michael. Justly thou abhorrest +That son, who on the quiet state of men +Such trouble brought, affecting to subdue +Rational liberty; yet know withal, +Since thy original lapse, true liberty +Is lost, which always with right reason dwells +Twinned, and from her hath no dividual being: +Reason in man obscured, or not obeyed, +Immediately inordinate desires, +And upstart passions, catch the government +From reason; and to servitude reduce +Man, till then free. Therefore, since he permits +Within himself unworthy powers to reign +Over free reason, God, in judgement just, +Subjects him from without to violent lords; +Who oft as undeservedly enthrall +His outward freedom: Tyranny must be; +Though to the tyrant thereby no excuse. +Yet sometimes nations will decline so low +From virtue, which is reason, that no wrong, +But justice, and some fatal curse annexed, +Deprives them of their outward liberty; +Their inward lost: Witness the irreverent son +Of him who built the ark; who, for the shame +Done to his father, heard this heavy curse, +Servant of servants, on his vicious race. +Thus will this latter, as the former world, +Still tend from bad to worse; till God at last, +Wearied with their iniquities, withdraw +His presence from among them, and avert +His holy eyes; resolving from thenceforth +To leave them to their own polluted ways; +And one peculiar nation to select +From all the rest, of whom to be invoked, +A nation from one faithful man to spring: +Him on this side Euphrates yet residing, +Bred up in idol-worship: O, that men +(Canst thou believe?) should be so stupid grown, +While yet the patriarch lived, who 'scaped the flood, +As to forsake the living God, and fall +To worship their own work in wood and stone +For Gods! Yet him God the Most High vouchsafes +To call by vision, from his father's house, +His kindred, and false Gods, into a land +Which he will show him; and from him will raise +A mighty nation; and upon him shower +His benediction so, that in his seed +All nations shall be blest: he straight obeys; +Not knowing to what land, yet firm believes: +I see him, but thou canst not, with what faith +He leaves his Gods, his friends, and native soil, +Ur of Chaldaea, passing now the ford +To Haran; after him a cumbrous train +Of herds and flocks, and numerous servitude; +Not wandering poor, but trusting all his wealth +With God, who called him, in a land unknown. +Canaan he now attains; I see his tents +Pitched about Sechem, and the neighbouring plain +Of Moreh; there by promise he receives +Gift to his progeny of all that land, +From Hameth northward to the Desart south; +(Things by their names I call, though yet unnamed;) +From Hermon east to the great western Sea; +Mount Hermon, yonder sea; each place behold +In prospect, as I point them; on the shore +Mount Carmel; here, the double-founted stream, +Jordan, true limit eastward; but his sons +Shall dwell to Senir, that long ridge of hills. +This ponder, that all nations of the earth +Shall in his seed be blessed: By that seed +Is meant thy great Deliverer, who shall bruise +The Serpent's head; whereof to thee anon +Plainlier shall be revealed. This patriarch blest, +Whom faithful Abraham due time shall call, +A son, and of his son a grand-child, leaves; +Like him in faith, in wisdom, and renown: +The grandchild, with twelve sons increased, departs +From Canaan to a land hereafter called +Egypt, divided by the river Nile +See where it flows, disgorging at seven mouths +Into the sea. To sojourn in that land +He comes, invited by a younger son +In time of dearth, a son whose worthy deeds +Raise him to be the second in that realm +Of Pharaoh. There he dies, and leaves his race +Growing into a nation, and now grown +Suspected to a sequent king, who seeks +To stop their overgrowth, as inmate guests +Too numerous; whence of guests he makes them slaves +Inhospitably, and kills their infant males: +Till by two brethren (these two brethren call +Moses and Aaron) sent from God to claim +His people from enthralment, they return, +With glory and spoil, back to their promised land. +But first, the lawless tyrant, who denies +To know their God, or message to regard, +Must be compelled by signs and judgements dire; +To blood unshed the rivers must be turned; +Frogs, lice, and flies, must all his palace fill +With loathed intrusion, and fill all the land; +His cattle must of rot and murren die; +Botches and blains must all his flesh emboss, +And all his people; thunder mixed with hail, +Hail mixed with fire, must rend the Egyptians sky, +And wheel on the earth, devouring where it rolls; +What it devours not, herb, or fruit, or grain, +A darksome cloud of locusts swarming down +Must eat, and on the ground leave nothing green; +Darkness must overshadow all his bounds, +Palpable darkness, and blot out three days; +Last, with one midnight stroke, all the first-born +Of Egypt must lie dead. Thus with ten wounds +The river-dragon tamed at length submits +To let his sojourners depart, and oft +Humbles his stubborn heart; but still, as ice +More hardened after thaw; till, in his rage +Pursuing whom he late dismissed, the sea +Swallows him with his host; but them lets pass, +As on dry land, between two crystal walls; +Awed by the rod of Moses so to stand +Divided, till his rescued gain their shore: +Such wondrous power God to his saint will lend, +Though present in his Angel; who shall go +Before them in a cloud, and pillar of fire; +By day a cloud, by night a pillar of fire; +To guide them in their journey, and remove +Behind them, while the obdurate king pursues: +All night he will pursue; but his approach +Darkness defends between till morning watch; +Then through the fiery pillar, and the cloud, +God looking forth will trouble all his host, +And craze their chariot-wheels: when by command +Moses once more his potent rod extends +Over the sea; the sea his rod obeys; +On their embattled ranks the waves return, +And overwhelm their war: The race elect +Safe toward Canaan from the shore advance +Through the wild Desart, not the readiest way; +Lest, entering on the Canaanite alarmed, +War terrify them inexpert, and fear +Return them back to Egypt, choosing rather +Inglorious life with servitude; for life +To noble and ignoble is more sweet +Untrained in arms, where rashness leads not on. +This also shall they gain by their delay +In the wide wilderness; there they shall found +Their government, and their great senate choose +Through the twelve tribes, to rule by laws ordained: +God from the mount of Sinai, whose gray top +Shall tremble, he descending, will himself +In thunder, lightning, and loud trumpets' sound, +Ordain them laws; part, such as appertain +To civil justice; part, religious rites +Of sacrifice; informing them, by types +And shadows, of that destined Seed to bruise +The Serpent, by what means he shall achieve +Mankind's deliverance. But the voice of God +To mortal ear is dreadful: They beseech +That Moses might report to them his will, +And terrour cease; he grants what they besought, +Instructed that to God is no access +Without Mediator, whose high office now +Moses in figure bears; to introduce +One greater, of whose day he shall foretel, +And all the Prophets in their age the times +Of great Messiah shall sing. Thus, laws and rites +Established, such delight hath God in Men +Obedient to his will, that he vouchsafes +Among them to set up his tabernacle; +The Holy One with mortal Men to dwell: +By his prescript a sanctuary is framed +Of cedar, overlaid with gold; therein +An ark, and in the ark his testimony, +The records of his covenant; over these +A mercy-seat of gold, between the wings +Of two bright Cherubim; before him burn +Seven lamps as in a zodiack representing +The heavenly fires; over the tent a cloud +Shall rest by day, a fiery gleam by night; +Save when they journey, and at length they come, +Conducted by his Angel, to the land +Promised to Abraham and his seed:--The rest +Were long to tell; how many battles fought +How many kings destroyed; and kingdoms won; +Or how the sun shall in mid Heaven stand still +A day entire, and night's due course adjourn, +Man's voice commanding, 'Sun, in Gibeon stand, +'And thou moon in the vale of Aialon, +'Till Israel overcome! so call the third +From Abraham, son of Isaac; and from him +His whole descent, who thus shall Canaan win. +Here Adam interposed. O sent from Heaven, +Enlightener of my darkness, gracious things +Thou hast revealed; those chiefly, which concern +Just Abraham and his seed: now first I find +Mine eyes true-opening, and my heart much eased; +Erewhile perplexed with thoughts, what would become +Of me and all mankind: But now I see +His day, in whom all nations shall be blest; +Favour unmerited by me, who sought +Forbidden knowledge by forbidden means. +This yet I apprehend not, why to those +Among whom God will deign to dwell on earth +So many and so various laws are given; +So many laws argue so many sins +Among them; how can God with such reside? +To whom thus Michael. Doubt not but that sin +Will reign among them, as of thee begot; +And therefore was law given them, to evince +Their natural pravity, by stirring up +Sin against law to fight: that when they see +Law can discover sin, but not remove, +Save by those shadowy expiations weak, +The blood of bulls and goats, they may conclude +Some blood more precious must be paid for Man; +Just for unjust; that, in such righteousness +To them by faith imputed, they may find +Justification towards God, and peace +Of conscience; which the law by ceremonies +Cannot appease; nor Man the mortal part +Perform; and, not performing, cannot live. +So law appears imperfect; and but given +With purpose to resign them, in full time, +Up to a better covenant; disciplined +From shadowy types to truth; from flesh to spirit; +From imposition of strict laws to free +Acceptance of large grace; from servile fear +To filial; works of law to works of faith. +And therefore shall not Moses, though of God +Highly beloved, being but the minister +Of law, his people into Canaan lead; +But Joshua, whom the Gentiles Jesus call, +His name and office bearing, who shall quell +The adversary-Serpent, and bring back +Through the world's wilderness long-wandered Man +Safe to eternal Paradise of rest. +Mean while they, in their earthly Canaan placed, +Long time shall dwell and prosper, but when sins +National interrupt their publick peace, +Provoking God to raise them enemies; +From whom as oft he saves them penitent +By Judges first, then under Kings; of whom +The second, both for piety renowned +And puissant deeds, a promise shall receive +Irrevocable, that his regal throne +For ever shall endure; the like shall sing +All Prophecy, that of the royal stock +Of David (so I name this king) shall rise +A Son, the Woman's seed to thee foretold, +Foretold to Abraham, as in whom shall trust +All nations; and to kings foretold, of kings +The last; for of his reign shall be no end. +But first, a long succession must ensue; +And his next son, for wealth and wisdom famed, +The clouded ark of God, till then in tents +Wandering, shall in a glorious temple enshrine. +Such follow him, as shall be registered +Part good, part bad; of bad the longer scroll; +Whose foul idolatries, and other faults +Heaped to the popular sum, will so incense +God, as to leave them, and expose their land, +Their city, his temple, and his holy ark, +With all his sacred things, a scorn and prey +To that proud city, whose high walls thou sawest +Left in confusion; Babylon thence called. +There in captivity he lets them dwell +The space of seventy years; then brings them back, +Remembering mercy, and his covenant sworn +To David, stablished as the days of Heaven. +Returned from Babylon by leave of kings +Their lords, whom God disposed, the house of God +They first re-edify; and for a while +In mean estate live moderate; till, grown +In wealth and multitude, factious they grow; +But first among the priests dissention springs, +Men who attend the altar, and should most +Endeavour peace: their strife pollution brings +Upon the temple itself: at last they seise +The scepter, and regard not David's sons; +Then lose it to a stranger, that the true +Anointed King Messiah might be born +Barred of his right; yet at his birth a star, +Unseen before in Heaven, proclaims him come; +And guides the eastern sages, who inquire +His place, to offer incense, myrrh, and gold: +His place of birth a solemn Angel tells +To simple shepherds, keeping watch by night; +They gladly thither haste, and by a quire +Of squadroned Angels hear his carol sung. +A virgin is his mother, but his sire +The power of the Most High: He shall ascend +The throne hereditary, and bound his reign +With Earth's wide bounds, his glory with the Heavens. +He ceased, discerning Adam with such joy +Surcharged, as had like grief been dewed in tears, +Without the vent of words; which these he breathed. +O prophet of glad tidings, finisher +Of utmost hope! now clear I understand +What oft my steadiest thoughts have searched in vain; +Why our great Expectation should be called +The seed of Woman: Virgin Mother, hail, +High in the love of Heaven; yet from my loins +Thou shalt proceed, and from thy womb the Son +Of God Most High: so God with Man unites! +Needs must the Serpent now his capital bruise +Expect with mortal pain: Say where and when +Their fight, what stroke shall bruise the victor's heel. +To whom thus Michael. Dream not of their fight, +As of a duel, or the local wounds +Of head or heel: Not therefore joins the Son +Manhood to Godhead, with more strength to foil +Thy enemy; nor so is overcome +Satan, whose fall from Heaven, a deadlier bruise, +Disabled, not to give thee thy death's wound: +Which he, who comes thy Saviour, shall recure, +Not by destroying Satan, but his works +In thee, and in thy seed: Nor can this be, +But by fulfilling that which thou didst want, +Obedience to the law of God, imposed +On penalty of death, and suffering death; +The penalty to thy transgression due, +And due to theirs which out of thine will grow: +So only can high Justice rest appaid. +The law of God exact he shall fulfil +Both by obedience and by love, though love +Alone fulfil the law; thy punishment +He shall endure, by coming in the flesh +To a reproachful life, and cursed death; +Proclaiming life to all who shall believe +In his redemption; and that his obedience, +Imputed, becomes theirs by faith; his merits +To save them, not their own, though legal, works. +For this he shall live hated, be blasphemed, +Seised on by force, judged, and to death condemned +A shameful and accursed, nailed to the cross +By his own nation; slain for bringing life: +But to the cross he nails thy enemies, +The law that is against thee, and the sins +Of all mankind, with him there crucified, +Never to hurt them more who rightly trust +In this his satisfaction; so he dies, +But soon revives; Death over him no power +Shall long usurp; ere the third dawning light +Return, the stars of morn shall see him rise +Out of his grave, fresh as the dawning light, +Thy ransom paid, which Man from death redeems, +His death for Man, as many as offered life +Neglect not, and the benefit embrace +By faith not void of works: This God-like act +Annuls thy doom, the death thou shouldest have died, +In sin for ever lost from life; this act +Shall bruise the head of Satan, crush his strength, +Defeating Sin and Death, his two main arms; +And fix far deeper in his head their stings +Than temporal death shall bruise the victor's heel, +Or theirs whom he redeems; a death, like sleep, +A gentle wafting to immortal life. +Nor after resurrection shall he stay +Longer on earth, than certain times to appear +To his disciples, men who in his life +Still followed him; to them shall leave in charge +To teach all nations what of him they learned +And his salvation; them who shall believe +Baptizing in the profluent stream, the sign +Of washing them from guilt of sin to life +Pure, and in mind prepared, if so befall, +For death, like that which the Redeemer died. +All nations they shall teach; for, from that day, +Not only to the sons of Abraham's loins +Salvation shall be preached, but to the sons +Of Abraham's faith wherever through the world; +So in his seed all nations shall be blest. +Then to the Heaven of Heavens he shall ascend +With victory, triumphing through the air +Over his foes and thine; there shall surprise +The Serpent, prince of air, and drag in chains +Through all his realm, and there confounded leave; +Then enter into glory, and resume +His seat at God's right hand, exalted high +Above all names in Heaven; and thence shall come, +When this world's dissolution shall be ripe, +With glory and power to judge both quick and dead; +To judge the unfaithful dead, but to reward +His faithful, and receive them into bliss, +Whether in Heaven or Earth; for then the Earth +Shall all be Paradise, far happier place +Than this of Eden, and far happier days. +So spake the Arch-Angel Michael; then paused, +As at the world's great period; and our sire, +Replete with joy and wonder, thus replied. +O Goodness infinite, Goodness immense! +That all this good of evil shall produce, +And evil turn to good; more wonderful +Than that which by creation first brought forth +Light out of darkness! Full of doubt I stand, +Whether I should repent me now of sin +By me done, and occasioned; or rejoice +Much more, that much more good thereof shall spring; +To God more glory, more good-will to Men +From God, and over wrath grace shall abound. +But say, if our Deliverer up to Heaven +Must re-ascend, what will betide the few +His faithful, left among the unfaithful herd, +The enemies of truth? Who then shall guide +His people, who defend? Will they not deal +Worse with his followers than with him they dealt? +Be sure they will, said the Angel; but from Heaven +He to his own a Comforter will send, +The promise of the Father, who shall dwell +His Spirit within them; and the law of faith, +Working through love, upon their hearts shall write, +To guide them in all truth; and also arm +With spiritual armour, able to resist +Satan's assaults, and quench his fiery darts; +What man can do against them, not afraid, +Though to the death; against such cruelties +With inward consolations recompensed, +And oft supported so as shall amaze +Their proudest persecutors: For the Spirit, +Poured first on his Apostles, whom he sends +To evangelize the nations, then on all +Baptized, shall them with wonderous gifts endue +To speak all tongues, and do all miracles, +As did their Lord before them. Thus they win +Great numbers of each nation to receive +With joy the tidings brought from Heaven: At length +Their ministry performed, and race well run, +Their doctrine and their story written left, +They die; but in their room, as they forewarn, +Wolves shall succeed for teachers, grievous wolves, +Who all the sacred mysteries of Heaven +To their own vile advantages shall turn +Of lucre and ambition; and the truth +With superstitions and traditions taint, +Left only in those written records pure, +Though not but by the Spirit understood. +Then shall they seek to avail themselves of names, +Places, and titles, and with these to join +Secular power; though feigning still to act +By spiritual, to themselves appropriating +The Spirit of God, promised alike and given +To all believers; and, from that pretence, +Spiritual laws by carnal power shall force +On every conscience; laws which none shall find +Left them inrolled, or what the Spirit within +Shall on the heart engrave. What will they then +But force the Spirit of Grace itself, and bind +His consort Liberty? what, but unbuild +His living temples, built by faith to stand, +Their own faith, not another's? for, on earth, +Who against faith and conscience can be heard +Infallible? yet many will presume: +Whence heavy persecution shall arise +On all, who in the worship persevere +Of spirit and truth; the rest, far greater part, +Will deem in outward rites and specious forms +Religion satisfied; Truth shall retire +Bestuck with slanderous darts, and works of faith +Rarely be found: So shall the world go on, +To good malignant, to bad men benign; +Under her own weight groaning; till the day +Appear of respiration to the just, +And vengeance to the wicked, at return +Of him so lately promised to thy aid, +The Woman's Seed; obscurely then foretold, +Now ampler known thy Saviour and thy Lord; +Last, in the clouds, from Heaven to be revealed +In glory of the Father, to dissolve +Satan with his perverted world; then raise +From the conflagrant mass, purged and refined, +New Heavens, new Earth, ages of endless date, +Founded in righteousness, and peace, and love; +To bring forth fruits, joy and eternal bliss. +He ended; and thus Adam last replied. +How soon hath thy prediction, Seer blest, +Measured this transient world, the race of time, +Till time stand fixed! Beyond is all abyss, +Eternity, whose end no eye can reach. +Greatly-instructed I shall hence depart; +Greatly in peace of thought; and have my fill +Of knowledge, what this vessel can contain; +Beyond which was my folly to aspire. +Henceforth I learn, that to obey is best, +And love with fear the only God; to walk +As in his presence; ever to observe +His providence; and on him sole depend, +Merciful over all his works, with good +Still overcoming evil, and by small +Accomplishing great things, by things deemed weak +Subverting worldly strong, and worldly wise +By simply meek: that suffering for truth's sake +Is fortitude to highest victory, +And, to the faithful, death the gate of life; +Taught this by his example, whom I now +Acknowledge my Redeemer ever blest. +To whom thus also the Angel last replied. +This having learned, thou hast attained the sum +Of wisdom; hope no higher, though all the stars +Thou knewest by name, and all the ethereal powers, +All secrets of the deep, all Nature's works, +Or works of God in Heaven, air, earth, or sea, +And all the riches of this world enjoyedst, +And all the rule, one empire; only add +Deeds to thy knowledge answerable; add faith, +Add virtue, patience, temperance; add love, +By name to come called charity, the soul +Of all the rest: then wilt thou not be loth +To leave this Paradise, but shalt possess +A Paradise within thee, happier far.-- +Let us descend now therefore from this top +Of speculation; for the hour precise +Exacts our parting hence; and see!the guards, +By me encamped on yonder hill, expect +Their motion; at whose front a flaming sword, +In signal of remove, waves fiercely round: +We may no longer stay: go, waken Eve; +Her also I with gentle dreams have calmed +Portending good, and all her spirits composed +To meek submission: thou, at season fit, +Let her with thee partake what thou hast heard; +Chiefly what may concern her faith to know, +The great deliverance by her seed to come +(For by the Woman's seed) on all mankind: +That ye may live, which will be many days, +Both in one faith unanimous, though sad, +With cause, for evils past; yet much more cheered +With meditation on the happy end. +He ended, and they both descend the hill; +Descended, Adam to the bower, where Eve +Lay sleeping, ran before; but found her waked; +And thus with words not sad she him received. +Whence thou returnest, and whither wentest, I know; +For God is also in sleep; and dreams advise, +Which he hath sent propitious, some great good +Presaging, since with sorrow and heart's distress +Wearied I fell asleep: But now lead on; +In me is no delay; with thee to go, +Is to stay here; without thee here to stay, +Is to go hence unwilling; thou to me +Art all things under $Heaven, all places thou, +Who for my wilful crime art banished hence. +This further consolation yet secure +I carry hence; though all by me is lost, +Such favour I unworthy am vouchsafed, +By me the Promised Seed shall all restore. +So spake our mother Eve; and Adam heard +Well pleased, but answered not: For now, too nigh +The Arch-Angel stood; and, from the other hill +To their fixed station, all in bright array +The Cherubim descended; on the ground +Gliding meteorous, as evening-mist +Risen from a river o'er the marish glides, +And gathers ground fast at the labourer's heel +Homeward returning. High in front advanced, +The brandished sword of God before them blazed, +Fierce as a comet; which with torrid heat, +And vapour as the Libyan air adust, +Began to parch that temperate clime; whereat +In either hand the hastening Angel caught +Our lingering parents, and to the eastern gate +Led them direct, and down the cliff as fast +To the subjected plain; then disappeared. +They, looking back, all the eastern side beheld +Of Paradise, so late their happy seat, +Waved over by that flaming brand; the gate +With dreadful faces thronged, and fiery arms: +Some natural tears they dropt, but wiped them soon; +The world was all before them, where to choose +Their place of rest, and Providence their guide: +They, hand in hand, with wandering steps and slow, +Through Eden took their solitary way. + +[The End] diff --git a/external/snappy-1.1.9/testdata/urls.10K b/external/snappy-1.1.9/testdata/urls.10K new file mode 100644 index 0000000..eaf0633 --- /dev/null +++ b/external/snappy-1.1.9/testdata/urls.10K @@ -0,0 +1,10000 @@ +http://ftp.sektornet.dk/tucows/herdwin0904.html +http://209.143.244.16/directory/us/nd/fargo/insurance/automotive.html +http://bellona.itworld.com:8080/cwi/reprint/0,1926,NAV63-128-1357-1367_STO46538,00.html +http://www.legis.state.ia.us/usr/ns-home/docs/GA/76GA/Session.2/SJournal/01600/01644.html +http://www.centc251.org/forums/aca-1/dispatch.cgi/isowg4/showFolder/100001/1211898 +http://www.burstnet.com/ads/ad7826a-map.cgi/271412263 +http://topcu.tucows.com/winme/adnload/137036_30095.html +http://topcu.tucows.com/winme/adnload/145034_49120.html +http://link.fastpartner.com/do/session/600342/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/bitconomy.php +http://www.retrobytes.org/classiccmp/9911/msg01245.html +http://www.localbusiness.com/Story/Print/0,1197,DFW_196102,00.html +http://bbs.kh.edu.tw/treasure/childhood/M.962620586.A/M.966031025.A/M.966031098.A.html +http://www.hig.se/(accessed,clientname,return)/~jackson/roxen/testform.html +http://www.ipclub.ru:8102/cgi-bin/linkmaker/linklist-view.cgi?owner=elvis&Sector=434 +http://www.dulux.co.uk/UKRETAIL:229853034:DFinity.1QJiP4jMofi7bof +http://www.dominionpost.com/cgi-bin/redirect.exe/85288 +http://br.egroups.com/message/anedotas/3988 +http://www.ing.iac.es/~cfg/group_notes/texinfo/spec/file$_must$_exist_$28appendfile$29.html +http://hurweb01.hurriyetim.com.tr/hur/turk/99/06/22/yasam/14yas.htm +http://www3.plala.or.jp/shinchi/niltuki/mai0416.htm +http://www3.plala.or.jp/shinchi/niltuki/mai0420.htm +http://213.36.119.69/do/session/152968/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www3.travelprice.com/voyages/recherche.phtml +http://www.meristation.es/Trucos/s/starcraft_brood.htm +http://www.meristation.es/Trucos/trainer/train_star_war.htm +http://www.askme.com/cat/ShowCategory_3104_an_9.htm +http://mozilla.org/newlayout/testcases/css/sec542cm.htm +http://ampec.ampec.it/ted/box04/page36.htm +http://ampec.ampec.it/ted/box04/page39.htm +http://ampec.ampec.it/ted/box04/page42.htm +http://ampec.ampec.it/ted/box04/page58.htm +http://ampec.ampec.it/ted/box04/page62.htm +http://www.businesswire.com/webbox/bw.080300/202160192.htm +http://www.businesswire.com/webbox/bw.062700/201790580.htm +http://www.businesswire.com/webbox/bw.040300/200940796.htm +http://retailer.gocollect.com/do/session/1912606/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/top_ten.asp?pagenum=1 +http://retailer.gocollect.com/do/session/1912606/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://genforum.genealogy.com/cgi-bin/print.cgi?ivy::116.html +http://www.spiral.at/Katalog/Artikel/6150331/ +http://www.spiral.at/Katalog/Artikel/6150390/ +http://www.spiral.at/Katalog/Artikel/6150411/ +http://bbs.msquare.or.kr/list.bbs/writer/Soohah/8.html +http://www.eskimo.com/~wesn/waflyfishers/msg03537.html +http://denniscares.mp2.homes.com/content/glossary.html?Letter=A +http://library.bangor.ac.uk/search/aChandler,+Peter,+1936-/achandler+peter+1936/-5,-1,0,B/bibandlinks&F=achandler+raymond+1888+1959&5,,6 +http://www.kimkihong.pe.kr/ +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/199/1998/6/0/1323673/ +http://musictz.com/user/fernman.html +http://tucows.concepts.nl/winnt/adnload/1381_28803.html +http://www.mirror.kiev.ua:8083/paper/2000/03/1251/text/03-06-6.htm +http://ring.crl.go.jp/pub/linux/debian/debian-jp/dists/stable/non-free/binary-arm/x11/?N=D +http://news.novgorod.ru/news/2000/4/23/2/9 +http://www.egroups.com/dir/World/Deutsch/Gesellschaft/Bildung/Schule?st=167 +http://www.egroups.com/group/abitur98 +http://genforum.genealogy.com/cgi-genforum/forums/casey.cgi?1477 +http://www.tvstore.com/browse/TV/BOXERSHO/s.UtRroVXF +http://www.tvstore.com/browse/TV/COLLECTI/s.UtRroVXF +http://www.tvstore.com/browse/TV/EARRINGS/s.UtRroVXF +http://polygraph.ircache.net:8181/text/m90/http_-2ewp.aliant.com/attivita.htm +http://rosebay.1000pages.com/ceclgt12.htm +http://www02.u-page.so-net.ne.jp/sb3/mizo/home/sub1/link2/?M=A +http://community.webshots.com/photo/5827455/5827535oqdRLPNiek +http://troy.lib.sfu.ca/search/dbiology+periodicals/dbiology+periodicals/19,-1,0,B/frameset&F=dbiology+religious+aspects&1,1 +http://213.36.119.69/do/session/152973/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/special/alitalia.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/programs/simple/linux/math/computers/tunes.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/programs/simple/linux/math/lit/hasard.html +http://www.elop.de/l0-1011-xx-3006-top.html +http://britanica.com/bcom/eb/article/idxref/0/0,5716,364643,00.html +http://britanica.com/bcom/eb/article/7/0,5716,28557+1+28108,00.html +http://www.geocrawler.com/archives/3/3174/2000/5/50/3724502/ +http://www.geocrawler.com/archives/3/3174/2000/5/50/3699557/ +http://www.geocrawler.com/archives/3/3174/2000/5/50/3689003/ +http://ftp.sunet.se/pub/FreeBSD/ports/ports-stable/net/slirp/files/ +http://www.duluxvalentine.com/FRANCE:219793321:DFinity.1QJiP4jmPgUaedp +http://mundo.ole.es/ocio/articulo/html/oci4270.htm +http://www.maasvlakte-cam.nl/webcams/43/etna__italy/1999/08/29/01:28:02.html +http://www.chinabyte.com/staticpages/builder/builder_course_next/HIPR/builder_course_next_219_HIPR.html +http://www.prospects2.csu.ac.uk/servlet/postgrad.TcAssess?pgid=9634 +http://ftp.sunet.se/pub/lang/perl/CPAN/authors/id/SPP/?N=D +http://www.egroups.com/message/WDT/7751 +http://pub8.ezboard.com/fapricotyarn.unsubscribeUnregisteredToTopic?topicID=4.topic +http://support.tandy.com/support_audio/doc9/9679.htm +http://megalink.tucows.com/winme/preview/74862.html +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/199/1996/2/0/2460450/ +http://www.monaco.gouv.mc/dataweb/gouvmc.nsf/(NewsActu)/d28eaee29b3287d4c1256905004e1ef1!OpenDocument&ExpandSection=10.3,10.4,7,9,4,6 +http://www.fao.org/montes/foda/wforcong/PUBLI/V2/T8S/1-3.HTM +http://library.cuhk.edu.hk/search*chi/a蔡淙霖,+1965-/a%7B215572%7D%7B214758%7D%7B215f60%7D+1965/-5,-1,0,B/browse +http://www.nrk.no/finnmark/x31_12_97/nyh6.htm +http://www.dailyrush.dk/stories/129/comments/pages/1 +http://home.wanadoo.nl/pieter.heres/nedbaskteam/nbt/Web%20Album%20nbt%20spelers/page3.htm +http://members.tripod.co.jp/masa_selfish/?M=A +http://bsd.sinica.edu.tw/cgi-bin/cvsweb.cgi/ports/misc/lile/patches/Attic/?sortby=date +http://www.chaos.dk/sexriddle/z/l/x/y/m/ +http://www.chaos.dk/sexriddle/z/l/x/y/p/ +http://users.sexyboards.com/amandaslut/messages/17.html +http://pub11.ezboard.com/fusscroatiastartrekanimators.showAddTopicScreenFromWeb +http://retailer.gocollect.com/do/session/1912610/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/help/site_tour/index.asp +http://ftp.sunet.se/pub/FreeBSD/ports/ports-current/misc/boxes/pkg-comment +http://www.ce-europe2.philips.com/do/session/80299/vsid/1034/tid/1034/cid/28533/mid/1020/rid/1021/chid/1024/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkZHbjbHrolLmbkKmefLifmLpkZHljlKmoaLl0/url/http://www.eu.microsoft.com/windows/ie_intl/es/ +http://www.peopledaily.co.jp/199904/26/newfiles/col_990426001084_tyxw.html +http://www.peopledaily.co.jp/199904/26/newfiles/col_990426001087_tyxw.html +http://iraustralia.com/listco/hk/swire/profile.htm +http://jefferson.village.virginia.edu/wax/slow/english/3pix/BRight2/1/1a5a15a1.html +http://infoserv2.ita.doc.gov/efm/efm.nsf/Sources!OpenView&Start=35.16&Count=30&Expand=37 +http://www.affiliate.hpstore.hp.co.uk/do/session/380772/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/entry1.asp +http://www.trax.nilex.co.uk/trax.cgi/A1S/B1U/B1R/A3S/A4R/C2U/ +http://www.trax.nilex.co.uk/trax.cgi/A1S/B1U/B1R/A3S/A4R/C2S/ +http://www.quia.com/email.cgi?7106&fc +http://www.mirror.edu.cn/res/sunsite/pub/academic/agriculture/sustainable_agriculture/news+mail-archives/6/ +http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/Beholder/CVSROOT/config?only_with_tag=MAIN +http://collection.nlc-bnc.ca/100/201/300/info_tabac/html/1998/bull21/poumon.html +http://www.erotism.com/sweetlostcherry/g3.htm +http://adex3.flycast.com/server/socket/127.0.0.1:2800/click/SharewareMusicMachine/MusicSoftware1/96457 +http://members.tripod.com/~tonarcos/paginas/Nancy1.html +http://www.gbnf.com/genealog2/stout/html/d0024/I2144.HTM +http://ftp.du.se/disk4/FreeBSD/branches/4.0-stable/ports/deskutils/cbb/ +http://www.hri.org/docs//statedep/95-09-13.std.html +http://ftp.univie.ac.at/packages/tex/macros/latex//contrib/supported/eurofont/adobeuro/readme.txt +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/showNextUnseen/fol/100001/1513138 +http://tucows.ipv.pt/winnt/adnload/1891_28712.html +http://www.tucsonweekly.com/tw/02-09-95/danehy.htm +http://message/artefactphil/87?expand=1 +http://www.kiarchive.ru:8091/pub/FreeBSD/FreeBSD-current/src/gnu/Makefile/ +http://retailer.gocollect.com/do/session/1912644/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/index.asp +http://retailer.gocollect.com/do/session/1912644/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/about.asp +http://park.org:8888/Cdrom/TheNot/Mail/NotPark/msg00070.html +http://citeseer.nj.nec.com/cachedpage/67611/1 +http://citeseer.nj.nec.com/cidcontext/1053642 +http://www.3w-buecher.de/GiacamanGeorge/GiacamanGeorge0745312381.htm +http://au.yahoo.com/Regional/U_S__States/Colorado/Cities/Littleton/Real_Estate/Agencies/ +http://www.power2lead.com/Global/English.nsf/pgWWLocations!OpenPage&ExpandSection=21,28,29,32,22 +http://hem.fyristorg.com/bfo/gagarin/WWW.SAMIRADIO.ORG/svenska/sport-sv.html +http://www.chaos.dk/sexriddle/e/n/q/v/m/ +http://www.hig.se/(formoutput,remove_cookie,sort,sql,sqlquery)/~jackson/roxen/ +http://129.142.8.149/ds/it/isodocs/122400/12240011/12240000117900/ +http://129.142.8.149/ds/it/isodocs/122400/12240011/12240000116400/ +http://129.142.8.149/ds/it/isodocs/122400/12240011/12240000116200/ +http://129.142.8.149/ds/it/isodocs/122400/12240011/12240000113100/ +http://129.142.8.149/ds/it/isodocs/122400/12240011/12240000110800/ +http://koi.www.citycat.ru/funny/fido/2000_10/07.html +http://koi.www.citycat.ru/funny/fido/2000_10/09.html +http://www.hig.se/(countdown,debug,header,if,return)/~jackson/roxen/ +http://www.findtravel.to/search_engine_directory/north_america_usa_canada/united_states/michigan/_travel_guides/ +http://mediate.magicbutton.net/do/session/625534/vsid/3255/tid/3255/cid/87978/mid/2008/rid/2157/chid/2581/url/http://www1.getmapping.com/competition/index.cfm +http://mediate.magicbutton.net/do/session/625534/vsid/3255/tid/3255/cid/87978/mid/2008/rid/2157/chid/2581/url/http://www1.getmapping.com/aboutus/partners2.cfm +http://www.petropages.com/products/p9827.htm +http://www.egroups.com/login.cgi?login_target=%2Fmessage%2Fspynews%2F54 +http://health.sx.zj.cn/Treatment/SuperGuide/2000-3-8/4716.htm +http://www.nease.net/~qin/chardware.htm +http://www.argos.asso.fr/bourges/pratiq/emploi/texte/anpesud.htm +http://ftp.sunet.se/pub/FreeBSD/ports/ports-current/www/p5-Apache-Session/?S=A +http://www.eveclub.com/cgi-bin/eveclub.front/972959425847/Catalog/1000046 +http://retailer.gocollect.com/do/session/1912628/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/top_ten.asp?pagenum=1 +http://yp.gates96.com/1/10/21/73.html +http://yp.gates96.com/1/10/21/95.html +http://yp.gates96.com/1/10/22/21.html +http://yp.gates96.com/1/10/22/31.html +http://yp.gates96.com/1/10/22/52.html +http://yp.gates96.com/1/10/22/76.html +http://yp.gates96.com/1/10/22/79.html +http://yp.gates96.com/1/10/23/57.html +http://yp.gates96.com/1/10/23/73.html +http://yp.gates96.com/1/10/25/20.html +http://yp.gates96.com/1/10/25/46.html +http://yp.gates96.com/1/10/25/87.html +http://yp.gates96.com/1/10/26/76.html +http://yp.gates96.com/1/10/26/84.html +http://yp.gates96.com/1/10/27/67.html +http://yp.gates96.com/1/10/28/70.html +http://yp.gates96.com/1/10/28/91.html +http://live.excite.com/lifestyle/politics_and_society/countries/asia/uzbekistan/guides_and_reference/ +http://biblioteca.upv.es/bib/doc/doc_fisbd/367/114176//C/1825519/0////25/S/MLTPAI +http://mai.flora.org/forum/5322 +http://mai.flora.org/forum/5318 +http://www.brickshelf.com/scans/0000/0715/0715-03.html +http://www.brickshelf.com/scans/0000/0715/0715-12.html +http://www.brickshelf.com/scans/0000/0715/0715-21.html +http://www.msb.malmo.se/search*swe/dManikyr/dmanikyr/-5,-1,0,B/frameset&F=dmani&1,1 +http://message/cinematik/2441?expand=1 +http://message/cinematik/2447?expand=1 +http://www.jamba.de/KNet/_KNet-Rco8j1-WDd-137sh/showInfo-special1.de/node.0/cde7f1uou +http://www.jamba.de/KNet/_KNet-Rco8j1-WDd-137ss/showInfo-hilfe.de/node.0/cde7f1uou +http://acmepet.petsmart.com/canine/breeds/labrador/bboard/messages/5245.html +http://acmepet.petsmart.com/canine/breeds/labrador/bboard/messages/5226.html +http://config.tucows.com/winnt/adnload/67680_29009.html +http://config.tucows.com/winnt/adnload/55386_29005.html +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/kdeutils/knotes/Attic/renamedlg.cpp?r1=1.7&only_with_tag=MAIN +http://www.imagestation.com/member/?name=Twiggy5&c=1 +http://cometweb01.comet.co.uk/do!tid=20&rtid=3&vsid=700&session=131981&mid=1000&rid=1060&cid=37030&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHljbLqleHqjiLlel5jblKqlmLkeq5j1 +http://community.webshots.com/photo/1921549/2334169DWEIWPyCoH +http://www.fogdog.com/cedroID/ssd3040183158605/nav/stores/skateboarding/ +http://www.fogdog.com/cedroID/ssd3040183158605/content/fan/subway_series/ +http://www.fogdog.com/cedroID/ssd3040183158605/boutique/ashworth/ +http://www.fogdog.com/cedroID/ssd3040183158605/customer_service/our_partners.html +http://www.jacksonhewitt.com/ctg/cgi-bin/JacksonHewitt/media_center/AAAksrACwAAACCOAAl +http://www.jacksonhewitt.com/ctg/cgi-bin/JacksonHewitt/talktous/AAAksrACwAAACCOAAl +http://arabia.com/jordan/article/print/1,5130,3048|Life,00.html +http://198.3.99.101/reference/politics_and_govt/humor/games/ +http://www.pocketbible.co.kr/old/Leviticus/Leviticus24/Leviticus24-14.htm +http://www.ozon.ru/detail.cfm/ent=5&id=12&txt=1 +http://www.ozon.ru/detail.cfm/ent=2&id=2141 +http://www.chaos.dk/sexriddle/m/t/i/t/j/ +http://www.outpersonals.com/cgi-bin/w3com/pws/out/5VhIq3rCy0eiHAzs1LOyTswNBIR33Wxc8NtFBCnYVNlrV5p9laRchaQrPWdU7-F739tsfX-p5-IA-j1rTm1YLCRAwn1FAriW9Ps21GP6CvyIL7YFYjLtOcez03i6Q9Xw3LRDtJY2CIzGQuZp-sH_-s_D66j9 +http://www.outpersonals.com/cgi-bin/w3com/pws/out/lKhIoWbn-weE729M1n0JT8Ina4qOfm_FI2ROg8RdrrVu5kq_AK_urPMHafLCMwWCiOLuc8OIIHCFnJaCfz2LSrURBHFjDJP1fBO0X58Y28opSv0qVXWAKYtub7NbCIIWMbE_ldcypBmh +http://www.outpersonals.com/cgi-bin/w3com/pws/out/PbhIoduIKw3faQWbBTWSK5aq7Y-nGqcvK3flLaTRo02t7k7GMY8rPlupJIheD8869wCXUAer4VimzyYa25qUx7ef2l2VdMR9i_p-pJ5gg2S6ZcP-G6RuPfdDS3TEsJNXGVsOTs1rA605 +http://www.linux.com/networking/network/development/web_server/performance/?printable=yes +http://www.linux.com/networking/network/development/web_server/performance/IBM/ +http://sunsite.icm.edu.pl/Linux/Documentation/HOWTO/mini/IP-Subnetworking-3.html +http://dreamcity.gaiax.com/www/dreamcity/m/s/musou/frame.html +http://guardian.co.uk/Widgets/Read_It_Later/TR/1,4694,4043922,00.html +http://www.gpul.org/ftp/os/infinite/?M=A +http://www.gpul.org/ftp/os/infinite/infinite_OS.txt +http://retailer.gocollect.com/do/session/1912666/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/exclusives/exclusives.asp +http://yp.gates96.com/13/77/10/66.html +http://yp.gates96.com/13/77/10/91.html +http://yp.gates96.com/13/77/11/82.html +http://yp.gates96.com/13/77/12/17.html +http://yp.gates96.com/13/77/13/68.html +http://yp.gates96.com/13/77/13/80.html +http://yp.gates96.com/13/77/16/3.html +http://yp.gates96.com/13/77/16/17.html +http://yp.gates96.com/13/77/16/49.html +http://yp.gates96.com/13/77/17/8.html +http://yp.gates96.com/13/77/18/4.html +http://yp.gates96.com/13/77/18/61.html +http://yp.gates96.com/13/77/18/71.html +http://yp.gates96.com/13/77/19/3.html +http://yp.gates96.com/13/77/19/24.html +http://yp.gates96.com/13/77/19/48.html +http://yp.gates96.com/13/77/19/98.html +http://yp.gates96.com/13/77/19/99.html +http://scsinternet.tucows.com/winnt/mail95.html +http://tolm.terrashare.com/45.htm +http://news.dreamwiz.com/news/08/20001030/kukmin/200010301903081903261.html +http://www.tccomputers.com/cgi-bin/bp/1463655603/services/info/tci.htm +http://www.tccomputers.com/cgi-bin/bp/1463655603/services/csc/csc.htm +http://www.2pl.com/b/pl/to/1/01/04/v2/1010400016-6-2r.htm +http://www.2pl.com/b/pl/to/1/01/04/v2/1010400016-3-2r.htm +http://www.2pl.com/b/pl/to/1/01/04/v2/1010400016-18-2r.htm +http://www.2pl.com/b/pl/to/1/01/04/v2/1010400016-1r.htm +http://www.123bestphonerates.com/q/001p/vn/vR85aEOIaY.htm +http://www.thisislancashire.co.uk/lancashire/archive/1997/07/17/SPORTST5VQ.html +http://www.thisislancashire.co.uk/lancashire/archive/1997/07/17/SPORTST7VQ.html +http://www.thisislancashire.co.uk/lancashire/archive/1997/07/17/SPORTST11VQ.html +http://www.elsur.cl/archivo/marzo2000/13marzo2000/elsur/deportes/ind3.php3 +http://home.no.net/fristart/kvasir816/ +http://www.fun7.de/party/cafe_europa/_vti_cnf/?D=A +http://www.users.yun.co.jp/cgi-bin/moriq/pigeon/pigeon.cgi/%C5%E7%BA%AC%B8%A9.%C2%E7%B8%B6%B7%B4%C2%E7%C5%EC%C4%AE?c=e +http://polygraph.ircache.net:8181/http_-2www.whowhere.com/http_-2www.expired.com/html/service.html +http://home.t-online.de/home/mtc.hannover/head1655833.htm +http://moneycentral.msn.com/investor/invsub/insider/Details.asp?Pval=1&Symbol=MKSI +http://www.sohu.com/Regional/hunan/City_County/Yiyang/Firms/Food_Beverage/ +http://www.kulturkreis-rhein-lahn.de/lauer/fax.htm +http://ustlib.ust.hk/search*chi/aporter+bill+1943/aporter+bill+1943/7,-1,0,B/browse +http://www.brio.de/BRIO.catalog/39fe2f3708fb3c8e2740d472aa7806d5/UserTemplate/2 +http://www.brio.de/BRIO.catalog/39fe2f3708fb3c8e2740d472aa7806d5/UserTemplate/6 +http://rcsl.auto.inha.ac.kr/~treeman/Documents/HOWTO/Keyboard-and-Console-HOWTO-19.html +http://www.etoys.com/cat/toy/category/construction/brio_builder_system/1 +http://www.kxmd.com/now/story/0,1597,194790-295,00.shtml +http://www.ferien-immobilien.de/DominikanischeRep/verkauf/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/Gemeinsam/Gemeinsam/versicherungen/gebaeude/IIM-Teil/Startseite/froben.htm +http://hiv.medscape.com/LWW/SMD/1999/v21.n03/smd2103.01.html +http://www.egroups.com/message/dk-jaws/530 +http://no.egroups.com/message/daemon-news-announce/12 +http://ring.toyama-ix.net/archives/text/elisp/jaist/yamaoka/apel/00_THIS_DIRECTORY_WILL_NOT_BE_UPDATED_UNTIL_2000-10-26 +http://pub12.ezboard.com/ftibesataxg1637tibes.subscribeUnregisteredToTopic?topicID=7.topic +http://ustlib.ust.hk/search*chi/ali+huan+1827+1891/ali+huan+1827+1891/-5,-1,0,E/frameset&F=ali+huan&4,,0 +http://ustlib.ust.hk/search*chi/ali+huan+1827+1891/ali+huan+1827+1891/-5,-1,0,E/frameset&F=ali+huang+1895&1,,0 +http://www.digitalcity.com/cincinnati/sports/log.dci?league=NCF&team=NNF +http://ftp.nacamar.de/pub/debian/dists/potato/main/disks-m68k/2.2.16-2000-07-14/mac/images-1.44/?D=A +http://www.academyfloral.com/state/arboo/flowers/thanksabunchbouquet2.html +http://dante.bdp.it/cgi-bin/poseidon_v2.0/reflect/poseidon/disc/peacelink-scuola/2015003604/view/8 +http://ring.omp.ad.jp/pub/NetBSD/NetBSD-current/pkgsrc/lang/smalltalk/files/?S=A +http://ring.omp.ad.jp/pub/NetBSD/NetBSD-current/pkgsrc/lang/smalltalk/files/patch-sum +http://carriage.de/Schoner/Sammlungen/literature/collections/literature/modelle/ +http://www.buybuddy.com/sleuth/27/1/11001/1692/ +http://193.120.14.241/pub/languages/perl/CPAN/src/5.0/devel/ +http://lastminutetravel.bedandbreakfast.com/bbc/p208900.asp +http://chat.sportsline.com/u/wire/stories/0,1169,2957692_59,00.html +http://acad.uis.edu/sas/qc/q-index.htm +http://acad.uis.edu/sas/qc/s-index.htm +http://library.cuhk.edu.hk/search*chi/aPan,+Zhuonan./apan+zhuonan/-5,1,1,B/frameset&F=apan+zhichang+1956&1,1, +http://www.linux.com/networking/network/install/tools/updates/new/ +http://www.linux.com/networking/network/install/tools/updates/Standards/ +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=13,31,5,11,26 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=23,31,5,11,26 +http://www.mfa.no/fin/norsk/publ/stprp/006005-991562/index-hov017-b-n-a.html +http://ftp.sunet.se/pub/lang/perl/CPAN/authors/id/DBEAZLEY/?N=D +http://fi.egroups.com/messages/infoespo/6?expand=1 +http://ibc.cn.net/2000/0718/it-1message.html +http://www.shaggysguide.com/conhtml/adnload/51647_1809.html +http://www.shaggysguide.com/conhtml/adnload/51657_5567.html +http://www.shaggysguide.com/conhtml/adnload/74370_17872.html +http://www.shaggysguide.com/conhtml/adnload/78469_19520.html +http://www.shaggysguide.com/conhtml/adnload/78940_19788.html +http://www.backflip.com/members/jhferrara/5171381/page=1/sort=1/linkspp=10 +http://www.amcity.com/philadelphia/stories/1998/08/24/newscolumn3.html?t=printable +http://www.rge.com/pub/tex/biblio/bibtex/ms-dos/demel/?N=D +http://www.v2music.com/Scripts/WebObjects-ISAPI.dll/V2_New_Publisher.woa/67841000005885200000309700000064451/Giveaways.wo/257820000054451/2.0.0.6.0/3/Webobjects1 +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www-gds.desy.de:8080/zeitpl/zpl.htm +http://click-to.tell-a-friend.boardhost.com/tell-a-friend-confirm.cgi?chudtvlogic&msg=1596 +http://retailer.gocollect.com/do/session/1912639/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://www.jpc-music.com/5590216.htm +http://huntingfishing.tripod.com/sturgeonmain.htm +http://polygraph.ircache.net:8181/wwwboard/prodev/seminar/fast/http_-2www.centennialcc.org/bps.html +http://www.chaos.dk/sexriddle/s/t/c/x/l/ +http://www.chaos.dk/sexriddle/s/t/c/x/z/ +http://es.egroups.com/messages/plato-meno/1285 +http://tonggu-gch.ed.seoul.kr/home/2grade/2-10/981001/hang.htm +http://sjsulib1.sjsu.edu:81/search/dreligion/-5,-1,0,E/exact&dreligion+libraries&1,3 +http://www.generation-formation.fr/chiffrec.htm---o21zAo0UPwo0Ol9A074fo6Td4ezyr6feZJPAPfVbNyqHSezTHkekydMfeZJPdspt6dsSAtdsNhJdspt6dsrvrdjlhkfbd.htm +http://www.generation-formation.fr/dicoguid/diclogin.htm---o21zAo0UPwo0Ol9A074fo6Td4ezyr6feZJPAPfVbNyqureds5cezwhlezMpDeH7vGebI1yoKkfMd4vmMAxaAooKkfMd4u5xdfb7rmdfbT.htm +http://www.hollywoodonline.com/asplocal/mgvideoad.asp?rushhour-video-holdon-mov +http://www.ifg.uni-kiel.de/doc-clients/kdelibs-doc/html/kdeui/full-list-KRestrictedLine.html +http://www.3w-sciencefiction.de/ShapiroLarry/ShapiroLarry0760306729.htm +http://202.96.140.98/js/wenge/ +http://www.great-cyber-mall.com/SelectCompany.asp?CityID=230&CatID=19 +http://www.great-cyber-mall.com/SelectCompany.asp?CityID=230&CatID=34 +http://www.amazon.com.hk/exec/obidos/tg/stores/browse/-/books/13361/ +http://www.hole.kommune.no/hole/journweb.nsf/weboffjournal!OpenView&Start=99&Count=50&Collapse=116 +http://www.pbase.com/image/35702/small +http://www.infoscape.com.cn:8171/nf/0010/21/nfzy2104.htm +http://dell.excite.com/photo/topic/weather/national/19 +http://www.linux.com/networking/network/network/firewall/microsoft/government/ +http://www.gasex.com/gay.photo/gay.penis.pics.html +http://hausarbeiten.de/cgi-bin/superDBinters.pl/archiv/geschichte/gesch-stedinger.shtml +http://polygraph.ircache.net:8181/http_-2www.microsoft.com/frontpage/http_-2www.exploreuw.com/cards/ssoenews.html +http://www.fogdog.com/cedroID/ssd3040183137325/cgi-bin/MyFogdog +http://www.fogdog.com/cedroID/ssd3040183137325/cgi-bin/CedroCommerce?func=EditBasket +http://www.fogdog.com/cedroID/ssd3040183137325/nav/stores/cycling/ +http://www.fogdog.com/cedroID/ssd3040183137325/nav/stores/snowboarding/ +http://tucows.wanadoo.nl/win2k/organ2k_license.html +http://tucows.wanadoo.nl/win2k/preview/59164.html +http://windows.tucows.com/preview/001-009-005-005C.html +http://anekdotwall.boom.ru/car/html/75.htm +http://tucows.concepts.nl/win2k/clipb2k_size.html +http://tucows.concepts.nl/win2k/adnload/37291_29917.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=cricrila&l=pt +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=cricrilava&l=pt +http://www.trax.nilex.co.uk/trax.cgi/A1C/1AR/A2S/A3S/A3D/D1S/ +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_ngqyjt_ngqyjt.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_rtnucb_tyciyrg.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_kiektgt_fpwif.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_rjdbc_rjdbc.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_xsygo_xsygo.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_bovqcy_mkaqta.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_lgbrnl_psnjjt.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_lgbrnl_ybvfp.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_vermn_xmxmm.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/12_keojvu_faoex.html +http://info-china.hypermart.net/enterprise/company/messages/25.html +http://ring.yamanashi.ac.jp/pub/linux/debian/debian-jp/dists/potato/non-US/contrib/binary-m68k/Release +http://www.amigos.com/cgi-bin/w3com/pws/ffe/R7RIRASjZ5ATyRjNyXQBbwzK4LLK-rhgzZEBqJsLaR1cdnaeB7LT1xORWRg6aQmLxO7QWLEpsdjuf2ZqAnUO1IKpfrRctaIMYIzMNy1DSb7dp8_5z39WdF7oxbKUAByA +http://indigotrem1.chemie.uni-mainz.de/~manng001/Filme/S/SexLuegenundVideo.html +http://se.egroups.com/message/hur/387 +http://www.ilmessaggero.it/hermes/19990111/07_MARCHE/MARCHE_REGIONE/DUE.htm +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/lit/quizz/misc/colorart/lit/pushkin.html +http://www.amzn.com/exec/obidos/ts/artist-glance/201040/ref=pm_dp_ln_m_6/ +http://tucows.netpower.no/winme/adnload/138674_29970.html +http://www.chaos.dk/sexriddle/z/d/q/p/c/ +http://www.chaos.dk/sexriddle/z/d/q/p/u/ +http://sv.pachinkovillage.co.jp/catalog/DinoVaderB/3.html +http://ww2.comune.fe.it/cgi-win/hiweb.exe/a2/B1,a,1f,6,6,3a,3a,,5,,1f,5, +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=deflazioneranno&l=it +http://polygraph.ircache.net:8181/company/html/http_-2www.io.com/~kinnaman/pchealth/f-agents.html +http://polygraph.ircache.net:8181/company/html/http_-2www.io.com/~kinnaman/pchealth/f-leisureworld.html +http://ftp.univie.ac.at/packages/perl/modules/by-module/Tie/ILYAZ/cperl-mode/rms-emacs-20.2-patch-narrow-buffer+dirfiles +http://www.expressindia.com/ie/daily/19991126/ige26097p.html +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/ELINKEINO-+JA+YRITYSTOIMINTA/yritt%E4jyys/lukio/oppimateriaali/itseopiskelu/ +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=36,23,11,33,18 +http://www.trib.com/scjournal/ARC/1996/MAR/3_24_96/marines.html +http://www.slac.stanford.edu/BFROOT/www/Computing/Programming/QA/QaBetaTools/6.7.5a/SunOS5/?S=D +http://pokemonplant.tripod.com/150yellow.html +http://ftp.debian.org/dists/potato/contrib/binary-all/devel/?N=D +http://sunsite.org.uk/packages/tcl/Collections/ftp.neosoft.com/sorted/packages-8.0/print/frink/1.2p35/ +http://library.bangor.ac.uk/search/m304.6+LIN/m304.6+lin/-5,-1,0,B/frameset&F=m304.6+jos&1,1 +http://members.tripod.lycos.nl/janninksweg145/huis.htm +http://www.uib.no/People/mihtr/PS01/PS01_219.htm +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus141561/eus174865/eus327367/eus327602/eus329879/ +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus141561/eus174865/eus327367/eus327602/eus327608/ +http://sound-dist.secured.co.uk/cgi-bin/psShop.cgi/add|39P02|972959512|Communications|user|0|1,0,0,1 +http://www.bluefreds.f9.co.uk/vote2.html +http://www.hri.org/docs//statedep/1999/99-05-07.std.html +http://polygraph.ircache.net:8181/http_-2www.hblinfo.com/f_snowbuddies.html +http://mediate.magicbutton.net/do/session/625565/vsid/3342/tid/3342/cid/88020/mid/2008/rid/2313/chid/2648/url/http://www1.getmapping.com/products.cfm +http://cometweb01.comet.co.uk/do!tid=20&rtid=2&vsid=692&session=131975&mid=1000&rid=1060&cid=37051&chid=1702&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG5ubLZDXLZolLl3l5jbqLlci5XqVLkXsLkao4tloHbmlLoq5 +http://digilander.iol.it/net4free/spedia.htm +http://totalsports.aol.com/stats/bbo/mlb/20000425/col.at.mon.prvw.html +http://210.178.135.1/netbbs/Bbs.cgi/nhic32042/qry/pno/0/zka/B2-kB2Zk/qqatt/^ +http://cikkek.lezlisoft.com/kikelet/spiritualitas/spirit3v9.shtml +http://www.wingateinns.com/ctg/cgi-bin/Wingate/aarp/AAAksrACwAAACCPAAl +http://sunsite.berkeley.edu/PhiloBiblon/BITAGAP/BIB/BIB1848.html +http://sunsite.uakom.sk/tucows/adnload/69390_28371.html +http://sunsite.uakom.sk/tucows/preview/77630.html +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=(22,0+9,0-~0,3 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=(22,0+9,0-~9,6 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=(22,0+9,0-~21,0 +http://sirac.inrialpes.fr/Infos/Personnes/Christophe.Rippert/ressources/jdk1.2.2/docs/api/java/security/ +http://polygraph.ircache.net:8181/getting_started/http_-2www.microsoft.com/powered/radio/email_pal/email_pal.htm +http://mirror.nucba.ac.jp/mirror/FreeBSD/branches/2.2-stable/ports/net/tund/?M=A +http://mirror.nucba.ac.jp/mirror/FreeBSD/branches/2.2-stable/ports/net/tund/?D=A +http://library.bangor.ac.uk/search/tNursing+times+clinical+monographs+&%2359%3B+no.+51/tnursing+times+clinical+monographs+no+++51/-17,-1,0,B/browse +http://library.bangor.ac.uk/search/tNursing+times+clinical+monographs+&%2359%3B+no.+51/tnursing+times+clinical+monographs+no+++51/-5,-1,0,B/frameset&F=tnursing+times+complementary+therapy&1,1 +http://ftp.chg.ru/pub/FreeBSD/doc/en_US.ISO_8859-1/articles/programming-tools/ +http://polygraph.ircache.net:8181/getting_started/http_-2www.microsoft.com/powered/bomb/bomb.htm +http://linux.tucows.inwind.it/conhtml/adnload/8523_5414.html +http://www.magicvillage.de/magicvillage/KonferenzPlaza/fbs/%2328835852?NextInThread +http://www.shopworks.com/samplers/index.cfm/action/cart/userid/0009CECE-2EE1-19FE-9038010B0A0ADCF2 +http://dailynews.sina.com/newsCenter/taiwan/udn/2000/1021/2051701_b5.html +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/kdeutils/khexedit/pics/Attic/?hideattic=1&sortby=date +http://moviestore.zap2it.com/browse/MOVIES/BOWL/s.zchC6lsi +http://moviestore.zap2it.com/browse/MOVIES/MUSIC/s.zchC6lsi +http://ww2.comune.fe.it/cgi-win/hiweb.exe/a2/d13/b12,c,1f,18,18,,13,,1f,13,17,,1f,17, +http://ww2.comune.fe.it/cgi-win/hiweb.exe/a2/d14/b12,c,1f,18,18,,13,,1f,13,17,,1f,17, +http://209.50.251.176/~bb/ +http://tucows.energy.it/winnt/adnload/59163_30035.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=circundara&l=pt +http://vishvesha.tripod.com/4/068d.htm +http://www.hot.ee/timbsy/kass_files/pildikogu.html +http://www3.newstimes.com/archive99/jan2599/rga.htm +http://pub11.ezboard.com/fmarjoriesdmboardpostyourdmpedigreeshere.showMessage?topicID=21.topic +http://www.geocities.com/Heartland/Plains/4825/bennyn.html +http://citeseer.nj.nec.com/site/115145 +http://www.techsupplies.com/sleuth/17/1/40406/254200/ +http://ccmnet.xj.cei.gov.cn/10/b10/b1007/99-05-02/a5-02.asp +http://206.251.18.85/FEATURES/home_improvement/1999/10/01/fall_lawncare3.html +http://www.dulux.co.uk/UKRETAIL:1355333640:DFinity.1QJiP4jmPgimjKlA +http://cometweb01.comet.co.uk/do!tid=20&rtid=2&vsid=700&session=131985&mid=1000&rid=1060&cid=37030&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG5ubLZDXLZolLl3l5jbqLlci5XqVLkXsLkao4tloHbmlLoq5 +http://cometweb01.comet.co.uk/do!tid=20&rtid=1&vsid=700&session=131985&mid=1000&rid=1060&cid=37030&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplGGolLarZLq4fLpmiLXv-KmooLckYLoznGmpq0qsc0mojLbkYLozvGotc0ZdoLckYLozvGsmv0qmc0jXfLkVZLdocLkYoLzcj1XfkLVZXLqkXLjbzKcob5qroLkVrLoizKlZd5fjYHfklKkZlLjjbLoZbLpl51ubZLDXZLollK3ljLbqlKjXfLkkaHotl4obmLloqL +http://www.berliner-morgenpost.de/bm/inhalt/990928/berlin/story14.html +http://gb.toget.com.tw/article/printer_tool/19990825_3210_p1.html +http://sbtr42.sbsusa.com/ncsamples/base1.htm +http://halflife02.opasia.dk/cs3stats/players/_AMNeSIA_.html +http://mediate.magicbutton.net/do/session/625570/vsid/3342/tid/3342/cid/88020/mid/2008/rid/2313/chid/2648/url/http://www1.getmapping.com/basket.cfm +http://mediate.magicbutton.net/do/session/625570/vsid/3342/tid/3342/cid/88020/mid/2008/rid/2313/chid/2648/url/http://www1.getmapping.com/viewer.cfm +http://www.citythek.de/erfurt/rheinhyp/fsinhalt.htm +http://my.egroups.com/group/mall-komputer +http://www-bd.cricket.org/link_to_database/ARCHIVE/1997-98/PAK_IN_RSA/PAK_IN_RSA_JAN-APR1998_PAK-SQUAD.html +http://www-bd.cricket.org/link_to_database/GROUNDS/RSA/ST-GEORGE_PARK_PT-ELIZ/ +http://www-bd.cricket.org/link_to_database/ARCHIVE/1997-98/PAK_IN_RSA/PAK_RSA_T3_06-10MAR1998_ET_MR.html +http://www.bemi-immobilien.de/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/versicherungen/unfall/Gemeinsam/erreichenPartner/Gemeinsam/MarketingStrategie/Gemeinsam/versicherungen/gebaeude/Gemeinsam/Top-Darlehens-Konditionen/anforderungsformular.htm +http://www.online.kokusai.co.jp/Qa/V0043459/wrd/G800/qa/ +http://iland.tucows.com/win2k/adnload/59229_29990.html +http://iland.tucows.com/win2k/preview/144411.html +http://iland.tucows.com/win2k/adnload/38173_29963.html +http://www.arm.com/sitearchitek/armtech.ns4/8ab0ea422fba51238025691f00399e13/9cb09cb360a967848025691f004e28b2!OpenDocument&ExpandSection=6,13,12,-1 +http://ftp.uni-mannheim.de/languages/perl/CPAN/modules/by-authors/id/JMURPHY/?N=D +http://proam.golfonline.com/tours/2000/hooters/silversprings/scores2.html +http://ftp.du.se/pub/FreeBSD/branches/4.0-stable/src/games/grdc/ +http://ftp.du.se/pub/FreeBSD/branches/4.0-stable/src/games/pom/ +http://ftp.du.se/pub/FreeBSD/branches/4.0-stable/src/games/Makefile +http://www.artex.firenze.it/_qualitart/articoli/zoom/03651.htm +http://www.chaos.dk/sexriddle/m/k/v/b/p/ +http://www.chaos.dk/sexriddle/m/k/v/b/s/ +http://www.chaos.dk/sexriddle/t/j/d/n/n/ +http://www.daysinn.com/ctg/cgi-bin/DaysInn/media_center/AAAksrACwAAACCQAAM +http://tukela.heha.net/ys/ll/boyuan.htm +http://tukela.heha.net/ys/ll/jinciming.htm +http://genforum.genealogy.com/ai/messages/4299.html +http://genforum.genealogy.com/ai/messages/4221.html +http://genforum.genealogy.com/ai/messages/4225.html +http://www.linkclub.or.jp/~sticky/index1/diary/1999/199906.html +http://ww.egroups.com/subscribe/lexingtonkystrapon +http://chita.fi.upm.es/docs/info/en_US/a_doc_lib/motif/motifsg/About.htm +http://chita.fi.upm.es/docs/info/en_US/a_doc_lib/motif/motifsg/motifsg41.htm +http://chita.fi.upm.es/docs/info/en_US/a_doc_lib/motif/motifsg/motifsg43.htm +http://hakuba-net.gr.jp/guide/rest/spa_each/spa_2.html +http://yp.gates96.com/6/16/40/22.html +http://yp.gates96.com/6/16/40/44.html +http://yp.gates96.com/6/16/40/50.html +http://yp.gates96.com/6/16/40/69.html +http://yp.gates96.com/6/16/40/83.html +http://yp.gates96.com/6/16/41/49.html +http://yp.gates96.com/6/16/41/50.html +http://yp.gates96.com/6/16/41/67.html +http://yp.gates96.com/6/16/42/15.html +http://yp.gates96.com/6/16/42/51.html +http://yp.gates96.com/6/16/42/56.html +http://yp.gates96.com/6/16/43/8.html +http://yp.gates96.com/6/16/43/69.html +http://yp.gates96.com/6/16/43/71.html +http://yp.gates96.com/6/16/44/11.html +http://yp.gates96.com/6/16/44/51.html +http://yp.gates96.com/6/16/45/20.html +http://yp.gates96.com/6/16/45/43.html +http://yp.gates96.com/6/16/46/12.html +http://yp.gates96.com/6/16/46/25.html +http://yp.gates96.com/6/16/46/64.html +http://yp.gates96.com/6/16/47/42.html +http://yp.gates96.com/6/16/47/80.html +http://yp.gates96.com/6/16/48/54.html +http://yp.gates96.com/6/16/48/85.html +http://yp.gates96.com/6/16/49/51.html +http://yp.gates96.com/6/16/49/62.html +http://assgay.com/main.html?fuck.cock.gaysex +http://ring.yamanashi.ac.jp/pub/linux/linuxppc/contrib/software/System_Environment/Libraries/?S=A +http://computalynx.tucows.com/winme/adnload/138681_29976.html +http://computalynx.tucows.com/winme/adnload/138706_29992.html +http://computalynx.tucows.com/winme/adnload/138690_29990.html +http://computalynx.tucows.com/winme/adnload/138694_29981.html +http://iceberg.adhomeworld.com/cgi-win/redirect.exe/851857198 +http://link.fastpartner.com/do/session/600337/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/mondosoft.php +http://link.fastpartner.com/do/session/600337/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/nordicliving.php +http://link.fastpartner.com/do/session/600337/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/create/learn.htm +http://www.linux.com/networking/network/applications/hardware/device/development/ +http://www.linux.com/networking/network/applications/hardware/device/Corel/ +http://www.linux.com/networking/network/applications/hardware/device/?kw_offset=50 +http://ftp.gigabell.net/debian/dists/unstable/main/binary-m68k/sound/?M=A +http://no.egroups.com/message/slfxpzur/36 +http://no.egroups.com/message/slfxpzur/38 +http://nuance.dhs.org/lbo-talk/0004/2286.html +http://www.jamba.de/KNet/_KNet-XEk8j1-ADd-136sq/showInfo-datenschutz.de/node.0/cde7f1uou +http://yp.gates96.com/2/37/60/0.html +http://yp.gates96.com/2/37/60/13.html +http://yp.gates96.com/2/37/61/24.html +http://yp.gates96.com/2/37/61/66.html +http://yp.gates96.com/2/37/62/5.html +http://yp.gates96.com/2/37/62/31.html +http://yp.gates96.com/2/37/63/31.html +http://yp.gates96.com/2/37/63/43.html +http://yp.gates96.com/2/37/63/48.html +http://yp.gates96.com/2/37/63/60.html +http://yp.gates96.com/2/37/63/88.html +http://yp.gates96.com/2/37/64/62.html +http://yp.gates96.com/2/37/64/74.html +http://yp.gates96.com/2/37/65/0.html +http://yp.gates96.com/2/37/66/20.html +http://yp.gates96.com/2/37/67/41.html +http://yp.gates96.com/2/37/68/2.html +http://yp.gates96.com/2/37/68/50.html +http://yp.gates96.com/2/37/69/15.html +http://yp.gates96.com/2/37/69/41.html +http://yp.gates96.com/2/37/69/47.html +http://yp.gates96.com/2/37/69/60.html +http://yp.gates96.com/2/37/69/75.html +http://yp.gates96.com/2/37/69/76.html +http://gettosdownloads.subportal.com/sn/Palm_Pilot/Games/12428.html +http://news.novgorod.ru/read/65/2000/10/27/10/49 +http://www.schwan.de/links-biografie.html +http://www.fogdog.com/cedroID/ssd3040183124617/cgi-bin/MyFogdog +http://www.nrk.no/finnmark/x27_6_97/nyh9.htm +http://www.aelita.net/products/news/services/sitemap/~archive/Download_redirect/company/Copyright.htm +http://www.staroriental.net/nav/soeg_c/ihf,aol,n15,149,TVB香港å°å§2000.html +http://members.xoom.com/agent187/politics.htm +http://sunsite.org.uk/public/packages/perl/collections/cis.ufl/comp.lang.perl.announce/1998-03/724 +http://www.thestateofcolorado.com/gcecommercialsales.html +http://ftp.du.se/pub/redhat/rawhide/sparc/RedHat/RPMS/?M=A +http://www.linux.com/networking/network/community/trade_show/magazine/open_source/ +http://www.linux.com/networking/network/community/trade_show/magazine/Slashdot/ +http://www.linux.com/networking/network/community/trade_show/magazine/investors/ +http://scifi.emerchandise.com/browse/TV/PIN/b.TV/s.KkOtzPMn +http://scifi.emerchandise.com/browse/DILBERT/_/b.TV/s.KkOtzPMn +http://scifi.emerchandise.com/browse/DR.KATZ/_/b.TV/s.KkOtzPMn +http://scifi.emerchandise.com/browse/FRIENDS/_/b.TV/s.KkOtzPMn +http://scifi.emerchandise.com/browse/FUTURAMA/_/b.TV/s.KkOtzPMn +http://scifi.emerchandise.com/browse/LOIS-CLARK/_/b.TV/s.KkOtzPMn +http://scifi.emerchandise.com/browse/SPEEDRACER/_/b.TV/s.KkOtzPMn +http://scifi.emerchandise.com/browse/THUNDERCATS/_/b.TV/s.KkOtzPMn +http://scifi.emerchandise.com/browse/WCW/_/b.TV/s.KkOtzPMn +http://www.railion.de/home/db_reise_touristik/region/bremen/db_rt_firmenreisedienst_reisezentrum_hb.shtml +http://pegasus.infor.kanazawa-it.ac.jp/~hara/bsd4.1-release/D/N_GETFLAG_NET.html +http://yp.gates96.com/5/54/20/19.html +http://yp.gates96.com/5/54/21/5.html +http://yp.gates96.com/5/54/21/42.html +http://yp.gates96.com/5/54/21/60.html +http://yp.gates96.com/5/54/21/69.html +http://yp.gates96.com/5/54/21/81.html +http://yp.gates96.com/5/54/21/96.html +http://yp.gates96.com/5/54/22/6.html +http://yp.gates96.com/5/54/22/29.html +http://yp.gates96.com/5/54/22/33.html +http://yp.gates96.com/5/54/22/64.html +http://yp.gates96.com/5/54/22/83.html +http://yp.gates96.com/5/54/22/94.html +http://yp.gates96.com/5/54/22/98.html +http://yp.gates96.com/5/54/23/17.html +http://yp.gates96.com/5/54/23/41.html +http://yp.gates96.com/5/54/24/2.html +http://yp.gates96.com/5/54/24/5.html +http://yp.gates96.com/5/54/24/9.html +http://yp.gates96.com/5/54/24/90.html +http://yp.gates96.com/5/54/25/89.html +http://yp.gates96.com/5/54/26/41.html +http://yp.gates96.com/5/54/27/83.html +http://yp.gates96.com/6/59/21/52.html +http://yp.gates96.com/6/59/22/63.html +http://yp.gates96.com/6/59/23/37.html +http://yp.gates96.com/6/59/23/95.html +http://yp.gates96.com/6/59/24/3.html +http://yp.gates96.com/6/59/24/9.html +http://yp.gates96.com/6/59/25/26.html +http://yp.gates96.com/6/59/25/55.html +http://yp.gates96.com/6/59/25/84.html +http://yp.gates96.com/6/59/25/94.html +http://yp.gates96.com/6/59/26/53.html +http://yp.gates96.com/6/59/26/73.html +http://yp.gates96.com/6/59/27/15.html +http://yp.gates96.com/6/59/27/29.html +http://yp.gates96.com/6/59/27/49.html +http://yp.gates96.com/6/59/27/97.html +http://yp.gates96.com/6/59/28/31.html +http://yp.gates96.com/6/59/28/32.html +http://yp.gates96.com/6/59/28/39.html +http://yp.gates96.com/6/59/28/98.html +http://yp.gates96.com/6/59/29/22.html +http://yp.gates96.com/6/59/29/83.html +http://www.gbnf.com/genealogy/royal92/html/d0016/I1249.HTM +http://www.gbnf.com/genealogy/royal92/html/d0018/I734.HTM +http://hifichoice.co.uk/archive/perl/193_printreview.htm +http://hifichoice.co.uk/archive/perl/313_printreview.htm +http://www.highwired.net/Paper/UniversalNav/Redirect/0,5314,2623-7802,00.html +http://www.mrlinux.notrix.de/ +http://www.ucalgary.ca/UofC/faculties/medicine/CHS/nhrdb/area/anat/fr.htm +http://home.pchome.com.tw/tv/pili0614/xing-sh/capric/capric47.htm +http://home.pchome.com.tw/tv/pili0614/xing-sh/capric/capric21.htm +http://home.pchome.com.tw/tv/pili0614/xing-sh/capric/caf26.htm +http://user.chollian.net/~pleiad7s/josun/3-37.htm +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=233&discrim=81,3,15 +http://mediate.magicbutton.net/do/session/625571/vsid/3342/tid/3342/cid/88020/mid/2008/rid/2313/chid/2648/url/http://www1.getmapping.com/aboutus/index.cfm +http://www.telecombrokers.com/q/001p/atn8/2aS9DLAZRXc.htm +http://www.telecomrefunds.com/q/001p/atn8/4SeFiiXvs2A.htm +http://soho.nascom.nasa.gov/solarsoft/soho/lasco/lasco/data_anal/data/9701/?M=A +http://members.xoom.com/mindnare +http://people.freenet.de/TheChamp/nachhilfe.htm +http://people.freenet.de/TheChamp/cheats.htm +http://www.zinezone.com/movies/1,4003,1040-23080,00.html +http://kulichki-win.rambler.ru/moshkow/TURIZM/kutsajo6.txt_with-icons.html +http://www.linux.com/networking/network/release/availability/hardware/?printable=yes +http://www.linux.com/networking/network/release/availability/hardware/applications/ +http://www.shopworks.com/flmp/index.cfm/action/cart/userid/000D1850-2F00-19FE-9038010B0A0ADCF2 +http://shrike.depaul.edu/~afranz/multimedia/?S=A +http://totalsports.net/news/20001014/bbo/mlb/sea/001014.0024.html +http://totalsports.net/news/20001009/bbo/mlb/sea/001009.0039.html +http://totalsports.net/news/20001006/bbo/mlb/sea/001006.0354.html +http://cometweb01.comet.co.uk/do!session=131986&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkkHbqpLZXmLbkZHljlKaltLkilLXalKfkaLbukKeqjLi1 +http://html.tucows.ciaoweb.it/adnload/berglincondlbind.html +http://www.tiscover.com/1Root/Interessante_Region/127151/sportfreizeit/m_sportfreizeit.wm_sport_freibad..1.html +http://f24.parsimony.net/forum54080/messages/97.htm +http://f24.parsimony.net/forum54080/messages/68.htm +http://www.amulation.com/md-l-archive/199702/msg00210.html +http://netpower.tucows.com/winnt/adnload/2821_29573.html +http://kutschen.de/Schoner/Info-d/literature/collections/collections/Geschichte/ +http://webtools.myschoolonline.com/page/0,1871,0-353-38-44534,00.html +http://www.linux.com/networking/network/help/hardware/open_source/GNOME/ +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=12,25,26,17,24 +http://retailer.gocollect.com/do/session/1912664/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/exclusives/exclusives.asp +http://retailer.gocollect.com/do/session/1912665/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/news/index.asp +http://ring.nihon-u.ac.jp/pub/doc/jpnic/members/WORLDNET/members.txt +http://www.123webagent.com/q/001p/atn8/zImXxARDSm.htm +http://www.tu-chemnitz.de/~jflo/DOSDemos/cost_b.txt +http://yp.gates96.com/5/54/27/97.html +http://yp.gates96.com/5/54/28/23.html +http://yp.gates96.com/5/54/29/33.html +http://yp.gates96.com/5/54/29/64.html +http://rex.skyline.net/html/Medical_Equipment.html?224,software,equipment,agriculture,science +http://adex3.flycast.com/server/socket/127.0.0.1:2800/click/OnlineCitiesSM/OnlineCitiesInteractiveCityGuides/bd434602591 +http://www.dispatch.co.za/1998/05/29/business/BA.HTM +http://www.dispatch.co.za/1998/05/29/business/JSE.HTM +http://retailer.gocollect.com/do/session/1912663/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/help/site_tour/index.asp +http://retailer.gocollect.com/do/session/1912663/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/about.asp +http://retailer.gocollect.com/do/session/1912663/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/contact.asp +http://www.hblb.org.uk/hblbweb.nsf/$Pages/NewsArchive1!OpenDocument&ExpandSection=8,9,3,6,1,11,13 +http://retailer.gocollect.com/do/session/1912620/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/gifts/gift_floor.asp +http://genforum.genealogy.com/ga/messages/4583.html +http://genforum.genealogy.com/ga/messages/4582.html +http://genforum.genealogy.com/ga/messages/4570.html +http://genforum.genealogy.com/ga/messages/4561.html +http://genforum.genealogy.com/ga/messages/5575.html +http://ftp.gnu.org/software/sather/ICSI_Sather/whoswho.html +http://dk.egroups.com/group/GHSBasketball +http://dk.egroups.com/group/lovebasket +http://biblioteca.upv.es/bib/doc/doc_fisbd/10/131276//V/1820145/0////25/S/MLTPAID +http://www.qth.net/archive/packfr/200009/20000921.html +http://213.36.119.69/do/session/152975/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/preparer/sante.htm +http://ftp.lip6.fr/pub8/FreeBSD/FreeBSD-current/ports/emulators/mtools/ +http://ftp.lip6.fr/pub8/FreeBSD/FreeBSD-current/ports/emulators/sim6811/ +http://fyi.cnn.com/ASIANOW/asiaweek/97/0328/aa7.html +http://pub21.ezboard.com/fbeauxbatonfrm32.showMessage?topicID=6.topic +http://www.tente.de/us/produkte/produkteigenschaften/aa000001609.htm +http://www.tente.de/us/produkte/produkteigenschaften/aa000001630.htm +http://ftp.sunet.se/pub/FreeBSD/ports/ports-stable/net/rboot/?N=D +http://www.geocities.co.jp/Technopolis-Mars/3952/link.html +http://saleonall.com/cat/software/reference/5112/969434/advanced-search.html +http://www.jazzbude.de/EddieLockjawDavis/B000026F24.htm +http://www6.freeweb.ne.jp/art/iftaka/art/ +http://www.canit.se/(ftp,irc,k15,www)/support/kontakt.html +http://www.mirror.edu.cn/res/sunsite/pub/academic/chemistry/iupac/Download/publications/pac/special/0199/ +http://cinemabilia.de/details/katnr/234764/ +http://polygraph.ircache.net:8181/services/design/http_-2www.infolane.com/dallas.htm +http://ftp.sunet.se/pub/FreeBSD/ports/ports-stable/games/crafty-open-medium/pkg-comment +http://uk.dir.yahoo.com/Education/Primary_and_Secondary/Schools/Middle_Schools/By_Region/U_S__States/Virginia/Complete_List/ +http://yp.gates96.com/6/2/10/13.html +http://yp.gates96.com/6/2/10/41.html +http://yp.gates96.com/6/2/10/83.html +http://yp.gates96.com/6/2/11/51.html +http://yp.gates96.com/6/2/11/89.html +http://yp.gates96.com/6/2/12/22.html +http://yp.gates96.com/6/2/12/58.html +http://yp.gates96.com/6/2/12/62.html +http://yp.gates96.com/6/2/12/79.html +http://yp.gates96.com/6/2/13/19.html +http://yp.gates96.com/6/2/13/51.html +http://yp.gates96.com/6/2/13/64.html +http://yp.gates96.com/6/2/14/75.html +http://yp.gates96.com/6/2/15/91.html +http://yp.gates96.com/6/2/16/83.html +http://yp.gates96.com/6/2/18/15.html +http://yp.gates96.com/6/2/18/54.html +http://yp.gates96.com/6/2/19/35.html +http://yp.gates96.com/6/2/19/68.html +http://yp.gates96.com/6/2/19/75.html +http://yp.gates96.com/6/2/19/82.html +http://yp.gates96.com/6/2/19/87.html +http://www.chaos.dk/sexriddle/z/w/c/b/v/ +http://itcareers.careercast.com/texis/it/itjs/+bwwBmeg5986wwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewhTwdGpdGwBna5dhBiwGnawppcoqwBodD5amnVncdpMnDBaiw5roDtBdDamwBwaoDqc1moDtamn5otDanLpnGonDqnawDwcO5o5aMFqhTfR20Dzme8hwwwpBmeMWD86etmwww5rmeHdwwwBrmeZpwww/jobpage.html +http://itcareers.careercast.com/texis/it/itjs/+3wwBmeV6D86euhwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewhTwdGpdGwBna5dhBiwGnawppcoqwBodD5amnVncdpMnDBaiw5roDtBdDamwBwaoDqc1moDtamn5otDanLpnGonDqnawDwcO5o5aMFqhTfR20Dzme8hwwwpBmeMWD86etmwww5rmeidwwwBrmeZpwww/jobpage.html +http://itcareers.careercast.com/texis/it/itjs/+iwwBmeiWD86zwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewhTwdGpdGwBna5dhBiwGnawppcoqwBodD5amnVncdpMnDBaiw5roDtBdDamwBwaoDqc1moDtamn5otDanLpnGonDqnawDwcO5o5aMFqhTfR20Dzme8hwwwpBmeMWD86etmwww5rme3dwwwBrmeZpwww/jobpage.html +http://sanming.ebigchina.com/ +http://www.bestinfo.net.cn/bsti_kjxn/gn/guoneifagui/17hebei3.htm +http://www.detroitfreepress.com/photos/umgallery/g8/g8.1.htm +http://www.detroitfreepress.com/photos/umgallery/g8/g8.3.htm +http://xgll.soyou.edu.cn/item/2000-04-07/43733.html43733.html +http://se.egroups.com/message/bunyan/903 +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/KIRJASTO-+JA+TIETOPALVELUT/p%E4ij%E4t-h%E4meen+koulutuskonserni/tietokannat/kirjastot/viitetietokannat/ +http://channel.nytimes.com/2000/05/19/technology/ +http://www.ycwb.com.cn/gb/2000/04/15/jrzk/jrms/5.html +http://no.egroups.com/message/healthdigest/97 +http://no.egroups.com/message/healthdigest/119 +http://www.securitiestimes.com.cn/199909/10/ssgs_19990910007_xw.html +http://javatest.a-net.nl/servlet/pedit.Main/http://www.dohistory.org/interests/i_teaching.html +http://www.buybuddy.com/sleuth/27/1/11009/518452/ +http://www.buybuddy.com/sleuth/27/1/11001/518452/ +http://www.buybuddy.com/sleuth/27/1/11004/518452/ +http://ring.omp.ad.jp/archives/text/CTAN/fonts/metrics/tools/?D=A +http://www.jamba.de/KNet/_KNet-CIq8j1-hEd-138qo/showInfo-special1.de/node.0/cde7f1uou +http://cafe4.daum.net/Cafe-bin/Bbs.cgi/sdfamilypds/qry/zka/B2-kBI7p/qqatt/^ +http://www.insurequotes.com/oh3/1AB2.html +http://www.egroups.com/login.cgi?login_target=%2Fmessage%2FWHKPNews%2F190 +http://www.linux.com/networking/network/performance/reliability/linux/?printable=yes +http://preview.egroups.com/message/tattoos88/32 +http://ring.shibaura-it.ac.jp/archives/NetBSD/packages/1.5/cobalt/math/ +http://ring.shibaura-it.ac.jp/archives/NetBSD/packages/1.5/cobalt/sysutils/ +http://in.us.biz.yahoo.com/z/a/p/prgx/prgx_f0149933.html +http://www.backflip.org/members/robeeena/6484057 +http://www.accesslasvegas.com/shared/health/adam/ency/article/003481res.html +http://library.cuhk.edu.hk/search*chi/dAir+--+Pollution+--+China+--+Hong+Kong./dair+pollution+china+hong+kong/-17,1,1,B/frameset&F=dair+pilots+united+states+biography&7,,7 +http://innopac.lib.tsinghua.edu.cn:2082/search*chi/cTM-62+C288/ctm-62+c288/-5,-1,,B/browse +http://www.nd.edu/~rarebook/coins/bnl-mg/BNL-index-B/BNL-index-BU/BNL-index-bursley.html +http://home.kimo.com.tw/lcl566/布告欄.htm +http://www.northampton.ac.uk/cgi-bin/liberation/betsie/betsie.pl/1005/www.northampton.ac.uk/stu/commdev/chap.htm +http://www.peopledaily.co.jp/199905/11/newfiles/col_990511001040_zyxw.html +http://missuniverse.studiostore.com/browse/PAGEANTS/CAP/s.pJicQfVY +http://ftp.up.pt/Linux/Linus/kernel/v2.1/patch-html/patch-2.2.0-pre6/linux_drivers_misc_parport_procfs.c.html +http://ftp.up.pt/Linux/Linus/kernel/v2.1/patch-html/patch-2.2.0-pre6/linux_drivers_sound_es1370.c.html +http://ftp.up.pt/Linux/Linus/kernel/v2.1/patch-html/patch-2.2.0-pre6/linux_include_asm-arm_arch-vnc_system.h.html +http://ftp.up.pt/Linux/Linus/kernel/v2.1/patch-html/patch-2.2.0-pre6/linux_include_asm-arm_dec21285.h.html +http://www.gbnf.com/genealog2/dezarn/html/d0004/I1071.HTM +http://dogbert.wu-wien.ac.at/UniverCD/cc/td/doc/product/access/acs_mod/cis4000/4000/c4000him/22693/ +http://www.uralweb.ru:8081/stats/who +http://www.rrz.uni-hamburg.de/biologie/b_online/kegg/kegg/db/ligand/cpdhtm/C04881.html +http://www.la.digitalcity.com/fortwaynein/health/conditions.dci?condition=badbreath +http://ibelong.digitalcity.com/uticaarea/guygirlmidwest/main.dci?page=guyssept2000 +http://moviestore.zap2it.com/browse/MOVIES/JACKET/s.jNIqMaLO +http://www.doc.ic.ac.uk/~ace97/whoknows/whoknows.cgi?topic=applescript +http://www.doc.ic.ac.uk/~ace97/whoknows/whoknows.cgi?topic=prolog +http://www.doc.ic.ac.uk/~ace97/whoknows/whoknows.cgi?topic=samba +http://209.52.189.2/discussions.cfm/3031/1757-1776 +http://209.52.189.2/discussions.cfm/3031/757-776 +http://209.52.189.2/discussions.cfm/3031/57-76 +http://itcareers.careercast.com/texis/it/itjs/+DwwBmeOWD86OwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewVtqDhdGMwBodDanDtoDnnGaoDBntGwBodDaMwDwtnMnDBanDBnGpGo5na5nGVnG5anLpnGonDqnaDnBidGAa5O5BnMawppcoqwBodDaMFqhTfR20DzmeitwwwpBme2WD86e1xwww5rmenDwwwBrmeZpwww/morelike.html +http://volunteersolutions.org/austin/volunteer/opp/one_100634_printer_detailed.html +http://www.changeyourhome.net/PropertiesToLet/WithamLet/LOO606/pages/DCP_0421_JPG.htm +http://www.users.qwest.net/~eagletac/ +http://www.motorradversand.de/cgi-bin/bekleidung/integralhelm/NG94G933/beurteilung.htm +http://stol.list.ru/catalog/25440.html +http://stol.list.ru/catalog/25301.html +http://www.eveclub.com/cgi-bin/eveclub.front/972959436300/Club/start/1000000 +http://www.gohamptonroads.com/sportsticker/events/06-12/0447.CWS.FSUTEXCURRENT.html +http://genforum.genealogy.com/merriman/messages/228.html +http://genforum.genealogy.com/merriman/messages/223.html +http://genforum.genealogy.com/merriman/messages/163.html +http://genforum.genealogy.com/merriman/messages/495.html +http://genforum.genealogy.com/merriman/messages/232.html +http://genforum.genealogy.com/merriman/messages/351.html +http://genforum.genealogy.com/merriman/messages/324.html +http://genforum.genealogy.com/merriman/messages/510.html +http://genforum.genealogy.com/merriman/messages/57.html +http://genforum.genealogy.com/merriman/messages/12.html +http://genforum.genealogy.com/merriman/messages/263.html +http://genforum.genealogy.com/merriman/messages/15.html +http://retailer.gocollect.com/do/session/1912656/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus53832/eus53833/eus328722/eus129553/eus129564/ +http://cma.arabia.com:8008/jordan/article/print/arabic/0,5195,3750,00.html +http://webhome.ai-lab.fh-furtwangen.de/for_local_use_only/CD-TMFUMV/daten/mathema/01121m/?N=D +http://store1.europe.yahoo.com/brink2/2000000141305.html +http://www.contractorresource.com/Vermont/Westford/Architects.shtml +http://www.bemi-immobilien.de/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/3d-service/Top-Darlehens-Konditionen/Startseite/Gemeinsam/versicherungen/gebaeude/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Top-Darlehens-Konditionen/anforderungsformular.htm +http://free.polbox.pl/p/pphromar/OFERTA.htm +http://www.burstnet.com/ads/ad5788a-map.cgi/tr00010005_12 +http://www.private-immobilien-boerse.de/ungarn/verkauf/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/Gemeinsam/Immolink/3d-service/IIM-Teil/Startseite/froben.htm +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/KIRJASTO-+JA+TIETOPALVELUT/ammattikorkeakoulukirjastot/lahti/toisen+asteen+koulutus/ammattikorkeakoulut/ +http://www.geomag.com/pirates/html/4books.html +http://www.lithoquoter.com/Scripts/WebObjects.exe/Printers.woa/559420000049560000009753100000548302/main.wo/7016200000448302/0/-/prime +http://www.adventurecentre.com/Framesets/intrside/csh.htm +http://mitglied.tripod.de/vox0/negrostodos/de_sexo_dobles.html +http://www.sasinstitute.com/offices/asiapacific/taiwan/whatsnew/art1999/art091601.html +http://oss.sgi.com/cgi-bin/cvsweb.cgi/gdb/sim/ppc/Attic/ppc-opcode-complex?only_with_tag=HEAD +http://www.yorosiku.net:8080/-_-http://www.suntory.co.jp/eco/what.html +http://www.yorosiku.net:8080/-_-http://www.suntory.co.jp/culture/birds/welcome.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/linux/music/misc/unitest/lit/pushkin.html +http://sunsite.uakom.sk/tucows/adnload/69291_28346.html +http://members.tripod.com/yamabito2/gardening_000416_0502_n22.htm +http://www.affiliate.hpstore.hp.co.uk/do/session/380775/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/REGISTRATION/entry.asp +http://www.onsemi.com.cn/pub/prod/0,1193,products1_Disty_order=MC100H642FNR2,00.html +http://perso.wanadoo.fr/michel.brunel/Infographie/content/contacts.htm +http://mindit.netmind.com/proxy/http://www.film.com/RGI/FC.(/watch/broadband.jhtml).def...RGI//reviews/features/mow/blairwitch2.jhtml +http://www.doc.ic.ac.uk/lab/labsrc_area/firstyear/submissions/1997-98/jmc1/labs/Ex09/gv197/?N=D +http://www-d0.fnal.gov/d0dist/dist/releases/test/l3fmuo_unpack/rcp/?N=D +http://students.lsu.edu/students/main.nsf/c81d2bf8cb0b80ff862566fb00105ab2/44dc495cc7534894862566fe00127751!OpenDocument&ExpandSection=7,10,4,9 +http://www.zdnet.com/gamespot/filters/printerfriendly/0,10855,2531809-95,00.html +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/asiasanahaku/el%25C3%2583%25C2%25A4kelaitokset/vakuutuslaitokset/rahoitus/el%E4kerahastot/ +http://coe.ier.hit-u.ac.jp/BibEc/data/Papers/fthteavfo2-96.html +http://polygraph.ircache.net:8181/http_-2ESPN.SportsZone.com/nfl/mall/http_-2www.excite.com/http_-2www.exploreuw.com/cards/ +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=cosido&l=pt +http://fazmali.bigsmart.com/mall/allinone/comparison_chart_new.html +http://sunsite.ualberta.ca/pub/Mirror/gnu/etc/ORDERS +http://www.bumppo.net/lists/realbasic-dr/1998/12/msg00347.html +http://www.bumppo.net/lists/realbasic-dr/1998/12/msg00363.html +http://www.bumppo.net/lists/realbasic-dr/1998/12/msg00482.html +http://www.bumppo.net/lists/realbasic-dr/1998/12/msg00483.html +http://www.bumppo.net/lists/realbasic-dr/1998/12/msg00499.html +http://www.bumppo.net/lists/realbasic-dr/1998/12/msg00508.html +http://www.bumppo.net/lists/realbasic-dr/1998/12/msg00518.html +http://it.sports.yahoo.com/000911/90/of8m.html +http://ftp.support.compaq.com/public/dunix/v3.2g/TruCluster_V1.0/?M=A +http://ftp.support.compaq.com/public/dunix/v3.2g/TruCluster_V1.0/ReleaseNotes.pdf +http://www.quzhou.gov.cn/flfg.nsf/0a043ae26eb50247002564640039f21d/e3cb86464a9f805a002564ac0039422d!OpenDocument&ExpandSection=5,1,9 +http://www.quzhou.gov.cn/flfg.nsf/0a043ae26eb50247002564640039f21d/e3cb86464a9f805a002564ac0039422d!OpenDocument&ExpandSection=6,1,9 +http://polygraph.ircache.net:8181/Keyboards/http_-2www.sky.net/~robertf/http_-2domino.findyn.com/fdi.nsf/http_-2home.netscape.com/ +http://www.nv.cc.va.us/home/jakim +http://itcareers.careercast.com/texis/it/itjs/+nwwBmJe0B-deVmwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewXhmoBGnaqdGpdGwBodDaDnBidGAoDta5O5BnM5amo5BGox1BnmanDtoDnnGaMw55wqr15nBB5a51ppdGBamnVncdpaBn5BaMFqhTfR20DzmeQtwwwpBme-WD86eyxwww5rmesdwwwBrmeZpwww/morelike.html +http://itcareers.careercast.com/texis/it/itjs/+MwwBme7WD86JwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewXhmoBGnaqdGpdGwBodDaDnBidGAoDta5O5BnM5amo5BGox1BnmanDtoDnnGaMw55wqr15nBB5a51ppdGBamnVncdpaBn5BaMFqhTfR20DzmeQtwwwpBme-WD86eyxwww5rme4dwwwBrmeZpwww/jobpage.html +http://my.dreamwiz.com/hideyu/couple/couplemain.htm +http://www.noras.bizland.com/top_pages/top_gen_1.htm +http://www.nomade.fr/catm6/entreprises_economi/electricite_electro/electricite/composants_fournitu/index5.shtml +http://www.staroriental.net/nav/soeg_c/ihf,aeb,s0,363,黎明.html +http://online.excite.de/lifestyle/katalog/27990 +http://www.linux.com/networking/network/performance/install/news/Linux/ +http://www.linux.com/networking/network/performance/install/news/kernel/ +http://tw.yahoo.com/Regional/Countries_and_Regions/China/Provinces__Regions_and_Municipalities/Shandong/Cities_and_Towns/He_Zhe/Government/ +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/ReadAdverData/2000-10-29/12/972792271154.txt +http://independent-sun-01.whoc.theplanet.co.uk/news/Sport/Football/Bradford/ipswich221000.shtml +http://www.emis.de/journals/EJDE/Monographs/Volumes/Monographs/1996/05-Hetzer/Hetzer-tex +http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.3-4/linux/arch/arm/def-configs/assabet?only_with_tag=LINUX-2_4_0-test1 +http://www.nrk.no/finnmark/x22_8_96/arkivet/ +http://pelit.saunalahti.fi/.9/telenation/valveworld/games/Half-Life/?S=A +http://pelit.saunalahti.fi/.9/telenation/valveworld/games/Half-Life/_Dedicated.txt +http://pelit.saunalahti.fi/.9/telenation/valveworld/games/Half-Life/_Mods.txt +http://ftp.sunet.se/pub/FreeBSD/ports/ports-stable/games/bugsx/?N=D +http://ring.yamanashi.ac.jp/archives/NetBSD/packages/1.4.1/sparc/databases/ +http://citeseer.nj.nec.com/cidcontext/260967 +http://members.tripod.co.jp/jojo6251/sasamineHP.htm +http://www.segodnya.ru/w3s.nsf/Archive/2000_96_life_vrez_noname2.html +http://www.citybrasil.com.br/rs/ivora/cidadefala.htm +http://web62.com/engl/fashion/pompoes/nav.htm +http://www.jufo.com/netcenter/house/item/bglz/477_lmt.html +http://gatekeeper.dec.com/pub/BSD/FreeBSD/FreeBSD-current/src/gnu/libexec/uucp/uupick/ +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/lelandsystems.stanford.edu/announce/pubsw/ +http://www.schleuse.de/maschine/World/Deutsch/Kultur/Literatur/Autoren_und_Autorinnen/D/Dominik,_Hans/ +http://www.elsur.cl/archivo/mayo2000/8mayo2000/elsur/espectaculos/ind2.php3 +http://www.jpc-neuheiten.de/2881737.htm +http://www.digitaldrucke.de/(aktuell,arbeitsvermittlung,computer,creaccess,gaestebuch,hilfe,hilfeallgemein,individualverkehr,kultur,onlineservice,schnellübersicht,sense,veranstaltungen,verkehr,von)/_fort/html/themen/computer/soft/links/softquad.htm +http://bbs.syu.ac.kr/NetBBS/Bbs.dll/groupbbs031/rcm/zka/B2-kB23m/qqo/004A/qqatt/^ +http://www.city-map.de/city/print/nl/Niedersachsen/Osterholz/actueel_&_nieuw/onroerendgoed_&_woningen/k012700681.html +http://members.tripod.com/sultana_2/thiskindalife.htm +http://members.tripod.com/sultana_2/thisthing.htm +http://members.tripod.com/sultana_2/believeinthis.html +http://tulips.ntu.edu.tw/search*chi/m586.47+4412/m586.47+4412/-5,-1,0,B/frameset&F=m586.48+0146&1,1 +http://btp1da.phy.uni-bayreuth.de/ftp/pub/FreeBSD/ports/www/linbot/?S=A +http://pub6.ezboard.com/fbiblediscussionandsharingparableorversesharing.subscribeUnregisteredToTopic?topicID=113.topic +http://www.cs.rit.edu/usr/local/pub/atk/course_descr/481.dir/?M=A +http://neptune.guestworld.com/gear/gateway.cfm?action=manage&owner=Nickdays +http://retailer.gocollect.com/do/session/1912673/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/shipping_policy.asp +http://tucows.minorisa.es/adnload/001-006-009-001.html +http://www.cwi.nl/~jack/spunk/texts/pubs/sekhmet/8/sp001225.txt +http://homepage.yesky.com/33554432/36700160/103524.htm +http://cvs.php.net/viewcvs.cgi/php3/functions/gd.c?annotate=1.65&sortby=log +http://www.genexchange.com/deathreg.cfm?state=nc&county=pasquotank +http://www.genexchange.com/schoolreg.cfm?state=nc&county=pasquotank +http://www.tagnet.org/uva/Eventos/Emergencia99/Fotos/FotosOccidente01.htm +http://itcareers.careercast.com/texis/it/itjs/+CwwBmue0B-dswwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew6nmoBGnaqdGpdGwBodDa5oBnaoDqc1mnanLqnca15naGn31oGnma5Aocc5awqqd1DBoDtamn5oGwxcnaMFqhTfR20Dzme9twwwpBme+6D865www5rmesDwwwBrmeRdwww/jobpage.html +http://retailer.gocollect.com/do/session/1912638/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://kulichki-win.rambler.ru/inkwell/bio/zitinsk.htm +http://www.thestateofcolorado.com/e1tatpiercing.html +http://www.pc-schulmusik.purespace.de/seminar/START.HTM +http://www.feeler.nl/rubrieken/index.xml/818004059 +http://ftp.dartmouth.edu/~mcb/faculty/fiering.html +http://ustlib.ust.hk/search*chi/cHD30.28+.C56+1995/chd+++30.28+c56+1995/-17,-1,0,E/2browse +http://herndon1.sdrdc.com/cgi-bin/com_detail/C00325258/ +http://www.linux.com/networking/network/industry/press_release/linuxworld/Linux/ +http://mindit.netmind.com/proxy/http://www.abc.net.au/children/bananas/dreamtime/page1.htm +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959860700/Catalog/1000188 +http://207.87.5.36/pc/news/saa7108/ +http://musicalproducts.asiaep.com/muspro5a.htm +http://www.trax.nilex.co.uk/trax.cgi/A1S/A1U/1AL/A1S/A2S/C1L/ +http://www.cjga.com/JamMoviesCanadianO/obsessed.html +http://www.symantec.se/region/jp/support/mac/utiliti/num352/num352up.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=catapultaras&l=pt +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=catapultai&l=pt +http://no.egroups.com/group/Chenzhou-families +http://www.teenplatinum.com/barelylegal/anal-sexass/young-adultbest-friends/hardaction/slutsnude/red-toenail-polishfoot-fetish/toenail-polish.html +http://beatles.sonicnet.com/allmusic/ai_links.jhtml?ai_id=1000 +http://www.luecos.de/wow/art/fu_satir_30142.html +http://nw1.newsweek.com/nw-srv/inetguide/iguide_4505343.html +http://www.si.uniovi.es/mirror/squid/mail-archive/squid-users/200002/0637.html +http://sunsite.compapp.dcu.ie/pub/perl/modules/by-category/08_User_Interfaces/Tk/NI-S/Tk402.004.readme +http://www.amzn.com/exec/obidos/tg/feature/-/44435/ +http://www.amzn.com/exec/obidos/tg/feature/-/2869/ +http://www.hanter21.co.kr/NetBBS/Bbs.dll/dhliter02/lst/qqeq/1/zka/B2-kBINo/qqo/PRMY +http://www.linux.com/networking/network/help/email/web/security/ +http://www.linux.com/networking/network/help/email/web/Slackware/ +http://www.linux.com/networking/network/help/email/web/e-commerce/ +http://www.linux.com/networking/network/help/email/web/release/ +http://debian.tod.net/debian/dists/stable/contrib/binary-all/web/?S=A +http://ftp.sunet.se/pub/FreeBSD/ports/ports-current/devel/fastcrc/pkg-descr +http://www.trax.nilex.co.uk/trax.cgi/A1C/A2S/B1S/B3S/B1S/C1U/ +http://www.trax.nilex.co.uk/trax.cgi/A1C/A2S/B1S/B3S/B1S/C1D/ +http://rex.skyline.net/html/Metalurgy.html?266,supplies,hobbies,painting,arts +http://infoseek.wunderground.com/geo/BigtempBannerPromo/US/CO/Cortez.html +http://www.kaernten.at/1Root/Kontinent/6/Staat/7/Bundesland/17/Ort/820/Pension/304806/Homepage/h_homepage...1.html +http://dellnet.excite.de/nachrichten/katalog/6663 +http://www.users.skynet.be/eloymarc/infomobil2/sobeen13.htm +http://www.outpersonals.com/cgi-bin/w3com/pws/out/hXRIA9gT9KNJakAdbkyW2SaEFRyXAJCa2tpUDiYF1BHxbpYG0_go-roWL4XPWFopknXRvCQG4gmCQLNceomD4GJpJ4hvR4eYeQbgN2CFeSPhxakPczINPvttFOQK3IDjjmYz66jR +http://www.outpersonals.com/cgi-bin/w3com/pws/out/_cRIZWRepq55uG8fC8ijlWOJrkBzrY7AXdlxz7fhosBeDRNPqhpYFY3uMBgWodvLAPXL2sPRQ7GqKF66xzHYxHZISDRz4dfZjEKnEShXdRFhDxBcOPx4ufr7uXHA0sNvRvMq6Z1j +http://polygraph.ircache.net:8181/health/http_-2cyril.com/http_-2www.americanexpress.com/corp/consumerinfo/privacy/privacystatement.shtml +http://polygraph.ircache.net:8181/health/http_-2cyril.com/arch.html +http://www.villager.com/ctg/cgi-bin/Villager/home/AAAksrACwAAACCOAAI +http://www.medoc-ias.u-psud.fr:81/synoptic/gif/950829/?D=A +http://members.tripod.lycos.nl/unlimited_pagez/pld2.html +http://www.thisislancashire.co.uk/lancashire/archive/1996/01/25/FEATURES0VQ.html +http://members.tripod.com/rebelstrange/buxoms.html +http://fi.egroups.com/message/TEZKo/3 +http://www.yamato.jp.ibm.com/servers/eserver/xseries/about/availa.html +http://polygraph.ircache.net:8181/NetworkInfo/http_-2www.thepetsupply.com/3d/web.html +http://polygraph.ircache.net:8181/NetworkInfo/http_-2www.thepetsupply.com/3d/http_-2www.sccsi.com/welcome.html +http://www.luf.org/wiki/edit/GIG/GenericCodingTerm +http://208.178.109.85/msgshow.cfm/msgboard=822531545582878&msg=50215618980084&page=1&idDispSub=-1 +http://mercury.spaceports.com/~xenical/diet-food.html +http://de.news.yahoo.com/991202/3/echc.html +http://web.tiscalinet.it/ipsiang/uviafede/tertulli.html +http://www.brio.de/BRIO.catalog/39fdb8820423a4d82740d472aa780733/Customer/Register +http://rainforest.parentsplace.com/dialog/thread.pl/bradley2/16/2.html?dir=prevResponse +http://www.centc251.org/forums/aca-1/dispatch.cgi/isowg4/folderFrame/100012/0/def/1208103 +http://www.bemi-immobilien.de/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/versicherungen/gebaeude/Gemeinsam/Inserieren/Gemeinsam/MarketingStrategie/Gemeinsam/erreichenPartner/Gemeinsam/versicherungen/unfall/Top-Darlehens-Konditionen/anforderungsformular.htm +http://www.planetit.com/techcenters/docs/internet_&_intranet/news/PIT20000630S0024/threads?comment_status=on +http://ftp.eq.uc.pt/software/unix/Linux/redhat/redhat-6.2/doc/HOWTOS/localization/Hellenic-HOWTO-html/Hellenic-HOWTO-8.html +http://help.sap.com/saphelp_45b/helpdata/de/20/7be8341545ab06e10000009b38f83b/applet.htm +http://www.imagestation.com/member/?name=RonnyClas6&c=1 +http://www.egroups.com/messages/cmass-syd-talk/1170 +http://bellsouth-cl.tucows.com/winnt/xwinservernt_size.html +http://ftp.surfnet.nl/os/FreeBSD/cdrom/development/FreeBSD-CVS/ports/mail/youbin/patches/home.html +http://chat.bigchurch.com/cgi-bin/w3com/pws/bc/PDhIf1s64yA1us4SS1FzmCsroIgpwrmcmdaKEhvT295b5JjMxs9ttaP_gpBzDbn5VR9hkgTaiz3efTGjRK64ORbhJMs0Q8ONiYshBhnFHdkQjl3uSSwZim5B5Layd_SDwYDTVgHM659c +http://www.starshop.co.uk/Masson-Andre/Masson-Andre-Soleil-3200802.html +http://www.21hk.com/book/wx1/wx/zpj/h/huanzhulouzhu/shushan/4/ +http://www.dietrich-computer.de/creativegrafik.htm +http://forum.kf.kommorg.no/forum/agenda21/dispatch.cgi/disk_1/showFolder/100005/9206559 +http://mindit.netmind.com/proxy/http://abc.net.au/rn/schedule/wed.htm +http://www.fogdog.com/cedroID/ssd3040183156802/nav/stores/adventure_travel/ +http://www.fogdog.com/cedroID/ssd3040183156802/nav/stores/tennis/ +http://link.fastpartner.com/do/session/600349/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/nordicliving.php +http://members2.clubphoto.com/luisf216501/TAMARINDO/icons.phtml +http://www.affiliate.hpstore.hp.co.uk/do/session/380795/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/SMARTTIPS/brocdesign.asp +http://www.hblb.org.uk/hblbweb.nsf/$Pages/NewsArchive1!OpenDocument&ExpandSection=3,7,14,5,13,4,12 +http://www.chaos.dk/sexriddle/d/l/t/i/a/ +http://www.crutchfield.com/S-s7BJxKzNmKr/shop/ +http://www.crutchfield.com/cgi-bin/S-s7BJxKzNmKr/email.asp?sid=S-s7BJxKzNmKr +http://tucows.interbaun.com/winme/adnload/137104_47064.html +http://iland.tucows.com/win2k/adnload/73990_29810.html +http://ftp.uk.debian.org/debian/dists/woody/contrib/binary-alpha/text/?M=A +http://sound-dist.secured.co.uk/cgi-bin/psShop.cgi/add|10P02|972959526|Warm===and===Dry|user|0|1,0,0,1 +http://pub14.ezboard.com/fjavagateforum69255multibasicboard +http://www.xrefer.com/entry/317621 +http://library.cuhk.edu.hk/search*chi/aChen,+Jih-peng./achen+jih+peng/-5,-1,0,B/frameset&F=achen+jie+qi&1,1 +http://library.cuhk.edu.hk/search*chi/aChen,+Jih-peng./achen+jih+peng/-5,-1,0,B/exact&F=achen+jih+hsin&1,2 +http://yp.gates96.com/5/50/60/53.html +http://yp.gates96.com/5/50/60/98.html +http://yp.gates96.com/5/50/61/14.html +http://yp.gates96.com/5/50/61/60.html +http://yp.gates96.com/5/50/62/0.html +http://yp.gates96.com/5/50/63/12.html +http://yp.gates96.com/5/50/63/14.html +http://yp.gates96.com/5/50/63/51.html +http://yp.gates96.com/5/50/63/52.html +http://yp.gates96.com/5/50/64/2.html +http://yp.gates96.com/5/50/64/31.html +http://yp.gates96.com/5/50/65/36.html +http://yp.gates96.com/5/50/65/44.html +http://yp.gates96.com/5/50/65/58.html +http://yp.gates96.com/5/50/65/78.html +http://yp.gates96.com/5/50/66/33.html +http://yp.gates96.com/5/50/66/38.html +http://yp.gates96.com/5/50/67/3.html +http://yp.gates96.com/5/50/67/83.html +http://yp.gates96.com/5/50/68/40.html +http://yp.gates96.com/5/50/69/2.html +http://yp.gates96.com/5/50/69/36.html +http://yp.gates96.com/5/50/69/49.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=cochichastes&l=pt +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=cochicharam&l=pt +http://www.affiliate.hpstore.hp.co.uk/do/session/380791/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp.com/cposupport/fr/?CTRYcod=FR +http://www.affiliate.hpstore.hp.co.uk/do/session/380791/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/FR/REGISTRATION/entry.asp +http://pub22.ezboard.com/fworldofmugenfrm2.showMessage?topicID=131.topic&index=1 +http://pub23.ezboard.com/fmugenshowdownfrm8.showMessage?topicID=36.topic&index=1 +http://www.questlink.com/QL/CDA/Research/ProductBrief/1,1768,0_11203_135680_85724,00.html +http://www.jamba.de/KNet/_KNet-KBq8j1-gEd-138pd/showInfo-special1.de/node.0/cde7f1uou +http://www.leg.wa.gov/pub/rcw%20-%20text/title_41/chapter_050/rcw_41_50_650.txt +http://www.tiscover.ch/1Root/Kontinent/6/Staat/30/Bundesland/31/Ort/234/Ferienpaket/20120/Homepage/buchen...1.html +http://family.go.com/Categories/Features/family_2000_02/kidv/kidv0200resourceiii/ +http://www.online.kokusai.co.jp/Service/V0043469/wrd/G200/service/service.html +http://www.linux.com/networking/network/help/hardware/website/ISP/ +http://store1.europe.yahoo.com/I/freemans_1592_58696403 +http://202.99.23.195/BIG5/channel5/745/20000427/51173.html +http://www-usa10.cricket.org/link_to_database/GROUNDS/WI/ALBION/ALBION_SPORTS_COMPLEX_00772/ +http://www16.freeweb.ne.jp/computer/taka34/ +http://books.hyperlink.co.uk/bookinfo/Caught_in_a_Tornado/Ross/James_R./155553192X +http://ftp.uni-stuttgart.de/pub/security/unix/SSLapps/doc/?S=A +http://www.moviestarpages.com/rebecca_romijn-stamos/picture05.htm +http://html.tucows.ciaoweb.it/adnload/001-009-008-022.html +http://html.tucows.ciaoweb.it/adnload/001-009-008-019.html +http://www.brio.de/BRIO.catalog/39fe2f4306cb75f4273fd472aa780708/UserTemplate/2 +http://www.hole.kommune.no/hole/journweb.nsf/weboffjournal!OpenView&Start=92&Count=50&Expand=170 +http://polygraph.ircache.net:8181/docs/Win95/MSdialer/http_-2www.fastcounter.com/http_-2home.netscape.com/home/http_-2www.bildhome.com/plantationhomes/bale1500.htm +http://polygraph.ircache.net:8181/docs/Win95/MSdialer/http_-2www.fastcounter.com/http_-2home.netscape.com/home/http_-2www.bildhome.com/plantationhomes/bale8000.htm +http://writer.heha.net/poetics/90_poetics.htm +http://yp.gates96.com/5/55/20/98.html +http://yp.gates96.com/5/55/21/17.html +http://yp.gates96.com/5/55/21/75.html +http://yp.gates96.com/5/55/22/2.html +http://yp.gates96.com/5/55/22/22.html +http://yp.gates96.com/5/55/22/92.html +http://yp.gates96.com/5/55/23/11.html +http://yp.gates96.com/5/55/23/46.html +http://yp.gates96.com/5/55/23/66.html +http://yp.gates96.com/5/55/23/90.html +http://yp.gates96.com/5/55/24/2.html +http://yp.gates96.com/5/55/24/83.html +http://yp.gates96.com/5/55/24/85.html +http://yp.gates96.com/5/55/25/62.html +http://yp.gates96.com/5/55/26/38.html +http://yp.gates96.com/5/55/26/48.html +http://yp.gates96.com/5/55/28/5.html +http://yp.gates96.com/5/55/28/77.html +http://yp.gates96.com/5/55/29/14.html +http://yp.gates96.com/6/50/40/47.html +http://yp.gates96.com/6/50/40/60.html +http://yp.gates96.com/6/50/40/62.html +http://yp.gates96.com/6/50/41/81.html +http://yp.gates96.com/6/50/41/83.html +http://yp.gates96.com/6/50/42/58.html +http://yp.gates96.com/6/50/42/90.html +http://yp.gates96.com/6/50/42/93.html +http://yp.gates96.com/6/50/43/29.html +http://yp.gates96.com/6/50/43/79.html +http://yp.gates96.com/6/50/43/85.html +http://yp.gates96.com/6/50/44/40.html +http://yp.gates96.com/6/50/44/76.html +http://yp.gates96.com/6/50/44/81.html +http://yp.gates96.com/6/50/45/15.html +http://yp.gates96.com/6/50/45/52.html +http://yp.gates96.com/6/50/46/15.html +http://yp.gates96.com/6/50/46/19.html +http://yp.gates96.com/6/50/46/92.html +http://yp.gates96.com/6/50/47/2.html +http://yp.gates96.com/6/50/47/7.html +http://yp.gates96.com/6/50/47/33.html +http://yp.gates96.com/6/50/49/29.html +http://yp.gates96.com/6/50/49/36.html +http://www.outpersonals.com/cgi-bin/w3com/pws/out/wRtIx3JBCL5wVzA1pIKradbm9z4Oo2BbPRx_FVh-j4UyLzjojbipsV0nsuM2iF9RxJ1jG2C4LUy3YP5pJl7qDqPdnqV765l2x5hJ0fIUUJuWLaccxO0svbclJ4-alyBQj6Y5dO8YdURyhf9q05q8mJ25FlvF62sm +http://213.36.119.69/do/session/152980/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www3.travelprice.com/voyages/recherche.phtml +http://yp.gates96.com/6/2/20/11.html +http://yp.gates96.com/6/2/21/12.html +http://yp.gates96.com/6/2/21/51.html +http://yp.gates96.com/6/2/21/56.html +http://yp.gates96.com/6/2/22/8.html +http://yp.gates96.com/6/2/22/38.html +http://yp.gates96.com/6/2/22/65.html +http://yp.gates96.com/6/2/23/14.html +http://yp.gates96.com/6/2/23/50.html +http://yp.gates96.com/6/2/23/57.html +http://yp.gates96.com/6/2/23/75.html +http://yp.gates96.com/6/2/24/15.html +http://yp.gates96.com/6/2/24/31.html +http://yp.gates96.com/6/2/24/43.html +http://yp.gates96.com/6/2/24/70.html +http://yp.gates96.com/6/2/24/87.html +http://yp.gates96.com/6/2/25/22.html +http://yp.gates96.com/6/2/25/53.html +http://yp.gates96.com/6/2/25/90.html +http://yp.gates96.com/6/2/26/25.html +http://yp.gates96.com/6/2/26/26.html +http://yp.gates96.com/6/2/26/45.html +http://yp.gates96.com/6/2/26/76.html +http://yp.gates96.com/6/2/27/34.html +http://yp.gates96.com/6/2/28/1.html +http://yp.gates96.com/6/2/28/25.html +http://yp.gates96.com/6/2/29/2.html +http://yp.gates96.com/6/2/29/31.html +http://yp.gates96.com/6/2/29/57.html +http://yp.gates96.com/6/2/29/74.html +http://archive.bitcon.no/tucows//winme/preview/136862.html +http://archive.bitcon.no/tucows//winme/preview/138371.html +http://archive.bitcon.no/tucows//winme/preview/137011.html +http://archive.bitcon.no/tucows//winme/preview/137897.html +http://archive.bitcon.no/tucows//winme/preview/138157.html +http://www.ngmag.com/books/reference/0792275667.html +http://socrates.berkeley.edu:4231/pth.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/music/midi/lit/quizz/lit/multiple.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/music/midi/lit/quizz/lit/god.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/music/midi/lit/quizz/misc/colorart/ +http://retailer.gocollect.com/do/session/1912687/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/postcards/index.asp +http://www.affiliate.hpstore.hp.co.uk/do/session/380807/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/creative/entry.asp +http://home.swipnet.se/~w-29806/Tab/Guitar/Svenska/h/Jakob%20Hellman/VACKERT_.TXT +http://jupiter.u-3mrs.fr/~msc41www/releves/16860204.HTM +http://citeseer.nj.nec.com/cidcontext/1003669 +http://citeseer.nj.nec.com/cidcontext/1003675 +http://citeseer.nj.nec.com/cidcontext/1003676 +http://www.escribe.com/religion/nondualitysalon/m10801.html +http://www.escribe.com/religion/nondualitysalon/m10824.html +http://www.tvstore.com/browse/TV/PATCH/s.bCooTxTe +http://digilander.iol.it/lorciao/computer.htm +http://yosemite.epa.gov/r9/sfund/overview.nsf/ef81e03b0f6bcdb28825650f005dc4c1/1d8f2e36da9dc1de8825660b007ee696?OpenDocument&ExpandSection=-1,-8,-4 +http://cn.egroups.com/post/ukr_liga?act=reply&messageNum=40 +http://www.lithoquoter.com/Scripts/WebObjects.exe/Printers.woa/048720000079262000002260000000798302/Session_Expired_Page.wo/6144200000698302/0/-/prime +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=coadjuvaram&l=pt +http://www.craft-supplies.co.uk/cgi-bin/psProdDet.cgi/LW132|972959517|Liming_&_Patinating|user|0|0,0,1,1 +http://www.angelfire.com/va/boogiescamp +http://www.kyotei.or.jp/JLC/VS/19/991209/0212.htm +http://www.affiliate.hpstore.hp.co.uk/do/session/380800/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/assistance/entry.asp +http://www.city-map.nl/city/map/en/Niedersachsen/Landkreis_Cuxhaven/customers/Dr.rer.nat._Büro_für_Erdwiss.Untersuchungen_Udo_Lade/contact.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=consternais&l=pt +http://muenchen.bda.de/freizeitparks/gastbuch/gaestebuch003.html +http://www.linux.com/networking/network/industry/growth/editing/SAP/ +http://www.linux.com/networking/network/industry/growth/editing/mobile/ +http://lists.omnipotent.net/qmail/199909/msg00892.html +http://lists.omnipotent.net/qmail/199909/msg00952.html +http://lists.omnipotent.net/qmail/199909/msg00964.html +http://ftp.cc.chuo-u.ac.jp/home/pub/lang/perl/CPAN/ports/msdos/old/?N=D +http://www3.buch-per-sms.de/faq.jsp$ID=To7697mC5277111659640048At0.5320036065114109 +http://www3.buch-per-sms.de/wir_ueber_uns.jsp$ID=To7697mC5277111659640048At0.5337056452821441 +http://tradersdirectory.com/channel/jobs/insurance/insurance_policy_clerk/b.2166.g.2360.html +http://www.mapion.co.jp/custom/nikkei/admi/13/13119/takashimadaira/7chome/27/ +http://www.dispatch.co.za/1998/02/19/easterncape/MARCHANC.HTM +http://www.techsupplies.com/sleuth/33/1/10703/523434/ +http://fi.egroups.com/message/911dispatchers/171 +http://polygraph.ircache.net:8181/services/define/toast/congress2000/http_-2www.sportfish.net/fish.htm +http://polygraph.ircache.net:8181/services/define/toast/congress2000/MS.htm +http://polygraph.ircache.net:8181/services/define/toast/congress2000/http_-2leader.linkexchange.com/1/X171400/clicklogo +http://polygraph.ircache.net:8181/services/define/toast/congress2000/cfiref.htm +http://www.digitaldrucke.de/(aktuell,arbeitsvermittlung,computer,daham,hilfe,individualverkehr,kultur,literatur,veranstaltungen,verkehr)/_fort/html/themen/aktuell/events/events.htm#regional +http://dellnet.excite.de/computer/katalog/7054 +http://read.cnread.net/cnread1/ztxs/b/baitian/lmss/006.htm +http://www-d0.fnal.gov/d0dist/dist/releases/psim01.02.00/l2utils/GNUmakefile +http://www.allgemeine-immobilien-boerse.de/Frankreich/Verkauf/Private-IB/Startseite/Gemeinsam/erreichenPartner/Gemeinsam/Inserieren/Allgemeine-IB/ +http://wish.themes.tucows.com/adnload/14495.html +http://wish.themes.tucows.com/preview/14494.html +http://wish.themes.tucows.com/preview/78220.html +http://www.uwm.edu/IMT/Computing/sasdoc8/sashtml/af/z0230835.htm +http://www.bdnet.com/Taiga/H/Fulu/fiche_serie.htm +http://se.egroups.com/message/clippingts/14?source=1 +http://adelaida.net/music/texts/trex_s1.html +http://archive.bitcon.no/pub/cica/handheld/desktop/ +http://www.jacksonhewitt.com/ctg/cgi-bin/JacksonHewitt/disclaimers/AAAksrACwAAACCMAAC +http://ftp.cc.chuo-u.ac.jp/home/pub/TeX/CTAN/language/ethiopia/ethtex/lj_fonts/?N=D +http://sirac.inrialpes.fr/Infos/Personnes/Christophe.Rippert/ressources/jdk1.3/docs/guide/jdbc/spec/jdbc-spec.frame16.html +http://www.linux.com/networking/network/release/press_release/competition/web/ +http://www.linux.com/networking/network/release/press_release/competition/internet/ +http://www.linux.com/networking/network/release/press_release/competition/HTTP/ +http://hughes.tucows.com/win2k/share2k_size.html +http://icq.planetout.com/popcornq/movienews/98/10/23/money/careers +http://go3.163.com/_NTES/~cntop07/files/k20808/zengby-k201/zengby-k201-09.html +http://uunetnl.pda.tucows.com/palm/pqa_news_license.html +http://uunetnl.pda.tucows.com/palm/preview/54359.html +http://uunetnl.pda.tucows.com/palm/preview/58637.html +http://uunetnl.pda.tucows.com/palm/adnload/72726_21807.html +http://uunetnl.pda.tucows.com/palm/adnload/62079_21796.html +http://uunetnl.pda.tucows.com/palm/preview/33674.html +http://uunetnl.pda.tucows.com/palm/preview/33501.html +http://uunetnl.pda.tucows.com/palm/adnload/52518_21780.html +http://ftp.dei.uc.pt/pub/net/ip/trace/traffic/?N=D +http://dreamgallery.simplenet.com/lobby/yrestless/sets/26/yrz19.htm +http://sanqin.net/wenyuan/gudian/fengshen/a/fengshen24.html +http://windows.tucows.com/preview/001-010-005-007C.html +http://windows.tucows.com/preview/001-010-005-004C.html +http://proshikanet.tucows.com/win2k/preview/37883.html +http://www5.cplaza.ne.jp/auth/kingdom/bbs/rescue/no70/182.html +http://www5.cplaza.ne.jp/auth/kingdom/bbs/rescue/no70/84.html +http://www5.cplaza.ne.jp/auth/kingdom/bbs/rescue/no70/82.html +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=7,19,34,20,29 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=36,19,34,20,29 +http://www.ne.jp/asahi/kume-kume/kume/photogellery/zoo/nihon_saru/html/nihon_saru04.html +http://www.ne.jp/asahi/kume-kume/kume/photogellery/zoo/nihon_saru/html/nihon_saru05.html +http://www.iabusnet.org:90/forums/aca-1/dispatch.exe/survey/showNextUnseen/fol/100001/2443194 +http://www.chaos.dk/sexriddle/t/r/p/c/p/ +http://www.ld.com/cbd/archive/1999/09(September)/13-Sep-1999/16sol007.htm +http://www.ld.com/cbd/archive/1999/09(September)/13-Sep-1999/16sol024.htm +http://www.ld.com/cbd/archive/1999/09(September)/13-Sep-1999/16sol025.htm +http://www.ld.com/cbd/archive/1999/09(September)/13-Sep-1999/16sol030.htm +http://debian.linux.org.tw/debian/dists/Debian2.1r4/non-free/binary-alpha/oldlibs/?N=D +http://www.tamil.net/list/2000-04/nav00304.html +http://www.2pl.com/b/se/to/1/01/05/v2/1010500263-7.htm +http://www.2pl.com/b/se/to/1/01/05/v2/1010500263-8.htm +http://www.mirror.ac.uk/sites/ftp.microsoft.com/deskapps/powerpt/KB/Q129/5/ +http://www.gbnf.com/genealogy/royal92/html/d0028/I307.HTM +http://www-linux.gsi.de/linux-doc/libqt2/examples/qfd/?M=A +http://www.arm.com/sitearchitek/support.ns4/html/sdt_debug!OpenDocument&ExpandSection=24,6,37,7 +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/kdeutils/kab/kab_kab1importer.h?sortby=log&only_with_tag=KDE_2_0_RELEASE +http://www.allgemeine-immobilien-boerse.de/nordrhein-Westfalen/bielefeld/Verkauf/Allgemeine-IB/Gemeinsam/versicherungen/gebaeude/Private-IB/Gemeinsam/erreichenPartner/email3d.htm +http://www.allgemeine-immobilien-boerse.de/nordrhein-Westfalen/bielefeld/Verkauf/Allgemeine-IB/Gemeinsam/versicherungen/gebaeude/Private-IB/3d-service/info.htm +http://satlink.tucows.com/winme/htmleditme_rating.html +http://satlink.tucows.com/winme/adnload/137630_29066.html +http://satlink.tucows.com/winme/adnload/137653_29087.html +http://yp.gates96.com/5/55/40/63.html +http://yp.gates96.com/5/55/40/93.html +http://yp.gates96.com/5/55/41/8.html +http://yp.gates96.com/5/55/41/27.html +http://yp.gates96.com/5/55/41/93.html +http://yp.gates96.com/5/55/42/1.html +http://yp.gates96.com/5/55/42/65.html +http://yp.gates96.com/5/55/43/15.html +http://yp.gates96.com/5/55/43/26.html +http://yp.gates96.com/5/55/43/94.html +http://yp.gates96.com/5/55/44/70.html +http://yp.gates96.com/5/55/44/83.html +http://yp.gates96.com/5/55/45/17.html +http://yp.gates96.com/5/55/46/3.html +http://yp.gates96.com/5/55/46/39.html +http://yp.gates96.com/5/55/46/43.html +http://yp.gates96.com/5/55/47/18.html +http://yp.gates96.com/5/55/48/23.html +http://yp.gates96.com/5/55/48/40.html +http://yp.gates96.com/5/55/48/72.html +http://yp.gates96.com/5/55/48/93.html +http://yp.gates96.com/5/55/49/7.html +http://yp.gates96.com/5/55/49/8.html +http://yp.gates96.com/5/55/49/20.html +http://yp.gates96.com/5/55/49/37.html +http://yp.gates96.com/5/55/49/49.html +http://yp.gates96.com/5/55/49/60.html +http://yp.gates96.com/5/55/49/69.html +http://www.ramtron.com/pages/visiters.htm +http://genforum.genealogy.com/cgi-genforum/forums/oh/wayne.cgi?56 +http://freebsd.ntu.edu.tw/perl/modules/by-module/DB_File/STAS/?N=D +http://sunsite.org.uk/public/usenet/news-faqs/alt.answers/us-visa-faq/?D=A +http://circumstance.co.kr/www.globalvillage.com/support/software.html +http://mediate.magicbutton.net/do/session/625589/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-top50.html +http://itcareers.careercast.com/texis/it/itjs/+9wwBmev6D86wwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewGPndhBiwGna5O5BnManDtoDnnGamnVncdpoDtaBn5Baw1BdMwBodDaGn31oGnma5Aocc5anLpnGonDqnaGnwcaMFqhTfR20DzmeTtwwwpBm3eP0-dmwww5rmehDwwwBrmeZpwww/morelike.html +http://library.bangor.ac.uk/search/dProtestant+churches+--+New+York+(State)+--+History+--+19th+century/dprotestant+churches+new+york+state+history+++19th+century/-17,-1,0,B/frameset&F=dprotestant+churches+england+history+++16th+century&2,,3 +http://augustachronicle.com/stories/021299/fea_223-4914.000.shtml +http://dreamcity.gaiax.com/www/dreamcity/k/n/kint/menu.html +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceMallCategories-BBC709D6_97E3_3D628A3FC67830F4FB7BD0E0AC833504 +http://www.mirror.kiev.ua:8082/paper/2000/07/1251/text/07-09-1.htm +http://www.burstnet.com/ads/ad7826a-map.cgi/1025131450 +http://link.fastpartner.com/do/session/600341/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/se/ +http://topcu.tucows.com/winme/adnload/137966_29370.html +http://topcu.tucows.com/winme/adnload/137990_29378.html +http://itcareers.careercast.com/texis/it/itjs/+9wwBmeS+D86swwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew6hwAwMwoaBnqrDoqwcaqdD51cBoDta5wcn5aqdD51cBwDB5aBnqrDdcdton5apGd5pnqBoVnaq15BdMnG5apGdm1qBaBnwMaMFqtwAwMwoDzmehxwwwpBmeV+D86eqxwww5rmedDwwwBrmeZpwww/jobpage.html +http://itcareers.careercast.com/texis/it/itjs/+DwwBmeoWD86eDqwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew6hwAwMwoaBnqrDoqwcaqdD51cBoDta5wcn5aqdD51cBwDB5aBnqrDdcdton5apGd5pnqBoVnaq15BdMnG5apGdm1qBaBnwMaMFqtwAwMwoDzmehxwwwpBmeV+D86eqxwww5rmeqDwwwBrmeZpwww/morelike.html +http://itcareers.careercast.com/texis/it/itjs/+QwwBme4+D86qxwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew6hwAwMwoaBnqrDoqwcaqdD51cBoDta5wcn5aqdD51cBwDB5aBnqrDdcdton5apGd5pnqBoVnaq15BdMnG5apGdm1qBaBnwMaMFqtwAwMwoDzmehxwwwpBmeV+D86eqxwww5rm+mwwBrmeZpwww/jobpage.html +http://wwwbackup.trinler.net/anleitungen/manual/mod/mod_dll.html +http://wwwbackup.trinler.net/anleitungen/manual/mod/mod_log_agent.html +http://as400bks.rochester.ibm.com/pubs/html/as400/v4r5/ic2962/info/RZAIENETDOTDATA.HTM +http://www.gov.ie/educ/000928.htm +http://www.gov.ie/educ/speech/000928.htm +http://pub3.ezboard.com/utaela.showPublicProfile?language=EN +http://genforum.genealogy.com/cody/messages/700.html +http://genforum.genealogy.com/cody/messages/525.html +http://genforum.genealogy.com/cody/messages/494.html +http://genforum.genealogy.com/cody/messages/447.html +http://ftp.surfnet.nl/os/FreeBSD/cdrom/development/FreeBSD-CVS/ports/editors/psgml-emacs/files/home.html +http://www.mic.hr/PGBURZA:135556 +http://pub8.ezboard.com/fthecompanionswebboardfrm19 +http://pub8.ezboard.com/fthecompanionswebboardarchive +http://gallery2.simplenet.com/lobby/main/videocaps/ghoffman/precious/ghsp36.htm +http://www.symantec.ru/avcenter/venc/data/unashamed.html +http://www.symantec.ru/avcenter/cgi-bin/virauto.cgi?vid=7000 +http://www.symantec.ru/avcenter/cgi-bin/virauto.cgi?vid=1685 +http://www.symantec.ru/avcenter/cgi-bin/virauto.cgi?vid=5358 +http://rex.skyline.net/navigate.cgi?reading,retail,hobbies,painting,arts +http://rex.skyline.net/navigate.cgi?forsale,retail,hobbies,painting,arts +http://pds.nchu.edu.tw/cpatch/ftp/cuteftp/?S=A +http://www.tel.de/s/M/MCFIT.htm +http://zeus.uni-trier.de/~ley/db/indices/a-tree/s/Stevenson:Allan.html +http://www.alsapresse.com/jdj/00/07/14/SA/article_16.html +http://link.fastpartner.com/do/session/600359/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/jobpilot.php +http://link.fastpartner.com/do/session/600359/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/index.php +http://news.dreamwiz.com/news_lg/04/20001025/joins/200010251653041653193.html +http://news.dreamwiz.com/news_lg/04/20001025/joins/200010250820040820583.html +http://windows.tucows.com/winnt/adnload/71593_30161.html +http://213.36.119.69/do/session/152979/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/reserver/encheres/ +http://213.36.119.69/do/session/152979/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/IT_IT/ +http://www.centc251.org/forums/aca-1/dispatch.cgi/isowg4/showNextUnseen/fol/100012/1220541 +http://bigpanda.net/46/alphabetical.html +http://bigpanda.net/46/io.html +http://fi.egroups.com/message/puzzles/547 +http://theaceshow.com/drawinglinda.html +http://theaceshow.com/drawingsketch.html +http://ftp.jp.debian.org/debian/dists/woody/main/binary-all/news/?D=A +http://www.trax.nilex.co.uk/trax.cgi/A1S/A2L/1AS/B3U/B4L/C2S/ +http://www.trax.nilex.co.uk/trax.cgi/A1S/A2L/1AS/B3U/B4L/C4D/ +http://in.egroups.com/message/islaam/3 +http://in.egroups.com/message/islaam/29 +http://ustlib.ust.hk/search*chi/a%7B233e68%7D%7B215976%7D%7B213e2e%7D/a%7B233e68%7D%7B215976%7D%7B213e2e%7D/-5,-1,0,B/browse +http://yp.gates96.com/13/8/20/68.html +http://yp.gates96.com/13/8/21/25.html +http://yp.gates96.com/13/8/21/32.html +http://yp.gates96.com/13/8/21/49.html +http://yp.gates96.com/13/8/21/63.html +http://yp.gates96.com/13/8/21/88.html +http://yp.gates96.com/13/8/22/2.html +http://yp.gates96.com/13/8/22/10.html +http://yp.gates96.com/13/8/22/67.html +http://yp.gates96.com/13/8/22/79.html +http://yp.gates96.com/13/8/23/19.html +http://yp.gates96.com/13/8/23/31.html +http://yp.gates96.com/13/8/25/64.html +http://yp.gates96.com/13/8/25/68.html +http://yp.gates96.com/13/8/25/73.html +http://yp.gates96.com/13/8/26/6.html +http://yp.gates96.com/13/8/26/11.html +http://yp.gates96.com/13/8/26/12.html +http://yp.gates96.com/13/8/26/39.html +http://yp.gates96.com/13/8/26/54.html +http://yp.gates96.com/13/8/26/55.html +http://yp.gates96.com/13/8/26/82.html +http://yp.gates96.com/13/8/27/89.html +http://yp.gates96.com/13/8/28/22.html +http://yp.gates96.com/13/8/28/61.html +http://yp.gates96.com/13/8/29/13.html +http://yp.gates96.com/13/8/29/33.html +http://yp.gates96.com/13/8/29/83.html +http://www.private-immobilien-boerse.de/baden-wuertemberg/ostalb-kreis/Verkauf/Versteigerungen-IB/Startseite/Gemeinsam/erreichenPartner/IIM-Teil/Startseite/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/indexbeginn.htm +http://www2.so-net.ne.jp/mc/columns/nakama/1112/ +http://ring.shibaura-it.ac.jp/archives/pack/x68/personal/tokei/00_index.txt +http://yp.gates96.com/5/32/0/0.html +http://yp.gates96.com/5/32/0/99.html +http://yp.gates96.com/5/32/1/92.html +http://yp.gates96.com/5/32/1/93.html +http://yp.gates96.com/5/32/3/68.html +http://yp.gates96.com/5/32/4/21.html +http://yp.gates96.com/5/32/4/72.html +http://yp.gates96.com/5/32/5/87.html +http://yp.gates96.com/5/32/6/64.html +http://yp.gates96.com/5/32/7/25.html +http://yp.gates96.com/5/32/7/32.html +http://yp.gates96.com/5/32/7/44.html +http://yp.gates96.com/5/32/7/68.html +http://yp.gates96.com/5/32/7/78.html +http://yp.gates96.com/5/32/8/40.html +http://yp.gates96.com/5/32/8/59.html +http://yp.gates96.com/5/32/8/90.html +http://yp.gates96.com/5/32/8/95.html +http://yp.gates96.com/5/32/9/3.html +http://yp.gates96.com/5/32/9/54.html +http://yp.gates96.com/5/32/9/62.html +http://yp.gates96.com/5/32/9/77.html +http://tucows.soneraplaza.nl/winme/preview/138260.html +http://www.cnnews.com/maya/finance/cjsy/gncj/item/2000_07/206341.shtml +http://212.31.0.37/hur/turk/98/09/23/dunya/02dun.htm +http://212.31.0.37/hur/turk/98/09/12/dunya/01dun.htm +http://ftp.cwi.nl/ftp/mdr/LOCKED/ +http://ftp.cwi.nl/ftp/mdr/PICH/ +http://www.ncte.org/lists/ncte-talk/jan2000/msg02008.html +http://www.russ.ru/forums/prav-dir/conf2/695_r.htm +http://www.doc.ic.ac.uk/lab/labsrc_area/firstyear/submissions/1997-98/jmc1/labs/Ex05/mjp97/?D=A +http://www.affiliate.hpstore.hp.co.uk/do/session/380786/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/search.asp +http://www.flapjack.de/main/2ndHP/jangl43637.htm +http://195.166.55.201/vfg-uk/HTML/P145232.HTM +http://www.greenleaves.com/bookcat/gb_0689826788.html +http://webraft.its.unimelb.edu.au/730452/students/sgm/pub/ +http://ring.omp.ad.jp/pub/NetBSD/packages/pkgsrc/print/teTeX-share/files/ +http://ww.egroups.com/subscribe/wtcjk_purnawirawan +http://167.8.29.14/life/travel/ski/skinj.htm +http://www.nrk.no/finnmark/x26_5_97/fastesid/abonn.htm +http://www.brio.de/BRIO.catalog/39fe2f41050aa9b82741d472aa7806dd/UserTemplate/6 +http://207.25.71.143/golf/news/2000/04/18/heintz/ +http://weekends.worldres.com/script/gen_review.asp?hotel_id=4291&n=1231 +http://www.netitor.com/photos/schools/bc/sport/m-footbl/auto_pdf/weekly-release-082800.pdf +http://www.3w-sciencefiction.de/SmytheRH/SmytheRH0785808744.htm +http://www.zdnet.com/gamespot/stories/screens/0,10865,2617426-32,00.html +http://ftp.lip6.fr/pub2/sgml-tools/website/HOWTO/Root-RAID-HOWTO/t1450.html +http://webusers.siba.fi/doc/texmf/latex/ms/?M=A +http://www.trax.nilex.co.uk/trax.cgi/A1S/1AL/A3L/A1U/A3S/1AS/ +http://www.trax.nilex.co.uk/trax.cgi/A1S/1AL/A3L/A1U/A3S/D1U/ +http://www.trax.nilex.co.uk/trax.cgi/A1S/1AL/A3L/A1U/A3S/D3S/ +http://thaigate.rd.nacsis.ac.jp/ftp/thaisoft/nectec/linux.tle/6.01/Mandrake/?S=D +http://www-ind5.cricket.org/link_to_database/ARCHIVE/2000-01/AUS_LOCAL/GRADE/NSW/SCA/WOMEN/SCA-WOMEN_2000-01_FIXTURES.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=abbratend&l=de +http://www.webvillage.org/mBEDJPsite/html/downloadplugins.html +http://www.gov.karelia.ru:8081/gov/Karelia/658/8.html +http://www.private-immobilien-boerse.de/bayern/ingolstadt/Verkauf/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/Gemeinsam/Inserieren/Gemeinsam/erreichenPartner/Ferien-IB/Startseite/ +http://pillsonline.00go.com/lowfatdiet/lifetime_fitness.htm +http://tecfa2.unige.ch/guides/java/examples/JavaClassLibExamples/io/FileReader/Main.class +http://www.burstnet.com/ads/ad7826a-map.cgi/1933336291 +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/asiasanahaku/Hong%2520Kong/aasia/talous/pika-+ja+perustilastoja/ +http://home.tiscalinet.be/oaseidstad/vonk/optop2000.html +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=19,36,22,32,23 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=29,36,22,32,23 +http://cn.egroups.com/messages/virtualaccess/194 +http://jerken.grida.no/nor/soeno97/ozone/frames/pressure.htm +http://online.excite.de/erotik/katalog/6213 +http://online.excite.de/erotik/katalog/6187 +http://online.excite.de/erotik/katalog/6221 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=28,7,35,25,13 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=31,7,35,25,13 +http://genforum.genealogy.com/cgi-genforum/forums/loughlin.cgi?11 +http://freesoftware.missouri.edu/pub/CPAN/authors/id/J/JS/JSWARTZ/?D=A +http://link.fastpartner.com/do/session/600360/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/fastpartner.php +http://www.jobvillage.com/channel/jobs/sciences/life_sciences/soil_plant_scientist/b.1041.g.251.html +http://ftp.debian.org/dists/Debian2.2r0/non-free/binary-sparc/mail/?D=A +http://generalstore.everdream.com/kore/catalog/Office_Supplies/General_Office_Supplies/Tape_Flags/Arrow/GRP-US6663/product.html +http://www.hig.se/(date,if,set,tablify,user)/~jackson/roxen/ +http://www.hig.se/(date,if,language,set,tablify)/~jackson/roxen/ +http://www.cyber-pages.com/0prog/classifieds_display.cgi?oakland=WEMP=0 +http://202.84.17.6/csnews/articles/141_18691.htm +http://202.84.17.6/csnews/articles/142_18526.htm +http://ftp.dti.ad.jp/pub/FreeBSD/FreeBSD-current/www/es/releases/1.1.5/ +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=9&discrim=247,207,129 +http://ftp.up.pt/Linux/debian/dists/unstable/main/disks-i386/?M=A +http://www.unterhaltungs-cd.de/HillJonny/B000025087.htm +http://filebox.vt.edu/users/aneal/excess/_fpclass/ +http://www.jamba.de/KNet/_KNet-JOt8j1-OEd-139q0/showInfo-presse.de/node.0/cde7f1uou +http://www.tercera.cl/diario/1997/12/05/win.html +http://yp.gates96.com/14/88/20/8.html +http://yp.gates96.com/14/88/20/13.html +http://yp.gates96.com/14/88/22/30.html +http://yp.gates96.com/14/88/25/28.html +http://yp.gates96.com/14/88/25/65.html +http://yp.gates96.com/14/88/26/3.html +http://bsdweb.pasta.cs.uit.no/bsdweb.cgi/~checkout~/pkgsrc/math/grace/pkg/ +http://ftp.tokyonet.ad.jp/pub/Linux/debian-jp/dists/unstable-jp/contrib/binary-m68k/math/?S=A +http://my.dreamwiz.com/piramos/lan.htm +http://pub8.ezboard.com/fselfreliantlivingfrm16.showMessage?topicID=11.topic +http://pub8.ezboard.com/fselfreliantlivingfrm16.showMessage?topicID=4.topic +http://www.affiliate.hpstore.hp.co.uk/do/session/380798/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/SMARTTIPS/vacationcards.asp +http://systemlogic.neoseeker.com/Companies/productportfolios/NEC_Interchannel/?sortby=sections +http://www.houses-apartment-rentals.com/Virginia/city_search_criteria.asp?state=VA&City=DALHART +http://www.wcbcourses.com/wcb2/schools/MERCED/merced/dhauser/2/forums/forum2/messages/17.html +http://www.wcbcourses.com/wcb2/schools/MERCED/merced/dhauser/2/forums/forum2/messages/10.html +http://beautifulsavers.subportal.com/sn/Shell_and_Desktop/Quick_Shutdown_Tools/2702.html +http://polygraph.ircache.net:8181/getting_started/http_-2www.lucent.com/micro/K56flex/http_-2home.netscape.com/comprod/mirror/http_-2www.wtcsf.org/mall/http_-2www.cdnow.com/http_-2www.microsoft.com/msoffice/publicaffairs.html +http://polygraph.ircache.net:8181/getting_started/http_-2www.lucent.com/micro/K56flex/http_-2home.netscape.com/comprod/mirror/http_-2www.wtcsf.org/mall/http_-2www.cdnow.com/http_-2www.microsoft.com/msoffice/videobroadcast/ +http://www.yagoo.co.kr/stats/pitching.asp?Mlbmanid=JESPEN7599 +http://www.4hotfantasy.com/acommon/guests/python4.html +http://boerseninfos.ksk-tut.de/dynamic/ak/adhoc/news/519000-20000316-150811.html +http://boerseninfos.ksk-tut.de/dynamic/ak/adhoc/news/519000-19991025-082814.html +http://cn.yahoo.com/Regional/Countries_and_Regions/China/Provinces__Regions_and_Municipalities/Zhejiang/Cities_and_Towns/Li_Hsua/Business/Companies/Books/ +http://www.affiliate.hpstore.hp.co.uk/do/session/380810/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/FR/REGISTRATION/entry.asp +http://kuyper.calvin.edu/fathers2/NPNF1-01/npnf1-01-12.htm +http://library.bangor.ac.uk/search/dModernism+(Literature)/dmodernism+literature/-5,-1,0,E/2browse +http://aleph.tau.ac.il:4500/ALEPH/ENG/ATA/AAS/AAS/SHORT/410519/1/ +http://pub1.ezboard.com/fflashboard1flashjunkiestalk.showAddReplyScreenFromWeb?topicID=190.topic&index=2 +http://www.inforiese.de/db_cargo/typ_b_files/db_cargo_cargo_ansprechpartner.shtml +http://www.gbnf.com/genealogy/dehart/html/d0005/I985.HTM +http://btclickfam.excite.co.uk/directory/categories/670199 +http://www.worldmedicus.com/servlet/Controller/$7008040516620000.sj_viewc/ +http://www.worldmedicus.com/servlet/Controller/$7008040528250000.sj/ +http://207.25.71.143/features/galleries/then_and_now/belinsky/belinsky01_lg_01.html +http://wiem.onet.pl/wiem/002c66.html +http://www.peopledaily.com.cn/GB/paper40/544/58242.html +http://www.uihealthcare.com////PatientsVisitors/MedMuseum/CenturyOfCaring/UniversityHospitals/05Quarantine.html +http://se.egroups.com/login.cgi?login_target=%2Fmessages%2Fwotccglist%2F333 +http://se.egroups.com/message/wotccglist/334 +http://se.egroups.com/message/wotccglist/350 +http://se.egroups.com/message/wotccglist/358 +http://www.msn.expedia.co.uk/wg/North_America/United_States/P30131.asp +http://www.uol.com.br/cinemaonline/starwars +http://www.perotech.ch/d/securedb/html/listtopic.php?7396 +http://moviestore.zap2it.com/browse/X-FILES/POSTCARD/s.goFzN1Lb +http://zeus.uni-trier.de/~ley/db/indices/a-tree/m/Morgoev:Vladimir_K=.html +http://www.3w-buecher.de/GilliesRobertJ/GilliesRobertJ0122839803.htm +http://www.buybuddy.com/sleuth/27/1/11002/6637/ +http://ftp.uk.debian.org/debian/dists/unstable/contrib/binary-powerpc/oldlibs/?D=A +http://no.egroups.com/login.cgi?login_target=%2Fgroup%2Fwww.members.xoom.com%2FLibertyFlame +http://www.aelita.net/products/support/sitemap/Reg/QuoteRegister/news/company/Copyright.htm +http://www.aelita.net/products/support/sitemap/Reg/QuoteRegister/news/services/default.htm +http://www.amateurplatinum.com/spankingfantasy/fertiletrophy-wife/hot-hardcore-fuckinglongest/red-toenail-polishfeet-fucking-/vietnamesewomen/chinesechi/womenpetite.html +http://www.amateurplatinum.com/spankingfantasy/fertiletrophy-wife/hot-hardcore-fuckinglongest/red-toenail-polishfeet-fucking-/vietnamesewomen/fuckinghard/actionsmacking.html +http://genforum.genealogy.com/cgi-bin/print.cgi?fikes::26.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/programs/unlambda/lit/quizz/music/midi/ +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/programs/unlambda/lit/quizz/computers/callcc.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/programs/unlambda/lit/quizz/misc/colorart/ +http://www.musiciansfriend.com/ex/ds/live/001030182726064208037002434823 +http://www.musiciansfriend.com/ex/ds/home/funzone/001030182726064208037002434823?doc=doc,postcard.html +http://www.musiciansfriend.com/ex/ds/home/platinum/001030182726064208037002434823?g,home.platinum.html +http://www.musiciansfriend.com/ex/ds/home/articles/001030182726064208037002434823?dbase=gw,gwmain.html +http://www.musiciansfriend.com/ex/ds/home/articles/001030182726064208037002434823?dbase=info,privacy.html +http://preview.egroups.com/dir/Business/Training_and_Schools/Management_Training/Consultants?st=4 +http://hammer.prohosting.com/~nieting/html1216/lmtf015.htm +http://planetfreebies.subportal.com/sn/Information_Management/Misc__Information_Databases/12835.html +http://dada.linuxberg.com/kdehtml/adnload/61589_33448.html +http://www.wlu.ca/~wwwregi/95-96/cal/ucourses/GM/GM151.html +http://walkabout.tucows.com/win2k/adnload/61015_28629.html +http://www.1001e.net/02/qbt/09.htm +http://se.egroups.com/post/webfaaa?act=reply&messageNum=3 +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/keats.admin.virginia.edu/asbestos/home.html +http://www.hotelboulevard.com/fr/riviera/standard/htmlf752567459c6d803842381c50e94fd9f/sessionLang/ANG/gettingstarted.html +http://ring.omp.ad.jp/pub/NetBSD/packages/pkgsrc/print/transfig/?N=D +http://citeseer.nj.nec.com/cidcontext/2339336 +http://www.uk.multimap.com/p/browse.cgi?pc=LS287DR +http://topcu.linux.tucows.com/x11html/adnload/46019_3809.html +http://www.mon.de/nr/stuemges +http://www.tamil.net/list/1998-10/msg00212.html +http://retailer.gocollect.com/do/session/1912682/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/terms_and_conditions.asp +http://pl.php.net/manual/nl/function.pfpro-version.php +http://members.tripod.co.jp/millenium/top.html +http://community.webshots.com/photo/4331085/4331572GooaFzYUAJ +http://community.webshots.com/photo/4331085/4331589oKrBmsJbga +http://community.webshots.com/photo/4331085/4331620zgfyMLoSjs +http://www.utdallas.edu/~chansen/text/qabbala9.html +http://www.jobvillage.com/channel/jobs/installation_repair/safety_equipment/fire_alarm/b.2283.g.3516.html +http://www.geocities.com/Area51/Chamber/8750/DoesKitEverTalkAboutTheSubjectOnHand.html +http://www.geocities.com/Area51/Chamber/8750/TheMotherofAllMissleBoats.html +http://www.geocities.com/Area51/Chamber/8750/Tomahawk2.html +http://www.thecitizennews.com/main/archive-000628/thecitizennews/citizen.html +http://links2go.publiweb.com/expert/topic/Mp3_Hardware +http://webhelp.promovacances.net/S02/BL/BEGYP/SAI00512024/cal.htm?d=1013 +http://205.161.150.96/cgi-bin/c2k/title_talent.html&id=143786&title_star=DOMINICK +http://dennou-q.geo.kyushu-u.ac.jp/library/Linux/debian-jp/dists/stable/non-free-jp/binary-all/net/?S=A +http://wow-online.vhm.de/Wirtschaft/Unternehmen/Versicherungen/Versicherungsgesellschaften/Signal_Versicherung.html +http://www.linux.com/networking/network/firewall/web/communications/?kw_offset=50 +http://www.leg.wa.gov/pub/rcw%20-%20text/title_28b/chapter_056/rcw_28b_56_090.txt +http://pub12.ezboard.com/flalaland96545listeningbooth.showMessage?topicID=74.topic +http://www.fogdog.com/cedroID/ssd3040183156032/crs/pw__/wld/fogdog_sports/lee_sport/fan_memorabilia/apparel/new_york_yanke_2000_ameri_leagu_champ_tee_shi.html +http://www.fogdog.com/cedroID/ssd3040183156032/nav/stores/adventure_travel/ +http://www.hoovers.com/travel/cityguide/detailed/0,3368,46_119158,00.html +http://user.chollian.net/~mlsc/ +http://www.158china.com/data/stock/fundowner/default.asp?stck_cd=0548 +http://www.affiliate.hpstore.hp.co.uk/do/session/380803/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/SMARTTIPS/createbroch.asp +http://rcsl.auto.inha.ac.kr/~treeman/Documents/HOWTO/Consultants-HOWTO-3.html +http://www.diogenes.ch/4DACTION/web_rd_aut_prview/a_id=7056427&area=&ID=483330 +http://polygraph.ircache.net:8181/http_-2www.horizonfinance.com/http_-2www.netscape.com/download/http_-2www.microsoft.com/ie/http_-2207.91.150.20/links.html +http://www.multicosm.com/facade/www.adobe.com/support/techguides/printpublishing/scanning/psscanning01b.html +http://yp.gates96.com/0/50/10/62.html +http://yp.gates96.com/0/50/10/95.html +http://yp.gates96.com/0/50/11/1.html +http://yp.gates96.com/0/50/11/18.html +http://yp.gates96.com/0/50/11/49.html +http://yp.gates96.com/0/50/12/55.html +http://yp.gates96.com/0/50/13/48.html +http://yp.gates96.com/0/50/13/96.html +http://yp.gates96.com/0/50/14/15.html +http://yp.gates96.com/0/50/14/73.html +http://yp.gates96.com/0/50/15/50.html +http://yp.gates96.com/0/50/15/80.html +http://yp.gates96.com/0/50/16/1.html +http://yp.gates96.com/0/50/16/8.html +http://yp.gates96.com/0/50/17/50.html +http://yp.gates96.com/0/50/17/71.html +http://yp.gates96.com/0/50/18/25.html +http://yp.gates96.com/0/50/18/73.html +http://yp.gates96.com/0/50/18/82.html +http://yp.gates96.com/0/50/18/84.html +http://yp.gates96.com/0/50/18/90.html +http://cisne.sim.ucm.es/search*spi/dBallets+--+Gran+Bretaña+--+Discos+compactos/dballets+gran+bretan~aa+discos+compactos/-29,-1,0,B/browse +http://opac.lib.ntnu.edu.tw/search*chi/++ftlist/bp20005025/-17,-1,0,B/browse +http://www.trax.nilex.co.uk/trax.cgi/A1S/1AL/A3L/A4R/B1D/A3S/ +http://php.nic.fi/manual/html/function.cpdf-open.html +http://php.nic.fi/manual/html/function.cpdf-fill.html +http://php.nic.fi/manual/html/function.cpdf-setrgbcolor-fill.html +http://www.classiccmp.org/mail-archive/classiccmp/1998-04/1426.html +http://text.csn.ul.ie/~danny/tabs/p/proclaimers/?N=D +http://mirror.nucba.ac.jp/mirror/FreeBSD/branches/3.0-stable/ports/japanese/zangband/?N=D +http://augustachronicle.com/stories/100197/spo_fishing.html +http://www.symatrixinc.com/website/website.nsf/0/3e40df86fb357cd5882568720079613f!OpenDocument&ExpandSection=10,8,9,5 +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/linux/music/quizz/pics.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/linux/music/quizz/lit/ldvelh.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/linux/music/quizz/misc/unitest/ +http://mirror.nucba.ac.jp/mirror/FreeBSD/branches/3.0-stable/ports/japanese/ptex-pkfonts360/?N=D +http://www.2pl.com/b/ru/fi/1/24/06/b1/1240601249-11023.htm +http://galaxy.einet.net/galaxy/Community/United-States/States/Minnesota/Cities-and-Regions/Winona/Education/K--12/Middle/Public.html +http://www.hotelboulevard.com/fr/paris/standard/htmlc866e5cecf73322551f00b0108eb84bc/sessionLang/ANG/prov/browse/cp/75001/resultatSearch.html +http://btp1da.phy.uni-bayreuth.de/ftp/pub/FreeBSD/ports/japanese/dvipsk-vflib/pkg-descr +http://32548news.subportal.com/sn/Utilities/Misc__Encryption_Utilities/ +http://www.hongen.com/proedu/hext/zxks/dxyw/html/dxy62804.htm +http://www.users.globalnet.co.uk/~roy/InternetTree/WC01/WC01_226.htm +http://www2.msstate.edu/~eaddy/famtread/html/nti07339.htm +http://www.trackinfo.com/trakdocs/hound/ca/RESULTS/ARCHIVE/1996/0996/GRCA19S.HTM +http://www.idg.net/crd_essential_110984.html +http://www.zdnet.de//news/artikel/2000/09/06015-wc.html +http://www.secinfo.com/d114Cu.52.htm +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus141561/eus174865/eus327367/eus327527/eus331435/ +http://enjoy100.com.cn/200005/23/ +http://link.fastpartner.com/do/session/600348/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/mediatransfer.php +http://www.chaos.dk/sexriddle/t/z/p/b/b/ +http://www.brio.de/BRIO.catalog/39fe2f4106ca8ce0273fd472aa7806ff/UserTemplate/6 +http://link.fastpartner.com/do/session/600352/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/robinhus.php +http://link.fastpartner.com/do/session/600352/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/create/index.php +http://www.underground-online.com/companyfinder/filters/products/0,9996,1793-101,00.html +http://mediate.magicbutton.net/do/session/625588/vsid/3342/tid/3342/cid/88020/mid/2008/rid/2313/chid/2648/url/http://www1.getmapping.com/viewer.cfm +http://aol.digitalcity.com/houston/recreation/event.dci?eid=6452 +http://www.linux.com.hk/mirror/ldp/LDP/LG/issue10/lg_bytes10.html +http://www.linux.com.hk/mirror/ldp/LDP/LG/issue10/issue10.txt +http://www.beauty.net.cn/main/japanese/mie.htm +http://www.allgemeine-immobilien-boerse.de/kanada/verkauf/Gemeinsam/Inserieren/Allgemeine-IB/Ferien-IB/Startseite/Private-IB/Startseite/Default.htm +http://www.kodak.co.uk/US/en/corp/store/catalog/Product.jhtml?PRODID=2113&CATID=2234 +http://opac.lib.ntnu.edu.tw/search*chi/f373+017/f373+017/-5,-1,,B/browse +http://ftp.du.se/disk3/mandrake/7.1/Mandrake/mdkinst/etc/pcmcia/?M=A +http://www.teenplatinum.com/barelylegal/anal-sexass/taismall/almond-skinned/{gaylink} +http://194.128.65.4/pa/cm199697/cmhansrd/vo970318/debtext/70318-11.htm +http://netlondon.hotelbook.com/live/photos/19368 +http://www.centc251.org/forums/aca-1/dispatch.cgi/hsi/folderFrame/100205/0/author/1243894 +http://www.teacherformation.org/html/od/facilitators.cfm/task1,login/discussion_id,2/xid,5474/yid,3022999 +http://polygraph.ircache.net:8181/environment_energy/heritage/http_-2www.apache.org/ +http://plat.debian.or.jp/debian/dists/unstable/main/binary-alpha/math/?D=A +http://home.hiwaay.net/~bjacobs/genealogy/laster/html/d0054/g0000038.html +http://www.northampton.ac.uk/cgi-bin/liberation/betsie/betsie.pl/1005/www.northampton.ac.uk/cgi-bin/liberation/betsie/betsie.pl/1037/www.northampton.ac.uk/lrs/Information/refword.html +http://ustlib.ust.hk/search*chi/cPL1275+.F426+1991/cpl+1275+f426+1991/-5,1,1,E/frameset&F=cpl+1273+y36+1982&1,1, +http://stormix.com/en/resources/packages/tex/devel/debmake +http://stormix.com/en/resources/packages/tex/devel/doc++ +http://stormix.com/en/resources/packages/tex/devel/ftnchek +http://stormix.com/en/resources/packages/tex/devel/libnet0-dev +http://stormix.com/en/resources/packages/tex/devel/libobgtk-dev +http://stormix.com/en/resources/packages/tex/devel/netatalk-dev +http://stormix.com/en/resources/packages/tex/devel/pact-base +http://stormix.com/en/resources/packages/tex/devel/scalapack1-mpich +http://members.tripod.co.jp/sugisaka/?M=A +http://www.szinfo.com/book/wai/no/fa/h/hongyuhei/011.htm +http://www.szinfo.com/book/wai/no/fa/h/hongyuhei/054.htm +http://www.centc251.org/forums/aca-1/dispatch.cgi/hsi/listUnseen/fol/100205/20,0/1230074 +http://www.crutchfield.com/cgi-bin/S-p5rPnwuC0SA/Auto.asp +http://www.abb.co.uk/global/seapr/SEAPR035.NSF/viewUNID/f79b6db19a951ce0c125697300319a41!OpenDocument&ExpandSection=6,4,8,5 +http://freebsd.ntu.edu.tw/perl/authors/id/A/AO/AOCINAR/?S=A +http://www.gaymencam.com/elke.html +http://www.linux.com/networking/network/industry/new/web_server/website/ +http://www.tccomputers.com/cgi-bin/bp/1899758621/products/removeabledrives/removeabledrives.htm +http://www.tccomputers.com/cgi-bin/bp/1899758621/store/showcart.html +http://www.highwired.net/Guidance/Section/0,1860,1779-27626,00.html +http://gd.cnread.net/cnread1/net/zpj/r/repinsky/005.htm +http://www.amateurplatinum.com/tubal-ligationmilk/pregnanttubal-ligation/off-the-ragnipples/jizz-dribbling-cumshotscumming/{amateurlink} +http://home.dqt.com.cn/~why/wenzhang/ckpajq/.htm +http://ftp.fi.debian.org/debian/dists/woody/non-free/binary-all/doc/?D=A +http://www.linux.com/networking/network/website/hardware/howto/Linuxcare/ +http://www.linux.com/networking/network/website/hardware/howto/sales/ +http://shn.webmd.com/printing/asset/adam_imagepage_8626 +http://www.geocities.co.jp/Outdoors/2127/bangai_makuyama.html +http://www2.to/souhey +http://www.hotelboulevard.com/fr/paris/standard/html73b90b9d262d517e98c9d779b3b09b7a/sessionLang/ANG/prov/browse/cp/75017/resultatSearch.html +http://perso.wanadoo.fr/olivier.leieber/page22.html +http://www.computer-networking.de/studenten/dv_labor/onlinebuecher/apache/sections.html +http://saejong.pufs.ac.kr/~cilim/homepage/link.html +http://cafe3.daum.net/Cafe-bin/Bbs.cgi/hopepds/qry/zka/B2-kCYFp/qqatt/^ +http://www3.newstimes.com/archive99/jun1899/lch.htm +http://www.7thlevel.com/python/cwot/demo/ +http://www.paidmania.com/getpaid/signup/100/4632 +http://yp.gates96.com/12/14/0/31.html +http://yp.gates96.com/12/14/0/43.html +http://yp.gates96.com/12/14/0/60.html +http://yp.gates96.com/12/14/1/18.html +http://yp.gates96.com/12/14/1/44.html +http://yp.gates96.com/12/14/1/64.html +http://yp.gates96.com/12/14/1/82.html +http://yp.gates96.com/12/14/2/84.html +http://yp.gates96.com/12/14/3/61.html +http://yp.gates96.com/12/14/4/65.html +http://yp.gates96.com/12/14/5/24.html +http://yp.gates96.com/12/14/5/49.html +http://yp.gates96.com/12/14/5/60.html +http://yp.gates96.com/12/14/5/62.html +http://yp.gates96.com/12/14/6/20.html +http://yp.gates96.com/12/14/6/51.html +http://yp.gates96.com/12/14/7/28.html +http://yp.gates96.com/12/14/7/85.html +http://yp.gates96.com/12/14/7/93.html +http://planet.gaiax.com/home/kito/main +http://www.svt.se/falun/packat/program/603/images/1rep/?D=A +http://volunteersolutions.org/swt/volunteer/opp/one_151124_printer_detailed.html +http://fyi.cnn.com/ASIANOW/asiaweek/97/1003/nat1.html +http://www.farhi.org/ps09/ps09_233.htm +http://yp.gates96.com/6/8/30/27.html +http://biz.yahoo.com/apf/000929/tire_death_7.html +http://www.studentadvantage.gamers.com/game/135583 +http://www.studentadvantage.gamers.com/game/45759 +http://yp.gates96.com/6/8/30/44.html +http://yp.gates96.com/6/8/30/50.html +http://yp.gates96.com/6/8/30/72.html +http://yp.gates96.com/6/8/30/86.html +http://yp.gates96.com/6/8/30/89.html +http://yp.gates96.com/6/8/31/78.html +http://yp.gates96.com/6/8/31/88.html +http://yp.gates96.com/6/8/32/3.html +http://yp.gates96.com/6/8/32/24.html +http://yp.gates96.com/6/8/32/34.html +http://yp.gates96.com/6/8/33/14.html +http://yp.gates96.com/6/8/33/42.html +http://yp.gates96.com/6/8/33/75.html +http://yp.gates96.com/6/8/34/32.html +http://yp.gates96.com/6/8/34/97.html +http://yp.gates96.com/6/8/35/53.html +http://yp.gates96.com/6/8/35/98.html +http://yp.gates96.com/6/8/36/74.html +http://yp.gates96.com/6/8/36/99.html +http://yp.gates96.com/6/8/38/92.html +http://yp.gates96.com/6/8/38/97.html +http://yp.gates96.com/6/8/39/45.html +http://yp.gates96.com/6/8/39/69.html +http://tour.stanford.edu/tour/29.0/gMlPb +http://idl.tucows.com/winme/adnload/138396_30343.html +http://idl.tucows.com/winme/adnload/138395_29743.html +http://web.singnet.com.sg/~tay7012i/family.htm +http://www.chaos.dk/sexriddle/p/f/g/j/o/ +http://lcweb2.loc.gov/ll/llnt/070/?S=A +http://lcweb2.loc.gov/ll/llnt/070/0100/ +http://www.crosswinds.net/~lucifern/ +http://pub14.ezboard.com/fblazinofdablazinestdabattledome.subscribeUnregisteredToTopic?topicID=190.topic +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/computers/lit/quizz/programs/unlambda/misc/peanuts.html +http://members.se.tripod.de/svdata/inglis/sida2.htm +http://www.fogdog.com/cedroID/ssd3040183217284/crs/hp/nav/stores/golf/ +http://198.103.152.100/search*frc/tOperations+guide+to+ZIM/toperations+guide+to+zim/-17,-1,0,E/2browse +http://herndon1.sdrdc.com/cgi-bin/com_detail/C00186353 +http://www.j2ee.com/products/javamail/javadocs/javax/mail/Flags.html +http://www.j2ee.com/products/javamail/javadocs/javax/mail/Header.html +http://www.intellicast.com/Sail/World/UnitedStates/FourCorners/Arizona/LakeMeadCanyon/LocalWinds/d1_18/ +http://genforum.genealogy.com/cgi-bin/print.cgi?guill::871.html +http://in.egroups.com/message/ucc-medicine/9 +http://in.egroups.com/message/ucc-medicine/14 +http://www-uk3.cricket.org/link_to_database/PLAYERS/WOMEN/AUS/WILSON_B_02011221/index.NSW-WOMEN.html +http://ftp.du.se/disk4/FreeBSD/FreeBSD-current/www/ja/releases/?M=A +http://www.citythek.de/koeln/eduscho/fsinhalt.htm +http://198.103.152.100/search*frc/cCA1+MPY30+97C31/cca1+mpy30+97c31/-5,-1,,E/browse +http://ftp.nsysu.edu.tw/Linux/RedHat/doc/en/HOWTOS/localization/Serbian/?N=D +http://mk158.tripod.co.jp/old/praga1/do/bio.html +http://oneplace.adbureau.net/accipiter/adclick/site=ONEPLACE/area=INDEX/POSITION=FOOTER/AAMSZ=468x60/ACC_RANDOM=449975866078 +http://members.tripod.co.jp/Primrose/honeydcolumn3.html +http://911codes.com/games/platform/n64/sect/div/cont/list_cheat/spray/y/id/0000009564/gid/0000003291/_cheats/_walkthroughs/_codes/_pc/_n64/_psx/_gameboy/_playstation/ +http://iqseek.shop.goto.com/compperiph/monfol/mon/search/detail.jhtml?MANUF=ViewSonic&MODEL=E790 +http://iqseek.shop.goto.com/compperiph/monfol/mon/search/detail.jhtml?MANUF=ViewSonic&MODEL=GA655 +http://plat.debian.or.jp/debian/dists/stable/main/binary-powerpc/shells/?M=A +http://retailer.gocollect.com/do/session/1912686/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/shipping_policy.asp +http://vvv.geocities.co.jp/Playtown-Yoyo/5287/ +http://vvv.geocities.co.jp/Playtown-Yoyo/5714/ +http://vvv.geocities.co.jp/Playtown-Yoyo/5750/ +http://genforum.genealogy.com/cgi-genforum/forums/charpia.cgi?3 +http://www.amateurplatinum.com/tubal-ligationmilk/plus-sizecoushin-for-the-pushin/best-friendsjail-bait/vietnamese/ac/dclubrication/bisexualelbow-grease.html +http://library.bangor.ac.uk/search/tContemporary+psychology+series/tcontemporary+psychology+series/-17,-1,0,B/2exact&F=tcontemporary+problems+in+geography&1,4 +http://www-d0.fnal.gov/cgi-bin/cvsweb.cgi/calreco/VERSION?only_with_tag=p05-br +http://www.158china.com/news/2000/08/21/52747.htm +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx031009.txt +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx031106.txt +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx031208.txt +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx031507.txt +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx032406.txt +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx032902.txt +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx041501.txt +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx041611.txt +http://www.ln.cei.gov.cn/dh/hgjj/wscf/hx/hx1.txt +http://wuarchive.wustl.edu/edu/math/software/multi-platform/SLATEC/G/G2/G2H/G2H2/sbols/ +http://www.loststars.net/story4/ab200-2.html +http://www.indian-express.com/ie/daily/19981219/35350564.html +http://www.indian-express.com/ie/daily/19981219/35351234.html +http://www.homestead.com/jennyb/pets.html +http://www.allgemeine-immobilien-boerse.de/kanada/verkauf/Gemeinsam/Inserieren/Allgemeine-IB/Versteigerungen-IB/Startseite/Gemeinsam/suche.htm +http://www.sankei.co.jp/databox/paper/9808/06/paper/today/sports/soccer/06soc002.htm +http://rex.skyline.net/navigate.cgi?history,collectibles,recreation,sculpture,arts +http://tjohoo.se/sport/snowboard/2.php3 +http://www.du-et.net/prof/n/nkaworu.html +http://www.iwon.com/home/movies/movies_summary_page/0,13160,383543,00.html +http://www.iwon.com/home/movies/movies_summary_page/0,13160,481885,00.html +http://www.iwon.com/home/movies/movies_summary_page/0,13160,372508,00.html +http://pub13.ezboard.com/fvisualbasicexplorergettingstarted.emailToFriend?topicID=861.topic +http://www.fogdog.com/cedroID/ssd3040183158417/customer_service/ +http://www.fogdog.com/cedroID/ssd3040183158417/cgi-bin/CedroCommerce?func=EditBasket +http://www.fogdog.com/cedroID/ssd3040183158417/nav/products/cycling/1y/software/ +http://www.niwl.se/wais/new/28/28189.htm +http://retailer.gocollect.com/do/session/1912674/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://www.trax.nilex.co.uk/trax.cgi/A1C/A2R/A2U/B3R/A1U/Resign/ +http://www.sofitware.com/books/sci05/0471969664.html +http://www.genome.wustl.edu:8021/gsc1/est/zebrafish_reports/old_rank_reports/zebrafish.rank.990322 +http://www.genome.wustl.edu:8021/gsc1/est/zebrafish_reports/old_rank_reports/zebrafish.rank.991004 +http://www.farhi.org/ps01/ps01_015.htm +http://www-usa10.cricket.org/link_to_database/ARCHIVE/WORLD_CUPS/WC99/STATS/BY_TEAM/SL/WC99_BOWL_BEST_INNS_SR_SL.html +http://www.online.kokusai.co.jp/Stock_corner/V0043480/wrd/G500/stock_corner/stock_corner.html +http://www.online.kokusai.co.jp/Mmf_corner/V0043480/mmf_corner/mmf_corner/url +http://mediate.magicbutton.net/do/session/625604/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-cust.html +http://www.malaysia.net/lists/sangkancil/1999-05/frm00449.html +http://www.bigstar.com/contest/index.cfm/4ae093fg371d8ddg3?fa=contest +http://www.bigstar.com/tv/index.cfm/4ae093fg371d8ddg3 +http://linux.tucows.dia.dk/gnomehtml/adnload/49933_5879.html +http://dc.web.aol.com/roanoke/health/directories.dci?type=professionals +http://dc.web.aol.com/roanoke/health/categories.dci?category=fitnessdiet +http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux/drivers/isdn/icn/Makefile?only_with_tag=davem-cvs-merge +http://dennou-h.gfd-dennou.org/arch/cc-env.old/db/?M=A +http://www.envy.nu/wildcats/gare.html +http://www.envy.nu/wildcats/horst.html +http://www.linux.com/networking/network/release/performance/updates/Netscape/ +http://ftpsearch.belnet.be/pub/os/linux/Linux-sunsite.unc/distributions/ultra/Users-Guide/?S=A +http://www.chaos.dk/sexriddle/n/f/p/g/a/ +http://pub24.ezboard.com/fphilosophersstonefrm7.showAddTopicScreenFromWeb +http://pub24.ezboard.com/fphilosophersstonefrm7.showMessage?topicID=10.topic +http://www.yorosiku.net:8080/-_-http://www2.biglobe.ne.jp/~animenet/jan222/note/bbs2.html +http://www.web-chart.com/Detail.htm?s=2568&c=229 +http://www.brio.de/BRIO.catalog/39fe2f5009021d362740d472aa780645/UserTemplate/8 +http://www.service911.com/egghead/step/0,2743,10+55+157+24348+17295_2,00.html +http://home.pchome.com.tw/computer/judy7777/fast-7.htm +http://big5.peopledaily.com.cn/zdxw/11/20000126/200001261111.html +http://www.nhic.or.kr/netbbs/Bbs.cgi/nhic31792/lst/qqo/012D +http://sunsite.org.uk/public/usenet/news-faqs/alt.answers/paranormal/faq +http://newsone.net/nnr/listl/alt.bbs.elebbs/1 +http://ourworld.compuserve.com/homepages/hallg/mg_vor.htm +http://www.world001.com/forum/yue/1573.html +http://www.greenleaves.com/bookcat/gb_1567112730.html +http://quotidiano.monrif.net/chan/motori:1119539:/2000/10/30: +http://quotidiano.monrif.net/chan/motori:926303:/2000/10/30: +http://quotidiano.monrif.net/chan/motori:944719:/2000/10/30: +http://home.online.tj.cn/~madgoe/subtitle/nt/nt363.htm +http://home.online.tj.cn/~madgoe/subtitle/nt/nt352.htm +http://home.online.tj.cn/~madgoe/subtitle/nt/nt343.htm +http://home.online.tj.cn/~madgoe/subtitle/nt/nt327.htm +http://home.online.tj.cn/~madgoe/subtitle/nt/nt320.htm +http://www.collectingnation.com/cgi-bin/bn/request_email.mod?EHANDLE=Vincze +http://www.beanienation.com/cgi-bin/bn/view_feedback.mod?HANDLE=ving +http://www.collectingnation.com/cgi-bin/bn/request_email.mod?EHANDLE=Vinrye +http://www.collectingnation.com/cgi-bin/bn/request_email.mod?EHANDLE=Vinzy +http://www.beanienation.com/cgi-bin/bn/view_feedback.mod?HANDLE=violinist +http://www.beanienation.com/cgi-bin/bn/view_feedback.mod?HANDLE=Violin +http://www.collectingnation.com/cgi-bin/bn/request_email.mod?EHANDLE=vione +http://www.beanienation.com/cgi-bin/bn/view_feedback.mod?HANDLE=viper0669 +http://www.missouri.edu/HyperNews/get/writery/poetry/1.html?embed=-1 +http://www.missouri.edu/HyperNews/get/writery/poetry/6.html?outline=1&embed=1 +http://www.missouri.edu/HyperNews/get/writery/poetry/9.html?outline=-1&embed=1 +http://www.missouri.edu/HyperNews/get/writery/poetry/20.html?outline=3&embed=1 +http://www.missouri.edu/HyperNews/get/writery/poetry/21.html?outline=-1&embed=1 +http://www.missouri.edu/HyperNews/get/writery/poetry/23.html?outline=1&embed=1 +http://www.missouri.edu/HyperNews/get/writery/poetry/38.html?outline=1&embed=1 +http://fi.egroups.com/messages/Avon3DayBoston/5 +http://www.online.kokusai.co.jp/Demo/V0043481/wrd/G400/demo/ +http://www.jamba.de/KNet/_KNet-TQt8j1-PEd-139qr/showInfo-werbung.de/node.0/cde7f1uou +http://computalynx.tucows.com/winnt/adnload/73435_29524.html +http://www.intellicast.com/Golf/World/UnitedStates/Northwest/Oregon/OregonDunes/THUNDERcast/d2_06/ +http://202.105.55.146/h0/news/200009/20/jty7.htm +http://pda.tucows.edisontel.com/newton/newtsfiction_size.html +http://pda.tucows.edisontel.com/newton/adnload/33238_19961.html +http://hem.fyristorg.com/lottaleman/LLfar/1_2942.htm +http://www.norrblom.com/..\hund\1996\s2665496.htm +http://www.ferien-immobilien.de/niedersachsen/weserbergland/Verkauf/Gemeinsam/MarketingStrategie/Allgemeine-IB/Gemeinsam/Super-Zins-Konditionen/Private-IB/Startseite/Default.htm +http://nathanael.upi.jussieu.fr/tele6.nsf/autres+centres+de+formations!OpenPage&ExpandSection=14,18,11,9,15,8 +http://dennou-h.gfd-dennou.org/arch/cc-env.old/xtop/TEBIKI.top.rs590 +http://www.amzn.com/exec/obidos/search-handle-url/index=vhs&field-director=Jim%20Stenstrum/ +http://www.amzn.com/exec/obidos/tg/browse/-/169237/ +http://www.flora.org/flora.oclug/old-6088 +http://www.msn.expedia.co.uk/wg/Images/P24601.htm +http://www.asahi-net.or.jp/~ei2h-kdu/photos/rail/sanin/amarube3.html +http://au.yahoo.com/Business_and_Economy/Shopping_and_Services/Health/Providers/By_Region/U_S__States/Montana/Complete_List/ +http://www.staroriental.net/nav/soeg/ihf,aai,n2,118,Electric+Wave+Girl+1998.html +http://www.hig.se/(accessed,formoutput,referrer,smallcaps,sqlquery)/~jackson/roxen/ +http://carefinder.digitalcity.com/fargond/sports/team.dci?league=NF2&team=VAC +http://carefinder.digitalcity.com/fargond/sports/team.dci?league=NF2&team=GAA +http://carefinder.digitalcity.com/fargond/sports/team.dci?league=NF2&team=AAB +http://carefinder.digitalcity.com/fargond/sports/team.dci?league=NF2&team=AAF +http://newnova.tucows.com/preview/60922.html +http://www-d0.fnal.gov/d0dist/dist/releases/test/l3fsmtcluster/rcp/?S=A +http://www.cs.rit.edu/~ats/inferno/man/html/proto8.htm +http://dandini.cranfield.ac.uk/vl=-39835473/cl=140/nw=1/rpsv/cw/web/nw1/browse.htm +http://homepage.mac.com/nanameneko/job/architecture-oriented/OHP/Why/why_05.html +http://ftp.sunet.se/pub/FreeBSD/FreeBSD-current/ports/games/CaribbeanStud/?M=A +http://ftp.sunet.se/pub/FreeBSD/FreeBSD-current/ports/games/CaribbeanStud/distinfo +http://ads3.zdnet.com/c/g=r734&c=a53975&idx=2000.10.30.21.30.24/www.zdnet.com/downloads/stories/info/0,,000FDG,.html +http://yp.gates96.com/6/57/80/89.html +http://yp.gates96.com/6/57/81/42.html +http://yp.gates96.com/6/57/81/66.html +http://yp.gates96.com/6/57/82/16.html +http://yp.gates96.com/6/57/82/61.html +http://yp.gates96.com/6/57/83/37.html +http://yp.gates96.com/6/57/83/54.html +http://yp.gates96.com/6/57/84/14.html +http://yp.gates96.com/6/57/85/7.html +http://yp.gates96.com/6/57/85/24.html +http://yp.gates96.com/6/57/85/35.html +http://yp.gates96.com/6/57/85/64.html +http://yp.gates96.com/6/57/86/80.html +http://yp.gates96.com/6/57/86/96.html +http://yp.gates96.com/6/57/87/15.html +http://yp.gates96.com/6/57/89/2.html +http://yp.gates96.com/6/57/89/95.html +http://www.oncology.com/v2_MainFrame/1,1614,_12|00332|00_21|002|00_04|0039|00_38|00188,00.html +http://library.bangor.ac.uk/search/aEllis,+Gail/aellis+gail/-5,-1,0,B/exact&F=aellis+griffith+1844+1913&1,9 +http://www.rezel.enst.fr/ftp/linux/distributions/debian/CD-2/debian/dists/unstable/contrib/source/mail/?S=A +http://itcareers.careercast.com/texis/it/itjs/+SwwBmeYKD86e8hwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewhPndhBiwGna5O5BnManDtoDnnGamn5otDamnVncdpaGnwcaBoMnaoDhdGMwBodDaDnBidGAanLpnGonDqnaMFqhTfR20Dzme4twwwpBmex_D86ejxwww5rme6dwwwBrmeZpwww/morelike.html +http://esatnet.tucows.com/winnt/adnload/31316_29136.html +http://home.c2i.net/w-225961/steinare/brosjyre.htm +http://aleph.tau.ac.il:4500/ALEPH/ENG/ATA/AAS/AAS/FIND-ACC/0860271 +http://www.chaos.dk/sexriddle/v/c/w/d/r/ +http://www9.hmv.co.uk:5555/do/session/1347760/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d135_sd0_pt0.html +http://tagesanzeiger.ch/archiv/99november/991122/79295.HTM +http://www.pacifictech.com.cn/pcsoftware/sj/jq/00803.htm +http://www.pacifictech.com.cn/pcsoftware/sj/jq/00430b.htm +http://www.pacifictech.com.cn/pcsoftware/zl/syjq/dmtgj/old/tuxing/3d/20000131.html +http://www.building.com/communities/texis/db/go/+DexVFdeKmYnwrmwxerJOwrmwx3exmww/profile.html +http://my.egroups.com/message/mathies/43?source=1 +http://www.brio.de/BRIO.catalog/39fe2f5706df064c273fd472aa78067c/UserTemplate/6 +http://www.brio.de/BRIO.catalog/39fe2f5706df064c273fd472aa78067c/UserTemplate/9 +http://www.egroups.com/messages/GollyBeenz/44 +http://www.buybuddy.com/sleuth/15/1/1020507/495848/ +http://www.brio.de/BRIO.catalog/39fe2f41010c308a2742d472aa7806a7/UserTemplate/5 +http://www.ferien-immobilien.de/hessen/bad-hersfeld/Verkauf/IIM-Teil/Startseite/Private-IB/Allgemeine-IB/Gemeinsam/versicherungen/gebaeude/deckungsumfang.htm +http://www.ferien-immobilien.de/hessen/bad-hersfeld/Verkauf/IIM-Teil/Startseite/Private-IB/Allgemeine-IB/Gemeinsam/impressum.htm +http://beetle.marion.ohio-state.edu/Bratt2000/D0029/I10769.html +http://members.tripod.lycos.co.kr/RAINBOR/?D=A +http://www.eos.ncsu.edu/eos/info/bae/bae324_info/ +http://www.chez.com/mousis/vg/aqui/pages/0006.htm +http://search.chollian.net/cgi-bin/filter.cgi?cid=2052&p=1 +http://channel.nytimes.com/1998/03/15/technology/cybertimes/eurobytes/ +http://www4.nas.edu/ohr.nsf/All+Documents/Major+Units?OpenDocument&ExpandSection=13,4,2,7,11 +http://uk.dir.yahoo.com/Regional/Countries/Mexico/States/Baja_California/Cities/Ensenada/Travel_and_Transportation/Accommodation/Caravan_Parks_and_Campgrounds/ +http://ring.toyama-ix.net/archives/mac/info-mac/inet/_Mail/_Eudora/ +http://sport.voila.fr/it/calcio/euro2000/teams/por/squad/nunogomes.html +http://idefix-41.cs.kuleuven.ac.be/~henk/DPS/ +http://library.bangor.ac.uk/search/dLaw+--+Study+and+teaching+--+Great+Britain/dlaw+study+and+teaching+great+britain/-5,-1,0,B/buttonframe&F=dlaw+study+and+teaching+great+britain&7,,7 +http://www.eveclub.com/cgi-bin/eveclub.front/972959440822/Catalog/1000002 +http://www.eveclub.com/cgi-bin/eveclub.front/972959440822/Catalog/1000062 +http://ring.shibaura-it.ac.jp/archives/FreeBSD-PC98/dists/4.0-RELEASE/XF86336/PC98-Servers/?N=D +http://www.uq.edu.au/site-index/index.phtml?site_tree_data=1,91,95,203,338,344,2,6,182,148 +http://www.uq.edu.au/site-index/index.phtml?site_tree_data=1,91,95,203,338,344,2,6,182,163 +http://www.xmission.com/(apocalypse,art,caffiene,geek,misc,music,music,caffiene,art,toys,dots,edge,misc,shopping,ftp,places,privacy,geek,cuseeme,apocalypse,people,stuffiuse,people,places,shopping,stuffiuse,toys)/~bill/links.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=confinarias&l=pt +http://www.xmission.com/(apocalypse,art,caffiene,cuseeme,geek,misc,music,music,caffiene,art,toys,dots,edge,misc,shopping,ftp,places,privacy,geek,cuseeme,apocalypse,people,stuffiuse,places,privacy,stuffiuse,toys)/~bill/links.html +http://www.gigclub.co.jp/tanigawa/tanigawa/980915/menu.html +http://www.3w-sciencefiction.de/SmithWilliamK/SmithWilliamK0126528756.htm +http://w3c1.inria.fr/Mobile/posdep/Presentations/Mogid/sld014.htm +http://members.tripod.co.jp/view_i/p.html +http://202.99.23.245/zdxw/11/20000317/200003171117.html +http://www.jpc-music.com/7334085.htm +http://library.bangor.ac.uk/search/aLibrary+Association/alibrary+association/-5,-1,0,B/buttonframe&F=alibrary+association&2,,64 +http://www.sf.digitalcity.com/puntagordafl/sports/team.dci?league=FSL&team=CHA +http://www.sf.digitalcity.com/puntagordafl/sports/team.dci?league=FSL&team=LAK +http://brain.brent.gov.uk/__802564ff0045d739.nsf/vWebAllPagesByLocsSrvd!OpenView&Start=33&Count=60&Collapse=45 +http://www.nypost.com/news/933.htm +http://www.nypost.com/business/979.htm +http://www.nypost.com/living/951.htm +http://www.computer-networking.de/studenten/cn_intern/bauer/jobst/k07-graphik-gui/controls/swing/ +http://194.55.30.33/albanian/tema_gjermane/67823.html +http://194.55.30.33/albanian/tema_gjermane/65962.html +http://yp.gates96.com/14/85/10/12.html +http://yp.gates96.com/14/85/11/98.html +http://yp.gates96.com/14/85/12/24.html +http://yp.gates96.com/14/85/13/57.html +http://yp.gates96.com/14/85/14/92.html +http://yp.gates96.com/14/85/16/37.html +http://yp.gates96.com/14/85/16/51.html +http://yp.gates96.com/14/85/16/78.html +http://yp.gates96.com/14/85/17/38.html +http://yp.gates96.com/14/85/17/48.html +http://yp.gates96.com/14/85/17/91.html +http://yp.gates96.com/14/85/19/35.html +http://yp.gates96.com/14/85/19/88.html +http://genforum.genealogy.com/cgi-genforum/forums/deppen.cgi?3 +http://www.ferien-immobilien.de/nordrhein-Westfalen/Muehlheim-ruhr/Verkauf/Private-IB/Startseite/Gemeinsam/Inserieren/Versteigerungen-IB/Startseite/Ferien-IB/Startseite/ +http://www.redrocksports.com/sports/webSession/shopper/RR972959668-31057/store/dept-5/department/dept-5/item/51800 +http://www.redrocksports.com/sports/webSession/shopper/RR972959668-31057/store/dept-5/department/dept-5/item/53510 +http://www.redrocksports.com/sports/webSession/shopper/RR972959668-31057/store/dept-5/department/dept-5/item/52600 +http://www.redrocksports.com/sports/webSession/shopper/RR972959668-31057/store/dept-5/department/dept-5/item/50510 +http://www.redrocksports.com/sports/webSession/shopper/RR972959668-31057/store/dept-5/department/dept-5/item/50400 +http://polygraph.ircache.net:8181/http_-2www.horizonfinance.com/http_-2www.netscape.com/download/http_-2www.microsoft.com/ie/http_-2207.91.150.20/http_-2www.updowntowner.org/julyjamm/headliners.html +http://www.ccurrents.com/magazine/national/1702/nets31702.html +http://adept.subportal.com/sn/Themes/Vehicle_Themes/5090.html +http://www.fogdog.com/cedroID/ssd3040183211390/nav/products/outlet/1a/fishing/ +http://www.linux.com/networking/network/communications/article/unix/sales/ +http://fyi.cnn.com/content/US/9902/25/germans.death.penalty.ap/ +http://fyi.cnn.com/US/9902/09/monk.execute.ap.02/ +http://fyi.cnn.com/WORLD/asiapcf/9902/06/PM-Philippines-DeathPena.ap/ +http://pub11.ezboard.com/ucivik.showPublicProfile +http://playboy.software.net/PKIN005896/prod.htm +http://www.linux.com/networking/network/help/free/performance/install/ +http://www.linux.com/networking/network/help/free/performance/X/ +http://se.egroups.com/message/ghost_tales/1490 +http://niteowl.userfriendly.net/linux/RPM/rawhide/1.0/i386/usr_src_linux-2.4.0_include_Tree.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=coexistissem&l=pt +http://promed.univ-rennes1.fr/cerf/ico_an/IDRE/21_HADM.HTM +http://promed.univ-rennes1.fr/cerf/ico_an/IDRE/25_HADM.HTM +http://promed.univ-rennes1.fr/cerf/ico_an/IDRE/86_HADM.HTM +http://promed.univ-rennes1.fr/cerf/ico_an/IDRE/88_HADM.HTM +http://promed.univ-rennes1.fr/cerf/ico_an/IDRE/90_HADM.HTM +http://promed.univ-rennes1.fr/cerf/ico_an/IDRE/HADM6.HTM +http://www.estrelladigital.es/000814/articulos/economia/correos.htm +http://itcareers.careercast.com/texis/it/itjs/+awwBme4CD86LxwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewPPnBwpcnaqdGpdGwBnaoDhdGMwBodDahoDma5BdGnaq15BdMnGa5nGVoqnaqdDBwqBamo5BGox1BodDaMwDwtnMnDBaMFqrIRE7P0IDzme_xwwwpBmHe0B-deaqwww5rmsmwwBrme7Dwww/morelike.html +http://yp.gates96.com/3/79/50/30.html +http://yp.gates96.com/3/79/50/54.html +http://yp.gates96.com/3/79/51/1.html +http://yp.gates96.com/3/79/51/11.html +http://yp.gates96.com/3/79/51/80.html +http://yp.gates96.com/3/79/52/27.html +http://yp.gates96.com/3/79/52/81.html +http://yp.gates96.com/3/79/53/81.html +http://yp.gates96.com/3/79/54/0.html +http://yp.gates96.com/3/79/54/31.html +http://yp.gates96.com/3/79/55/74.html +http://yp.gates96.com/3/79/55/78.html +http://yp.gates96.com/3/79/56/72.html +http://yp.gates96.com/3/79/57/0.html +http://yp.gates96.com/3/79/58/27.html +http://yp.gates96.com/3/79/58/31.html +http://yp.gates96.com/3/79/58/48.html +http://yp.gates96.com/3/79/58/76.html +http://yp.gates96.com/3/79/58/99.html +http://yp.gates96.com/3/79/59/27.html +http://yp.gates96.com/3/79/59/32.html +http://yp.gates96.com/3/79/59/49.html +http://yp.gates96.com/3/79/59/81.html +http://yp.gates96.com/3/79/59/83.html +http://startribune.atevo.com/misc/print_article/0,3869,4504302,00.html +http://browse.carnaby.com/home/showcase/6/381/2078/A0638120780000EA01.html +http://www.checkout.com/music/earmail/form/1,7650,325272-1761567,00.html +http://ring.shibaura-it.ac.jp/archives/doc/jpnic/minutes/committee/200007/shiryou-4-1.txt +http://www.secinfo.com/d1ZMQs.51h.htm +http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/AtlantisPBEM/CVSROOT/modules?only_with_tag=MAIN +http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/AtlantisPBEM/CVSROOT/modules?only_with_tag=HEAD +http://ftp.bitcon.no/tucows/adnload/4961_28325.html +http://yp.gates96.com/3/37/0/21.html +http://yp.gates96.com/3/37/0/29.html +http://yp.gates96.com/3/37/0/80.html +http://yp.gates96.com/3/37/0/87.html +http://yp.gates96.com/3/37/1/9.html +http://yp.gates96.com/3/37/2/83.html +http://yp.gates96.com/3/37/2/92.html +http://yp.gates96.com/3/37/3/26.html +http://yp.gates96.com/3/37/4/9.html +http://yp.gates96.com/3/37/4/29.html +http://yp.gates96.com/3/37/5/31.html +http://yp.gates96.com/3/37/5/49.html +http://yp.gates96.com/3/37/5/51.html +http://yp.gates96.com/3/37/5/63.html +http://yp.gates96.com/3/37/5/95.html +http://yp.gates96.com/3/37/6/0.html +http://yp.gates96.com/3/37/6/4.html +http://yp.gates96.com/3/37/7/22.html +http://yp.gates96.com/3/37/8/10.html +http://yp.gates96.com/3/37/8/50.html +http://yp.gates96.com/3/37/8/92.html +http://yp.gates96.com/3/37/9/46.html +http://ftp.digex.net/debian/dists/woody/contrib/binary-sh/libs/?N=D +http://students.lsu.edu/students/main.nsf/c81d2bf8cb0b80ff862566fb00105ab2/7f3436ae9cb1268886256773006f9288!OpenDocument&ExpandSection=4,15,12,16 +http://in.egroups.com/group/bbw-uk +http://home.swipnet.se/~w-20817/ +http://shop.puretec.de/kunden/19867293/detailansicht_Aku1025B.html +http://www.rezeptkoch.de/Rezepte/Heimisches_/Gemuse/Sommerliche_Gemusegerichte/sommerliche_gemusegerichte_2.html +http://www.rezeptkoch.de/Rezepte/Heimisches_/Gemuse/Kohl/kohl_4.html +http://www.rezeptkoch.de/Rezepte/Heimisches_/Gemuse/Kohl/kohl_11.html +http://www.chinainvest.com.cn/C/Showdetail/20359.html +http://tucows.sp-plus.nl/winme/preview/141310.html +http://www.al-hujjat.grid9.net/gnomehtml/ent_enhance_rating.html +http://www.warmbloods.net/breeding/_vti_bin/shtml.dll/disc123_post.htm?1260 +http://ftp.sunet.se/pub/FreeBSD/FreeBSD-current/ports/net/ruby-snmp/Makefile +http://basil.cs.uwp.edu/Documentation/java/jdk/docs/guide/sound/prog_guide/chapter3.fm.html +http://tucows.1web.it/winme/preview/75525.html +http://uk-wire.ukinvest.com/articles/200009180701200586R.html +http://www.ozon.ru/detail.cfm/ent=33&id=953&add2navigator=1&txt=1 +http://cometweb01.comet.co.uk/do!session=131984&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkkHbqpLZXmLbkZHljlKaltLkilLXalKfkaLbukKeqjLi1 +http://community.webshots.com/photo/3922869/3923445TSuTSQIWpD +http://www.eveclub.com/cgi-bin/eveclub.front/972959447434/Catalog/1000040 +http://www.tvstore.com/browse/TV/NIGHTSHI/s.nXZNPRgQ +http://www.tvstore.com/browse/TV/COMIC/s.nXZNPRgQ +http://www.xmwb.sh.cn/xmwb/19981016/GB/13389^8101623.htm +http://helios.nlib.ee/search*est/tThe+threshold+series/tthreshold+series/-5,-1,0,B/frameset&F=tthrillers&1,1 +http://www4.nas.edu/ohr.nsf/All+Documents/Major+Units?OpenDocument&ExpandSection=23,9,7,18 +http://ftp.bitcon.no/pub/windowsce/epoc/desktop5.htm +http://ftp.lip6.fr/pub2/sgml-tools/website/HOWTO/Multicast-HOWTO/t1595.html +http://ftp.rge.com/pub/X/XFree86/3.3.3.1/untarred/xc/programs/Xserver/ +http://ftp.rge.com/pub/X/XFree86/3.3.3.1/untarred/xc/programs/xwud/ +http://syix.tucows.com/win2k/adnload/73370_29328.html +http://yp.gates96.com/0/54/80/40.html +http://yp.gates96.com/0/54/80/56.html +http://yp.gates96.com/0/54/80/61.html +http://yp.gates96.com/0/54/80/79.html +http://yp.gates96.com/0/54/81/11.html +http://yp.gates96.com/0/54/81/25.html +http://yp.gates96.com/0/54/81/58.html +http://yp.gates96.com/0/54/82/48.html +http://yp.gates96.com/0/54/82/75.html +http://yp.gates96.com/0/54/83/0.html +http://yp.gates96.com/0/54/84/12.html +http://yp.gates96.com/0/54/84/67.html +http://yp.gates96.com/0/54/85/47.html +http://yp.gates96.com/0/54/85/59.html +http://yp.gates96.com/0/54/86/52.html +http://yp.gates96.com/0/54/86/55.html +http://yp.gates96.com/0/54/86/79.html +http://yp.gates96.com/0/54/86/87.html +http://yp.gates96.com/0/54/87/12.html +http://yp.gates96.com/0/54/87/81.html +http://yp.gates96.com/0/54/88/97.html +http://yp.gates96.com/0/54/89/90.html +http://www.yorosiku.net:8080/-_-http://liinwww.ira.uka.de/bibliography/Distributed/SIGCOMM.94.html +http://news.pchome.com.tw/ftv/health/20000915/ +http://www.emis.de/journals/EJDE/Volumes/Volumes/Monographs/1998/05/?N=D +http://travelocity-dest.excite.com/DestGuides/0,1840,TRAVELOCITY|5706|3|1|159040|photo_id|4022,00.html +http://travelocity-dest.excite.com/DestGuides/0,1840,TRAVELOCITY|5706|3|1|159040|photo_id|4020,00.html +http://lhcbsoft.web.cern.ch/LHCbSoft/simmuon/v1/mgr/CVS/Root +http://tucows.soneraplaza.nl/winme/adnload/137454_28942.html +http://www.borland.nl/techpubs/jbuilder/jbuilder3/ui/wclass.html +http://fi.egroups.com/links/dssf +http://www.homestead.com/jcv2000/MBoard.html +http://careershop.resumeshotgun.com/directory/italy/sardegna/o.10.p.4408.html +http://www.hantsnet.co.uk/istcclr/cch32751.html +http://www.hantsnet.co.uk/istcclr/cch16729.html +http://www.hantsnet.co.uk/istcclr/cch03788.html +http://www.hantsnet.co.uk/istcclr/cch05491.html +http://www.hantsnet.co.uk/istcclr/cchr0418.html +http://www.hantsnet.co.uk/istcclr/cchh2289.html +http://www.hantsnet.co.uk/istcclr/cchh2074.html +http://www.hantsnet.co.uk/istcclr/cch30426.html +http://www.hantsnet.co.uk/istcclr/cch11726.html +http://www.hantsnet.co.uk/istcclr/cch03858.html +http://www.hantsnet.co.uk/istcclr/cche0920.html +http://www.hantsnet.co.uk/istcclr/cch34768.html +http://www.hantsnet.co.uk/istcclr/cchc2067.html +http://www.hantsnet.co.uk/istcclr/cche1085.html +http://www.v2music.com/Scripts/WebObjects-ISAPI.dll/V2_New_Publisher.woa/53771000000443000000339400000065451/v2tvindex.wo/614720000055451/1.14/3/Webobjects1 +http://www.sternonline.de/magazin/fotogalerie/hinz/index5.html +http://www.envy.nu/Sing.html +http://employment.subportal.com/sn/Themes/ +http://www.diogenes.ch/4DACTION/web_rd_aut_prview/a_id=7002120&area=&ID=483332 +http://wlink.tucows.com/winme/adnload/137847_29260.html +http://tucows.computalynx.net/winnt/adnload/71633_28766.html +http://ftp.up.pt/Linux/debian/dists/stable/main/disks-m68k/?M=A +http://lcweb2.loc.gov/ll/llnt/009/0000/ +http://www.magma.ca/~denisd/africa/day02.html +http://www.magma.ca/~denisd/africa/day16.html +http://content.health.msn.com/message_board_author/802072 +http://ep.com/js/about/c0/189455 +http://ep.com/js/about/c0/154005 +http://www.realbig.com/miata/miata/1999-12/2340.html +http://www.multimap.com/wi/33738.htm +http://www.multimap.com/wi/148724.htm +http://www.bemi-immobilien.de/Landhaus-Bordeaux/Gemeinsam/3d-service/Gemeinsam/versicherungen/lebensversicherung/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/versicherungen/lebensversicherung/Gemeinsam/MarketingStrategie/Strategie.htm +http://link.fastpartner.com/do/session/600347/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/create/learn.htm +http://pub16.ezboard.com/fisnforumsfrm16.subscribeUnregisteredToTopic?topicID=731.topic +http://freesoftware.subportal.com/sn/Business/Application_Add-ins/726.html +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/ports/deskutils/genius/files/?sortby=date +http://www.madein.nnov.ru/stat/index.phtml?cid=418&t=3 +http://citeseer.nj.nec.com/correct/294145 +http://www.phillips.semiconductors.com/pip/PCF5001H +http://www.tvstore.com/browse/TV/BANK/s.Vaphccqs +http://www.tvstore.com/browse/TV/SCRIPT/s.Vaphccqs +http://www.tvstore.com/aboutus/s.Vaphccqs +http://www.fogdog.com/cedroID/ssd3040183205929/nav/products/featured_brands/3b/arm_warmers/ +http://orders.mkn.co.uk/bear/steiff/classic/order/now.en$NOK?what-e=1 +http://www.crutchfield.com/S-jtpRS1P7vRY/help/ +http://www06.u-page.so-net.ne.jp/tb3/y-miyu/azure/kodatour.htm +http://ftp.sunet.se/pub/FreeBSD/ports/ports-stable/japanese/escpf/distinfo +http://no.egroups.com/subscribe/Theater_plays +http://www.equipe.fr/Football/FootballFicheJoueur8954_0.html +http://www.equipe.fr/Football/FootballFicheJoueur6039_0.html +http://www.pmdc.org.uk/dogsdb/p00/P00133.HTM +http://ip.tosp.co.jp/i.asp?i=nononatti3 +http://tucows.wlink.com.np/adnload/144221_48889.html +http://store.yahoo.co.jp/I/naturum_1590_147867488 +http://providenet.office.tucows.com/adnload/77414_41755.html +http://providenet.office.tucows.com/adnload/73011_41097.html +http://www.goldersgreen.londonengland.co.uk/medicalequipmentrentalandleasing.htm +http://www.online.kokusai.co.jp/Mmf_corner/V0043462/mmf_corner/mmf_corner/url +http://www.qth.net/archive/packrats/200008/20000804.html +http://www.expage.com/buffykat11nelly +http://dk.egroups.com/login.cgi?login_target=%2Fmessages%2Fbbs_people +http://dk.egroups.com/message/bbs_people/23 +http://www.linux.com/networking/network/technology/free/development/learning/ +http://www.chaos.dk/sexriddle/r/x/z/t/l/ +http://www.opensecrets.org/lobbyists/98profiles/5918.htm +http://www.cbs.sportsline.com/u/football/nfl/kids/players/3418.htm +http://www.cbs.sportsline.com/u/football/nfl/kids/players/3868.htm +http://www.cbs.sportsline.com/u/football/nfl/kids/players/133268.htm +http://www.hig.se/(apre,clientname,countdown,language,set_cookie)/~jackson/roxen/ +http://www.platogmbh.de/plato/home.nsf/c81870434660ba41c125652a0029a47a/fb7566ed772f8580c12566f00036ac59!OpenDocument&ExpandSection=4,8,11,12 +http://www.fogdog.com/cedroID/ssd3040183211315/nav/products/featured_brands/2m/kick_sprint_boards/ +http://www.iabusnet.org:90/forums/aca-1/dispatch.exe/survey/folderFrame/100001/0/alpha/2458960 +http://www.jamba.de/KNet/_KNet-ONt8j1-NEd-139p9/showInfo-jobs.de/node.0/cde7f1uou +http://www.jamba.de/KNet/_KNet-ONt8j1-NEd-139pf/browse.de/node.0/cdzqggtyb +http://iland.tucows.com/win2k/adnload/38318_29882.html +http://builder.hw.net/frmRestDir/0,1112,'1~21~325~1~S~020060~04880',00.html +http://builder.hw.net/frmRestDir/0,1112,'1~21~325~1~S~020060~35840',00.html +http://builder.hw.net/frmRestDir/0,1112,'1~21~325~1~S~020060~90237',00.html +http://sunsite.org.uk/public/usenet/news.answers/alt.answers/self-impr-faq/part1 +http://ftp.bitcon.no/pub/simtelnet/win95/fileutl/?S=A +http://totalsports.aol.com/stats/bbo/mlb/20000517/bal.at.ana.game.html +http://au.yahoo.com/Regional/U_S__States/Virginia/Counties_and_Regions/Henrico_County/Business_and_Shopping/Shopping_and_Services/Travel/ +http://ftp.up.pt/Linux/debian/dists/unstable/main/binary-all/math/ +http://students.lsu.edu/students/main.nsf/c81d2bf8cb0b80ff862566fb00105ab2/7f3436ae9cb1268886256773006f9288!OpenDocument&ExpandSection=10,17,13,14 +http://ftp.sunet.se/pub/FreeBSD/ports/ports-stable/japanese/vfghostscript/Makefile +http://polygraph.ircache.net:8181/yp/User_Contribs/http_-2home.netscape.com/comprod/mirror/ +http://www.emis.de/journals/EJDE/Volumes/Monographs/Volumes/1998/26/?S=A +http://www.smartshop.com/cgi-bin/main.cgi?c=314&a=contactus +http://213.36.119.69/do/session/152986/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/BE_NL/ +http://www.outdoorwire.com/lists/dirt/200009/msg01273.html +http://chicagocow.com/top/1,1419,M-Metromix-Home-Carryout!InputReview-9757--0,00.html +http://www.lithoquoter.com/Scripts/WebObjects.exe/Printers.woa/659920000022582000008720100000129302/main.wo/9193100000029302/4/-/prime +http://groups.haas.berkeley.edu/hcs/Docs/SASv8/sasdoc/sashtml/proc/z0292493.htm +http://groups.haas.berkeley.edu/hcs/Docs/SASv8/sasdoc/sashtml/proc/z0292495.htm +http://groups.haas.berkeley.edu/hcs/Docs/SASv8/sasdoc/sashtml/proc/z0292496.htm +http://www.outpersonals.com/cgi-bin/w3com/pws/out/jlhIVflnBPgWmpC4eFAjXlk3QXcFhcK-b9D_cbZyHLtTP5aigpMrgot7TKiIhNzg8y23_mmQAn7GVTQsvALIGIvJI8RFNXRZDuyGCzJ8JFs6ysbZfjgM3ik0nyIt5yhT_ujQhRI-42lzAOeb666j +http://www.nissan.co.jp/RENAULT-DEALERS/PASSPORT/view.cgi/admission/972959588-- +http://www.intellicast.com/Golf/World/UnitedStates/MidAtlantic/Virginia/RoyalNewKentGC/LocalWinds/d1_12/ +http://gbchinese.yahoo.com/headlines/001028/sports/ycwb/ycba28c003txttyxw00102800.html +http://gbchinese.yahoo.com/headlines/001028/sports/ycwb/ycba28c004txttyxw00102800.html +http://mx.php.net/manual/hu/language.references.unset.php +http://www.cbtravelguide.com/north_america/united_states/info_2.htm?sortby=city +http://www.intellicast.com/Sail/World/UnitedStates/Northwest/Idaho/Targhee/LocalWinds/d1_03/ +http://ftp.sunet.se/pub/FreeBSD/ports/ports-current/devel/libgii/distinfo +http://biblioteca.upv.es/bib/doc/doc_fisbd/816/149599//C/1826373/0////25/S/MLTPAI +http://willsmith.sonicnet.com/events/jay_z/index_sonicnet.jhtml +http://tucows.soneraplaza.nl/winme/tucowsme_license.html +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/src/usr.sbin/fdcontrol/Makefile?only_with_tag=MAIN +http://www.kurit.com/ip/a5iu/dungeon/showsw1.html +http://www.mapion.co.jp/custom/AOL/admi/13/13118/minamisenju/3chome/index-30.html +http://yp.gates96.com/3/2/10/4.html +http://yp.gates96.com/3/2/10/19.html +http://yp.gates96.com/3/2/10/48.html +http://yp.gates96.com/3/2/10/52.html +http://yp.gates96.com/3/2/10/82.html +http://yp.gates96.com/3/2/11/10.html +http://yp.gates96.com/3/2/11/13.html +http://yp.gates96.com/3/2/13/31.html +http://yp.gates96.com/3/2/13/41.html +http://yp.gates96.com/3/2/13/43.html +http://yp.gates96.com/3/2/14/3.html +http://yp.gates96.com/3/2/14/19.html +http://yp.gates96.com/3/2/15/54.html +http://yp.gates96.com/3/2/15/72.html +http://yp.gates96.com/3/2/16/84.html +http://yp.gates96.com/3/2/17/22.html +http://yp.gates96.com/3/2/17/61.html +http://yp.gates96.com/3/2/18/1.html +http://yp.gates96.com/3/2/18/41.html +http://yp.gates96.com/3/2/18/58.html +http://yp.gates96.com/3/2/19/56.html +http://yp.gates96.com/3/2/19/79.html +http://www.stas.net/lonlywtrsoul/minesweeper/ms.html +http://ksu.freeyellow.com/ +http://www.genome.wustl.edu:8021/gsc10/est/yt/yt69/ +http://www.genome.wustl.edu:8021/gsc10/est/yt/yt82/ +http://www.winsite.com/info/pc/win95/miscutil/cutty10.exe/downltop.html +http://habenix.uni-muenster.de/Rektorat/Forschungsberichte-1997-1998/fo05bbe03.htm +http://www.jobvillage.com/channel/jobs/installation_repair/bicycle/g.3370.html +http://www.mordkommission.de/ratgeber/praxis/service/broschueren/40504/ +http://www.aelita.net/products/news/solutions/sitemap/company/library/default.htm +http://www.beanienation.com/cgi-bin/bn/view_feedback.mod?HANDLE=acejet +http://cgi1.washingtonpost.com/wp-dyn/metro/va/alexandria/ +http://www.linux.com/networking/network/applications/interface/linux/distro/ +http://www2.brent.gov.uk/bv1nsf.nsf/031d5c68638196618025664000760871/963fe55ca97ccaa5802568f900503269!OpenDocument&Start=57.3&Count=60&Expand=69 +http://www2.brent.gov.uk/bv1nsf.nsf/031d5c68638196618025664000760871/963fe55ca97ccaa5802568f900503269!OpenDocument&Start=57.3&Count=60&Expand=72 +http://www2.brent.gov.uk/bv1nsf.nsf/031d5c68638196618025664000760871/963fe55ca97ccaa5802568f900503269!OpenDocument&Start=57.3&Count=60&Expand=87 +http://genforum.genealogy.com/cgi-genforum/forums/youngs.cgi?26 +http://www.tvstore.com/browse/TV/CAP/s.IRspZRIy +http://210.178.135.1/netbbs/Bbs.cgi/nhic30592/qry/zka/B2-kB2-p/pno/0/qqo/012A/qqatt/^ +http://home.sol.no/~leskjerv/aner/12063.htm +http://pub6.ezboard.com/fwatckkeepersgeneralwatchkeeperdiscussion?page=5 +http://www.centc251.org/forums/aca-1/dispatch.cgi/hsi/folderFrame/100217/0/def/1210456 +http://ftp.sunet.se/pub/FreeBSD/ports/ports-stable/games/xosmulti/?S=A +http://opac.lib.rpi.edu/search/ddata+processing+english+language+style/7,-1,0,B/browse +http://yp.gates96.com/7/40/0/5.html +http://yp.gates96.com/7/40/0/33.html +http://yp.gates96.com/7/40/1/27.html +http://yp.gates96.com/7/40/3/25.html +http://yp.gates96.com/7/40/3/36.html +http://yp.gates96.com/7/40/4/67.html +http://yp.gates96.com/7/40/4/77.html +http://yp.gates96.com/7/40/6/28.html +http://yp.gates96.com/7/40/6/49.html +http://yp.gates96.com/7/40/6/89.html +http://yp.gates96.com/7/40/7/21.html +http://yp.gates96.com/7/40/9/24.html +http://indonesian.wunderground.com/geo/GizmoTempBigPromo/global/stations/07434.html +http://www.teenplatinum.com/barelylegal/anal-sexass/legsred-toenail-polish/swallowspit/submissiondiscipline/maledomspanking/hardcorebondage.html +http://cgi.cnnsi.com/basketball/college/women/scoreboards/aeast/2000/10/18/ +http://cgi.cnnsi.com/basketball/college/women/scoreboards/aeast/2000/10/16/ +http://bellona.itworld.com:8080/cwi/Printer_Friendly_Version/frame/0,1212,NAV63-128-1357-1367_STO48482-,00.html +http://cdrwww.who.int/fsf/ehec.pdf +http://tw.yahoo.com/Regional/Countries_and_Regions/China/Provinces__Regions_and_Municipalities/Jiangxi/Cities_and_Towns/Nanchang/Real_Estate/ +http://tw.yahoo.com/Regional/Countries_and_Regions/China/Provinces__Regions_and_Municipalities/Jiangxi/Cities_and_Towns/Nanchang/Society_and_Culture/ +http://www.camden-industrial.com/supply/webSession/shopper/CI972959657-31048/store/dept-8 +http://www.msb.malmo.se/search*swe/mQdfm/mqdfm/-5,-1,0,E/2browse +http://tagesanzeiger.ch/archiv/96september/960903/213235.htm +http://yp.gates96.com/3/7/20/3.html +http://yp.gates96.com/3/7/20/28.html +http://yp.gates96.com/3/7/20/42.html +http://yp.gates96.com/3/7/21/5.html +http://yp.gates96.com/3/7/21/61.html +http://yp.gates96.com/3/7/22/18.html +http://yp.gates96.com/3/7/22/20.html +http://yp.gates96.com/3/7/22/24.html +http://yp.gates96.com/3/7/23/33.html +http://yp.gates96.com/3/7/23/49.html +http://yp.gates96.com/3/7/23/57.html +http://yp.gates96.com/3/7/24/22.html +http://yp.gates96.com/3/7/24/23.html +http://yp.gates96.com/3/7/24/27.html +http://yp.gates96.com/3/7/24/36.html +http://yp.gates96.com/3/7/24/45.html +http://yp.gates96.com/3/7/25/98.html +http://yp.gates96.com/3/7/26/56.html +http://yp.gates96.com/3/7/26/77.html +http://yp.gates96.com/3/7/26/94.html +http://yp.gates96.com/3/7/27/10.html +http://yp.gates96.com/3/7/27/17.html +http://yp.gates96.com/3/7/27/61.html +http://yp.gates96.com/3/7/27/73.html +http://yp.gates96.com/3/7/27/81.html +http://yp.gates96.com/3/7/27/82.html +http://yp.gates96.com/3/7/27/87.html +http://yp.gates96.com/3/7/28/48.html +http://yp.gates96.com/3/7/29/1.html +http://yp.gates96.com/3/7/29/8.html +http://yp.gates96.com/3/7/29/32.html +http://www.crit.org/http://www-mel.nrlmry.navy.mil/%ff:words:(MEL-is-a-sponsored-distributed-environmental-data-access-system-which-allows-users-to-search-for-browse-and-retrieve-environmental-data-from-distributed-sources) +http://www.crit.org/http://crit.org/pub/radiks.net/jwoods/%ff:words:jwoods-radiks-net-(A-More-Graceful-Transition)-An-expanded-definition +http://shn.webmd.com/roundtable_reply/802056 +http://shn.webmd.com/roundtable_author/802056 +http://bbs.bianca.com/mforums/e/expounder/posts/2000_Jan_09/3067/3073.html +http://www.spaindustry.com/ita/geosearch/navarra/navarra/ESLAVA.html +http://www.backflip.org/members/rj2nagle/4643211 +http://www.backflip.org/members/rj2nagle/7211888 +http://www.backflip.org/members/rj2nagle/5066953 +http://www.backflip.org/members/rj2nagle/5346740 +http://www.backflip.org/members/rj2nagle/5382951 +http://www.linux.com/networking/network/performance/help/va_linux_systems/server/ +http://www.secinfo.com/d178s.ad.htm +http://www.secinfo.com/d178s.9d.htm +http://www.secinfo.com/d178s.8b.htm +http://www.secinfo.com/d178s.8y.htm +http://iceberg.adhomeworld.com/cgi-win/redirect.exe/1153874888 +http://tmxy.363.net/refer-e.htm +http://www.narodnaobroda.sk/20000210/10_007.html +http://retailer.gocollect.com/do/session/1912712/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/index.asp +http://retailer.gocollect.com/do/session/1912712/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/halloween/halloween.asp +http://www.larevista.elmundo.es/documentos/secciones/ciencia.html +http://ftpsearch.belnet.be/mirrors/ftp.isc.org/pub/usenet/control/brightnet/?M=A +http://www.5a8.com/book/zt/zpj/k/kelisidi/wanshenjie/006.htm +http://www.5a8.com/book/zt/zpj/k/kelisidi/wanshenjie/019.htm +http://www.northwoods.bigsmart.com/mall/cat_automotive.cfm?drop_menu=yes +http://www.leg.wa.gov/pub/rcw%20-%20text/title_41/chapter_004/rcw_41_04_220.txt +http://www.leg.wa.gov/pub/rcw%20-%20text/title_41/chapter_004/rcw_41_04_364.txt +http://www.leg.wa.gov/pub/rcw%20-%20text/title_41/chapter_004/rcw_41_04_400.txt +http://www.leg.wa.gov/pub/rcw%20-%20text/title_41/chapter_004/rcw_41_04_630.txt +http://bsd.tucows.mol.com/x11html/adnload/69206_8129.html +http://ldp.teihal.gr/LDP/LG/issue22/notes-mode.html +http://ldp.teihal.gr/LDP/LG/issue22/haters.html +http://members.nbci.com/design_res/software_ftp.htm +http://www.nativeamerican-jewelry.com/necklace53.htm +http://members.theglobe.com/pamile/Pamela0004.html +http://webtools.familyeducation.com/whatworks/item/front/0,2551,22-9696-7350-1099-49655,00.html +http://wwws.br-online.de/geld/boerse/970909/072001.html +http://212.31.0.37/fix98/75yil/1938.htm +http://212.31.0.37/fix98/75yil/1950.htm +http://212.31.0.37/fix98/75yil/26ekl.htm +http://212.31.0.37/fix98/75yil/28ekl.htm +http://212.31.0.37/fix98/75yil/38ekl.htm +http://212.31.0.37/fix98/75yil/67ekl.htm +http://212.31.0.37/fix98/75yil/92ekl.htm +http://212.31.0.37/fix98/75yil/15ekl.htm +http://www.insurequotes.com/wa2/71J2.html +http://cn.egroups.com/message/csreye/112 +http://ring.crl.go.jp/archives/lang/perl/CPAN/authors/id/J/JA/JARIAALTO/?D=A +http://ds.dial.pipex.com/town/drive/kch36/select/s31/ch027.html +http://ds.dial.pipex.com/town/drive/kch36/select/s31/ch056.html +http://ds.dial.pipex.com/town/drive/kch36/select/s31/ch043.html +http://202.99.23.245/huadong/199905/25/no_4.html +http://www.linux.com/networking/network/industry/training/services/business/ +http://www.writtenbyme.com/articles/849308468.shtml +http://members.tripod.com/TroupeLynx/index_m.htm +http://polygraph.ircache.net:8181/http_-2www.horizonfinance.com/https_-2www.truste.org/validate/http_-2www.ziplink.net/~ralphb/newsroom/http_-2www.travelsc.com/industry/home.html +http://ftp.bitcon.no/pub/tucows/preview/1095.html +http://ftp.bitcon.no/pub/tucows/preview/870.html +http://ftp.bitcon.no/pub/tucows/preview/144675.html +http://ftp.bitcon.no/pub/tucows/preview/144869.html +http://ftp.bitcon.no/pub/tucows/preview/31162.html +http://ftp.bitcon.no/pub/tucows/preview/7724.html +http://ftp.bitcon.no/pub/tucows/preview/2691.html +http://ftp.bitcon.no/pub/tucows/preview/72841.html +http://ftp.bitcon.no/pub/tucows/preview/72185.html +http://www.jacksonhewitt.com/ctg/cgi-bin/JacksonHewitt/company_profile/AAAksrACwAAABtvAAX +http://search.excaliburfilms.com/moviepgs/goodbadanddirty.htm?currency=NOK&stock=8377V1 +http://search.excaliburfilms.com/moviepgs/goodbadanddirty.htm?currency=FRF&stock=8377V1 +http://genforum.genealogy.com/cgi-bin/print.cgi?torian::44.html +http://retailer.gocollect.com/do/session/1912702/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/exclusives/newintros.asp +http://www.retrobytes.org/classiccmp/9911/msg00941.html +http://ftp.support.compaq.com/public/dunix/v3.2d-1/dce/?S=A +http://www.collectingnation.com/cgi-bin/bn/request_email.mod?EHANDLE=CoyoteChief +http://www.collectingnation.com/cgi-bin/bn/request_email.mod?EHANDLE=cpatch +http://www.beanienation.com/cgi-bin/bn/view_feedback.mod?HANDLE=cpegasus +http://www.quzhou.gov.cn/flfg.nsf/0a043ae26eb50247002564640039f21d/483ed12afec2b31d002564ac0039427a!OpenDocument&ExpandSection=7,6,5 +http://www.luecos.de/wow/art/mu_newsc_12080.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/quizz/misc/lit/programs/simple/pages_new.html +http://library.cuhk.edu.hk/search*chi/aChen,+Hui-fen./achen+hui+fen/31,-1,0,E/frameset&F=achen+hung&4,,0 +http://www.vedomosti.spb.ru/2000/arts/spbved-82-art-2.html +http://www.vedomosti.spb.ru/2000/arts/spbved-82-art-21.html +http://www.vedomosti.spb.ru/2000/arts/spbved-82-art-45.html +http://caller-times.com/1999/june/26/today/national/2447.html +http://cafe5.daum.net/Cafe-bin/Bbs.cgi/vision20pds/lst/qqeq/1/zka/B2-kB2Np +http://www.crutchfield.com/S-q8jdM6hvouc/sales.html +http://www.crutchfield.com/S-q8jdM6hvouc/cgi-bin/Catalog.asp?sid=S-q8jdM6hvouc +http://www.crutchfield.com/S-q8jdM6hvouc/copyright.html +http://deliveryc.aftonbladet.se/puls/stockholmsguiden/presentation/0,1714,2000023149,00.html +http://deliveryc.aftonbladet.se/puls/stockholmsguiden/presentation/0,1714,2000023162,00.html +http://deliveryc.aftonbladet.se/puls/stockholmsguiden/presentation/0,1714,2000023220,00.html +http://www.tnonline.com/archives/news/2000weeklies/09.20/pocono/pocono/police.html +http://retailer.gocollect.com/do/session/1912688/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/sports/index.asp +http://ftp.fas.org/irp/world/iraq/hadi/ +http://rusf.ru/kb/stories/kogda_chapaev_ne_utonul/text.htm +http://ring.yamanashi.ac.jp/pub/FreeBSD-PC98/dists/4.1-RELEASE/packages/chinese/?M=A +http://www3.buch-per-sms.de/anmeldung0.jsp$ID=To7737mC4935289641883087At0.9095524774481786 +http://www3.buch-per-sms.de/impressum.jsp$ID=To7737mC4935289641883087At0.9104482951702283 +http://ftp.uni-bremen.de/pub/linux/dist/suse/6.4/i386.de/suse/contents/ +http://ftp.uni-bremen.de/pub/linux/dist/suse/6.4/i386.de/suse/pay3/ +http://ftp.uni-bremen.de/pub/linux/dist/suse/6.4/i386.de/suse/xdev2/ +http://www.mlbworldseries.com/u/baseball/mlb/players/moreplayer_7649.htm +http://www.rismedia.com/consumer/27/5192/ +http://www.rismedia.com/consumer/27/18760/ +http://library.cuhk.edu.hk/search*chi/aZhang,+Wei-Yuan./azhang+wei+yuan/-5,-1,0,B/browse +http://itcareers.careercast.com/texis/it/itjs/+XwwBmeSFy86xwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew8awn5otDanDtoDnnGaxdo5na5BwBnazdxanLpnGonDqnamnVncdpaBnwMahoGMiwGna31wcohoqwBodDaMFqpl0bP0RRe2PftgQE2yDzmesxwwwpBmeAFy86Kwww5rmepdwwwBrmeZpwww/morelike.html +http://itcareers.careercast.com/texis/it/itjs/+zwwBmerEy86e+xwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew8awn5otDanDtoDnnGaxdo5na5BwBnazdxanLpnGonDqnamnVncdpaBnwMahoGMiwGna31wcohoqwBodDaMFqpl0bP0RRe2PftgQE2yDzmesxwwwpBmeAFy86Kwww5rmeADwwwBrmeZpwww/jobpage.html +http://itcareers.careercast.com/texis/it/itjs/++wwBmex8286xwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew8awn5otDanDtoDnnGaxdo5na5BwBnazdxanLpnGonDqnamnVncdpaBnwMahoGMiwGna31wcohoqwBodDaMFqpl0bP0RRe2PftgQE2yDzmesxwwwpBmeAFy86Kwww5rm6mwwBrmeZpwww/jobpage.html +http://archive.soccerage.com/s/de/09/b2445.html +http://archive.soccerage.com/s/de/09/b2408.html +http://archive.soccerage.com/s/de/09/b2272.html +http://archive.soccerage.com/s/de/09/b2256.html +http://archive.soccerage.com/s/de/09/b2249.html +http://archive.soccerage.com/s/de/09/b2245.html +http://archive.soccerage.com/s/de/09/b2246.html +http://archive.soccerage.com/s/de/09/b2237.html +http://archive.soccerage.com/s/de/09/b2207.html +http://genforum.genealogy.com/cgi-genforum/forums/wickham.cgi?296 +http://ftpsearch.belnet.be/packages/CPAN/authors/id/N/NE/NEDKONZ/?S=A +http://www.cheatscape.com/amiga/a/game53cindex_1.htm +http://www.best.com/~radko/lounge/messages/3572.html +http://www.best.com/~radko/lounge/messages/3542.html +http://www.best.com/~radko/lounge/messages/3563.html +http://www.best.com/~radko/lounge/messages/3502.html +http://www.best.com/~radko/lounge/messages/3431.html +http://user.tninet.se/~lrg243i/leo2.htm +http://www.pocketbible.co.kr/new/hebrews/hebrews07/hebrews7-5.htm +http://www.pocketbible.co.kr/new/hebrews/hebrews07/hebrews7-10.htm +http://members.tripod.co.jp/sugart/?D=A +http://www.linux.com/networking/network/industry/growth/new/server/ +http://kdecvs.stud.fh-heilbronn.de/cvsweb/kdegames/kspaceduel/sprites/?hideattic=0&sortby=log +http://karate.list.ru/catalog/10621.html +http://www.digitaldrucke.de/(aktuell,arbeitsvermittlung,computer,hilfe,individualverkehr,kultur,mix,nuernberg,sense,software,verkehr)/_fort/html/themen/aktuell/verkehr.htm +http://www.digitaldrucke.de/(aktuell,arbeitsvermittlung,computer,hilfe,individualverkehr,kultur,mix,nuernberg,sense,software,verkehr)/_fort/html/themen/aktuell/fahrzeug/fahrzeug.htm +http://www.digitaldrucke.de/(aktuell,arbeitsvermittlung,computer,creaccess,hilfe,individualverkehr,kultur,mix,nuernberg,schnellübersicht,sense,software,verkehr,von)/_fort/html/themen/hilfe/getall.htm +http://polygraph.ircache.net:8181/http_-2www.infolane.com/http_-2www.neosoft.com/~nitemoon/technical/http_-2www2.davidweekleyhomes.com/advancedproj.html +http://wow-online.vhm.de/Regional/Sri_Lanka/Nachrichten.html +http://www.bell.bellnet.com/suchen/sport/rodeo.html +http://netway.pda.tucows.com/palm/adnload/67796_21902.html +http://netway.pda.tucows.com/palm/preview/48544.html +http://netway.pda.tucows.com/palm/adnload/139037_47478.html +http://netway.pda.tucows.com/palm/adnload/73256_21914.html +http://netway.pda.tucows.com/palm/adnload/71930_21910.html +http://netway.pda.tucows.com/palm/adnload/136499_47294.html +http://netway.pda.tucows.com/palm/adnload/77938_21926.html +http://wap.jamba.de/KNet/_KNet-g_v8j1-4Fd-13aaq/browse.de/node.0/cde7f2elw +http://www.oreilly.com/medical/autism/news/research.html +http://www.geocities.co.jp/HeartLand-Namiki/5523/kopen.html +http://br-online.de/wissenschaft/wimfs/tm/tm9611/tt9611ol.htm +http://retailer.gocollect.com/do/session/1912709/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/exclusives/preorder.asp +http://rac.co.kr/www.avm.de/ +http://rac.co.kr/www.aztech.com.sg/ +http://rac.co.kr/www.simple.com.au/drivers.htm +http://www.egroups.com/messages/Wrestlings2ndComing/263 +http://mediate.magicbutton.net/do/session/625584/vsid/3342/tid/3342/cid/88020/mid/2008/rid/2313/chid/2648/url/http://www1.getmapping.com/index.cfm +http://ben.aspads.net/ex/c/643/874990125 +http://www.hri.org/docs//statedep/1998/98-05-26.std.html +http://member1.shangdu.net/home2/longing/byzs/036.htm +http://web.tiscalinet.it/informacitta/n2Maggio2000/n2Maggio2000/Pagine/P16.htm +http://www.eveclub.com/cgi-bin/eveclub.front/972959455723/Catalog/11000155 +http://www.eveclub.com/cgi-bin/eveclub.front/972959455723/Basket/View/1000038 +http://student.monterey.edu/sz/troxellphillipju/campus/ +http://readers.thevines.com/leaf/AA0000401329/45///&act=24-1-11&bref=1601 +http://caller-times.com/1999/september/30/today/business/750.html +http://www.online.kokusai.co.jp/Mmf_corner/V0043482/mmf_corner/mmf_corner/url +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=27,33,21,19,32 +http://jupiter.u-3mrs.fr/~msc41www/GRATXT/PD6483.HTM +http://webtools.familyeducation.com/whatworks/item/front/0,2551,1-9696-7765-539-51377,00.html +http://parallel.fh-bielefeld.de/ti/vorlesung/sp/jdk_doc/java/text/class-use/FieldPosition.html +http://cinemabilia.de/details/katnr/239509/ +http://ftp.sunet.se/pub/FreeBSD/FreeBSD-current/ports/games/xgolgo/pkg-comment +http://yp.gates96.com/13/2/50/12.html +http://yp.gates96.com/13/2/50/68.html +http://yp.gates96.com/13/2/52/56.html +http://yp.gates96.com/13/2/53/71.html +http://yp.gates96.com/13/2/54/13.html +http://yp.gates96.com/13/2/54/21.html +http://yp.gates96.com/13/2/54/43.html +http://yp.gates96.com/13/2/54/52.html +http://yp.gates96.com/13/2/54/94.html +http://yp.gates96.com/13/2/55/25.html +http://yp.gates96.com/13/2/55/57.html +http://yp.gates96.com/13/2/56/95.html +http://yp.gates96.com/13/2/57/24.html +http://yp.gates96.com/13/2/57/34.html +http://yp.gates96.com/13/2/57/35.html +http://yp.gates96.com/13/2/57/64.html +http://yp.gates96.com/13/2/58/92.html +http://yp.gates96.com/13/2/59/2.html +http://yp.gates96.com/13/2/59/31.html +http://www.outpersonals.com/cgi-bin/w3com/pws/out/RLhI7rcI1D4JxQFT7-3mEP5SJK8AVzq_FCHTmPD4oB4tzM54LVISOGr6gaW80TieiLj3vEEhfqMBuYuDKIQXk3pROAhdckz6dDnbPsi72aC9ZSsK2o3j3J8YlLpw-uOtcBIEsA4ZZATUNj1D6atp66I4 +http://www.dulux.co.uk/UKRETAIL:1938649915:DFinity.1QJiP4jRabmkmb +http://www.dulux.co.uk/UKRETAIL:1938649915:DFinity.1QJiP4jMomdoclfieh +http://www.egroups.com/messages/raite-dvd/1442 +http://www3.newstimes.com/archive2000/jun28/bzd.htm +http://yp.gates96.com/2/75/20/35.html +http://yp.gates96.com/2/75/20/42.html +http://yp.gates96.com/2/75/20/48.html +http://yp.gates96.com/2/75/21/28.html +http://yp.gates96.com/2/75/21/88.html +http://yp.gates96.com/2/75/21/91.html +http://yp.gates96.com/2/75/21/93.html +http://yp.gates96.com/2/75/21/96.html +http://yp.gates96.com/2/75/22/23.html +http://yp.gates96.com/2/75/23/50.html +http://yp.gates96.com/2/75/24/13.html +http://yp.gates96.com/2/75/24/47.html +http://yp.gates96.com/2/75/24/90.html +http://yp.gates96.com/2/75/25/33.html +http://yp.gates96.com/2/75/25/46.html +http://yp.gates96.com/2/75/25/84.html +http://yp.gates96.com/2/75/26/37.html +http://yp.gates96.com/2/75/26/40.html +http://yp.gates96.com/2/75/27/30.html +http://yp.gates96.com/2/75/27/66.html +http://yp.gates96.com/2/75/27/81.html +http://yp.gates96.com/2/75/28/34.html +http://yp.gates96.com/2/75/28/55.html +http://yp.gates96.com/2/75/29/12.html +http://yp.gates96.com/2/75/29/19.html +http://yp.gates96.com/2/75/29/45.html +http://yp.gates96.com/2/75/29/56.html +http://yp.gates96.com/2/75/29/86.html +http://yp.gates96.com/2/75/29/99.html +http://cn.egroups.com/message/agribusiness1/31 +http://biblio.cesga.es:81/search*gag/jLugo+(Provincia).+Mapas+topográficos.+[1890%3F]/jlugo+provincia+mapas+topograficos+1890/31,-1,0,B/browse +http://bbs.lineone.net/news/uknews/msg01030.html +http://bbs.lineone.net/news/uknews/msg01047.html +http://bbs.lineone.net/news/uknews/msg01026.html +http://bbs.lineone.net/news/uknews/msg00976.html +http://bbs.lineone.net/news/uknews/msg00960.html +http://bbs.lineone.net/news/uknews/msg00952.html +http://idl.tucows.com/winnt/adnload/1380_28802.html +http://retailer.gocollect.com/do/session/1912681/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/christmas/holiday_shoppe.asp +http://www1.zdnet.co.uk/software/fstore/A/9/000BA9.html +http://polygraph.ircache.net:8181/home/http_-2www.tauchbali.com/SERV.HTM +http://channel.nytimes.com/1998/05/01/technology/cybertimes/artsatlarge/ +http://ftp.sunet.se/pub/FreeBSD/ports/ports/japanese/linux-netscape47-communicator/?D=A +http://www9.hmv.co.uk:5555/do/session/1347757/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/hiddenframe.html +http://www9.hmv.co.uk:5555/do/session/1347757/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/logoframe.html +http://www-usa9.cricket.org/link_to_database/ARCHIVE/1999-2000/WI_IN_NZ/ARTICLES/ +http://www-usa9.cricket.org/link_to_database/ARCHIVE/1999-2000/WI_IN_NZ/SCORECARDS/ +http://a228.g.akamai.net/7/228/289/55d96730f1ea56/news.indiainfo.com/2000/08/13/floods.html +http://caller-times.com/1999/august/08/today/texas_me/4241.html +http://ftp.uni-bremen.de/pub/doc/news.answers/movies/winona-ryder-faq/part3 +http://www.globalsources.com/gsol/owa/website.gold/GP3/8801728414/HOME.HTM +http://eds.kse.or.kr/jaemoo/jipyo_e/k_grp/E01683.htm +http://eds.kse.or.kr/jaemoo/jipyo_e/i_grp/E01116.htm +http://eds.kse.or.kr/jaemoo/jipyo_e/i_grp/E01126.htm +http://eds.kse.or.kr/jaemoo/jipyo_e/d_grp/E00366.htm +http://eds.kse.or.kr/jaemoo/jipyo_e/h_grp/E00929.htm +http://www.jobvillage.com/channel/jobs/cleaning/pruner/g.1276.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380817/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/assistance/entry.asp +http://gamingplace.zeelandnet.nl/poker_rating.html +http://no.egroups.com/message/DVD-Info/111 +http://www.relax.ch/static/it/lazurigo/mercatodellavoro/oben.html +http://internet.exit.de/mees-online/left_geld.html +http://www.redrocksports.com/sports/webSession/shopper/RR972959658-31049/store/dept-5/department/dept-5/item/footwear +http://www.redrocksports.com/sports/webSession/shopper/RR972959658-31049/store/dept-5/department/dept-5/item/52550 +http://www11.cplaza.ne.jp/babyweb/bbs/bdnmp01/no16/61N.html +http://www.daimi.au.dk/dIntProg/java/jdk1.2.2/docs/api/javax/swing/plaf/basic/BasicScrollBarUI.ArrowButtonListener.html +http://www.daimi.au.dk/dIntProg/java/jdk1.2.2/docs/api/javax/swing/plaf/basic/BasicScrollBarUI.ModelListener.html +http://www.angelfire.com/nc/Percosolation/POSDerisions.html +http://yp.gates96.com/3/4/40/80.html +http://yp.gates96.com/3/4/41/23.html +http://yp.gates96.com/3/4/41/24.html +http://yp.gates96.com/3/4/41/37.html +http://yp.gates96.com/3/4/41/90.html +http://yp.gates96.com/3/4/42/26.html +http://yp.gates96.com/3/4/42/71.html +http://yp.gates96.com/3/4/42/90.html +http://yp.gates96.com/3/4/44/44.html +http://yp.gates96.com/3/4/45/52.html +http://yp.gates96.com/3/4/45/75.html +http://yp.gates96.com/3/4/45/77.html +http://yp.gates96.com/3/4/46/0.html +http://yp.gates96.com/3/4/46/85.html +http://yp.gates96.com/3/4/47/19.html +http://yp.gates96.com/3/4/47/20.html +http://yp.gates96.com/3/4/47/23.html +http://yp.gates96.com/3/4/47/72.html +http://yp.gates96.com/3/4/48/4.html +http://yp.gates96.com/3/4/48/16.html +http://yp.gates96.com/3/4/48/45.html +http://yp.gates96.com/3/4/48/51.html +http://yp.gates96.com/3/4/49/16.html +http://ftpsearch.belnet.be/pub/mirror/sunsite.cnlab-switch.ch/mirror/harvest/contrib/Example-Customizations/?S=A +http://pub9.ezboard.com/fgaprforeignrelationdepartment.showAddTopicScreenFromWeb +http://pub9.ezboard.com/fgaprforeignrelationdepartment.showMessage?topicID=4.topic +http://www.asstr.org/nifty/gay/authoritarian/adonis-brotherhood/adonis-brotherhood-3 +http://www.brio.de/BRIO.catalog/39fe2f4c06d41844273fd472aa7806a9/UserTemplate/8 +http://itcareers.careercast.com/texis/it/itjs/+HwwBmeH_D86aqwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew6nxqdDdMoqax15oDn55a5BwhhawDwcO5o5aqd5Ban5BoMwBoDtaGo5Aa5nGVoqnaADdicnmtnaBddc5aMFqhTfR20DzmenxwwwpBmeWWD86exhwww5rmeWcwwwBrmeZpwww/jobpage.html +http://polygraph.ircache.net:8181/http_-2www.whowhere.com/http_-2www.updowntowner.org/julyjamm/frmain.htm +http://213.36.119.69/do/session/152987/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/reserver/spectacles/ +http://www.jobvillage.com/channel/jobs/health_care/physician/anesthesiologist/b.9467.g.1575.html +http://www.private-immobilien-boerse.de/friesland/verkauf/IIM-Teil/Startseite/Gemeinsam/Super-Zins-Konditionen/Gemeinsam/Inserieren/Gemeinsam/MarketingStrategie/inhalt.htm +http://se.egroups.com/message/yemdiscussion/38 +http://se.egroups.com/message/yemdiscussion/45 +http://home.bip.net/kerstin.hjelm/Stamtavla%20Z-kullen.html +http://mediate.magicbutton.net/do/session/625616/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-abou.html +http://members.tripod.lycos.co.kr/KWEN3607/?S=A +http://cpan.clix.pt/authors/id/B/BP/BPOWERS/String-StringLib-1.02.readme +http://www.gbnf.com/genealogy/bookout/html/d0001/I3283.HTM +http://m4.findmail.com/group/Opera2Developers +http://m4.findmail.com/group/acctworks +http://retailer.gocollect.com/do/session/1912690/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/top_ten.asp?pagenum=1 +http://retailer.gocollect.com/do/session/1912690/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/postcards/index.asp +http://platsbanken.amv.se/kap/text/47/001023,170030,140912,11,1276051947.shtml +http://www.gamespot.com/features/dunesg/dune6a.html +http://tucows.iquest.net/winme/preview/138053.html +http://tucows.iquest.net/winme/preview/137529.html +http://tucows.iquest.net/winme/preview/138641.html +http://archive.soccerage.com/s/pt/09/03721.html +http://archive.soccerage.com/s/pt/09/07102.html +http://www10.nytimes.com/library/national/science/health/021500hth-women-diabetes.html +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www.phy.bnl.gov/e949/e949_update.txt +http://www.mapion.co.jp/custom/AOL/admi/13/13105/otsuka/3chome/index-7.html +http://go18.163.com/_NTES/~starseeker/gin/saga/gin01/gin0100.htm +http://village.infoweb.ne.jp/~fvgg8450/t91.html +http://clickahouse.mp2.homes.com/content/articles/locks.html +http://findmail.com/messages/studentdoctor/354 +http://ldp.mirror.nettuno.it/Linux/LDP/LDP/lkmpg/node3.html +http://ldp.mirror.nettuno.it/Linux/LDP/LDP/lkmpg/node13.html +http://fi.egroups.com/group/sandycove +http://www.fogdog.com/cedroID/ssd3040183219992/boutique/nike/ +http://www.fogdog.com/cedroID/ssd3040183219992/boutique/harbinger/ +http://www.fogdog.com/cedroID/ssd3040183219992/customer_service/employment.html +http://www.genoma.de/shop/736a8b4b4c331e80f780899842a4b0b4/99/b +http://sjsulib1.sjsu.edu:81/search/tbraille+transcription+project+of+santa+clara+county+inc/-5,-1,1,B/frameset&tbook+reviews+in+the+humanities&1,1, +http://students.washington.edu/emgall/eng481/final/ +http://www.vc-graz.ac.at/ilct/ffe_349_99.htm +http://www.vc-graz.ac.at/ilct/ffe_372_00.htm +http://www.vc-graz.ac.at/ilct/ffe_375_00.htm +http://www.escribe.com/computing/virtcom/m452.html +http://members.tripod.com/~TreasureIsland/welcom/e.htm +http://augustachronicle.com/stories/022699/obi_038-5494.001.shtml +http://augustachronicle.com/stories/022699/obi_038-5477.001.shtml +http://ring.edogawa-u.ac.jp/archives/X/opengroup/R6.5.1/xc/lib/Imakefile +http://www.elop.de/d0-1015-2044-3001-top.html +http://www.ibiblio.org/pub/languages/java/blackdown.org/JDK-1.1.7/i386/glibc/v1a/?S=D +http://www.linux.com/networking/network/enterprise/integration/management/Linux/ +http://www.mapion.co.jp/custom/AOL/admi/13/13221/matsuyama/2chome/index-7.html +http://www.mapion.co.jp/custom/AOL/admi/13/13221/matsuyama/2chome/index-12.html +http://ftp.sunet.se/pub/FreeBSD/ports/ports/japanese/tcl76/Makefile +http://ftp.lip6.fr/pub2/sgml-tools/website/HOWTO/Consultants-HOWTO/t19977.html +http://www.irishnews.com/archive2000/06072000/sportuk1.html +http://allmacintosh.ii.net/adnload/71893.html +http://allmacintosh.ii.net/adnload/70339.html +http://www.museumshops.co.uk/Bonnefoit-Alain/Bonnefoit-Alain-Die-Schoene-mit-dem-Pelz-3000062.html +http://www.timesoc.com/editions/orange/20001030/t000103758.html +http://www.musiciansfriend.com/ex/ds/bv/001030182803064208037039434033 +http://www.beneteau-owners.com/library.nsf/Library+By+System!OpenView&Start=41.4&Count=45&Expand=49 +http://www.musiciansfriend.com/ex/search/guitar/001030182759064208037059215342?FIND=BABX&q=c +http://www.musiciansfriend.com/ex/search/guitar/001030182759064208037059215342?FIND=ASAX&q=c +http://www.iabusnet.org:90/forums/aca-1/dispatch.exe/survey/showNextUnseen/fol/100001/2467632 +http://tucows.wish.net/winme/adnload/137243_28721.html +http://yp.gates96.com/3/71/10/71.html +http://yp.gates96.com/3/71/11/12.html +http://yp.gates96.com/3/71/11/27.html +http://yp.gates96.com/3/71/11/34.html +http://yp.gates96.com/3/71/11/40.html +http://yp.gates96.com/3/71/11/62.html +http://yp.gates96.com/3/71/11/78.html +http://yp.gates96.com/3/71/12/70.html +http://yp.gates96.com/3/71/13/34.html +http://yp.gates96.com/3/71/13/38.html +http://yp.gates96.com/3/71/13/82.html +http://yp.gates96.com/3/71/14/94.html +http://yp.gates96.com/3/71/15/0.html +http://yp.gates96.com/3/71/15/88.html +http://yp.gates96.com/3/71/17/28.html +http://yp.gates96.com/3/71/17/85.html +http://yp.gates96.com/3/71/18/37.html +http://yp.gates96.com/3/71/18/69.html +http://yp.gates96.com/3/71/19/55.html +http://www.kodak.ca/US/en/corp/jobs/samplingMechanicalProds.shtml +http://ring.crl.go.jp/archives/lang/perl/CPAN/authors/id/G/GR/GRICHTER/HTML-Embperl-1.3b4.readme +http://www7.freeweb.ne.jp/photo/lystra/a/n_aikawa.html +http://www.imagesofengland.org.uk/31/73/317339.htm +http://webraft.its.unimelb.edu.au/110080/students/ojb/pub/?D=A +http://pub.chinaccm.com/13/news/200010/31/155751.asp +http://pub.chinaccm.com/13/news/200010/21/162140.asp +http://go18.163.com/_NTES/~chen0580/y25.htm +http://pub17.ezboard.com/fcometalkfreetalk.showMessage?topicID=15.topic +http://pub17.ezboard.com/fcometalkfreetalk.showMessage?topicID=6.topic +http://mediate.magicbutton.net/do/session/625593/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-tips.html +http://213.36.119.69/do/session/152982/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/wap/lancement.html +http://wap.jamba.de/KNet/_KNet-Drs8j1-yEd-1395x/showInfo-presse.de/node.0/cde7f1uou +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=choramingar&l=pt +http://www.amcity.com/philadelphia/stories/1998/11/09/story5.html?t=email_story +http://www.mic.hr/PGMARKET:553666 +http://cn.egroups.com/messages/KristinChenoweth/2280 +http://quest7.proteome.com/databases/YPD/PombePD/SPAC343.03.html +http://www.engines.org.uk/white/fld19/ +http://www.engines.org.uk/white/fld27/ +http://se.egroups.com/subscribe/plusgothswap +http://www.headlight.com/invoice_process/1,1074,adpa-4049-2423-69-718,00.html +http://www.findarticles.com/cf_0/m4PRN/1999_Nov_3/57153314/p1/article.jhtml +http://www.iabusnet.org:90/forums/aca-1/dispatch.exe/survey/folderFrame/100001/0/alpha/2480022 +http://archive.soccerage.com/s/it/06/10903.html +http://innopac.lib.tsinghua.edu.cn/search*chi/dProduction+engineering/dproduction+engineering/-5,-1,0,B/browse +http://www.consource.com/communities/profile_categories/1759/1510 +http://column.daum.net/Column-bin/Bbs.cgi/thinkaboutrbs/new/zka/B2-kB2Np +http://wwws.br-online.de/geld/boerse/960301/0730.html +http://www.2pl.com/asp/tools/fili1.asp?sp=ro&fi=pppp0003zi +http://www.proviser.co.uk/regional/towns/alford/property_prices/compare_current_prices/terraced.html +http://cometweb01.comet.co.uk/do!session=131998&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG3XqLbdlLov4LfpmLiXvL-Zd5jbkLYozKvot0cZd5ockLYozKvsm0utt0cZX5qkXLjbzKMfaLblpLbom0bos0bom04M4Lbom0miXLvboLp1 +http://cometweb01.comet.co.uk/do!session=131998&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG3XqLbdlLov4LfpmLiXvL-Zd5jbkLYozKvot0cZd5ockLYozKvsm0uqo0cZX5qkXLjbzKG3pLibo0miX5mqlLmpbKomb0osb0oml1odXLkfpLbopL +http://www.geocities.co.jp/Milano/8578/profile.html +http://ftp.dti.ad.jp/pub/XFree86/3.3.3/binaries/NetBSD-1.2/Servers/?N=D +http://ftp.dti.ad.jp/pub/XFree86/3.3.3/binaries/NetBSD-1.2/Servers/?D=A +http://www.best.com/~radko/lounge/messages/3742.html +http://www.best.com/~radko/lounge/messages/3711.html +http://www.best.com/~radko/lounge/messages/3619.html +http://www.linux.com/networking/network/help/email/business/RuleSpace/ +http://www.financialexpress.com/fe/daily/20000918/fco17026.html +http://209.67.27.70/comics/dilbert/scott/dawn/pg19.html +http://209.67.27.70/comics/dilbert/scott/dawn/pg22.html +http://flamingo.promote.ru/href.pl?fct_051 +http://pda.saa.net/palm/adnload/34404_22152.html +http://www.outpersonals.com/cgi-bin/w3com/pws/out/q6tIzhLNlKeaaMXYVAPJiOq7V33Ul08VcQoPAomjWMQzOxA0cR6_kRLx42D4nA_uumPVc2DRZtv6CVpWQCyNUgVZQ2P9F7bqqvcf_5WqCdUM7UIRKBdjb9lTbrCrrl5_jZ6cQsstJDqry3XrFI0toILqSCSm66j2 +http://www.home.ch/~spaw9012/ps11/ps11_003.htm +http://help.sap.com/saphelp_45b/helpdata/de/1c/e464b20437d1118b3f0060b03ca329/frameset.htm +http://abc.ru/cgi-bin/get_firminfo.pl?firm=comsys +http://www.pressa.spb.ru/newspapers/nevrem/arts/nevrem-1749-art-28.html +http://www.pressa.spb.ru/newspapers/nevrem/arts/nevrem-1749-art-32.html +http://admin.afiliando.com/do/session/189435/vsid/1507/tid/1507/cid/23455/mid/1025/rid/1168/chid/1205/parser/yes/imref/eqqLmwlGltt5tkpHrYjLXofLklkKZljLkju5lZa5l0/url/http://www.submarino.com.mx/pesquisa/jutherC.asp?id_categoria=57&id_tipo=C +http://admin.afiliando.com/do/session/189435/vsid/1507/tid/1507/cid/23455/mid/1025/rid/1168/chid/1205/parser/yes/imref/eqqLmwlGltt5tkpHrYjLXofLklkKZljLkju5lZa5l0/url/http://www.submarino.com.mx/extra/talk_to_sub.asp +http://cometweb01.comet.co.uk/do!session=131998&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG3XqLbdlLov4LfpmLiXvL-Zd5jbkLYozKvot0cZd5ockLYozKvsn0mvm0cZX5qkXLjbzKGelLkbpL +http://yp.gates96.com/3/39/30/1.html +http://yp.gates96.com/3/39/30/53.html +http://yp.gates96.com/3/39/31/22.html +http://yp.gates96.com/3/39/32/0.html +http://yp.gates96.com/3/39/32/39.html +http://yp.gates96.com/3/39/32/41.html +http://yp.gates96.com/3/39/32/45.html +http://yp.gates96.com/3/39/32/97.html +http://yp.gates96.com/3/39/34/39.html +http://yp.gates96.com/3/39/34/50.html +http://yp.gates96.com/3/39/34/68.html +http://yp.gates96.com/3/39/34/72.html +http://yp.gates96.com/3/39/35/14.html +http://yp.gates96.com/3/39/35/84.html +http://yp.gates96.com/3/39/36/3.html +http://yp.gates96.com/3/39/36/19.html +http://yp.gates96.com/3/39/36/20.html +http://yp.gates96.com/3/39/36/84.html +http://yp.gates96.com/3/39/36/88.html +http://yp.gates96.com/3/39/37/37.html +http://yp.gates96.com/3/39/38/60.html +http://yp.gates96.com/3/39/38/63.html +http://yp.gates96.com/3/39/39/52.html +http://yp.gates96.com/3/39/39/56.html +http://yp.gates96.com/3/39/39/58.html +http://yp.gates96.com/3/39/39/63.html +http://yp.gates96.com/13/9/80/14.html +http://yp.gates96.com/13/9/80/92.html +http://yp.gates96.com/13/9/81/23.html +http://yp.gates96.com/13/9/81/47.html +http://yp.gates96.com/13/9/82/45.html +http://yp.gates96.com/13/9/82/59.html +http://yp.gates96.com/13/9/82/65.html +http://yp.gates96.com/13/9/82/71.html +http://yp.gates96.com/13/9/82/77.html +http://yp.gates96.com/13/9/83/86.html +http://yp.gates96.com/13/9/83/88.html +http://yp.gates96.com/13/9/84/4.html +http://yp.gates96.com/13/9/84/28.html +http://yp.gates96.com/13/9/84/77.html +http://yp.gates96.com/13/9/85/34.html +http://yp.gates96.com/13/9/85/59.html +http://yp.gates96.com/13/9/86/22.html +http://yp.gates96.com/13/9/86/28.html +http://yp.gates96.com/13/9/86/30.html +http://yp.gates96.com/13/9/86/37.html +http://yp.gates96.com/13/9/86/85.html +http://yp.gates96.com/13/9/87/1.html +http://yp.gates96.com/13/9/87/2.html +http://yp.gates96.com/13/9/88/58.html +http://yp.gates96.com/13/9/89/17.html +http://yp.gates96.com/13/9/89/49.html +http://yp.gates96.com/13/9/89/51.html +http://yp.gates96.com/13/9/89/64.html +http://yp.gates96.com/13/9/89/69.html +http://yp.gates96.com/13/9/89/79.html +http://www.diogenes.ch/4DACTION/web_rd_aut_frlist_az/ID=483337&chr=D +http://ngi.tucows.com/win2k/adnload/37473_28857.html +http://www4.nas.edu/ohr.nsf/All+Documents/Major+Units?OpenDocument&ExpandSection=1,4,21,7,17 +http://www4.nas.edu/ohr.nsf/All+Documents/Major+Units?OpenDocument&ExpandSection=2,4,21,7,17 +http://www4.nas.edu/ohr.nsf/All+Documents/Major+Units?OpenDocument&ExpandSection=15,4,21,7,17 +http://www4.nas.edu/ohr.nsf/All+Documents/Major+Units?OpenDocument&ExpandSection=16,4,21,7,17 +http://www.susi.de/cgi-bin/order/segelzentrum-kagerer/c134-5021905270003,de +http://www.egroups.com/messages/iraq-l/9973 +http://www2.kbank.no/Web/nlpublish.nsf/Published/ord_og_uttrykk!OpenDocument&ExpandSection=29,24,30,11 +http://www.etoys.com/prod/book/51604361 +http://link.fastpartner.com/do/session/600358/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/itjobbank.php +http://link.fastpartner.com/do/session/600358/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/shopnett.php +http://mirror.nucba.ac.jp/mirror/FreeBSD/branches/2.2-stable/ports/devel/mips64orion-rtems-objc/?S=A +http://www-uk5.cricket.org/link_to_database/NATIONAL/ENG/FC_TEAMS/SOMERSET/STATS/CAREER/SOMERSET_CAREER_J.html +http://www.linux.com/networking/network/performance/install/distro/industry/ +http://www.linux.com/networking/network/performance/install/distro/tools/ +http://www.linux.com/networking/network/performance/install/distro/enterprise/ +http://mx.php.net/manual/de/language.basic-syntax.php +http://mx.php.net/manual/fr/language.basic-syntax.php +http://moviestore.zap2it.com/browse/MOVIES/SCRIPT/s.UxBwM3db +http://www.armouries.org.uk/bjarni/introduction.htm +http://mirror.cc.utsunomiya-u.ac.jp/mirror/CPAN/authors/id/C/CT/CTWETEN/?D=A +http://atlanta.webmd.com/related_results/1/25/article/1738.50204 +http://www.ccnet.com/tzimmer/?M=A +http://go2.163.com/~xinhua/ +http://www.ualberta.ca/FTP/OpenBSD/src/regress/lib/libc/_setjmp/CVS/Root +http://www.dqt.com.cn/wymb/military/jinyong/金庸全集.htm +http://www.hole.kommune.no/hole/journweb.nsf/7e180336094ef23a412568cd004a5093/2fd09f96f20814cac12568e300443d50!Navigate&To=Next +http://classifieds.alberta.com/js/mi/c16000/b16000/n15/858640.html +http://classifieds.alberta.com/js/mi/c16000/b16000/n15/861013.html +http://homepages.go.com/homepages/b/n/g/bngholo/ +http://www.aelita.net/products/news/library/support/Reg/Subscribe/library/default.htm +http://www.chaos.dk/sexriddle/j/a/b/s/e/ +http://www.chaos.dk/sexriddle/j/a/b/s/t/ +http://213.36.119.69/do/session/152985/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/contact/info-publicite.html +http://www.indian-express.com/fe/daily/19990807/corporate.html +http://web.cln.com/archives/atlanta/newsstand/atl100795/1316.htm +http://web.cln.com/archives/atlanta/newsstand/atl100795/1317.htm +http://plaza.gaiax.com/www/plaza/k/n/kenta/friends.html +http://polygraph.ircache.net:8181/docs/eudora/http_-2www.kentuckylake.com/rates/http_-2www.hubbell-wiring.com/NEMA/admin/additional.html +http://gd.cnread.net/cnread1/wxxs/d/dongfangying/pljc/015.htm +http://www.bemi-immobilien.de/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Startseite/Gemeinsam/versicherungen/gebaeude/Gemeinsam/versicherungen/unfall/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/versicherungen/lebensversicherung/Gemeinsam/versicherungen/gebaeude/anforderungsformular.htm +http://www.linux.com/networking/network/help/free/red_hat/competition/ +http://www.linux.com/networking/network/help/free/red_hat/development/ +http://www.linux.com/networking/network/help/free/red_hat/SuSE/ +http://search.chollian.net/d/%b1%e2%be%f7,%c8%b8%bb%e7/%b0%e1%c8%a5/%c5%e4%c5%bb%bf%fe%b5%f9%bc%ad%ba%f1%bd%ba/16.html +http://no.egroups.com/message/plowshares/840 +http://www.pressa.spb.ru/newspapers/nevrem/arts/nevrem-1872-art-13.html +http://www.bemi-immobilien.de/Startseite/www.allgemeine-immobilien-boerse.de/allgemeine-ib/landkreiszwickau/Verkauf/29109700708107kirchbergvillamü/Gemeinsam/erreichenPartner/Startseite/Gemeinsam/versicherungen/lebensversicherung/Top-Darlehens-Konditionen/Gemeinsam/versicherungen/unfall/anforderungsformular.htm +http://www.affiliate.hpstore.hp.co.uk/do/session/380819/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.france.hp.com/main/respect/ +http://www-rn.informatik.uni-bremen.de/home/ftp/pub/linux/redhat/updates/6.2EE/i586/ +http://archive.soccerage.com/s/es/09/12718.html +http://www.intel.es/kr/hangul/pressroom/archive/releases/dp990218.htm +http://www.intel.es/kr/hangul/pressroom/archive/releases/dp990105.htm +http://sunsite.informatik.rwth-aachen.de/cgi-bin/ftp/ftpshow/pub/Linux/sunsite.unc.edu/distributions/caldera/eServer/updates/2.3/021/RPMS/ +http://library.bangor.ac.uk/search/aMatis,+James+H/amatis+james+h/-5,-1,0,B/browse +http://polygraph.ircache.net:8181/http_-2www.microsoft.com/frontpage/html/http_-2www.sharkyextreme.com/hardware/hercules_tnt/ +http://ring.nihon-u.ac.jp/archives/pack/win95/net/fee/?N=D +http://dbc.copystar.com.tw/bcbchat/199804/msg03730.htm +http://dbc.copystar.com.tw/bcbchat/199804/msg03761.htm +http://dbc.copystar.com.tw/bcbchat/199804/msg03787.htm +http://www.private-immobilien-boerse.de/nordrhein-Westfalen/grevenbroich/Verkauf/Gemeinsam/Super-Zins-Konditionen/Exklusiv-IB/Startseite/IIM-Teil/Startseite/Gemeinsam/IIMMitglieder.htm +http://www.private-immobilien-boerse.de/nordrhein-Westfalen/grevenbroich/Verkauf/Gemeinsam/Super-Zins-Konditionen/Exklusiv-IB/Startseite/IIM-Teil/Startseite/Gemeinsam/vertriebspartner.htm +http://pd.shiseido.co.jp/s9604tub/html_00/win00051.htm +http://solaris.license.virginia.edu/os_product_patches/patches/5.7/107094-04/SUNWdtbas/pkgmap +http://www.eveclub.com/cgi-bin/eveclub.front/972959470432/Catalog/11000034 +http://www.sportinggreen.com/news/20001007/fbo/fbc/aar/001007.0607.html +http://www-x500-1.uni-giessen.de:8890/Lcn%3dBelloch%20Belloch%5c,%20Juana%20Maria,ou%3dFacultad%20de%20Medicina%20y%20Odontologia,o%3dUniversidad%20de%20Valencia,c%3dES +http://retailer.gocollect.com/do/session/1912723/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/exclusives/limited_editions.asp +http://www.jufo.com/netcenter/chemistry/item/000904/16888.htm +http://ww2.comune.fe.it/cgi-win/hiweb.exe/a2/d29/b14,8,1f,1d,1d,,19,,1f,19, +http://www.2pl.com/b/ru/to/1/24/16/v2/1241600107-8.htm +http://ring.htcn.ne.jp/pub/text/CTAN/fonts/metrics/polish/plpsfont/?D=A +http://config.tucows.com/winme/adnload/26398_28890.html +http://ocean.ntou.edu.tw/search*chi/aRadojcic,+Riko,+jt.+auth./aradojcic+riko/-5,-1,0,B/frameset&F=aradomsky+nellie+a&1,1 +http://www.intellicast.com/Sail/World/UnitedStates/Northwest/Montana/Beaverhead/LocalWinds/d1_09/ +http://www.bild.de/service/archiv/2000/mar/31/sport/coulthard/coulthard.html +http://ustlib.ust.hk/search*chi/a%7B215a36%7D%7B213246%7D%7B215e42%7D+1926/a{215a36}{213246}{215e42}+1926/-5,-1,0,B/frameset&F=a{215a36}{213230}{214e70}&1,1 +http://mediate.magicbutton.net/do/session/625620/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-top50.html +http://mediate.magicbutton.net/do/session/625620/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-corp.html +http://www.amateurplatinum.com/mouthlicking/eunuchhershey-highway/bad-girlsubmission/petitebeauties/actionno-boundaries/fellatiogoing-down-on/give-headcock-suckers.html +http://www.brd.net/brd-cgi/brd_dkameras/filmscanner_fotodrucker/FZ00F0EF/beurteilung/ci=972751646.htm +http://www.niwl.se/WAIS/31607/31607073.htm +http://www.magicvillage.de/Login/magicvillage/magiclife/Lucullus/%2328706045/Reply +http://polygraph.ircache.net:8181/consumer/rel_meet_main.html +http://sunsite.informatik.rwth-aachen.de/cgi-bin/ftp/ftpshow/pub/Linux/sunsite.unc.edu/distributions/debian/dists/potato/non-free/binary-i386/x11/ +http://www.great-cyber-mall.com/SelectCompany.asp?CityID=67&CatID=5 +http://www.great-cyber-mall.com/SelectCompany.asp?CityID=67&CatID=50 +http://rainforest.parentsplace.com/dialog/get/bradley2/39/1/1.html?embed=2 +http://www.users.yun.co.jp/cgi-bin/moriq/pigeon/pigeon.cgi/DataSet.after_post?c=e +http://www.chaos.dk/sexriddle/n/f/p/x/x/ +http://www.amcity.com/dayton/stories/2000/03/20/smallb1.html?t=email_story +http://www.linux.com/networking/network/industry/web_server/windows_nt/Red_Hat/ +http://www.du-et.net/cgi/mail.cgi?NickName=naiki +http://gameboyz.com/g/demos_p1_c41_lV_w2.html +http://intelinfo.subportal.com/sn/Games/Strategy_Games/9289.html +http://home.kimo.com.tw/maso-kid/index2.html +http://citeseer.nj.nec.com/nrelated/1377121/289677 +http://citeseer.nj.nec.com/nrelated/0/289677 +http://ccar.ust.hk/~dataop/rs_ocean_cd/WVS/wvsplus/wvs003m/bat/q/h/lf/ +http://home.baoding.cn.net/~tjhlove/dzrwy/l11.htm +http://home.baoding.cn.net/~tjhlove/dzrwy/l23.htm +http://208.178.109.85/msgshow.cfm/msgboard=129014524422386&msg=3558983275052&page=1&idDispSub=-1 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=4,9,33,27,35 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=29,9,33,27,35 +http://config.tucows.com/win2k/adnload/76944_30007.html +http://www1.zdnet.com/zdnn/stories/news/0,4586,1021147,00.html +http://www.fogdog.com/cedroID/ssd3040183236187/nav/stores/snowboarding/ +http://www.fogdog.com/cedroID/ssd3040183236187/nav/stores/institutional/ +http://debian.linux.org.tw/debian/dists/sid/main/disks-powerpc/current/source/?M=A +http://satftp.soest.hawaii.edu/dlr/slides/ql21176.html +http://www.linux.com/networking/network/industry/new/help/internet/ +http://www.linux.com/networking/network/industry/new/help/growth/ +http://flint.freethemes.com/skins/winamp/preview/46994.html +http://flint.freethemes.com/skins/winamp/preview/24628.html +http://flint.freethemes.com/skins/winamp/preview/25113.html +http://flint.freethemes.com/skins/winamp/preview/24645.html +http://flint.freethemes.com/skins/winamp/preview/25319.html +http://flint.freethemes.com/skins/winamp/preview/25017.html +http://flint.freethemes.com/skins/winamp/preview/26154.html +http://flint.freethemes.com/skins/winamp/preview/24669.html +http://flint.freethemes.com/skins/winamp/preview/24674.html +http://flint.freethemes.com/skins/winamp/preview/69522.html +http://flint.freethemes.com/skins/winamp/preview/58805.html +http://flint.freethemes.com/skins/winamp/preview/71909.html +http://flint.freethemes.com/skins/winamp/preview/24389.html +http://flint.freethemes.com/skins/winamp/preview/25052.html +http://flint.freethemes.com/skins/winamp/preview/77185.html +http://flint.freethemes.com/skins/winamp/preview/56733.html +http://flint.freethemes.com/skins/winamp/preview/24736.html +http://flint.freethemes.com/skins/winamp/preview/24408.html +http://flint.freethemes.com/skins/winamp/preview/24744.html +http://flint.freethemes.com/skins/winamp/preview/24424.html +http://flint.freethemes.com/skins/winamp/preview/25075.html +http://flint.freethemes.com/skins/winamp/preview/71807.html +http://nomade.fr/cat/informatique_tele/informatique/progiciels_logiciel/utilitaires/communication +http://pub9.ezboard.com/umetalman5566.showPublicProfile?language=EN +http://archiv.leo.org/pub/comp/usenet/comp.binaries.atari.st/texinfo31/texif31b.zoo/ +http://www.maas.ccr.it/cgi-win/hiweb.exe/a18/d13/b261,4,d,,be,d, +http://citeseer.nj.nec.com/cidcontext/608466 +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/asiasanahaku/strategia/kansainv%E4listyminen/ulkomaankauppa/kansainv%E4linen+kauppa/ +http://cms.letsmusic.com/directory/search/albuminfo/1,1125,af0127818000000,00.asp +http://www.musiciansfriend.com/ex/ds/other/001030182805064208037054818832 +http://www.musiciansfriend.com/ex/search/other/001030182805064208037054818832?FIND=IBAX&q=c +http://www.mapion.co.jp/custom/tv/admi/13/13106/kuramae/3chome/19/ +http://dblab.comeng.chungnam.ac.kr/~dolphin//db/journals/ac/ac11.html +http://archive.soccerage.com/s/de/09/c4816.html +http://archive.soccerage.com/s/de/09/c4698.html +http://archive.soccerage.com/s/de/09/c4664.html +http://archive.soccerage.com/s/de/09/c4463.html +http://archive.soccerage.com/s/de/09/c4423.html +http://archive.soccerage.com/s/de/09/c4422.html +http://workingfamilies.digitalcity.com/tampabay/penpals/browse.dci?cat=teens&sort=f +http://www.bemi-immobilien.de/Startseite/www.allgemeine-immobilien-boerse.de/allgemeine-ib/landkreiszwickau/Verkauf/29109700708107kirchbergvillamü/Gemeinsam/Inserieren/Startseite/Gemeinsam/immolink/Top-Darlehens-Konditionen/Gemeinsam/versicherungen/unfall/anforderungsformular.htm +http://www.samba.org/cgi-bin/cvsweb/gnokii/xgnokii/docs/help/en_US/windows/main/?sortby=log +http://www.accesslasvegas.com/shared/health/adam/ency/article/002669sym.html +http://www.egroups.com/message/gaywrestle/33 +http://lfs.cyf-kr.edu.pl:8888/3Lcn%3dDirectory%20Manager,%20o%3dSPRITEL,%20c%3dES +http://www.acfas.ca/congres/congres66/S10.htm +http://hansard.www.act.gov.au/2000/week02/423.htm +http://207.25.71.142/cycling/2000/tour_de_france/stages/4/ +http://207.25.71.142/cycling/2000/tour_de_france/news/2000/07/20/pantani_reflects +http://207.25.71.142/cycling/2000/tour_de_france/news/2000/07/19/driver_charged/ +http://207.25.71.142/POLL/results/1142011.html +http://www2.kbank.no/Web/nlpublish.nsf/Published/ord_og_uttrykk!OpenDocument&ExpandSection=6,14,27,22 +http://www2.kbank.no/Web/nlpublish.nsf/Published/ord_og_uttrykk!OpenDocument&ExpandSection=29,14,27,22 +http://www.affiliate.hpstore.hp.co.uk/do/session/380816/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.france.hp.com/ +http://www.affiliate.hpstore.hp.co.uk/do/session/380816/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/products/entry.asp +http://ads.carltononline.com/accipiter/adclick/site=purejamba/area=jamba.home_page/AAMSZ=POPUP/ACC_RANDOM=972959547609 +http://retailer.gocollect.com/do/session/1912714/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/contact.asp +http://208.178.101.41/news/1998/12/10newsd.html +http://208.178.101.41/news/1998/03/05news.html +http://208.178.101.41/news/1998/03/03news.html +http://208.178.101.41/news/1998/01/09news.html +http://hff.shunde.net/mobile/radio2000.163.net/radio2000.163.html +http://hff.shunde.net/mobile/www.tohome.net/www.tohome.html +http://www.egroups.com/login.cgi?login_target=%2Fmessages%2FShayrs%2F31 +http://moviestore.zap2it.com/browse/MOVIES/BANK/s.bsk4qCBs +http://moviestore.zap2it.com/browse/MOVIES/STATION/s.bsk4qCBs +http://moviestore.zap2it.com/browse/MOVIES/VIDEO/s.bsk4qCBs +http://ftp.fi.debian.org/debian/dists/unstable/contrib/source/x11/?N=D +http://link.fastpartner.com/do/session/600364/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/company/jobs.htm +http://pub16.ezboard.com/uprieni.showPublicProfile +http://ftp.du.se/disk4/FreeBSD/branches/4.0-stable/ports/x11-servers/XFree86-4-FontServer/ +http://ftp.du.se/disk4/FreeBSD/branches/4.0-stable/ports/x11-servers/XttXF98srv-NKVNEC/ +http://www.generation-formation.fr/services/adrutils/GUIDES/CCI.HTM---o21zAo0UaWo0Ol9A074fo65iyfmKlze8SUeecTAseLvI5ehw7se7NeCfeZJPAPfVbNyqgBecVktePbBxehwwlezc9fAb0vyApuRtAhGqGdisSLdspt6dsSAtdsNhJdspt6dsrvrdjlhkfbu.htm +http://www.generation-formation.fr/services/adrutils/GUIDES/DRIRE.HTM---o21zAo0UaWo0Ol9A074fo65iyfmKlze8SUeecTAseLvI5ehw7se7NeCfeZJPAPfVbNyqgBecVktePbBxehwwlezc9fAb0vyApuRudNnJpo1XCjdRsR3djaPfdNjfcdRsR3djakUApvGdhcmdfbv.htm +http://198.103.152.100/search*frc/aMayer,+Anita/amayer+anita/-5,-1,0,B/frameset&F=amaybank+j+e&1,1 +http://198.103.152.100/search*frc/aMayer,+Anita/amayer+anita/-5,-1,0,B/2exact&F=amaycunich+ann&1,3 +http://kobenhavn.icepage.se/hilfe/XFree86/3.9.18/DECtga2.html +http://itcareers.careercast.com/texis/it/itjs/+YwwBmeJf5C6wwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewyhw1Bdmn5AanLnq1BoVnawmMoDo5BGwBoVnazdxamnpwGBMnDBaGnpdGB5a5BdGnaqddGmoDwBnanMwoca5Aocc5aMFqoEuRZy0IQDzmeJqwwwpBmeBFZ86mwww5rmehpwwwBrmeZpwww/morelike.html +http://itcareers.careercast.com/texis/it/itjs/+cwwBmetKD86eMmwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewyhw1Bdmn5AanLnq1BoVnawmMoDo5BGwBoVnazdxamnpwGBMnDBaGnpdGB5a5BdGnaqddGmoDwBnanMwoca5Aocc5aMFqoEuRZy0IQDzmeJqwwwpBmeBFZ86mwww5rmeODwwwBrmeZpwww/morelike.html +http://bbs.syu.ac.kr/NetBBS/Bbs.dll/scbbs008/rcm/zka/B2-kB27p/qqo/005A/qqatt/^ +http://musicmabey.subportal.com/sn/Themes/Misc__Themes/ +http://www.intel.it/eBusiness/pdf/prod/ia64/SAS_IA-64_Paper.pdf +http://elflife.bigpanda.net/2866/io.html +http://www.excelsior.com.mx/9609/960911/nac11.html +http://www.allgemeine-immobilien-boerse.de/ungarn/verkauf/Private-IB/Ferien-IB/Startseite/Allgemeine-IB/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/indexbeginn.htm +http://www.allgemeine-immobilien-boerse.de/ungarn/verkauf/Private-IB/Ferien-IB/Startseite/Allgemeine-IB/Gemeinsam/geschaeftsbedingungen.htm +http://www.wingateinns.com/ctg/cgi-bin/Wingate/look_over/AAAksrACwAAACCPAAT +http://my.netian.com/~rakyun/?N=D +http://www.bemi-immobilien.de/Landhaus-Bordeaux/Gemeinsam/versicherungen/gebaeude/Gemeinsam/immolink/Top-Darlehens-Konditionen/Gemeinsam/Inserieren/Gemeinsam/suche.htm +http://www.mirror.kiev.ua:8083/paper/2000/04/1251/text/04-07-5.htm +http://ring.toyama-u.ac.jp/archives/NetBSD/packages/1.4.2/sun3/?N=D +http://ring.toyama-u.ac.jp/archives/NetBSD/packages/1.4.2/sun3/lang/ +http://www.vstore.com/vstorecomputers/8store/ +http://indiadirectory.indiatimes.com/webdirectory/1514pg1.htm +http://indiadirectory.indiatimes.com/webdirectory/1513pg1.htm +http://www.online.kokusai.co.jp/Map/V0002508/wrd/G400/demo/ +http://www.gamespot.com.au/features/everquest_gg/creatures1.html +http://www.jxi.gov.cn/yw-ty001.nsf/view!OpenView&Start=38.11&Count=30&Expand=40 +http://www.jxi.gov.cn/yw-ty001.nsf/view!OpenView&Start=38.11&Count=30&Expand=42 +http://yp.gates96.com/6/0/40/22.html +http://yp.gates96.com/6/0/40/85.html +http://yp.gates96.com/6/0/41/26.html +http://yp.gates96.com/6/0/41/94.html +http://yp.gates96.com/6/0/42/50.html +http://yp.gates96.com/6/0/43/30.html +http://yp.gates96.com/6/0/43/76.html +http://yp.gates96.com/6/0/44/43.html +http://yp.gates96.com/6/0/44/61.html +http://yp.gates96.com/6/0/44/99.html +http://yp.gates96.com/6/0/45/37.html +http://yp.gates96.com/6/0/45/84.html +http://yp.gates96.com/6/0/47/33.html +http://yp.gates96.com/6/0/47/43.html +http://yp.gates96.com/6/0/47/54.html +http://yp.gates96.com/6/0/48/30.html +http://yp.gates96.com/6/0/48/47.html +http://yp.gates96.com/6/0/49/5.html +http://hammer.prohosting.com/~kobeweb/cgi-bin/nagaya/nagaya.cgi?room=036&action=mente +http://www.petropages.com/kproduct/k4267p.htm +http://webraft.its.unimelb.edu.au/536029/students/plam/pub/?M=A +http://www.ld.com/cbd/archive/1999/09(September)/13-Sep-1999/Fawd001.htm +http://www.caijing.yesky.com/33554432/36700160/122010.htm +http://yp.gates96.com/14/85/0/7.html +http://yp.gates96.com/14/85/2/86.html +http://yp.gates96.com/14/85/3/90.html +http://yp.gates96.com/14/85/6/37.html +http://yp.gates96.com/14/85/8/82.html +http://yp.gates96.com/14/85/8/88.html +http://cn.egroups.com/messages/Toledo_Storm/228 +http://mediate.magicbutton.net/do/session/625598/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-cart.html +http://rainforest.parentsplace.com/dialog/thread.pl/bradley2/10/2.html?dir=prevResponse +http://tvstore.zap2it.com/browse/TV/JACKET/s.CmMildAx +http://tvstore.zap2it.com/browse/TV/CLOCK/s.CmMildAx +http://findmail.com/post/studentdoctor?act=forward&messageNum=2315 +http://www.chaos.dk/sexriddle/d/j/l/a/y/ +http://gandalf.neark.org/pub/distributions/OpenBSD/src/gnu/egcs/libstdc++/testsuite/libstdc++.tests/?D=A +http://gd.cnread.net/cnread1/net/zpj/s/shenfang/004.htm +http://www.imagesignworks.com/vinylmasksforacidetching/index.nhtml +http://209.249.170.32/stores/dir/bycat/Holiday_and_Seasonal/Christmas.shtml +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959867726/Catalog/1000107 +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959867726/Catalog/1000108 +http://www.linux.com/networking/network/applications/interface/microsoft/IBM/ +http://www.linux.com/networking/network/applications/interface/microsoft/Corel/ +http://www.linux.com/networking/network/applications/interface/microsoft/?kw_offset=50 +http://www.tiefbau-suhl.de/Leistung/Stuetzmauern/stuetzmauern2.htm +http://providenet.tucows.com/win2k/adnload/38394_29124.html +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/index.opentext.net/weather/detail.cgi?us-dc +http://iceberg.adhomeworld.com/cgi-win/redirect.exe/2133549064 +http://www.dc.digitalcity.com/charlestonwvarea/announce/main.dci?page=letusknow +http://members.tripod.co.jp/yoshihiro_2/yotete.html +http://www.bemi-immobilien.de/Startseite/www.allgemeine-immobilien-boerse.de/allgemeine-ib/landkreiszwickau/Verkauf/29109700708107kirchbergvillamü/Gemeinsam/immolink/Startseite/Gemeinsam/versicherungen/lebensversicherung/Gemeinsam/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/ +http://ftp.debian.org/dists/Debian2.2r0/non-free/binary-arm/web/?N=D +http://www.complete-skier.co.uk/resorts/survey/submit.asp?ResortID=1755 +http://members.tripod.com/~BHS_CC/boys_times_1997.html +http://fi.egroups.com/post/mens-health?act=forward&messageNum=11 +http://nomade.fr/cat/famille_sante/sante/medecine_pratique/medecine_generale/ +http://home.att.net/~mlbvault/mac8.htm +http://mirror.nucba.ac.jp/mirror/Perl/authors/id/ROSCH/String-ShellQuote-1.00.readme +http://www.nrk.no/finnmark/x12_9_96/nyh6.htm +http://ftp.debian.org/dists/Debian2.2r0/non-free/binary-m68k/editors/?N=D +http://134.84.160.1/infoserv/lists/nih-image/archives/nih-image-9702/0141.html +http://www.philly.digitalcity.com/saintjosephmo/penpals/browse.dci?cat=seniors&sort=m +http://www.idg.net/crd_percent_19960.html +http://204.202.130.51/playerfile/profile/mark_karcher.html +http://www.redrocksports.com/sports/webSession/shopper/RR972959692-31077/store/dept-5/department/dept-5/item/52800 +http://www.redrocksports.com/sports/webSession/shopper/RR972959692-31077/store/dept-5/department/dept-5/item/52900 +http://www.online.kokusai.co.jp/Service/V0043510/wrd/G200/service/service.html +http://www.service911.com/mvu/step/0,2632,1+13+139+23899+17191_4,00.html +http://216.34.146.180/141000afp/14worl21.htm +http://www.chaos.dk/sexriddle/t/p/v/r/i/ +http://www.chaos.dk/sexriddle/t/p/v/r/x/ +http://www.ualberta.ca/FTP/Mirror/debian/dists/potato-proposed-updates/eruby_0.0.9-1potato1_arm.changes +http://www.hbdaily.com.cn/scznb/20000622/BIG5/scznb^1104^16^Zn16014.htm +http://www.linux.com/networking/network/administrator/internet/ftp/install/ +http://bsdweb.pasta.cs.uit.no/bsdweb.cgi/xsrc/xc/lib/Xt/PassivGrab.c?sortby=author +http://bsdweb.pasta.cs.uit.no/bsdweb.cgi/xsrc/xc/lib/Xt/ConstrainP.h?sortby=author +http://www.jamba.de/KNet/_KNet-EAA8j1-vFd-13b95/browse.de/node.0/cdel3j591 +http://vvv.geocities.co.jp/SiliconValley-SanJose/5688/sn-3.html +http://vvv.geocities.co.jp/SiliconValley-SanJose/5688/n.html +http://www.amel.net/english/computer/games/b/X0006_Backstab__.html +http://www.amel.net/english/computer/games/b/X0059_Bumper_Ships_1.1.html +http://retailer.gocollect.com/do/session/1912693/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/sports/index.asp +http://www.hig.se/(apre,formoutput,modified,set,set_cookie)/~jackson/roxen/ +http://yp.gates96.com/3/73/80/18.html +http://yp.gates96.com/3/73/81/27.html +http://yp.gates96.com/3/73/81/48.html +http://yp.gates96.com/3/73/81/58.html +http://yp.gates96.com/3/73/82/38.html +http://yp.gates96.com/3/73/83/30.html +http://yp.gates96.com/3/73/83/43.html +http://yp.gates96.com/3/73/83/49.html +http://yp.gates96.com/3/73/83/52.html +http://yp.gates96.com/3/73/84/33.html +http://yp.gates96.com/3/73/84/75.html +http://yp.gates96.com/3/73/85/2.html +http://yp.gates96.com/3/73/85/44.html +http://yp.gates96.com/3/73/85/70.html +http://yp.gates96.com/3/73/86/37.html +http://yp.gates96.com/3/73/86/59.html +http://yp.gates96.com/3/73/87/97.html +http://yp.gates96.com/3/73/87/99.html +http://yp.gates96.com/3/73/88/58.html +http://yp.gates96.com/3/73/88/63.html +http://yp.gates96.com/3/73/88/97.html +http://yp.gates96.com/3/73/89/31.html +http://yp.gates96.com/3/73/89/40.html +http://deseretbook.com/products/4108132/stock-38.html +http://workingfamilies.digitalcity.com/madison/search/ +http://debian.linux.org.tw/debian/dists/Debian2.2r0/main/disks-sparc/current/?D=A +http://debian.linux.org.tw/debian/dists/Debian2.2r0/main/disks-sparc/current/base-contents.txt +http://www.wizardsoftheweb.com/news/183.shtml +http://mathematics.fiz-karlsruhe.de/stn/whyonline/why_0367.html +http://www.nrk.no/finnmark/x27_11_98/nyh3.htm +http://rex.skyline.net/navigate.cgi?computers,agriculture,nature,agriculture,computers +http://www.secinfo.com/d1ZG7r.78.htm +http://www.secinfo.com/d1ZG7r.74.htm +http://www.freesoftware.com.cn/python.org.cn/doc/essays/ppt/hp-training/tsld051.htm +http://www.nrk.no/finnmark/x28_5_96/nyh1.htm +http://www.areteoutdoors.com/channel/snow/downhilling/b.354.g.2944.html +http://www.areteoutdoors.com/channel/snow/downhilling/b.357.g.2944.html +http://www.mywebmd.net/roundtable_message/662348 +http://lovers-lane.porncity.net/216/ +http://myhome.thrunet.com/~estefe/seng/sen18.htm +http://myhome.thrunet.com/~estefe/seng/sen42.htm +http://myhome.thrunet.com/~estefe/seng/sen52.htm +http://myhome.thrunet.com/~estefe/seng/sen73.htm +http://no.egroups.com/login.cgi?login_target=%2Fmessages%2Fenglish-zone +http://www.uzp.gov.pl/biulety/1998/100/100_1327.html +http://www.uzp.gov.pl/biulety/1998/100/100_1341.html +http://www.uzp.gov.pl/biulety/1998/100/100_1372.html +http://www.uzp.gov.pl/biulety/1998/100/100_1377.html +http://www.uzp.gov.pl/biulety/1998/100/100_1428.html +http://www.hotelboulevard.com/fr/riviera/standard/html40f8403856d2fa84c9080a860b7608ba/sessionLang/ANG/prov/browse/lstLieu[0]/Saint-Tropez/resultatSearch.html +http://polygraph.ircache.net:8181/http_-2www.microsoft.com/frontpage/speeches/Pages/funds/portfolio.html +http://www9.hmv.co.uk:5555/do/session/1347778/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d40_sd0_pt0.html +http://edc.uni-augsburg.de/doc/susehilf/pak/paket_doinst_insure.html +http://www.schlagerplatten.de/NewmanJimmyC/B000009PXU.htm +http://cn.egroups.com/message/pro92/604 +http://wwws.br-online.de/geld/boerse/980107/190001.html +http://faqs.bilkent.edu.tr/faqs/sgi/faq/performer/section-3.html +http://faqs.bilkent.edu.tr/faqs/sgi/faq/performer/section-46.html +http://faqs.bilkent.edu.tr/faqs/sgi/faq/performer/section-105.html +http://faqs.bilkent.edu.tr/faqs/sgi/faq/performer/section-111.html +http://newsone.net/nnr/prep/maus.soziales.recht +http://www.mapion.co.jp/custom/tv/admi/14/14131/yako/3chome/1/ +http://info.verwaltung.uni-freiburg.de/doc/packages/qt/html/qpicture-members.html +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959870915/ContentView/1000091/1/1200207 +http://tour.stanford.edu/cgi/locate2.prl/135.5/jltA +http://mapquest.digitalcity.com/daytonarea/salaries/main.dci?page=admin +http://linuxberg.zeelandnet.nl/x11html/adnload/9146_6809.html +http://medwebplus.com/subject/Alternative%20and%20Complementary%20Medicine/Population/Lists%20of%20Internet%20Resources?^ftc=240&^cc=ftc +http://ftp.du.se/disk0/slackware/slackware-current/contrib/ham/login/package_descriptions +http://yp.gates96.com/12/56/70/0.html +http://yp.gates96.com/12/56/70/14.html +http://yp.gates96.com/12/56/70/62.html +http://yp.gates96.com/12/56/71/19.html +http://yp.gates96.com/12/56/71/38.html +http://yp.gates96.com/12/56/71/46.html +http://yp.gates96.com/12/56/72/49.html +http://yp.gates96.com/12/56/72/78.html +http://yp.gates96.com/12/56/72/91.html +http://yp.gates96.com/12/56/73/18.html +http://yp.gates96.com/12/56/73/52.html +http://yp.gates96.com/12/56/74/15.html +http://yp.gates96.com/12/56/74/54.html +http://yp.gates96.com/12/56/74/79.html +http://yp.gates96.com/12/56/75/28.html +http://yp.gates96.com/12/56/75/68.html +http://yp.gates96.com/12/56/75/71.html +http://yp.gates96.com/12/56/75/76.html +http://yp.gates96.com/12/56/75/88.html +http://yp.gates96.com/12/56/75/94.html +http://yp.gates96.com/12/56/76/27.html +http://yp.gates96.com/12/56/76/57.html +http://yp.gates96.com/12/56/76/73.html +http://yp.gates96.com/12/56/77/60.html +http://yp.gates96.com/12/56/78/3.html +http://yp.gates96.com/12/56/78/45.html +http://yp.gates96.com/12/56/78/64.html +http://yp.gates96.com/12/56/78/86.html +http://yp.gates96.com/12/56/78/91.html +http://yp.gates96.com/12/56/78/95.html +http://yp.gates96.com/12/56/79/39.html +http://yp.gates96.com/12/56/79/75.html +http://www.alldata.com/TSB/19/831915CS.html +http://polygraph.ircache.net:8181/iisadmin/libraries/http_-2www.travelsc.com/welcome_v3/form1.html +http://majordomo.cgu.edu/cgi-bin/lwgate/NEMAI/archives/nemai.archive.0003/Date/article-9.html +http://home.tiscalinet.be/fysinet/studententips/tipsVanStudentenNicolas/sld007.htm +http://www4.netease.com/~abac/writting/zpnr/xw.htm +http://64.209.212.162/learnlots/step/0,2891,47+75+26299+10981_5,00.html +http://www.adcentral.com/cgi-bin/w3com/pws/adsites/KLhIZjY9X9xD5moK2JGI9yyxCV4tsONpzxjYyzP1Uq5ZFTlQAg3Wd-d9dlZbdFK8g3p8_O5GT8q_tKPHmrHXekF-PEpGmxPO69EhQYYR0fwhi_k2GqJa7eAy8n4PQUv0fLw2IIBwNP_qQkQpWEvx666v +http://www.nrc.nl/W2/Nieuws/1998/08/01/ +http://online.excite.de/unterhaltung/katalog/38320 +http://202.167.121.158/ebooks/jetro/tra1-1-1.html +http://ftp.uni-paderborn.de/aminet/aminet/demo/tp94/Blur.readme +http://www.symatrixinc.com/website/website.nsf/0/3e40df86fb357cd5882568720079613f!OpenDocument&ExpandSection=11,14,12,26 +http://www.intellicast.com/Ski/World/UnitedStates/Northeast/NewYork/WingedFootGCWest/WindChill/d1_12/ +http://yp.gates96.com/10/17/80/25.html +http://yp.gates96.com/10/17/80/66.html +http://yp.gates96.com/10/17/80/92.html +http://yp.gates96.com/10/17/82/56.html +http://yp.gates96.com/10/17/82/80.html +http://yp.gates96.com/10/17/83/48.html +http://yp.gates96.com/10/17/83/71.html +http://yp.gates96.com/10/17/83/85.html +http://yp.gates96.com/10/17/84/9.html +http://yp.gates96.com/10/17/84/20.html +http://yp.gates96.com/10/17/84/56.html +http://yp.gates96.com/10/17/84/63.html +http://yp.gates96.com/10/17/85/88.html +http://yp.gates96.com/10/17/86/4.html +http://yp.gates96.com/10/17/86/43.html +http://yp.gates96.com/10/17/86/45.html +http://yp.gates96.com/10/17/86/89.html +http://yp.gates96.com/10/17/86/97.html +http://yp.gates96.com/10/17/87/2.html +http://yp.gates96.com/10/17/87/46.html +http://yp.gates96.com/10/17/88/0.html +http://yp.gates96.com/10/17/89/21.html +http://yp.gates96.com/10/17/89/83.html +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www.w3.org/International/O-URL-and-ident +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=(9,6)+21,0+3,0 +http://polygraph.ircache.net:8181/http_-2www.hystuff.com/nrc.htm +http://jproxy.uol.es/jproxy/http://www.ocregister.com/beaches/capistrano +http://www1.zdnet.com/companyfinder/filters/products/0,9996,38071-58,00.html +http://www.ftp.uni-erlangen.de/pub/mirrors/_other/afterstep.foo.net/AfterStep/binaries/?M=A +http://www.genome.wustl.edu:8021/gsc10/mouse/up/?D=A +http://www.genome.wustl.edu:8021/gsc10/mouse/up/up24/ +http://rotten-tomatoes.com/movies/browse/1074473/reviews.php?view=reviews.source +http://www.virtual-impact-mktg.com/fx110001.htm +http://genforum.genealogy.com/hagen/messages/164.html +http://genforum.genealogy.com/hagen/messages/111.html +http://genforum.genealogy.com/hagen/messages/7.html +http://genforum.genealogy.com/hagen/messages/271.html +http://genforum.genealogy.com/hagen/messages/40.html +http://nt.mortgage101.com/partner-scripts/1024.asp?p=cashsolutions +http://nt.mortgage101.com/partner-scripts/1026.asp?p=cashsolutions +http://library.cuhk.edu.hk/search*chi/té¾æƒ…三地+%26%2359%3B+[3]/t%7B21632b%7D%7B213e5b%7D%7B213024%7D%7B213779%7D++++3/-5,-1,0,B/browse +http://ftp.net.uni-c.dk/pub/linux/redhat/redhat-6.2/sparc/misc/src/anaconda/isys/?S=A +http://ftp.net.uni-c.dk/pub/linux/redhat/redhat-6.2/sparc/misc/src/anaconda/isys/modutils/ +http://cobrand.altrec.com/shop/detail/8273/30 +http://pegasus.infor.kanazawa-it.ac.jp/~hatlab/kaga/docs/jdk1.3-beta_api/jdk1.3/docs/api/java/lang/class-use/ClassFormatError.html +http://bci.tucows.com/winnt/adnload/58788_28761.html +http://www.buybuddy.com/sleuth/33/1/1020503/300/ +http://203.116.23.91/computer/pages2/it120800e.html +http://203.116.23.91/special/newspapers/2000/pages4/computer030700.html +http://203.116.23.91/computer/pages1/software131197.html +http://dic.empas.com/show.tsp/?q=anarchically&f=B +http://noodle.tigris.org/source/browse/subversion/subversion/libsvn_vcdiff/tests/target0.txt +http://www.dbservicestore.de/home/db_reise_touristik/angebote/db_rt_gat_muenster.shtml +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=2&discrim=16,237,275 +http://www.narodnaobroda.sk/20000926/06_006.html +http://mandijin.chinamarket.com.cn/C/Showdetail_company/22591.html +http://202.167.121.158/ebooks/jetro/t6.html +http://a228.g.akamai.net/7/228/289/dd50406be5fc91/news.indiainfo.com/2000/08/17/world-index.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=disaminerei&l=it +http://polygraph.ircache.net:8181/http_-2www.eastnebr.net/html/conversions.htm +http://www.secinfo.com/d2wVq.7ar.htm +http://www.secinfo.com/d2wVq.7B5.htm +http://www.secinfo.com/d2wVq.6cd.htm +http://www.secinfo.com/d2wVq.59x.htm +http://www.jamba.de/KNet/_KNet-xdz8j1-mFd-13b2b/browse.de/node.0/cenv0b09a +http://213.36.119.69/do/session/152991/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/jeux/jeux_himalaya.html +http://www.dailyexcelsior.com/99sep30/edit.htm +http://www.dailyexcelsior.com/99sep30/sports.htm +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/misc/misc/music/lit/quizz/computers/netwars.html +http://cometweb01.comet.co.uk/do!session=132020&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkjHfZoLlplLcqkKZljLlfb5lal5tkiLlXaLl0 +http://www.affiliate.hpstore.hp.co.uk/do/session/380832/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/search.asp +http://208.216.182.15/exec/obidos/ASIN/0516206443/qid=972959559/sr=1-22/ +http://fi.egroups.com/messages/alau/2350 +http://ads.puntopartenza.com/cgi-bin/redirect.cgi/31033631 +http://pds.nchu.edu.tw/cpatch/ftp/ftpctrl/?N=D +http://www.brio.de/BRIO.catalog/39fe2f5606def942273fd472aa7806e2/UserTemplate/5 +http://ep.com/js/mi/c7246/b0/832275.html +http://ep.com/js/mi/c7246/b0/837505.html +http://ep.com/js/mi/c7246/b0/764046.html +http://www.fogdog.com/cedroID/ssd3040183223072/nav/products/nhl/pittsburgh_penguins/fan/gender/autographed_pucks/ +http://netway.pda.tucows.com/palm/preview/33567.html +http://netway.pda.tucows.com/palm/preview/34007.html +http://cometweb01.comet.co.uk/do!session=132006&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkjHfZoLlplLcqkKZljLlfb5lal5tkiLlXaLl0 +http://www.udn.com.tw/ARCHIVE/2000/08/04/DOMESTIC/YUNLIN/587058.htm +http://www.linux.com/networking/network/support/web/news/services/ +http://www.linux.com/networking/network/support/web/news/website/ +http://www.linux.com/networking/network/support/web/news/business/ +http://ads.carltononline.com/accipiter/adclick/site=purejamba/area=jamba.home_page/AAMSZ=IAB_FULL_BANNER//ACC_RANDOM=972959548213 +http://www-x500-1.uni-giessen.de:8890/Lcn%3dConsuelo%20Alvarez,ou%3dDpto.%20Fisiologia%20y%20Biologia%20Animal,o%3dUniversidad%20de%20Sevilla,c%3dES +http://www.chaos.dk/sexriddle/b/q/v/y/n/ +http://www.cs.kuleuven.ac.be/~java/docs/tutorial/uiswing/converting/example-1dot1/ListDemo.html +http://golfonline.comfluent.net/cgi.pan$player&lpga82&Debbie_Raso&lpga?golfstats +http://acetoys.com/cgi-bin/exec/modify_cart_button=1&cart_id=1999923.7130.303&page=/tystore/htmlfiles/eden/dw.html +http://www.bigchurch.com/cgi-bin/w3com/pws/bc/y1hIyNzn0Bl2XX5GzG9wVnUEhWD8GTd-XbpDm6aNI4ZMGTnV_YsP2OjB0RrwLpDbJub1pKlzEMrInSQi9hRM-Rz4WNq8C1vKJ9STiU9leUD_a3PBVh-7OMZDzJtyEBAXTehiRqme6jBR +http://www.bigchurch.com/cgi-bin/w3com/pws/bc/mChIR_iy1798J8x9InaTkzOfisuwH2hv2KUj0e64IQ9CeS327muTnTo70bT5YC4YznUddEOY5WdX70keIPRlsQibJtG6uzZtaaPmL58O5zJ0z_2PkJNxmBS5dj5-gWoeBgE0zaSvCbi66Grq +http://wap.jamba.de/KNet/_KNet-8qB8j1-FFd-13blo/browse.de/node.0/cde7f2elw +http://collection.nlc-bnc.ca/100/201/300/info_tabac/html/1997/bull7/fdacarol.html +http://pub17.ezboard.com/fzhaostempleofenlightenmentzhaosforum.showMessage?topicID=116.topic +http://www.home.ch/~spaw4360/HOWTO_fr/Ethernet-HOWTO-5.html +http://www.chaos.dk/sexriddle/s/g/n/y/j/ +http://polygraph.ircache.net:8181/http_-2www.horizonfinance.com/https_-2www.truste.org/validate/page3.html +http://marketbiz.subportal.com/sn/Themes/Sports_Themes/288.html +http://www.chinaccm.com/04/news/200004/20/120305.asp +http://www.american.webtourist.net/travel/northamerica/usa/lagunabeach/bwlagunareefinn.htm +http://elib.zib.de/pub/visual/avs/mirror/imperial/new/?S=A +http://www.burstnet.com/ads/ad7826a-map.cgi/969206790 +http://yp.gates96.com/14/82/10/81.html +http://yp.gates96.com/14/82/12/82.html +http://yp.gates96.com/14/82/13/55.html +http://yp.gates96.com/14/82/14/27.html +http://yp.gates96.com/14/82/14/31.html +http://yp.gates96.com/14/82/15/52.html +http://yp.gates96.com/14/82/17/16.html +http://yp.gates96.com/14/82/17/93.html +http://www.outpersonals.com/cgi-bin/w3com/pws/out/P2hI5ODQEZ1-vIl-agOzeOeNg4wShDlZrsCbdT5YZ3TrprEU4rb4NnnDXiGmf5cX3dh8ltMer04TMDd3q-cE5Mne85eH57ltxsi4ZQfER6vkktoaaYlS9JFTzylmCJZ2_PAT9uu2oWvIjgMzt9toyeuV +http://www.mirror.ac.uk/sites/ftp.microsoft.com/deskapps/powerpt/KB/Q226/7/ +http://mirror.nucba.ac.jp/mirror/Perl/authors/id/MIKEKING/?M=A +http://lists.insecure.org/linux-kernel/2000/Jun/4357.html +http://www.nlc-bnc.ca/indexmus-bin/resultsum/m=0/e=0/h=25/p=1/f=AU/t=Siroir,+Maryse+Angrignon +http://genforum.genealogy.com/cgi-bin/print.cgi?leavy::19.html +http://www.egroups.com/message/malaysiakini/219 +http://wuarchive.wustl.edu/graphics/mirrors/ftp.povray.org/.3/netlib/ode/rksuite/?S=A +http://www.earthsystems.org/list/greenyes/jan2000/1999-2/0858.html +http://pp3.shef.ac.uk:4040/search=browse/dn=countryName%3DGB%40organizationName%3DUniversity+of+Sheffield%40organizationalUnitName%3DAutomatic+Control+and+Systems+Engineering%40commonName%3DI+D+Durkacz +http://cobrand.altrec.com/shop/detail/6133/15/sizing +http://cobrand.altrec.com/shop/detail/5624/17/write +http://members.theglobe.com/inwardpath/history.htm +http://findmail.com/post/studentdoctor?act=reply&messageNum=5168 +http://www.service911.com/everythingtele/step/0,2675,3+26057+24201+16394_0,00.html +http://www.linux.com/networking/network/free/release/development/mysql/ +http://www.nbip.com.cn/books/xdwx/Hongyan/hongyan14.html +http://ftp.jp.debian.org/debian-non-US/dists/sid/non-US/non-free/binary-hurd-i386/?N=D +http://homepage.swissonline.ch/chico_logo/www.Link008 +http://homepage.swissonline.ch/chico_logo/www.Link009 +http://citeseer.nj.nec.com/cidcontext/3719857 +http://itcareers.careercast.com/texis/it/itjs/+CwwBme3AT+6e-xwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewXnmoBGnamwBwxw5naBnqrDdcdtOaOnwGaMdDBramwOaqmwBwamn5otDamnVncdpoDtanDtoDnnGoDtaMFqhTfR20DzmebmwwwpBme3AT+6ekxwww5rmeXdwwwBrmeZpwww/jobpage.html +http://www.amazon.com.hk/exec/obidos/tg/stores/detail/-/pro-tools/B0000224UB/customer-reviews/ref=th_hp_rs_2_6/ +http://www.ard-buffet.de/buffet/teledoktor/1998/02/16/ +http://pub19.ezboard.com/fmissionimplausiblewhatpeoplearesaying.emailToFriend?topicID=41.topic +http://no.egroups.com/message/NikonCoolPix/211 +http://www.gasex.com/free.gay.sex/gay.men.dick.dicks.html +http://www.centc251.org/forums/aca-1/dispatch.cgi/hsi/showFolder/100001/1255931 +http://www.uni-duesseldorf.de/ftp/ftp/pf/s/yagirc-0.65.6/?N=D +http://www.outpersonals.com/cgi-bin/w3com/pws/out/uIhI1DhpdvAdxVFONIJuaNcvtSTejSMmZIBgOwsZamHFS4JpS3i6VWNOSb8LsLcmqmG0gp2hs1YjuScHwXmociV5L_3_fCYngafHC4CIYDuKoI-rOZldw1RU5K3jOfh5d3PxatRmmHqB662F +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/elax176954/eus53832/eus155852/eus53907/eus62316/ +http://www.magictraders.com/cgi-bin/ubb/ubbmisc.cgi?action=getbio&UserName=Ammo187 +http://fi.egroups.com/login.cgi?login_target=%2Fgroup%2Fweirdchicks +http://www.accesslasvegas.com/shared/health/adam/ency/article/000589.images.html +http://pp3.shef.ac.uk:4040/search=browse/dn=countryName%3DGB%40organizationName%3DAberdeen+University%40organizationalUnitName%3DGeneral+Practice%40commonName%3DMorrison+S +http://worldres.lycos.com/script/gen_amen.asp?hotel_id=2252&n=2089 +http://tulips.ntu.edu.tw/search*chi/dSymbolism+in+fairy+tales/dsymbolism+in+fairy+tales/-5,-1,0,B/browse +http://ftp.du.se/disk4/FreeBSD/branches/4.0-stable/ports/x11-clocks/pclock/ +http://ftp.du.se/disk4/FreeBSD/branches/4.0-stable/ports/x11-clocks/xtimer/ +http://polygraph.ircache.net:8181/cgi-win/lincoln/$cgi4wpro.exe/http_-2www.k56.com/http_-2www.webexplorer.net/c/SHLFFREZ.HTM +http://www.ecs.soton.ac.uk/~seg7/private/contact.html +http://wiem.onet.pl/wiem/00de68-s.html +http://lcweb2.loc.gov/ll/llnt/008/?M=A +http://www.alladvantage.com/pressroom.asp?refid=CBI-463 +http://herndon1.sdrdc.com/cgi-bin/ind_detail/FERRELL|PORTER|FORT+WORTH|TX|76107|SINGLE+SERVER+COMMUNICATIONS/ +http://herndon1.sdrdc.com/cgi-bin/ind_detail/HARRIS|WILLIAM|FAIRFAX|VA|22031|HARRIS+AND+ASSOCIATES/ +http://herndon1.sdrdc.com/cgi-bin/ind_detail/HUTCHER|LARRY|NEW+YORK|NY|10023|DAVIDOFF+AND+MALITO/ +http://herndon1.sdrdc.com/cgi-bin/ind_detail/ISIKOFF|NATHAN+R|WASHINGTON|DC|20007|CAREY-WINSTON+CO/ +http://www.linux.com/networking/network/communications/security/wireless/protocol/ +http://www.linux.com/networking/network/communications/security/wireless/technology/ +http://retailer.gocollect.com/do/session/1912719/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/about.asp +http://retailer.gocollect.com/do/session/1912719/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/exclusives/limited_editions.asp +http://retailer.gocollect.com/do/session/1912719/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://www9.hmv.co.uk:5555/do/session/1347779/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/hiddenframe.html +http://pub9.ezboard.com/fwestlifedublinmessageboardwestlifemessageboard.showMessage?topicID=8.topic +http://no.egroups.com/subscribe/hardzero +http://link.fastpartner.com/do/session/600378/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/index.php +http://link.fastpartner.com/do/session/600378/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/gosafe.php +http://link.fastpartner.com/do/session/600378/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/bitconomy.php +http://www.hello.co.jp/~daichi2/ +http://bbs.nsysu.edu.tw/txtVersion/treasure/ChiaYi/M.937783175.A/M.959916136.M.html +http://chat.hani.co.kr/NetBBS/Bbs.dll/chosun21/lst/qqeq/1/zka/B2-kB2Bp/qqo/PRMY +http://www.gartenfachmarkt.de/haus/schleifen/so.htm +http://links2go.publiweb.com/topic/US_Department_of_Agriculture +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=14,15,6,36,22 +http://www.linux.com/networking/network/new/hardware/open_source/operating_system/ +http://www.linux.com/networking/network/new/hardware/open_source/availability/ +http://tokyo.cool.ne.jp/pure0101/Oblivion_dust.html +http://www.digitaldrucke.de/(aktuell,computer,gaestebuch,hilfe,hilfeallgemein,individualverkehr,kultur,onlineservice,peripherie,sense,veranstaltungen,verkehr)/_fort/html/themen/computer/hard/links/mitsu.htm +http://www.gbnf.com/genealogy/jenkins/html/d0097/I4129.HTM +http://www.geocities.co.jp/Outdoors-River/1625/hakuba0502.htm +http://ftp.fi.debian.org/OpenBSD/src/regress/share/man/ +http://www3.buch-per-sms.de/angemeldet.jsp$ID=To7767mC050667397857644736At0.8818825373175998 +http://www2.kbank.no/Web/nlpublish.nsf/Published/ord_og_uttrykk!OpenDocument&ExpandSection=15,25,16,27 +http://debian.tod.net/debian/dists/sid/main/binary-sparc/electronics/?D=A +http://hs1.takeoff.ne.jp/~hatuse/ +http://polygraph.ircache.net:8181/Keyboards/http_-2www.sky.net/~robertf/handson/engine.html +http://www.gbnf.com/genealogy/jenkins/html/d0005/I3818.HTM +http://sepwww.stanford.edu/oldreports/sep67/old_src/jon/extend/junk.listing +http://www.kol.net/~calldj/cyberstar/map/dw25a.htm +http://citeseer.nj.nec.com/cidcontext/1297195 +http://citeseer.nj.nec.com/cidcontext/1297207 +http://books.hyperlink.co.uk/xt2/Peace_Verses_War/Cole/Derek/0722329539 +http://www.spousehouse.com/ +http://futures.homeway.com.cn/lbi-html/news/special/zhzt/jdht/twparty/zhengfu94652.shtml +http://www.yorosiku.net:8080/-_-http://www.zdnet.co.jp/zdii/interviews/interviews.html +http://library.cwu.edu/search/aIdaho+State+University/aidaho+state+university/-5,-1,0,E/frameset&F=aidaho+state+university&2,,0 +http://pelit.saunalahti.fi/.1/tucows/preview/68721.html +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=34,20,30,36,32 +http://pike-community.org/(base=/forums/show.html,forum=7,show=146,t=972959487953431)/forums/show.html +http://pike-community.org/(base=/forums/show.html,forum=7,show=185,t=972959487953431)/forums/show.html +http://pike-community.org/(base=/forums/show.html,explode=763,forum=7,t=972959487953431)/forums/show.html +http://pike-community.org/(base=/forums/show.html,forum=7,show=870,t=972959487953431)/forums/show.html +http://pike-community.org/(base=/forums/show.html,forum=7,show=890,t=972959487953431)/forums/show.html +http://ww2.comune.fe.it/cgi-win/hiweb.exe/a2/d3/b34,8,1,,1f,1,65,,1f,65, +http://www.telematik.informatik.uni-karlsruhe.de/osf/sw/v4.0x/lp2/bst320/kit/ +http://cafe3.daum.net/Cafe-bin/Bbs.cgi/harukypds/rnw/zka/B2-kB2Zq +http://www.digitaldrucke.de/(computer,hilfe)/_fort/html/themen/computer/hard/links/escom.htm +http://www2.ipc.pku.edu.cn/scop/pdb.cgi?sid=d6stdb_ +http://www2.ipc.pku.edu.cn/scop/pdb.cgi?sid=d4stdc_ +http://www.shopworks.com/index.cfm/action/specials/userid/00029735-2E1C-19FE-AF65010C0A0A8CF2 +http://www.shopworks.com/index.cfm/action/search/userid/00029735-2E1C-19FE-AF65010C0A0A8CF2 +http://www.helpnow.net.cn/helpnow/hardware/bbs/cpu/?D=A +http://books.hyperlink.co.uk/xt1/Light_My_Fire/Manzarek/Ray/0099280655 +http://bsd.sinica.edu.tw/cgi-bin/cvsweb.cgi/src/crypto/heimdal/appl/ftp/ftp/?sortby=author +http://tucows.interbaun.com/winme/adnload/5147_28523.html +http://tucows.interbaun.com/winme/adnload/137019_28530.html +http://moviestore.zap2it.com/browse/MOVIES/COLLECTI/s.NedNjpDf +http://moviestore.zap2it.com/browse/MOVIES/STRAW/s.NedNjpDf +http://www.online.kokusai.co.jp/Words/V0043505/wrd/G700/words/kana_main.html +http://www.mirror.edu.cn/res/sunsite/pub/X11/contrib/window_managers/gwm/patches/gwm_patch_1.8a_001 +http://www.musicblvd.com/cgi-bin/tw/270242907922133_20_hip +http://www.cowo.de/archiv/1991/21/9121c045.html +http://www.russ.ru:8080/netcult/nevod/19990827-pr.html +http://usol.linux.tucows.com/x11html/preview/26680.html +http://usol.linux.tucows.com/x11html/preview/10385.html +http://yp.gates96.com/7/22/20/54.html +http://yp.gates96.com/7/22/20/67.html +http://yp.gates96.com/7/22/20/71.html +http://yp.gates96.com/7/22/22/26.html +http://yp.gates96.com/7/22/22/55.html +http://yp.gates96.com/7/22/22/74.html +http://yp.gates96.com/7/22/22/94.html +http://yp.gates96.com/7/22/23/38.html +http://yp.gates96.com/7/22/23/59.html +http://yp.gates96.com/7/22/24/43.html +http://yp.gates96.com/7/22/24/60.html +http://yp.gates96.com/7/22/24/64.html +http://yp.gates96.com/7/22/24/66.html +http://yp.gates96.com/7/22/24/72.html +http://yp.gates96.com/7/22/24/85.html +http://yp.gates96.com/7/22/26/11.html +http://yp.gates96.com/7/22/26/69.html +http://yp.gates96.com/7/22/27/3.html +http://yp.gates96.com/7/22/27/11.html +http://yp.gates96.com/7/22/27/22.html +http://yp.gates96.com/7/22/27/48.html +http://yp.gates96.com/7/22/27/69.html +http://yp.gates96.com/7/22/28/13.html +http://yp.gates96.com/7/22/28/30.html +http://yp.gates96.com/7/22/29/39.html +http://yp.gates96.com/7/22/29/58.html +http://www.allgemeine-immobilien-boerse.de/frankfurt/verkauf/Gemeinsam/Super-Zins-Konditionen/Private-IB/Startseite/IIM-Teil/Startseite/Gemeinsam/Super-Zins-Konditionen/anforderungsformular.htm +http://cobrand.altrec.com/shop/detail/8470/9/description +http://oa-nett.no/0/73/90/2.html +http://www.nordi.no/~steinsk/ +http://www02.geocities.co.jp/Stylish/6692/ +http://no.egroups.com/login.cgi?login_target=%2Fmessages%2Fsan-diego-tango +http://no.egroups.com/message/san-diego-tango/390 +http://www.jamba.de/KNet/_KNet-m_C8j1-PFd-13bt7/showInfo-special1.de/node.0/cenv0b09a +http://www.bemi-immobilien.de/Ferien-IB/Startseite/Gemeinsam/immolink/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Startseite/Gemeinsam/versicherungen/gebaeude/Startseite/froben.htm +http://it.egroups.com/post/pimnews-homeworker?act=reply&messageNum=661 +http://members.es.tripod.de/remoto/t2/p3b.htm +http://no.egroups.com/post/Translat2000?act=reply&messageNum=530 +http://www.opengroup.com/pabooks/081/0816631352.shtml +http://www6.freeweb.ne.jp/feminine/ki18/portrait10/p21.htm +http://genforum.genealogy.com/cgi-genforum/forums/cantrell.cgi?2117 +http://www9.hmv.co.uk:5555/do/session/1347769/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d30_sd0_pt0.html +http://polygraph.ircache.net:8181/docs/Win95/MSdialer/http_-2www.fastcounter.com/http_-2www.perrypip.com/http_-2www.scruz.net/~dvb/cam.html +http://polygraph.ircache.net:8181/docs/Win95/MSdialer/http_-2www.fastcounter.com/http_-2www.perrypip.com/~logan/ +http://polygraph.ircache.net:8181/docs/Win95/MSdialer/http_-2www.fastcounter.com/http_-2www.perrypip.com/http_-2hits.omino.com/ +http://javatest.a-net.nl/servlet/pedit.Main/http://epidem13.plantsci.cam.ac.uk/~js/glossary/course-glossary.html +http://www.hellefors.se/ulf/akno/alla/p0349c5e1e.html +http://home.no.net/islamnor/had.sira.html +http://www.gutenberg2000.de/immerman/muenchim/muen1171.htm +http://www.gutenberg2000.de/immerman/muenchim/muen3091.htm +http://www.gutenberg2000.de/immerman/muenchim/muen7011.htm +http://www.sikhnet.com/sikhnet/music.nsf/by%20Shabad!OpenView&Start=30&Count=20&Expand=2 +http://www.proteome.com/databases/PombePD/reports/SPCC613.01.html +http://www.midwestvanlines.com/oh/indexC.html +http://ring.tains.tohoku.ac.jp/pub/linux/debian/debian-jp/dists/stable/contrib/binary-arm/electronics/?S=A +http://members.tripod.com/~infolog/Genhouses/Chap12.htm +http://www.4positiveimages.com/4positiveimages/1998693855/UserTemplate/2 +http://www.greenleaves.com/bookcat/gb_096855900X.html +http://www-rn.informatik.uni-bremen.de/home/X11R6/xc/doc/hardcopy/test/?M=A +http://rex.skyline.net/html/Shipping_of_Goods.html?48,airplanes,transportation,collectibles,transportation +http://rex.skyline.net/html/Automobile_Classified_Listings.html?59,airplanes,transportation,collectibles,transportation +http://www.admin.co.martin.fl.us/GOVT/depts/cas/corresp/2000/cas00l.133.html +http://www.admin.co.martin.fl.us/GOVT/depts/cas/corresp/2000/cas00l.126.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380834/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hpstore.hewlett-packard.fr/gp +http://link.fastpartner.com/do/session/600367/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/no/ +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www-library.lbl.gov/photo/gallery/ +http://dogbert.wu-wien.ac.at/UniverCD/cc/td/doc/product/core/cis12012/bfrcfig/4334acps/?M=A +http://ftp.uni-stuttgart.de/pub/tex/nonfree/support/latexdraw/doc/ltdmanual.html.g/node10.html +http://se.egroups.com/message/911dispatchers/718 +http://ftp.eecs.umich.edu/.1/people/jfr/Pinata_Book/?D=A +http://community.bigchalk.com/servlet/schools_ProcServ/DBPAGE=cge&GID=66001000660906746080215398&PG=66001000660906746080492039 +http://www2.kbank.no/Web/nlpublish.nsf/Published/ord_og_uttrykk!OpenDocument&ExpandSection=16,27,29,4 +http://www2.kbank.no/Web/nlpublish.nsf/Published/ord_og_uttrykk!OpenDocument&ExpandSection=22,27,29,4 +http://pds.nchu.edu.tw/cpatch/ftp/dap/cdap_4002.txt +http://pds.nchu.edu.tw/cpatch/ftp/dap/source/ +http://kuyper.calvin.edu/fathers2/ANF-03/anf03-22.htm +http://kuyper.calvin.edu/fathers2/ANF-03/anf03-27.htm +http://blisty.internet.cz/1250/9908/19990813a.html +http://ring.shibaura-it.ac.jp/archives/doc/jpnic/minutes/committee/200008/shiryou-2-8-2.txt +http://194.128.65.4/pa/cm199697/cmhansrd/vo970306/text/70306w14.htm +http://www.mortgagemag.com/guide/c096/c096573.htm +http://link.fastpartner.com/do/session/600369/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/mondosoft.php +http://link.fastpartner.com/do/session/600369/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/gosafe.php +http://cometweb01.comet.co.uk/do!session=132008&vsid=692&tid=20&cid=37051&mid=1000&rid=1060&chid=1702&url=eqqLmwlGltt5tkjHfZoLlplLcqkKZljLlfb5lal5tkiLlXaLl0 +http://www.vh.org///////Patients/IHB/FamilyPractice/AFP/November1994/HormoneReplacement.html +http://ftp.sunet.se/pub/unix/OpenBSD/distfiles/md5/74892a6ae002937d011d3e1102269b7f/?M=A +http://www.pcdads.com/pressroom/archive/releases/cn112999.htm +http://www.pcdads.com/pressroom/archive/releases/Fe90199a.htm +http://www.pcdads.com/pressroom/archive/releases/Cn042199.htm +http://www.cheap-cds.com/surf/order/017172 +http://www.hani.co.kr/ECONOMY/data/9909/day09/print/p00909060.html +http://www.bemi-immobilien.de/Startseite/www.allgemeine-immobilien-boerse.de/allgemeine-ib/landkreiszwickau/Verkauf/29109700708107kirchbergvillamü/Gemeinsam/MarketingStrategie/Startseite/Gemeinsam/Inserieren/Gemeinsam/Gemeinsam/versicherungen/unfall/anforderungsformular.htm +http://www.sj-rmall.com/Mall/Catalog/Product/ASP/product-id/57419/store-id/1000400121.html +http://www.travelodge.com/ctg/cgi-bin/Travelodge/home/AAAksrACwAAABvTAAd +http://ctc.org.cn/ctc2/news/internet/develop/news0322-6.htm +http://www.schlagertempel.de/FallbachTrio/B000025MBP.htm +http://www.fogdog.com/cedroID/ssd3040183238127/nav/products/nike/1b/all/10.html +http://www.fogdog.com/cedroID/ssd3040183238127/customer_service/security_policy.html +http://in.egroups.com/login.cgi?login_target=%2Fgroup%2Fradiotutorium +http://yp.gates96.com/7/87/70/43.html +http://yp.gates96.com/7/87/70/61.html +http://yp.gates96.com/7/87/71/85.html +http://yp.gates96.com/7/87/72/75.html +http://yp.gates96.com/7/87/73/1.html +http://yp.gates96.com/7/87/73/5.html +http://yp.gates96.com/7/87/73/60.html +http://yp.gates96.com/7/87/74/34.html +http://yp.gates96.com/7/87/75/9.html +http://yp.gates96.com/7/87/75/50.html +http://yp.gates96.com/7/87/75/92.html +http://yp.gates96.com/7/87/76/2.html +http://yp.gates96.com/7/87/76/59.html +http://yp.gates96.com/7/87/76/92.html +http://yp.gates96.com/7/87/78/30.html +http://yp.gates96.com/7/87/78/32.html +http://yp.gates96.com/7/87/78/75.html +http://yp.gates96.com/7/87/78/85.html +http://yp.gates96.com/7/87/78/93.html +http://yp.gates96.com/7/87/79/30.html +http://yp.gates96.com/7/87/79/50.html +http://yp.gates96.com/7/87/79/71.html +http://yp.gates96.com/7/87/79/85.html +http://interhotel.com/luxembourg/es/hoteles/45691.html +http://interhotel.com/luxembourg/es/hoteles/73094.html +http://bart.kullen.rwth-aachen.de/~quake3/Html_log/471_chat.html +http://search.yam.com.tw/en/search/rec/travel/domest/resorts/miaolir/ +http://www.narodnaobroda.sk/19991009/23_006.html +http://news.china.com/zh_cn/social/1007/20001027/7624.html +http://www.fila.com.br/ +http://www.jobvillage.com/channel/jobs/health_care/female_health/b.3122.g.2360.html +http://online.excite.de/bildung/katalog/35461 +http://deportes.ole.com/ocio/articulo/articulo.cfm?ID=OCI8055 +http://yp.gates96.com/3/36/90/2.html +http://yp.gates96.com/3/36/90/37.html +http://yp.gates96.com/3/36/90/55.html +http://yp.gates96.com/3/36/90/79.html +http://yp.gates96.com/3/36/91/7.html +http://yp.gates96.com/3/36/92/59.html +http://yp.gates96.com/3/36/92/95.html +http://yp.gates96.com/3/36/93/76.html +http://yp.gates96.com/3/36/93/88.html +http://yp.gates96.com/3/36/94/41.html +http://yp.gates96.com/3/36/94/64.html +http://yp.gates96.com/3/36/95/16.html +http://yp.gates96.com/3/36/95/33.html +http://yp.gates96.com/3/36/95/39.html +http://yp.gates96.com/3/36/96/36.html +http://yp.gates96.com/3/36/96/53.html +http://yp.gates96.com/3/36/99/30.html +http://yp.gates96.com/3/36/99/73.html +http://download.sourceforge.net/mirrors/turbolinux/turbolinux-cn/pub/turbolinux/updates/TLC3.0.2/?S=D +http://www.jobvillage.com/channel/jobs/administrative/mrd/courier/b.4728.g.3366.html +http://www.jobvillage.com/channel/jobs/administrative/mrd/shipping_clerk/b.4713.g.3366.html +http://quote.fool.com/simple.asp?symbols=NS +http://itcareers.careercast.com/texis/it/itjs/+NwwBmeIXD86dxwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewXhmoBGnaqdGpdGwBodDaqdMp1BnGadpnGwBodD5aMw55wqr15nBB5aqdGpdGwBnahoDwDqowcaMwocaBn5BoDtapGdxcnMaMFqhTfR20DzmetmwwwpBme_9D86eYmwww5rme1DwwwBrmeZpwww/jobpage.html +http://www.shopworks.com/index.cfm/action/info/userid/00066256-1160-19FE-A703010D0A0A8CF2 +http://isbn.nu/0716723212/fatbrain +http://isbn.nu/0716723212/amazon.ceo.html +http://ftp.nacamar.de/pub/NetBSD/NetBSD-current/pkgsrc/www/p5-URI/?N=D +http://213.36.119.69/do/session/152993/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/preparer/sante.htm +http://213.36.119.69/do/session/152993/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/jeux/jeux_himalaya.html +http://213.36.119.69/do/session/152993/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/DE_DE/ +http://www.linux.com/networking/network/support/open_source/investors/consulting/ +http://www.linux.com/networking/network/support/open_source/investors/research/ +http://sunsite.uakom.sk/doc/FAQ/alt-sex/fetish-fashion/?S=A +http://sunsite.uakom.sk/doc/FAQ/alt-sex/fetish-fashion/?D=A +http://phnet.tucows.com/winme/preview/75994.html +http://www.fivedoves.com/letters/june99/trish67.htm +http://www.teacherformation.org/html/od/facilitators.cfm/task1,about/discussion_id,2/xid,8571/yid,4064381 +http://pub24.ezboard.com/fnightmagicfrm1.showMessage?topicID=3.topic +http://infoserv2.ita.doc.gov/efm/efm.nsf/Sources!OpenView&Start=53.28&Count=30&Expand=54 +http://www.linux.com/networking/network/communications/management/windows_nt/website/ +http://www.linux.com/networking/network/communications/management/windows_nt/?kw_offset=50 +http://www.epinions.com/cmd-review-593A-C9BAC2B-3987B6DC-prod1 +http://www.bande-dessinee.org/bd/bd02.nsf/InterDescenaristes!OpenView&Start=1&Count=50&Collapse=51 +http://www.business-partner.ch/static/fr/pourlesfirmes/lesgrandesentreprises/whateveryouwant/solutionsspecifiquesalabranche/transport/main.html +http://ads.carltononline.com/accipiter/adclick/site=purejamba/area=JAMBA.HOME_PAGE/AAMSZ=KSJAMBA//ACC_RANDOM=972959547161 +http://expert.cc.purdue.edu/~yoko/simpsons/front.html +http://dailynews.sina.com.cn/society/2000-06-14/97332.html +http://ftp.dti.ad.jp/pub/Linux/debian-jp/dists/potato/main/binary-all/editors/?M=A +http://www.babyheirlooms.com/catalog/htmlos.cat/041124.1.5608817466 +http://www9.hmv.co.uk:5555/do/session/1347791/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d100_sd0_pt0.html +http://www.jobvillage.com/channel/jobs/health_care/pharmaceutical/pharmacist/b.3231.g.1267.html +http://yp.gates96.com/11/24/80/12.html +http://yp.gates96.com/11/24/80/18.html +http://yp.gates96.com/11/24/80/84.html +http://yp.gates96.com/11/24/80/90.html +http://yp.gates96.com/11/24/81/6.html +http://yp.gates96.com/11/24/81/9.html +http://yp.gates96.com/11/24/81/54.html +http://yp.gates96.com/11/24/81/74.html +http://yp.gates96.com/11/24/81/98.html +http://yp.gates96.com/11/24/82/17.html +http://yp.gates96.com/11/24/82/96.html +http://yp.gates96.com/11/24/83/54.html +http://yp.gates96.com/11/24/83/58.html +http://yp.gates96.com/11/24/84/44.html +http://yp.gates96.com/11/24/84/52.html +http://yp.gates96.com/11/24/84/63.html +http://yp.gates96.com/11/24/85/35.html +http://yp.gates96.com/11/24/85/77.html +http://yp.gates96.com/11/24/85/78.html +http://yp.gates96.com/11/24/87/15.html +http://yp.gates96.com/11/24/87/77.html +http://yp.gates96.com/11/24/88/0.html +http://yp.gates96.com/11/24/88/63.html +http://yp.gates96.com/11/24/89/93.html +http://www.iabusnet.org:90/forums/aca-1/dispatch.exe/survey/listUnseen/fol/100001/20,0/2498053 +http://www.zeenzone.com/movies/1,4003,1040-21565,00.html +http://www.zeenzone.com/movies/1,4003,1040-99354,00.html +http://www.zeenzone.com/movies/1,4003,1040-109493,00.html +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/folderFrame/100001/0/author/627181 +http://moshkow.rsl.ru/alt/MORUA/letters.txt +http://members.tripod.co.jp/muttley2000/?M=A +http://www.shopworks.com/index.cfm/action/specials/userid/000A8C31-2EFD-19FE-9038010B0A0ADCF2 +http://www.bookhome.net/xiandangdai/other1/chunjiang/006.html +http://www.bookhome.net/xiandangdai/other1/chunjiang/013.html +http://www.dailyrush.dk/clans/145 +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/auto/0210/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/brandenburg/0011/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/lokales/0077/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/lokales/0009/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/lokales/0111/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/lokales/0117/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/lokales/0014/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/sport/0018/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/sport/0158/ +http://www.berlinonline.de/wissen/berliner_kurier/archiv/2000/0429/tv/0209/ +http://www.multicosm.com/facade/www.contigo.com/ +http://www.boston.digitalcity.com/cincinnati/health/conditions.dci?condition=sids +http://www.onlineathens.com/1998/041498/0414.a2zbriefs.html +http://ist.linux.tucows.com/conhtml/adnload/52224_1782.html +http://www.outpersonals.com/cgi-bin/w3com/pws/out/-2hIv4VApV7948YHO6tPdd62dgSdHSwg0xTrLhYidK4__IjhefvQTQrwpTMkkPdR5C5XRGbdA57_pJIxtMRvHJmrtjKdnzn_di6Er9p9vwIk1rLYwssqdvQbgeNAvSgd2M1a7O5NWleCth4ETxMfqPQS +http://www.outpersonals.com/cgi-bin/w3com/pws/out/VwhIXbmwUfG9PK362Tf07_xy8BQY7YBwNspFlCmPD_syQhuUcYEAU2eNoW3Liccn5fOj3JHbx2nCG9Tkl-PZwI9bR0uW5_3bO8O3kRwFm2Sp0E8MBNqJ9FvuLKt4pS_X3qzA8sbHcygn7lFrBe9ZZqi565Rs +http://www.crutchfield.com/cgi-bin/S-5ILchLS19Z9/auto.asp +http://www.quzhou.gov.cn/flfg.nsf/0a043ae26eb50247002564640039f21d/7cdda9dbc7e2b2bb002564ac00393b48!OpenDocument&ExpandSection=1,7,6 +http://opac.lib.ntnu.edu.tw/search*chi/m92+R627/m92+r627/-5,-1,0,B/buttonframe&F=m92+r449m&1,1 +http://www03.u-page.so-net.ne.jp/fc4/kazumasa/tdl/side2/side2.html +http://launchbase.com/Home/Personal_Organization/communication/information/Bank_Rates_&_Info.htm +http://launchbase.com/Home/Personal_Organization/communication/entertainment/Sports.htm +http://launchbase.com/Home/Personal_Organization/communication/shopping/Flowers.htm +http://launchbase.com/Home/Personal_Organization/communication/shopping/Pro-Audio.htm +http://www.nissan.co.jp/RENAULT-DEALERS/PASSPORT/view.cgi/admission/972959587-- +http://channel.nytimes.com/1998/10/15/technology/ +http://www.la.gunma-u.ac.jp/S97/thtml/m/kiso/41808.html +http://www1.ocn.ne.jp/~yaiba/_private/kobanasi/tyouhen/haraguroido/noroi.htm +http://www.duluxvalentine.com/FRANCE:1161209847:DFinity.1QJiP4jmPgipihoa +http://fi.egroups.com/messages/mediamalle-letter/6 +http://personal.wol.com.cn/lxz20a/gp13.htm +http://eclat.gaiax.com/www/eclat/y/k/yoko_mama/main.html +http://eclat.gaiax.com/www/eclat/y/k/yoko_mama/bbs.html +http://findmail.com/login.cgi?login_target=%2Fgroup%2Fohsama-iroiro +http://www.fogdog.com/cedroID/ssd3040183248487/crs/po__/wld/fogdog_sports/superfeet/outdoor/footwear/green_hi-profile.html +http://www.fogdog.com/cedroID/ssd3040183248487/nav/stores/baseball/ +http://www.fogdog.com/cedroID/ssd3040183248487/nav/stores/winter_sports/ +http://www.consource.com/members/signup/signup_temp_user.html?tAccountID=561 +http://213.36.119.69/do/session/152994/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/reserver/voit.htm +http://213.36.119.69/do/session/152994/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/BE_NL/ +http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdevelop/Attic/configure.in?r1=1.62&sortby=rev +http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdevelop/Attic/configure.in?annotate=1.53&sortby=rev +http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdevelop/Attic/configure.in?r1=1.46&sortby=rev +http://www.aelita.net/products/solutions/sitemap/Reg/QuoteRegister/solutions/products/default.htm +http://sunsite.org.uk/public/public/packages/pine/docs/?S=A +http://sunsite.org.uk/public/public/packages/pine/docs/QandA.txt +http://www.sfc.keio.ac.jp/~s98008na/miniproject/0.html +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959867760/Catalog/1000023 +http://www.msn.expedia.co.uk/wg/Africa/Mauritius/P39048.asp +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/asiasanahaku/rakennesuunnittelu/talonrakennus/rakennukset/ohjeet/ +http://www.ericsson.cl/education/centers/dtmexic.shtml +http://ftp.gigabell.net/debian/dists/Debian2.2r0/main/binary-powerpc/web/?S=A +http://dirs.educationamerica.net/Colorado/Localities/C/Colorado_Springs/News_and_Media/Television/ +http://polygraph.ircache.net:8181/services/define/jeff/http_-2web01.hq.cyberserv.com/ryanhomes/http_-2www.travelsc.com/cgi-bin/news/NewsList.cfm?ID=1 +http://salinas2000.com/index.cfm/r/960/a/95.htm +http://213.36.119.69/do/session/152988/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www3.travelprice.com/voyages/recherche.phtml +http://213.36.119.69/do/session/152988/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/connaitre/questions-reponses.htm +http://ftp.cpan.org/src/5.0/sperl-2000-08-05/?D=A +http://virtualpubliclibrary.com/hallofanima/moresports/JOELOUIS.ORG//hallofanima/music/ +http://x500.rz.uni-karlsruhe.de:8000/Lcn%3dMonika%20Vogel,%20ou%3dPersonalabteilung,%20ou%3dUniversitaetsleitung%20und%20-verwaltung,%20o%3dUniversitaet%20Konstanz,%20c%3dDE +http://bsd.sinica.edu.tw/cgi-bin/cvsweb.cgi/ports/korean/pine/files/patch-ai?only_with_tag=RELEASE_2_2_2 +http://ftp.ring.gr.jp/archives/XFree86/4.0.1/binaries/Linux-ix86-glibc21/RELNOTES +http://homepage1.nifty.com/SAKURAISANS/itoshi.html +http://www.expage.com/savetucker +http://ring.edogawa-u.ac.jp/archives/pack/os2/prog/rexx/?N=D +http://www.saarreisen.de/rueckel-reisen/fluege-buchen/barbados/reise-ibiza.htm +http://debian.linux.org.tw/debian/dists/sid/contrib/binary-powerpc/interpreters/?S=A +http://ricoh.co.jp/rtoss/School/other/other/lotus_syo/pg7.html +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus52213/eus52841/eus236353/eus591199/eus937052/ +http://www.mapion.co.jp/custom/AOL/admi/23/23101/higashiyamatori/4chome/index-17.html +http://stocks.tradingcharts.com/stocks/charts/swti-bb/w/javachart +http://ftp.univ-lyon1.fr/gnu/Manuals/diffutils-2.7/html_chapter/diff_15.html +http://www.elfoco.com/EL_Foco/CDA/PrintPage/1,2171,2_53_28444,00.html +http://www.debian.org.cn/Bugs/db/61/61000.html +http://www.debian.org.cn/Bugs/db/66/66591.html +http://www.debian.org.cn/Bugs/db/57/57112.html +http://www.gxrb.com.cn/26/tbzl.htm +http://opac.lib.rpi.edu/search/dyosemite+national+park+water+resources+development+research+california/-5,-1,0,E/2browse +http://ring.omp.ad.jp/pub/NetBSD/NetBSD-current/src/usr.sbin/dhcp/client/scripts/openbsd +http://attach1.egroups.com/attach/1087162/28/gs-108=71=1087162/10-1-10-160/application=octet-stream/IntOrganist.htm +http://www.brainerddispatch.com/stories/071299/obi_0712990015.shtml +http://webusers.siba.fi/doc/HOWTO/en-html/Multi-Disk-HOWTO-27.html +http://www.pressa.spb.ru/newspapers/nevrem/arts/nevrem-1667-art-30.html +http://www4.ocn.ne.jp/~l-tommy/C1024.html +http://pub13.ezboard.com/fsequelossavannasoftwaredevelopment.showMessage?topicID=74.topic +http://pub13.ezboard.com/fsequelossavannasoftwaredevelopment.showMessage?topicID=109.topic +http://www.z-plus.de/freizeit/kino/galerie/unhold/kritikdpa.html +http://www.tiscover.com/1Root/Kontinent/6/Staat/7/Bundesland/16/Ort/515/Privatvermieter/326225/Homepage/m_homepage...2.html +http://wap.jamba.de/KNet/_KNet-NKE8j1-2Gd-13c6l/showInfo-wir.de/node.0/cde7f1uou +http://www.refdag.nl/kl/990706kl02.html +http://www.ferien-immobilien.de/nordrhein-Westfalen/soest/Verkauf/Versteigerungen-IB/Startseite/Gemeinsam/versicherungen/gebaeude/Versteigerungen-IB/Startseite/Gemeinsam/Super-Zins-Konditionen/anforderungsformular.htm +http://caller-times.com/1999/september/18/today/local_sp/78.html +http://link.fastpartner.com/do/session/600350/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/mondosoft.php +http://providenet.tukids.tucows.com/mac/9-12/adnload/11899_25711.html +http://providenet.tukids.tucows.com/mac/9-12/adnload/51475_24795.html +http://fivestar.subportal.com/sn/Network_and_Internet/Dial-up_Networking_Dialers/11735.html +http://www.kenley.londonengland.co.uk/newspaperandmagazinepublishers.htm +http://builder.hw.net/frmRestDir/0,1112,'1~21~325~1~C~013800~07790',00.html +http://builder.hw.net/frmRestDir/0,1112,'1~21~325~1~C~013800~54357',00.html +http://ftp1.support.compaq.com/public/vms/vax/v6.0/sls/2.6/?M=A +http://cpan.clix.pt/authors/id/I/IL/ILYAM/Mail-CheckUser-0.15.readme +http://www.maasvlakte-cam.nl/webcams/23/stavanger__norway/2000/10/12/?D=A +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/music/midi/computers/quizz/lit/arnheim.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/music/midi/computers/quizz/misc/colorart/ +http://www.taftp.com/A555D3/WebDir.nsf/MBC!OpenView&Start=89.2&Count=30&Expand=106 +http://jundavid.subportal.com/sn/Shell_and_Desktop/Animal_Cursors/11879.html +http://www.netitor.com/photos/schools/ucla/sports/m-wpolo/98-99action/?M=A +http://cpan.nitco.com/modules/by-module/Devel/MSCHWERN/Class-DBI-0.03.readme +http://cpan.nitco.com/modules/by-module/Devel/MSCHWERN/Text-Metaphone-0.02.readme +http://www.digitaldrucke.de/(aktuell,computer,gaestebuch,kino,literatur,nuernberg,rundfunk,sense,veranstaltungen,zeitschriften)/_fort/html/themen/kultur/literat/links/bin.htm +http://194.128.65.4/pa/cm199899/cmhansrd/vo990727/text/90727w01.htm +http://194.128.65.4/pa/cm199899/cmhansrd/vo990727/text/90727w15.htm +http://213.36.119.69/do/session/152989/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/jeux/jeux_himalaya.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/misc/quizz/lit/misc/cv.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/misc/quizz/lit/misc/lit/larme.html +http://www.hblb.org.uk/hblbweb.nsf/$Pages/NewsArchive1!OpenDocument&ExpandSection=6,7,3,5,1,8,11 +http://www.identer.co.kr/삶ì˜ì—¬ìœ /ë°ì´íŠ¸ì •ë³´/ë°ì´íŠ¸ì •ë³´/ +http://allmacintosh.arrakis.es/adnload/54801.html +http://link.fastpartner.com/do/session/600380/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/brleksaker.php +http://link.fastpartner.com/do/session/600380/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/local/redirect.php +http://icm.html.tucows.com/adnload/001-009-003-014.html +http://www.rakuten.co.jp/coffee/forum/forum-w.cgi?p=131&url=coffee +http://jxi.gov.cn/yw-cj001.nsf/6770fc9e7685796c482568c70008a30a!OpenView&Start=69&Count=30&Expand=70 +http://jxi.gov.cn/yw-cj001.nsf/6770fc9e7685796c482568c70008a30a!OpenView&Start=69&Count=30&Expand=72 +http://freehomepage.taconet.com.tw/This/is/taconet/top_hosts//tsyang/test9g.htm +http://www11.cplaza.ne.jp/babyweb/bbs/bdnm01/no33/130N.html +http://library.cuhk.edu.hk/search*chi/a憪���/a{213972}{213230}/-5,-1,0,B/frameset&F=a{213972}{213233}{215b34}&1,1 +http://library.cuhk.edu.hk/search*chi/a憪���/a{213972}{213230}/-5,-1,0,B/frameset&F=a{213972}{21323e}{213165}+1947&1,1 +http://library.cuhk.edu.hk/search*chi/a撱嗅ˊ,+904-975./a{213d32}{213877}++904++975/-5,-1,0,B/frameset&F=a{213d32}{213a67}{213779}{213455}+china+{215f7a}{213579}{213966}{21363e}{21435a}+{214241}{213c37}&1,1 +http://www.online.kokusai.co.jp/Service/V0043539/wrd/G200/service/service.html +http://quote.morningstar.com/Quote.html?ticker=GASFX +http://uoi.linux.tucows.com/x11html/adnload/9826_7194.html +http://dk.egroups.com/post/batoco?act=forward&messageNum=2017 +http://www.chaos.dk/sexriddle/b/h/l/o/h/ +http://www.picktips.com/category-1031-1174_1171_1170-4_3_2 +http://www.schmunzelecke.de/pic18.htm +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chhand20.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chhand25.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chhand30.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chimag16.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chimag26.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chlight3.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chspec34.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chspec35.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chview15.html +http://sun1.rrzn-user.uni-hannover.de/zzzzgart/matlab/help/techdoc/umg/chvolvi5.html +http://www.t-onlien.de/dtag/mail/kontaktseite/1,3606,160,00.html +http://yumemi.ne.jp/bbs/hiroba/ky/view/h/hiroba3/8_wdsmcn_wdsmcn.html +http://yumemi.ne.jp/bbs/hiroba/ky/view/h/hiroba3/8_mrlinl_tcincn.html +http://yumemi.ne.jp/bbs/hiroba/ky/view/h/hiroba3/8_caouny_hixlcy.html +http://students.lsu.edu/students/main.nsf/c81d2bf8cb0b80ff862566fb00105ab2/7f3436ae9cb1268886256773006f9288!OpenDocument&ExpandSection=20,9,13,16 +http://www.crn.com/sections/BreakingNews/breakingnews.asp?ArticleID=5760 +http://dennou-h.ees.hokudai.ac.jp/library/Linux/debian-jp/dists/hamm/main-jp/binary-all/tex/?M=A +http://www.cmyk21.com/photo1-3.htm +http://www.cs.ruu.nl/mirror/CPAN/modules/by-category/14_Security_and_Encryption/User/ILYAZ/images/?N=D +http://www.egroups.com/login.cgi?login_target=%2Fmessage%2FFloodsystems%2F45 +http://www.mirnet.org/ccsi/nisorgs/ukraine/kyiv/renaisnc.htm +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=231&discrim=2,125,10 +http://ring.omp.ad.jp/archives/lang/perl/CPAN/authors/id/BRADAPP/PodParser-1.17.readme +http://www.amzn.com.ref.digital-price.com/redir/amzn.com/prods/0553373730 +http://library.cwu.edu/search/dGermany+--+Politics+and+government+--+1918-1933/dgermany+politics+and+government+1918+1933/-5,-1,0,B/marc&F=dgermany+politics+and+government+1918+1933+bibliography&1,1, +http://www.multicosm.com/facade/www.unisys.com/partners/default.asp?cn=su +http://enjoy100.com.cn/200006/08/sssh/sssh_ssjp.html +http://enjoy100.com.cn/200006/08/yskj/b_s_big3_f.jpg.html +http://www.hoops.ne.jp/~zuikaku/photo2000/0811/rie11.html +http://pub23.ezboard.com/fiolaniy2kmessageboardfrm1.showMessage?topicID=66.topic +http://ring.htcn.ne.jp/archives/lang/perl/CPAN/modules/by-module/CGI/ULPFR/Wais-2.301.readme +http://www3.newstimes.com/archive99/mar1199/spg.htm +http://ftp1.support.compaq.com/public/vms/axp/v6.2-1h2/dsnlink/2.2/dsnlinkd022.CVRLET_TXT +http://ftp.nacamar.de/pub/redhat/cpan/6.2/CPAN-archive/doc/manual/html/pod/perldsc.html +http://ftp.nacamar.de/pub/redhat/cpan/6.2/CPAN-archive/doc/manual/html/pod/perlfaq5.html +http://info.cs.unitn.it/sdb/de/html/keylist.SOFTWARE.html +http://www.online.kokusai.co.jp/Mmf_corner/V0043545/mmf_corner/mmf_corner/url +http://www.office.com/global/0,2724,66-15915,FF.html +http://polygraph.ircache.net:8181/home/ISO9001.htm +http://www.allgemeine-immobilien-boerse.de/niedersachsen/emsland/Verkauf/Versteigerungen-IB/Startseite/Allgemeine-IB/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/Gemeinsam/hilfe.htm +http://launchbase.com/Health/Home_Health/communication/information/Science.htm +http://library.cwu.edu/search/aLockyer,+Norman,+Sir,+1836-1920/alockyer+norman+sir+1836+1920/-17,-1,0,B/frameset&F=alockwood+victoria+s+1953&1,1 +http://bbs.kcm.co.kr/NetBBS/Bbs.dll/chbod05/lst/qqa/r/qqo/004D/zka/B2-kCYFl +http://www.egroups.com/post/bhagavad_gita?act=forward&messageNum=101 +http://carriage.de/Schoner/Literatur/info-e/Geschichte/modelle/ +http://carriage.de/Schoner/Literatur/info-e/Geschichte/history/ +http://carriage.de/Schoner/Literatur/info-e/Geschichte/literature/ +http://wwwftp.ciril.fr/pub/linux/kernel///people/andrea/kernels +http://www.inctechnology.com/guide/item/0,7462,AGD6_GDE79,00.html +http://live.sportsline.com/u/basketball/college/teams/injuries/VATECH.htm +http://www-1.cisco.com/univercd/cc/td/doc/product/lan/28201900/1928v67x/28icg67x/28icpref.pdf +http://www.hitlist.com/music/presult/003948.php3 +http://ip.tosp.co.jp/Eki/TosiE000.asp?I=Jerryfish +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=(20,0)-16,0-9,2 +http://www.bigchurch.com/cgi-bin/w3com/pws/bc/RLhIotYxW-B0bt7seq4d876RzKIuJDYbydJP1qooxhzSKDVca77BUHQv6tsO2JdNpkx837SBl7FHRIEy00rmcLBk9Y1kQEmni0_YSk5mrym8WALtovIPQU_vlEtiMcNswNyh9z6CjU-2oS2uurrk666t +http://www.secinfo.com/d2wVq.7hv.htm +http://www.secinfo.com/d2wVq.6yd.htm +http://www.secinfo.com/d2wVq.6Y5.htm +http://www.secinfo.com/d2wVq.5gf.htm +http://www.secinfo.com/d2wVq.5hp.htm +http://www.secinfo.com/d2wVq.5y4.htm +http://ring.htcn.ne.jp/pub/text/CTAN/graphics/psfig/unsupported/macdemo/macfigs/?N=D +http://ring.htcn.ne.jp/pub/text/CTAN/graphics/psfig/unsupported/macdemo/macfigs/?M=A +http://books.hyperlink.co.uk/xt2/Drakelow_Unearthed/Stokes/Paul/0904015408 +http://www.homestead.com/rebeccah/files/ +http://sunsite.compapp.dcu.ie/pub/linux/redhat/redhat-6.1/alpha/usr/share/locale/ga_IE/LC_TIME +http://www.gbnf.com/genealogy/rockwel4/html/d0037/I2684.HTM +http://www.yorosiku.net:8080/-_-http://www.dd.iij4u.or.jp/~oni9/skebe/aindex18.html +http://www.yorosiku.net:8080/-_-http://www.dd.iij4u.or.jp/~oni9/skebe/aindex12.html +http://www.yorosiku.net:8080/-_-http://www.dd.iij4u.or.jp/~oni9/skebe/atg05.html +http://shn.webmd.net/content/article/1700.50808 +http://home.clara.net/cornell/woodcraft/spring2000/contents.htm +http://dic.empas.com/show.tsp/EDACITY +http://www.sanxia.net/beauty/Eriimai/417.htm +http://www.judds-resort.com/judds/Lake-Winni-pike-lodge/97menu/fallphoto/playground/boat/photo/12.html +http://www.judds-resort.com/judds/Lake-Winni-pike-lodge/97menu/fallphoto/playground/boat/fallphoto/2.html +http://imageserver2.tibetart.com:8087/fif=fpxbuddhistreverse/56.fpx&init=0.0,0.0,1.0,1.0&rect=0.0,0.25,0.5,0.75&wid=1443&hei=400&lng=en_US&enablePastMaxZoom=OFF&page=image.html&obj=uv,1.0&cmd=W +http://www.jamba.nl/KNet/_KNet-krE8j1-KC4-pv5y/showInfo-hilfe.nl/node.0/ce6u2jadf +http://www.babyheirlooms.com/catalog/htmlos.cat/011639.1.3372173854 +http://community.webshots.com/photo/441160/441363 +http://www.kaos.dk/sexriddle/x/n/d/x/b/ +http://isbn.nu/088730866X/chapters +http://login.hq.cricinfo.org/link_to_database/ARCHIVE/1992-93/AUS_LOCAL/MMC/WA_NSW_MMC_11OCT1992.html +http://login.hq.cricinfo.org/link_to_database/ARCHIVE/1991-92/AUS_LOCAL/FAI/WA_TAS_FAI_11OCT1991.html +http://login.hq.cricinfo.org/link_to_database/ARCHIVE/1991-92/AUS_LOCAL/FAI/WA_QLD_FAI-SEMI_19OCT1991.html +http://login.hq.cricinfo.org/link_to_database/ARCHIVE/1980S/1987-88/AUS_LOCAL/MDC/WA_SOA_MDC_06MAR1988.html +http://login.hq.cricinfo.org/link_to_database/ARCHIVE/1980S/1981-82/AUS_LOCAL/MDC/QLD_WA_MDC_08NOV1981.html +http://www.chaos.dk/sexriddle/x/k/l/y/h/ +http://tucows.teihal.gr/winnt/preview/6004.html +http://tucows.teihal.gr/winnt/preview/5986.html +http://tucows.teihal.gr/winnt/preview/71328.html +http://tucows.teihal.gr/winnt/preview/2757.html +http://www.medoc-ias.u-psud.fr:81/synoptic/gif/950724/?N=D +http://www4.nas.edu/ohr.nsf/All+Documents/Major+Units?OpenDocument&ExpandSection=18,7,21,20,4 +http://members.xoom.fr/logart/Anciens/Liste25/Selection_Navlist25.html +http://polygraph.ircache.net:8181/http_-2www.arthritis.org/http_-2pathfinder.com/si/swimsuit/swim97/terms2.html +http://polygraph.ircache.net:8181/http_-2www.arthritis.org/http_-2pathfinder.com/si/swimsuit/swim97/products2.html +http://debian.linux.org.tw/debian/dists/Debian2.2r0/main/disks-m68k/current/doc/ +http://findmail.com/dir/Arts/Writing/Fan_Fiction?st=1943 +http://www.telecombroker.com/q/001p/tgcb/4izQYz7mc.htm +http://www.free-phone.com/q/001p/tgcb/ItMd2D3jdEM.htm +http://www.123bestlongdistance.com/q/001p/tgcb/msN54jfl4mE.htm +http://www.netitor.com/photos/schools/nw/sport/w-baskbl/97action/?S=A +http://excite.de/katalog/katalog/33823 +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/programs/simple/music/midi/lit/misc/unitest/programs/ +http://yp.gates96.com/14/43/40/9.html +http://yp.gates96.com/14/43/40/43.html +http://yp.gates96.com/14/43/40/82.html +http://yp.gates96.com/14/43/40/85.html +http://yp.gates96.com/14/43/41/6.html +http://yp.gates96.com/14/43/41/18.html +http://yp.gates96.com/14/43/41/44.html +http://yp.gates96.com/14/43/41/96.html +http://yp.gates96.com/14/43/42/12.html +http://yp.gates96.com/14/43/46/38.html +http://yp.gates96.com/14/43/46/66.html +http://yp.gates96.com/14/43/46/68.html +http://yp.gates96.com/14/43/47/4.html +http://yp.gates96.com/14/43/47/37.html +http://yp.gates96.com/14/43/47/64.html +http://yp.gates96.com/14/43/47/68.html +http://yp.gates96.com/14/43/47/70.html +http://yp.gates96.com/14/43/48/68.html +http://yp.gates96.com/14/43/48/69.html +http://yp.gates96.com/14/43/49/7.html +http://yp.gates96.com/14/43/49/36.html +http://yp.gates96.com/14/43/49/37.html +http://yp.gates96.com/14/43/49/52.html +http://sound-dist.secured.co.uk/cgi-bin/psProdDet.cgi/5P005|972959562|Accessories|user|0|1,0,0,1 +http://school.educities.org/card/judy180.html +http://207.138.41.133/message/the-voice1/123 +http://207.138.41.133/message/the-voice1/124 +http://www-d0.fnal.gov/d0dist/dist/releases/p05.00.00/muo_analyze/?S=A +http://sjsulib1.sjsu.edu:81/search/cernest+haberkern+director/-5,-1,0,B/frameset&cgeorge+miller+director&1,1 +http://ring.nii.ac.jp/pub/pack/x68/net/00_index.txt +http://pub24.ezboard.com/fdoyoustillneedtoventfrm43.showMessage?topicID=19.topic +http://pub24.ezboard.com/fdoyoustillneedtoventfrm43.showMessage?topicID=15.topic +http://ukinvest.ukwire.com/articles/200007200700261473O.html +http://www.brd.net/brd-cgi/brd_multimedia/lautsprecher/LZ7460LK/ci=972822952.htm +http://my.netian.com/~haeng14/tatler_july6.htm +http://genforum.genealogy.com/cgi-genforum/forums/anderton.cgi?122 +http://www.excelsior.com.mx/0001/000125/for03.html +http://www.jobvillage.com/channel/jobs/sciences/b.9070.g.1675.html +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/www/contact.html?annotate=1.19&sortby=author +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/www/contact.html?r1=1.12&sortby=author +http://www.doc.ic.ac.uk/lab/labsrc_area/firstyear/submissions/1998-99/jmc1/labs/Ex06/skw98/?N=D +http://www.jamba.de/KNet/_KNet-fNw8j1-6Fd-13acp/browse.de/node.0/cde7f1uou +http://www.jamba.de/KNet/_KNet-fNw8j1-6Fd-13act/browse.de/node.0/cdel3j591 +http://www.nedstat.nl/cgi-bin/viewstat?name=mrbertmat +http://no.egroups.com/message/acessibilidade/1092 +http://no.egroups.com/message/acessibilidade/1099 +http://sound-dist.secured.co.uk/cgi-bin/psShop.cgi/add|38P08A|972959552|Communications|user|0|1,0,0,1 +http://213.36.119.69/do/session/152990/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/reserver/spectacles/ +http://213.36.119.69/do/session/152990/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/CA_EN/ +http://wiki2.parsimony.net/wiki2954/ +http://www.f2.parsimony.net/forum2954/messages/214.htm +http://www.f2.parsimony.net/forum2954/messages/181.htm +http://www.f2.parsimony.net/forum2954/messages/292.htm +http://www.f2.parsimony.net/forum2954/messages/115.htm +http://www.f2.parsimony.net/forum2954/messages/290.htm +http://www.f2.parsimony.net/forum2954/messages/54.htm +http://home.pchome.com.tw/cool/162203/wunew15.htm +http://hem.fyristorg.com/lottaleman/LLfar/1_6721.htm +http://www.babyheirlooms.com/catalog/htmlos.cat/011628.1.4596216338 +http://www.affiliate.hpstore.hp.co.uk/do/session/380833/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/search.asp +http://www.outdoorwire.com/content/lists/dirt/200007/msg00127.html?{LoadingFrameset} +http://adept.subportal.com/sn/Programming/ActiveX/11674.html +http://www.staroriental.net/nav/soeg/ihf,aog,s0,10,Lam+Hei-Lui.html +http://www-d0.fnal.gov/d0dist/dist/releases/p05.00.01/man/?N=D +http://members.tripod.com/bluti/PSX/V/VACUUM.HTM +http://connexus.tucows.com/winme/adnload/138384_29728.html +http://wwwtios.cs.utwente.nl/archive/wilyfans/msg00265.html +http://custom.clubnet.zeelandnet.nl/eckhardt/myself.htm +http://ftp.tokyonet.ad.jp/pub/Linux/debian/dists/potato/contrib/binary-arm/otherosfs/?D=A +http://www.amcity.com/charlotte/stories/1997/07/07/daily4.html?t=email_story +http://www.generation-formation.fr/chiffrec.htm---o21zAo0UbDo0Ol9A074fo6Td4ezyr6feZJPAPfVbNyqHSezTHkekydMfeZJPdspt6dsSAtdsNhJdspt6dsrvrdjlhkfbi.htm +http://tv.thevines.com/leaf/AA0000369140/2 +http://kuyper.calvin.edu/fathers2/NPNF2-02/Npnf2-02-06.htm +http://www.intellicast.com/Ski/World/UnitedStates/Southeast/Florida/FortWaltonBeach/TEMPcast/d0_12/ +http://stevebarnes.studiostore.com/aboutus/b.EMERCH/s.P01EBK2I +http://student.monterey.edu/Students_N-R/richterheidil/private/ +http://ds.dial.pipex.com/town/drive/kch36/select/s30/ch052.html +http://ds.dial.pipex.com/town/drive/kch36/select/s30/ch027.html +http://ds.dial.pipex.com/town/drive/kch36/select/s30/ch077.html +http://ds.dial.pipex.com/town/drive/kch36/select/s30/ch092.html +http://soneraplaza.tucows.com/winme/adnload/137026_28536.html +http://www.egroups.com/post/realtyindia +http://www.kita.or.kr/untpdc/incubator/zwe/tphar/ZIMB0037.htm +http://citeseer.nj.nec.com/nrelated/126165/187254 +http://citeseer.nj.nec.com/cachedpage/187254/1 +http://citeseer.nj.nec.com/cidcontext/2417551 +http://yp.gates96.com/13/6/1/36.html +http://yp.gates96.com/13/6/1/61.html +http://yp.gates96.com/13/6/1/83.html +http://yp.gates96.com/13/6/1/91.html +http://yp.gates96.com/13/6/3/39.html +http://yp.gates96.com/13/6/3/45.html +http://yp.gates96.com/13/6/3/65.html +http://yp.gates96.com/13/6/4/46.html +http://yp.gates96.com/13/6/4/57.html +http://yp.gates96.com/13/6/5/44.html +http://yp.gates96.com/13/6/6/21.html +http://yp.gates96.com/13/6/6/42.html +http://yp.gates96.com/13/6/7/0.html +http://yp.gates96.com/13/6/7/30.html +http://yp.gates96.com/13/6/7/69.html +http://yp.gates96.com/13/6/7/82.html +http://yp.gates96.com/13/6/8/5.html +http://yp.gates96.com/13/6/8/98.html +http://yp.gates96.com/13/6/9/45.html +http://home.wanadoo.nl/hockeyclub.nieuwegein/Teams/Dames/Dames_IV/body_dames_iv.html +http://pub3.ezboard.com/fthe4thdimensiongeneralinsanity.subscribeUnregisteredToTopic?topicID=38.topic +http://pub3.ezboard.com/fthe4thdimensiongeneralinsanity.unsubscribeUnregisteredToTopic?topicID=38.topic +http://moviestore.zap2it.com/help_shipping/s.hXCLyc56 +http://www.geocities.co.jp/Outdoors/2363/typoon1.html +http://ua.php.net/manual/it/function.pg-numrows.php +http://kidneyfailure.shn.net/roundtable_reply/727640 +http://itcareers.careercast.com/texis/it/itjs/+HwwBmje0B-deZqwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewyPxGwproqamn5otDnGaoDm15BGowcamn5otDapGdm1qBamnVncdpa5dhBiwGna5BGwBnton5ah1DqBodDanD51GnaMFqnFZI0DzmzwwwpBmje0B-deZqwww5rmeZpwwwBrmeZpwww/morelike.html +http://itcareers.careercast.com/texis/it/itjs/+lwwBmex6D86egqwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewyPxGwproqamn5otDnGaoDm15BGowcamn5otDapGdm1qBamnVncdpa5dhBiwGna5BGwBnton5ah1DqBodDanD51GnaMFqnFZI0DzmzwwwpBmje0B-deZqwww5rmeacwwwBrmeZpwww/morelike.html +http://pub23.ezboard.com/fhardoverclockfrm1.showAddReplyScreenFromWeb?topicID=43.topic&index=3 +http://www.adquest3d.com/content.cfm?BRD=1578&PAG=63 +http://pelit.saunalahti.fi/.1/tucows/adnload/51_28438.html +http://pelit.saunalahti.fi/.1/tucows/preview/70307.html +http://www.maillist.com.tw/maillist/publicboard_newform.pl?maillist_id=softuse +http://dennou-t.ms.u-tokyo.ac.jp/arch/cc-env/Linux/debian-jp/dists/woody/non-free-jp/binary-alpha/news/?M=A +http://ustlib.ust.hk/search*chi/amarcot+bruce+g/amarcot+bruce+g/-5,-1,0,B/frameset&F=amarcotty+michael+1931&1,1 +http://wine.cc.chuo-u.ac.jp/home/pub/TeX/CTAN/support/rtf2tex/?M=A +http://netchief.tucows.com/winme/preview/75911.html +http://yp.gates96.com/4/57/60/83.html +http://yp.gates96.com/4/57/60/99.html +http://yp.gates96.com/4/57/62/17.html +http://yp.gates96.com/4/57/62/88.html +http://yp.gates96.com/4/57/63/9.html +http://yp.gates96.com/4/57/63/39.html +http://yp.gates96.com/4/57/63/64.html +http://yp.gates96.com/4/57/64/33.html +http://yp.gates96.com/4/57/65/41.html +http://yp.gates96.com/4/57/65/70.html +http://yp.gates96.com/4/57/66/18.html +http://yp.gates96.com/4/57/66/56.html +http://yp.gates96.com/4/57/66/61.html +http://yp.gates96.com/4/57/66/94.html +http://yp.gates96.com/4/57/67/0.html +http://yp.gates96.com/4/57/67/63.html +http://yp.gates96.com/4/57/67/85.html +http://yp.gates96.com/4/57/69/1.html +http://yp.gates96.com/4/57/69/56.html +http://citeseer.nj.nec.com/cs?q=dbnum%3D1,DID%3D9262,qtype%3Dsamesite: +http://citeseer.nj.nec.com/cidcontext/163444 +http://www.amazon.com.au/exec/obidos/change-style/tg/stores/detail/-/books/0873995562/e-mail-friend/ +http://www.sdinfonet.com.cn/411/24/411249999.htm +http://pub14.ezboard.com/fallpodsgotoroswellsayhello.threadControl?topicID=17.topic +http://in.egroups.com/message/sexualidades-noticias/14 +http://in.egroups.com/message/sexualidades-noticias/37 +http://library.cuhk.edu.hk/search*chi/dChinese+literature+--+20th+century+--+Periodicals/dchinese+literature+++20th+century+periodicals/-5,-1,0,B/frameset&F=dchinese+literature+++20th+century+periodicals&26,,188 +http://www.3w-zeitschriften.de/EyreLinda/EyreLinda1582380570.htm +http://cometweb01.comet.co.uk/do!session=132027&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkjHfZoLlplLcqkKZljLlfb5lal5tkiLlXaLl0 +http://retailer.gocollect.com/do/session/1912774/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/contact.asp +http://providenet.games.tucows.com/adnload/71993_40744.html +http://www.geocities.co.jp/playtown-Toys/6366/bbsp.html +http://www.hnby.com.cn/docroot/jzrb/200001/19/km01/19031711.htm +http://213.36.119.69/do/session/152997/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/IT_IT/ +http://www.jamba.de/KNet/_KNet-p7t8j1-FEd-139gj/showInfo-datenschutz.de/node.0/cde7f1uou +http://www.jamba.de/KNet/_KNet-p7t8j1-FEd-139gn/browse.de/node.0/cdzqggtyb +http://www.paidmania.com/getpaid/signup/42/2518 +http://www.pressa.spb.ru/newspapers/nevrem/arts/nevrem-1679-art-13.html +http://jproxy.uol.es/jproxy/http://jama.ama-assn.org/issues/current/related/joc00479.html +http://www.mirror.kiev.ua:8082/paper/2000/11/1251/text/11-08-2.htm +http://my.netian.com/~eco71/wzmain.html +http://www.craft-supplies.co.uk/cgi-bin/psProdDet.cgi/HT206|972959540|Deluxe_Dividers|user|0|0,0,1,1 +http://www.trax.nilex.co.uk/trax.cgi/A1S/1AR/A3R/B3D/A4R/A4S/ +http://www.linux.com/networking/network/network/development/project/growth/ +http://www.linux.com/networking/network/development/project/growth/sales/ +http://www.icopyright.com/1.1653.134616 +http://retailer.gocollect.com/do/session/1912718/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/about.asp +http://www.dw-tv.de/indonesia/sari_pers/19793.html +http://freethemes.netc.pt/skins/icq/preview/44470.html +http://freethemes.netc.pt/skins/icq/adnload/26145.html +http://freethemes.netc.pt/skins/icq/preview/52524.html +http://freethemes.netc.pt/skins/icq/adnload/52040.html +http://students.lsu.edu/students/main.nsf/c81d2bf8cb0b80ff862566fb00105ab2/7f3436ae9cb1268886256773006f9288!OpenDocument&ExpandSection=7,18,9,16 +http://golfonline.comfluent.net/cgi.pan$player&pga93&John_Morse&pga?golfstats +http://wai.camera.it/_presidenti/003.htm +http://www.pcmagazine.de/produkte/artikel/komp/200003/mainboards01_00-wc.html +http://www.pcmagazine.de/produkte/artikel/komp/199908/asus_00-wc.html +http://se.sslug.dk/emailarkiv/locale/2000_09/msg00053.html +http://se.sslug.dk/emailarkiv/locale/2000_09/msg00057.html +http://se.sslug.dk/emailarkiv/locale/2000_09/msg00115.html +http://www.brio.de/BRIO.catalog/39fe2f7406fad828273fd472aa7806ff/UserTemplate/8 +http://link.fastpartner.com/do/session/600389/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/jobpilot.php +http://www.shopworks.com/grizzlygulch/index.cfm/action/search/userid/000B40E3-1177-19FE-A703010D0A0A8CF2 +http://www.shopworks.com/grizzlygulch/index.cfm/action/product/prodid/0001AF94-3FC3-19E7-A703010D0A0A8CF2/userid/000B40E3-1177-19FE-A703010D0A0A8CF2 +http://spiritwolf52.subportal.com/sn/Web_Authoring/Misc__Programming_Tools/2670.html +http://www.chaos.dk/sexriddle/o/g/j/h/t/ +http://link.fastpartner.com/do/session/600394/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/learn/ +http://opac.lib.rpi.edu/search/dpolitical+corruption+united+states/-5,-1,0,B/frameset&dpolitical+corruption+united+states&7,,22 +http://cnnsi.com/baseball/mlb/news/2000/01/28/ +http://amrr.com/agents/contact.html?Agents_id=3707 +http://www.dulux.co.uk/UKRETAIL:1489107816:DFinity.1QJiP4jMomdkbEc +http://www.geocities.com/SiliconValley/Screen/9059/ +http://www.nrk.no/finnmark/x17_4_96/nyh4.htm +http://in.egroups.com/message/islaam/288 +http://www.incestpornstories.com/knocked-upepisiotomy/fertileoff-the-rag/one-night-standlubrication/japaneseslanted-eyes/{storieslink} +http://kuyper.calvin.edu/fathers2/ANF-04/anf04-30.htm +http://wuarchive.wustl.edu/systems/unix/NetBSD/NetBSD-release/src/sys/arch/sun3/stand/bootxx/ +http://polygraph.ircache.net:8181/services/define/noframes/http_-2www.microsoft.com/ie/download/http_-2www.microsoft.com/infoserv/about.html +http://pub23.ezboard.com/fferion80369frm4.showMessage?topicID=192.topic +http://pub23.ezboard.com/fferion80369frm4.showMessage?topicID=182.topic +http://www.cs.ruu.nl/mirror/CPAN/authors/id/N/NO/?S=A +http://yp.gates96.com/1/40/30/16.html +http://yp.gates96.com/1/40/30/72.html +http://yp.gates96.com/1/40/30/99.html +http://yp.gates96.com/1/40/31/25.html +http://yp.gates96.com/1/40/31/42.html +http://yp.gates96.com/1/40/31/54.html +http://yp.gates96.com/1/40/31/61.html +http://yp.gates96.com/1/40/31/95.html +http://yp.gates96.com/1/40/32/39.html +http://yp.gates96.com/1/40/32/88.html +http://yp.gates96.com/1/40/32/92.html +http://yp.gates96.com/1/40/33/33.html +http://yp.gates96.com/1/40/34/24.html +http://yp.gates96.com/1/40/34/51.html +http://yp.gates96.com/1/40/34/62.html +http://yp.gates96.com/1/40/34/72.html +http://yp.gates96.com/1/40/35/38.html +http://yp.gates96.com/1/40/36/80.html +http://yp.gates96.com/1/40/36/98.html +http://yp.gates96.com/1/40/37/35.html +http://yp.gates96.com/1/40/37/89.html +http://yp.gates96.com/1/40/38/13.html +http://yp.gates96.com/1/40/38/67.html +http://yp.gates96.com/1/40/39/8.html +http://yp.gates96.com/1/40/39/11.html +http://yp.gates96.com/1/40/39/42.html +http://netway.pda.tucows.com/palm/preview/33466.html +http://netway.pda.tucows.com/palm/preview/70276.html +http://netway.pda.tucows.com/palm/adnload/76963_22012.html +http://netway.pda.tucows.com/palm/preview/33676.html +http://www.private-immobilien-boerse.de/berlin-immobilien/verkauf/Private-IB/Startseite/Gemeinsam/versicherungen/gebaeude/Gemeinsam/Immolink/Gemeinsam/Super-Zins-Konditionen/anforderungsformular.htm +http://www.ne.jp/asahi/matinami/gallery/mati/hokkaido/hakodate/ph_l011.html +http://www.findarticles.com/cf_0/m0EKF/14_46/61415465/p1/article.jhtml +http://www.trax.nilex.co.uk/trax.cgi/A1C/A2S/B1S/B1L/B4S/A1S/ +http://students.lsu.edu/students/main.nsf/c81d2bf8cb0b80ff862566fb00105ab2/7f3436ae9cb1268886256773006f9288!OpenDocument&ExpandSection=1,21,16,5 +http://students.lsu.edu/students/main.nsf/c81d2bf8cb0b80ff862566fb00105ab2/7f3436ae9cb1268886256773006f9288!OpenDocument&ExpandSection=18,21,16,5 +http://ddb.libnet.kulib.kyoto-u.ac.jp/exhibit/fl3/image/fl3lhf/fl3lh0344.html +http://www.trnonline.com/archives/2000archives/04072000/sports/26732.shtml +http://www.linux.com/networking/network/new/press_release/management/editor/ +http://www.linux.com/networking/network/new/press_release/management/experiences/ +http://jundavid.subportal.com/sn/Business/Misc__Phone_Tools/index3.html +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=27,9,23,14,19 +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/music/misc/thoughts/lit/music/midi/mirroring.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/music/misc/thoughts/lit/music/midi/legendes/ +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/music/misc/thoughts/lit/music/midi/lit/laurent.txt +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/music/misc/thoughts/lit/music/midi/misc/colorart/ +http://www.lz.gs.cninfo.net/news/shenghuo/messages/361.html +http://www.egroups.com/messages/skarmflyg/683 +http://www.egroups.com/message/skarmflyg/675 +http://www.egroups.com/message/skarmflyg/681 +http://www.genoma.de/shop/0d79e8c12cc42ea8242eafc8a0c5586a/99/b +http://travelocity-dest.excite.com/Vacations/Reviews/Cruise/Submit/1,2586,0_228__,00.html +http://www02.geocities.co.jp/HeartLand-Sakura/1068/history.html +http://www.streetprices.com/Electronics/Computer_Software_PC/Programming/MAKE+DIGITAL/sortproductbyhighprice/SP275945.html +http://www.streetprices.com/Electronics/Computer_Software_PC/Programming/MAKE+DIGITAL/sortproductbyhighprice/SP246217.html +http://www.emerchandise.com/help_privacy/b.TV%20SATNIGHTLIVE/s.BOkfj8Vk +http://ftp.ccu.edu.tw/pub/documents/faq/mail/setup/?S=A +http://iceberg.adhomeworld.com/cgi-win/redirect.exe/304063772 +http://pdacentral.zeelandnet.nl/rim/email_license.htm +http://pdacentral.zeelandnet.nl/rim/adnload/139471_47673.html +http://www.loisirs.ch/tfhglx/17/ltxeld.html +http://au.yahoo.com/Business_and_Economy/Shopping_and_Services/Health/Providers/By_Region/U_S__States/Mississippi/Cities/ +http://sound-dist.secured.co.uk/cgi-bin/psProdDet.cgi/15P02A|972959527|Helmet|user|0|1,0,0,0 +http://news.dreamwiz.com/news_lg/04/20001030/yonhap/200010301014041007292.html +http://news.dreamwiz.com/news_lg/04/20001028/yonhap/ +http://pds.nchu.edu.tw/cpatch/ftp/ftpnav/?D=A +http://members.tripod.lycos.co.kr/BONGBAE/?N=D +http://www9.hmv.co.uk:5555/do/session/1347758/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d50_sd0_pt0.html +http://itcareers.careercast.com/texis/it/itjs/+xwwBmeHWD86YwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewDhmoBGnaqdGpdGwBodDarGo5awDwcO5Baiw5roDtBdDaGn31n5BaGn31oGnmamnVncdpar1MwDaGn5d1Gqn5aMFqhTfR20DzmehrwwwpBmefWD86mwww5rmeddwwwBrmeZpwww/morelike.html +http://www.3w-buecher.de/GibbonsRob/GibbonsRob1572152214.htm +http://sennka.hoops.livedoor.com/%91%90%8a%a0%93%fa%98a%81%f4.htm +http://www.uni-duesseldorf.de/ftp/ftp/pf/s/netscape-v451/?S=A +http://www.outpersonals.com/cgi-bin/w3com/pws/out/0nhIQeA1Kelaujy0pUaBOo2AAoNruJ7MPpvxwl5qu-YeCeEn6SDc5vURHb5rk8dZP84c_4bSWkIDaPe8dCV5mfxj4LA69UDbXc_J2Z-eZg7dURZLZinceqCXYFUYC4pqT29R1BQKpdPvHP0APgIYRhQG +http://208.178.109.85/msgshow.cfm/msgboard=4779506785434&msg=80064825094809&page=1&idDispSub=-1 +http://interbox.tucows.com/preview/61367.html +http://www.crutchfield.com/cgi-bin/S-CI62JsDkHYX/viewcart.asp +http://www.hig.se/(aconf,formoutput,if,modified,set_cookie)/~jackson/roxen/ +http://www.trax.nilex.co.uk/trax.cgi/A1C/1AS/B1D/A3L/A1S/1AR/ +http://www.trax.nilex.co.uk/trax.cgi/A1C/1AS/B1D/A3L/A1S/C1R/ +http://www.trax.nilex.co.uk/trax.cgi/A1C/1AS/B1D/A3L/A1S/B4L/ +http://www.haikou.hi.cn/pandect/nj/n96ei3.htm +http://se.egroups.com/message/dailydreamers/36 +http://sunsite.org.uk/Mirrors/ftp.cdrom.com/pub/linux/slackware/contrib/contrib-sources/gcc-2.7.2.3/ +http://hp-partner.whowhere.lycos.com/hp/excite/Online_Communities/Angelfire/wi/index9.html +http://www.cse.unsw.edu.au/archives/linux/redhat/beta/?M=A +http://www.webcrawler.com/entertainment/music/artists_and_genres/folk_and_acoustic/artists_s/simon_and_garfunkel/garfunkel_art/interviews/ +http://www.russ.ru:8081/journal/media/98-05-21/telen0.htm +http://www.chaos.dk/sexriddle/x/r/k/o/w/ +http://www.jt.com.br/noticias/98/06/22/sd2.htm +http://retailer.gocollect.com/do/session/1912734/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/gifts/gift_floor.asp +http://www.ualberta.ca/CNS/RESEARCH/Software/SAS/gis/z0782606.htm +http://www.sentientnet.com/univercd/cc/td/doc/product/rtrmgmt/bluelist/cwblue21/cwbwsug/features.htm +http://pub5.ezboard.com/fthekojiroestrogenbrigadeconsolegaming.threadControl?topicID=16.topic +http://www.zjrs.zei.gov.cn/economy/text/policy/LHB/LHBA0909.TXT +http://seascape.tucows.com/winnt/adnload/2060_29646.html +http://seascape.tucows.com/winnt/adnload/2063_29648.html +http://seascape.tucows.com/winnt/adnload/2066_29651.html +http://ben.aspads.net/ex/c/641/517693268 +http://yp.gates96.com/7/63/80/20.html +http://yp.gates96.com/7/63/80/22.html +http://yp.gates96.com/7/63/80/80.html +http://yp.gates96.com/7/63/80/87.html +http://yp.gates96.com/7/63/81/50.html +http://yp.gates96.com/7/63/81/77.html +http://yp.gates96.com/7/63/81/79.html +http://yp.gates96.com/7/63/81/91.html +http://yp.gates96.com/7/63/82/36.html +http://yp.gates96.com/7/63/82/73.html +http://yp.gates96.com/7/63/84/6.html +http://yp.gates96.com/7/63/84/91.html +http://yp.gates96.com/7/63/85/30.html +http://yp.gates96.com/7/63/85/57.html +http://yp.gates96.com/7/63/85/98.html +http://yp.gates96.com/7/63/89/13.html +http://yp.gates96.com/7/63/89/20.html +http://yp.gates96.com/7/63/89/32.html +http://yp.gates96.com/7/63/89/65.html +http://www.rarf.riken.go.jp/archives/tex-archive/macros/latex//contrib/supported/linguex/?M=A +http://members.tripod.com/shelly34/shellyphotos/page12.html +http://ftp.nsysu.edu.tw/Unix/Perl/modules/by-category/23_Miscellaneous_Modules/Bundle/PlRPC-0.2003.readme +http://www.affiliate.hpstore.hp.co.uk/do/session/380827/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/SMARTTIPS/vacationcards.asp +http://www.marktplatz-hs.de/cgi-bin/ChioEditionShop.s/39fe2ee3005fd9642740d47540f806e1/IconBar +http://home.sprynet.com/~keithco/london.htm +http://earth.collectingnation.com/cgi-bin/bn/post.mod/aupn?B=cna&R=48 +http://earth.collectingnation.com/cgi-bin/bn/post.mod/aupn?B=cna&R=38 +http://www.realize.com/am747b81.htm,qt=e784fe2f=2a38a234-e-1adebfb-80000000-0-0-3-- +http://www.opengroup.com/dfbooks/009/0091856140.shtml +http://www.egroups.org/message/fotografya/216 +http://www.cn.informatik.fh-furtwangen.de/studenten/dv_labor/onlinebuecher/php/function.yaz-errno.html +http://www.cn.informatik.fh-furtwangen.de/studenten/dv_labor/onlinebuecher/php/function.yaz-hits.html +http://www.cn.informatik.fh-furtwangen.de/studenten/dv_labor/onlinebuecher/php/function.yaz-wait.html +http://www.catholicstore.com/search/index.cfm/FuseAction/detailSearch/SKU/17311/category/Bo/subCategory/G/subject/1 +http://www.cc.ntut.edu.tw/~584ce040/anne-1.htm +http://www.intervoz.com.ar/2000/09/23/sociedad_n11.htm +http://pub22.ezboard.com/frecipegoldminesharearecipe.showAddReplyScreenFromWeb?topicID=4.topic +http://opencity.kulichki.ru/moshkow/PROZA/LIPSKEROV/okno.txt +http://www.tccomputers.com/cgi-bin/bp/1021890426/products/modems/modems.htm +http://www.tccomputers.com/cgi-bin/bp/1021890426/services/sitemap.htm +http://library.bangor.ac.uk/search/dCrystallography+--+Periodicals/dcrystallography+periodicals/-5,-1,0,B/frameset&F=dcrystallography+mathematical&8,,9 +http://music.excite.ca/artist/-264813 +http://www.gameboyz.com/g/review_465_p4_n3.html +http://library.cwu.edu/search/aCarande,+Robert/acarande+robert/-5,-1,0,B/2exact&F=acarande+robert&1,2 +http://www.townstuff.com/search.cfm?directory=1040&town=285 +http://bsd.sinica.edu.tw/cgi-bin/cvsweb.cgi/ports/graphics/png/files/patch-aa?only_with_tag=RELEASE_2_2_7 +http://www.amcity.com/columbus/stories/1997/07/07/focus6.html?t=email_story +http://retailer.gocollect.com/do/session/1912716/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/checkout/shopping_cart.asp +http://ds.dial.pipex.com/town/drive/kch36/select/s12/ch034.html +http://ds.dial.pipex.com/town/drive/kch36/select/s12/ch118.html +http://www.dbring.de/160/16005-09.html +http://198.103.152.100/search*frc/lHQ+769+E3614/lhq++769+e3614/7,-1,0,B/frameset&F=lhq++777.4+d47&1,1 +http://yp.gates96.com/7/27/70/14.html +http://yp.gates96.com/7/27/70/27.html +http://yp.gates96.com/7/27/70/35.html +http://yp.gates96.com/7/27/70/37.html +http://yp.gates96.com/7/27/70/62.html +http://yp.gates96.com/7/27/71/38.html +http://yp.gates96.com/7/27/71/80.html +http://yp.gates96.com/7/27/72/62.html +http://yp.gates96.com/7/27/72/80.html +http://yp.gates96.com/7/27/73/10.html +http://yp.gates96.com/7/27/73/61.html +http://yp.gates96.com/7/27/73/78.html +http://yp.gates96.com/7/27/74/7.html +http://yp.gates96.com/7/27/74/16.html +http://yp.gates96.com/7/27/75/62.html +http://yp.gates96.com/7/27/76/90.html +http://yp.gates96.com/7/27/77/7.html +http://yp.gates96.com/7/27/77/92.html +http://yp.gates96.com/7/27/78/21.html +http://yp.gates96.com/7/27/79/21.html +http://yp.gates96.com/7/27/79/57.html +http://yp.gates96.com/7/27/79/96.html +http://moviestore.zap2it.com/help/b.STARWARSSAGA%20STARWARS-ROJ/s.nrF6V2sr +http://www2.kbank.no/Web/nlpublish.nsf/Published/ord_og_uttrykk!OpenDocument&ExpandSection=8,27,13,5 +http://newspaper.swww.com.cn/1999/cdwb/199912/26/html/1003.html +http://newspaper.swww.com.cn/1999/cdwb/199912/26/html/1008.html +http://iworld.freethemes.com/adnload/77752.html +http://iworld.freethemes.com/adnload/15251.html +http://iworld.freethemes.com/adnload/54697.html +http://iworld.freethemes.com/adnload/15232.html +http://www.fogdog.com/cedroID/ssd3040183238457/nav/products/ice_hockey/1d/gear_accessories/ +http://www.ftp.uni-erlangen.de/pub/Linux/DEBIAN/dists/Debian2.2r0/main/binary-m68k/doc/ +http://www.ftp.uni-erlangen.de/pub/Linux/DEBIAN/dists/Debian2.2r0/main/binary-m68k/sound/ +http://library.cwu.edu/search/aThimbleby,+Harold/athimbleby+harold/-5,-1,0,B/exact&F=athilde+jean&1,2 +http://www5.pconline.com.cn/pcedu/soft/doc/001024/2.htm +http://member.nifty.ne.jp/kaito-mist/nifty5.htm +http://www.cc.yamaguchi-u.ac.jp/~archive/doc/jdk1.2.2/docs/api/java/awt/image/BandedSampleModel.html +http://www.sandiego.digitalcity.com/honolulu/arts/occurrence.dci?ecid=75 +http://ubahn.exit.de/ffm/pic/pp/?S=A +http://www.visiobroker.com/opcvm/details/4/43591.html +http://www.visiobroker.com/opcvm/details/9/9765.html +http://ring.toyama-ix.net/archives/linux/debian/debian-jp/dists/woody-towns/?M=A +http://www.asahi-net.or.jp/~ZI3H-KWRZ/lawylegalaid.html +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/195/1999/7/0/ +http://www.buybuddy.com/sleuth/27/1/1060103/490578/ +http://java.javasoft.com/products/jdk/1.2/ja/docs/ja/api/java/awt/image/BandedSampleModel.html +http://mitglied.tripod.de/~HTTC/mannschaften/3LigaGr1_0001.htm +http://opac.lib.rpi.edu/search/anightingale+peggy+1942/-5,-1,0,B/browse +http://ftp.unina.it/pub/Amiga/NetBSD/NetBSD-current/pkgsrc/editors/ssam/files/ +http://kikakusvr3.city.yokohama.jp/y/j/e25/ktt/ktt.html +http://members.spree.com/entertainment/juskickit/http//members.spree.com/sports/comicus1 +http://www.butuanon.tsx.org/ +http://archive.soccerage.com/s/de/07/05375.html +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/151/1995/10/0/859255/ +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/151/1995/10/50 +http://polygraph.ircache.net:8181/http_-2www.soniajekums.com/docs/Http_-2ua.battle-zone.com/html/html/on_line.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380855/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-creativeworld.com/creativeworld.asp?lang=f +http://mirror.cc.utsunomiya-u.ac.jp/mirror/CPAN/authors/id/T/TO/TOSTI/vstadaf-0.01.readme +http://www.xmission.com/~dkenison/cgi/lwgate.cgi/KLR650/archives/v02.n1633/Subject/article-16.html +http://www.realize.com/p25581.htm,qt=e784fe2f=2a38a234-7-da710e-0-0-0-1-- +http://www.realize.com/am947681.htm,qt=e784fe2f=2a38a234-7-da6e1d-80000000-0-0-3-- +http://www.realize.com/am2c3a81.htm,qt=e784fe2f=2a38a234-7-da6e1d-80000000-0-0-3-- +http://www.realize.com/amd15381.htm,qt=e784fe2f=2a38a234-7-da6e1d-1-84-0-3-- +http://link.fastpartner.com/do/session/600403/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/speednames.php +http://home.freeuk.net/lyne/work.htm +http://www.gotocity.com/local/2/us/AZ/p/85643/people/ +http://www.service911.com/egghead/step/0,2743,6+33+121+25440+18092_4,00.html +http://www.jamba.de/KNet/_KNet-irv8j1-WEd-139z7/showInfo-werbung.de/node.0/cenv0b09a +http://ustlib.ust.hk/search*chi/dbeijing+mandarin+dialects+china+slang/dbeijing+mandarin+dialects+china+slang/-5,1,1,B/frameset&F=dbeijing+mayors+china+fiction&1,1, +http://www.linux.org.tw/~chester/xlib/GC/convenience-functions/XSetGraphicsExposures.html +http://www.linux.org.tw/~chester/xlib/graphics/font-metrics/XUnloadFont.html +http://www.chaos.dk/sexriddle/c/f/j/u/c/ +http://www.chaos.dk/sexriddle/c/f/j/u/q/ +http://www.bornloser.com/comics/committed/archive/committed-20001027.html +http://tulips.ntu.edu.tw/search*chi/dDeath+lc/ddeath+lc/-17,-1,0,E/frameset&F=ddeath+in+adolescence+abstracts&1,,0 +http://hem.fyristorg.com/lottaleman/LLfar/1_6955.htm +http://preview.egroups.com/post/scoresheet-talk?act=reply&messageNum=7013 +http://209.52.189.2/profile.cfm/TimmyJ +http://archive.soccerage.com/s/pt/37/04816.html +http://pub16.ezboard.com/fleftbehindmessageboardfellowshiphall.showMessage?topicID=456.topic&index=16 +http://www.2pl.com/asp/tools/fili1.asp?sp=se&fi=pppp0005s8 +http://link.fastpartner.com/do/session/600382/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/company/jobs.htm +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/kdenetwork/kppp/Rules/Poland/?only_with_tag=MAIN +http://genforum.genealogy.com/cgi-genforum/forums/flippin.cgi?30 +http://pub.chinaccm.com/23/news/200010/28/114339.asp +http://pub.chinaccm.com/23/news/200010/27/134259.asp +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=21,9,14,35,15 +http://gamesearcher.com/games/pc/returnofphantom-cheatsfaqs.html +http://ua.php.net/manual/es/function.pg-errormessage.php +http://findmail.com/group/prairydog +http://www.loria.fr/projets/dilib/DILIB_ROOT/SYSTEMS/Linux/Dilib/Data/NLM/MedLine/ +http://www.daysinn.com/ctg/cgi-bin/DaysInn/programs/AAAksrACwAAACEaAAQ +http://www.leo.org/leoclick/35dd60550f1ba90ed5bb7952eebae0d3+L+1__ +http://members.fortunecity.com/abbalink/songs/lyrics/wg.htm +http://chat.sportsline.com/u/football/nfl/xword/answers/091500.htm +http://210.173.172.13/entertainments/sports/sydney/kanrenkiji/0924/0925m096-500.html +http://210.173.172.13/entertainments/sports/sydney/kanrenkiji/0924/0925m094-500.html +http://www.private-immobilien-boerse.de/nordrhein-Westfalen/Muehlheim-ruhr/Verkauf/3d-service/Gemeinsam/Inserieren/3d-service/Gemeinsam/versicherungen/gebaeude/deckungsumfang.htm +http://www.private-immobilien-boerse.de/nordrhein-Westfalen/Muehlheim-ruhr/Verkauf/3d-service/Gemeinsam/Inserieren/3d-service/Gemeinsam/IIMMitglieder.htm +http://www.realize.com/amcf7781.htm,qt=e784fe2f=2a38a234-4-7cf2ef-80000000-0-0-3-- +http://family.go.com/Categories/Features/family_1998_12/penn/penn128urban/ +http://www.loria.fr/projets/dilib/DILIB_ROOT/ApplicationsTest/Dilib/newBD/Prog/?N=D +http://www.loisirs.ch/xfeoav/7/kqbmsh.html +http://tucows.tu-graz.ac.at/herdwin0807.html +http://www-d0.fnal.gov/cgi-bin/cvsweb.cgi/gtr_htf/dat/?sortby=log +http://www.buybuddy.com/sleuth/17/1/2006/32619/ +http://www.aelita.net/products/Reg/QuoteRegister/products/library/products/company/Privacy.htm +http://www.refdag.nl/bui/990803bui08.html +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=3,0+9,6-14,0+0,2 +http://www.aelita.net/products/services/support/sitemap/news/solutions/default.htm +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=26,5,30,16,12 +http://www.ericsson.cl/gsmpro/contact.shtml +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/maheuitu/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mangoo333/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/maomizhijia/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/masaki_hamada/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/maxiaofei/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/maz0503/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/menghuanboy/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/michealshen/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mike717/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mikeshang_2/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mingyueyaze/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mm3/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mnbv89/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/morsia/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/move/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mslug/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/msshi/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/muwei/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/my1799/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mychat2000/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/myesky/ +http://members.tripodasia.com.cn/maolin_photo/maolin_suzuki/maolin_suzuki/mzlzq/ +http://www.ring.gr.jp/pub/linux/Vine/VineSeed/alpha/mnt/source/sbin/loader +http://www.nrk.no/finnmark/x8_5_96/nyh7.htm +http://202.99.23.245/rmrb/200001/27/no_txb_6.html +http://www-d0.fnal.gov/d0dist/dist/releases/test/smt_hit/test/?N=D +http://www-d0.fnal.gov/d0dist/dist/releases/test/smt_hit/test/LIBRARIES +http://jupiter.u-3mrs.fr/~msc41www/releves/13440405.HTM +http://ftp.univie.ac.at/packages/perl/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/CGI/ANDK/Apache-correct_headers.readme.html +http://www.linux.com/networking/network/networking/free/windows_nt/distro/ +http://www.linux.com/networking/network/networking/free/windows_nt/tip/ +http://australia-holiday-guide.com/Englisch/Queensland_1/QLD_Furher_North_1/qld_further_north_1.html +http://australia-holiday-guide.com/Englisch/Queensland_1/QLD_Great_Barrier_Reef_1/qld_great_barrier_reef_1.html +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/Ayrton.readme +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/Deadline_1.readme +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/DiamondPPC.readme +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/Gravity2_inv.readme +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/HJB-BCFix.readme +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/ImpPos.readme +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/Nat-AutF.readme +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/PSB-Desperado2.readme +http://ftp.uni-paderborn.de/aminet/aminet/demo/aga/PSB-PUK_final.readme +http://genforum.genealogy.com/cgi-genforum/forums/kilroy.cgi?34 +http://genforum.genealogy.com/cgi-bin/print.cgi?kilroy::34.html +http://content.health.msn.com/ef/message/803324/content.health.msn.com%2fmessage_board_message%2f803324/803324 +http://de.excite.de/gesundheit/katalog/6107 +http://de.excite.de/gesundheit/katalog/4909 +http://de.excite.de/gesundheit/katalog/5941 +http://de.excite.de/gesundheit/katalog/4924 +http://de.excite.de/gesundheit/katalog/5898 +http://de.excite.de/gesundheit/katalog/4949 +http://de.excite.de/gesundheit/katalog/5987 +http://de.excite.de/gesundheit/katalog/5855 +http://de.excite.de/gesundheit/katalog/39862 +http://de.excite.de/gesundheit/katalog/5852 +http://de.excite.de/gesundheit/katalog/5645 +http://de.excite.de/gesundheit/katalog/6078 +http://de.excite.de/gesundheit/katalog/5834 +http://yp.gates96.com/11/26/80/31.html +http://yp.gates96.com/11/26/80/47.html +http://yp.gates96.com/11/26/80/91.html +http://yp.gates96.com/11/26/81/61.html +http://yp.gates96.com/11/26/81/86.html +http://yp.gates96.com/11/26/82/37.html +http://yp.gates96.com/11/26/82/49.html +http://yp.gates96.com/11/26/83/38.html +http://yp.gates96.com/11/26/83/52.html +http://yp.gates96.com/11/26/83/58.html +http://yp.gates96.com/11/26/83/84.html +http://yp.gates96.com/11/26/84/0.html +http://yp.gates96.com/11/26/84/59.html +http://yp.gates96.com/11/26/84/75.html +http://yp.gates96.com/11/26/84/99.html +http://yp.gates96.com/11/26/85/37.html +http://yp.gates96.com/11/26/85/63.html +http://yp.gates96.com/11/26/85/78.html +http://yp.gates96.com/11/26/86/36.html +http://yp.gates96.com/11/26/86/40.html +http://yp.gates96.com/11/26/87/66.html +http://yp.gates96.com/11/26/87/87.html +http://yp.gates96.com/11/26/89/7.html +http://yp.gates96.com/11/26/89/21.html +http://yp.gates96.com/11/26/89/38.html +http://providenet.tukids.tucows.com/mac/9-12/macspell912_license.html +http://providenet.tukids.tucows.com/mac/9-12/adnload/25805_25780.html +http://www04.u-page.so-net.ne.jp/zb3/eiji-m/dog6.htm +http://school.educities.org/card/jou0731.html +http://school.educities.org/card/ke234.html +http://school.educities.org/card/aaaaaqqqqqqq.html +http://school.educities.org/card/cso.html +http://school.educities.org/card/g40203.html +http://school.educities.org/card/h123915388.html +http://school.educities.org/card/k1084211.html +http://www.cigar-pipe.de/SP/dhuc3112.htm +http://www.newquestcity.com/cities/MA///news/3675.htm +http://caowei_814.home.chinaren.com//wenxue/wenxue-mood/love147.htm +http://www.amulation.com/md-l-archive/199805/msg00065.html +http://in.egroups.com/messages/conventions/51?viscount=-30 +http://yp.gates96.com/11/63/20/4.html +http://yp.gates96.com/11/63/20/21.html +http://yp.gates96.com/11/63/20/51.html +http://yp.gates96.com/11/63/21/29.html +http://yp.gates96.com/11/63/21/41.html +http://yp.gates96.com/11/63/21/74.html +http://yp.gates96.com/11/63/22/4.html +http://yp.gates96.com/11/63/22/29.html +http://yp.gates96.com/11/63/22/80.html +http://yp.gates96.com/11/63/22/86.html +http://yp.gates96.com/11/63/23/7.html +http://yp.gates96.com/11/63/23/24.html +http://yp.gates96.com/11/63/23/39.html +http://yp.gates96.com/11/63/24/1.html +http://yp.gates96.com/11/63/25/35.html +http://yp.gates96.com/11/63/25/78.html +http://yp.gates96.com/11/63/25/83.html +http://yp.gates96.com/11/63/26/37.html +http://yp.gates96.com/11/63/27/3.html +http://yp.gates96.com/11/63/27/9.html +http://yp.gates96.com/11/63/27/14.html +http://yp.gates96.com/11/63/28/16.html +http://yp.gates96.com/11/63/28/26.html +http://yp.gates96.com/11/63/28/54.html +http://yp.gates96.com/11/63/28/55.html +http://yp.gates96.com/11/63/29/13.html +http://yp.gates96.com/11/63/29/64.html +http://yp.gates96.com/11/63/29/69.html +http://spaceports.tucows.com/winnt/httpservernt_license.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380848/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/FR/REGISTRATION/entry.asp +http://incrediblegolfsavings.subportal.com/sn/Games/Simulation_Games/11310.html +http://incrediblegolfsavings.subportal.com/sn/Games/Simulation_Games/12064.html +http://www.linux.com/networking/linux/industry/gnu/operating_system/Corel/ +http://www.linux.com/networking/linux/industry/gnu/operating_system/Updates/ +http://www.fogdog.com/cedroID/ssd3040183307418/womens/ +http://www.fogdog.com/cedroID/ssd3040183307418/nav/products/featured_brands/1o/casual_sunglasses/ +http://www.fogdog.com/cedroID/ssd3040183307418/nav/products/featured_brands/1o/hockey_skates/ +http://www.fogdog.com/cedroID/ssd3040183307418/nav/products/featured_brands/1o/sweatshirts_fleece/ +http://www.fogdog.com/cedroID/ssd3040183307418/crs/nvCZ/wld/fogdog_sports/nike/football/equipment/500r_series_football.html +http://www.seoul.co.kr/dmaeil/199908/0820j015.htm +http://www-trn.bards.ru/Lobanovskiy/part13.htm +http://www-trn.bards.ru/Vahnuk/part27.htm +http://www-trn.bards.ru/Vetrova_Svetlana/part9.htm +http://www-trn.bards.ru/Tretiyakov/part22.htm +http://www-trn.bards.ru/Okoudjava/part202.htm +http://www-trn.bards.ru/Panyushkin/part100.htm +http://www-trn.bards.ru/Gorodnicky/part287.htm +http://yumemi.ne.jp/bbs/ky/view/f/forum9/1_jpbshj_vvvzil.html +http://yumemi.ne.jp/bbs/ky/view/f/forum9/1_xxosis_czhmrb.html +http://yumemi.ne.jp/bbs/ky/view/f/forum9/1_yikriy_qjvins.html +http://www.peopledaily.co.jp/shch/199907/28/newfiles/D103.html +http://legalminds.lp.findlaw.com/list/newlawbooks-l/frm00336.html +http://tucows.sp-plus.nl/winme/phoneme.html +http://ustlib.ust.hk/search*chi/dalcoholic+beverages+china/dalcoholic+beverages+china/7,-1,0,E/2browse +http://ustlib.ust.hk/search*chi/dalcoholic+beverages+china/dalcoholic+beverages+china/-5,-1,0,E/frameset&F=dalcoholic+beverages+great+britain&1,,0 +http://www.canit.se/(k10,k13,k16,k6)/support/faq/faq.html +http://aecjobbank.com/texis/script/jobbank/+Owwrmwxeri2wBV6evNVpwwwF6eWYqkwwwn6eXmcOwwwn6ekmyjwwwn6eULpOwwqn6eUCBZwwwn6e22QuwwwefPY9GepmwwmeiP46eczdwwmeOTB6eXhzwwwnmBVve89AHwwxeY44Ie-pxwww+vejWRhwwxealYTeXjzwwwhvep9q9wwwxveoA6kwwqe0PYieqFzwwwv6eFRFrwwwt6eSGxDwwwetNY1e8drwwqeT53Amwww0h7mwww1tzmwwweb-3qmwwww/jobdirectory.html +http://www9.hmv.co.uk:5555/do/session/1347780/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/newmenu.html +http://www9.hmv.co.uk:5555/do/session/1347780/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d30_sd0_pt0.html +http://www9.hmv.co.uk:5555/do/session/1347780/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d70_sd0_pt0.html +http://www9.hmv.co.uk:5555/do/session/1347780/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d90_sd0_pt0.html +http://www9.hmv.co.uk:5555/do/session/1347780/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d120_sd0_pt0.html +http://www.hbdaily.com.cn/hbrb/20000622/BIG5/hbrb^18323^12^0622h016.htm +http://excite.de/immobilien/katalog/6877 +http://excite.de/immobilien/katalog/7012 +http://www.globalmart.com/housewares/appliances/household/irons/blackanddecker/S680.htm +http://mediate.magicbutton.net/do/session/625631/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-artc.html +http://ddb.libnet.kulib.kyoto-u.ac.jp/exhibit/mt3/image/mt3shf/mt3sh0192.html +http://us.parsimony.net/forum26166/messages/410.htm +http://linux.tnc.edu.tw/CPAN/authors/id/A/AZ/AZEMGI/?M=A +http://linux.tnc.edu.tw/CPAN/authors/id/A/AZ/AZEMGI/CHECKSUMS +http://launchbase.com/Shopping/Visual_Arts/communication/entertainment/Pictures_&_Images.htm +http://launchbase.com/Shopping/Visual_Arts/communication/shopping/Gifts.htm +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/programs/simple/music/midi/lit/lit/quizz/quizz1.html +http://home02.wxs.nl/~nash0002/amber-94.htm +http://www.redrocksports.com/sports/webSession/shopper/RR972959711-31098/store/dept-5/department/dept-5/item/52400 +http://www.redrocksports.com/sports/webSession/shopper/RR972959711-31098/store/dept-5/department/dept-5/item/52550 +http://www.redrocksports.com/sports/webSession/shopper/RR972959711-31098/store/dept-5/department/dept-5/item/50900 +http://gnu.archive.sunet.se/software/sather/ICSI_Sather/Documentation/Compiler/CompilerBrowser/shortflat-FLIST{_}.html +http://mailman.real-time.com/rte-crossfire/1992/Dec/mail1.html +http://de.nedstat.net/viewstat.asp?name=larsen +http://ftp.ring.gr.jp/archives/pc/gnu-win32/latest/man/?S=A +http://src.openresources.com/debian/src/graphics/HTML/D/S_ISSOCK.html +http://www.perotech.ch/d/securedb/html/listtopic.php?4277 +http://web.health.aol.thriveonline.oxygen.com/medical/library/article/003558res.html +http://cn.egroups.com/message/Website_Warez/346 +http://adex3.flycast.com/server/socket/127.0.0.1:2800/click/OnlineCitiesSM/OnlineCitiesInteractiveCityGuides/bd510213891 +http://ring.nii.ac.jp/pub/pack/x68/personal/calendar/ +http://www.zeal.com/Government/U_S__Government/State___Local_Governments/South_Carolina/Politics/Elections/State_wide/ +http://ftp.unina.it/pub/TeX/macros/latex209/contrib/manual/?S=A +http://www.perotech.ch/d/securedb/html/listtopic.php?5376 +http://polygraph.ircache.net:8181/lci/https_-2ssl.galaxy-net.net/jazzee/http_-2www.microsoft.com/truetype/fontpack/win.htm +http://python.konbib.nl/dutchess.ned/83/00/info-1592.html +http://www.excite.com/lifestyle/cultures_and_groups/world_cultures/regions/north_america/ethnic_communities/african_american/history/military_history/ +http://www.bluemonutain.com/engy/david/CHI1-educk.html +http://www.bluemonutain.com/engy/susie/CHI1-edaddog.html +http://cn.egroups.com/messages/childhoodepilepsy/3349 +http://cn.egroups.com/messages/childhoodepilepsy/648 +http://cn.egroups.com/messages/childhoodepilepsy/1189 +http://polygraph.ircache.net:8181/services/design/http_-2www.swnebr.net/~cambridg/http_-2www.bikininet.com/climate.htm +http://www.annuairefrancais.com/54/France/I/INTERNET/Fournisseurs-d'acces/Fournisseurs-d +http://polygraph.ircache.net:8181/http_-2www.monarchcom.net/http_-2www.netscape.com/comprod/mirror/http_-2bible.gospelcom.net/http_-2www.rehablinks.com/ptlinks.htm +http://findmail.com/message/studentdoctor/4312?source=1 +http://mediate.magicbutton.net/do/session/625624/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-cart.html +http://ring.htcn.ne.jp/archives/lang/perl/CPAN/authors/id/P/PG/?M=A +http://www.buybuddy.com/sleuth/33/1/10601/526343/ +http://www1.zdnet.com/products/stories/reviews/0,4161,2470142,00.html +http://www1.zdnet.com/companyfinder/filters/products/0,9996,2256-82,00.html +http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdeutils/ark/doc/en/Attic/index-2.html?only_with_tag=MAIN +http://tv.thevines.com/leaf/AA0000364048/45///&act=24-1-11&bref=1601 +http://link.fastpartner.com/do/session/600384/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/local/redirect.php +http://www.excite.com/lifestyle/politics_and_society/community_and_cultures/world_cultures/diaspora/jewish/judaism/congregations/humanistic_judaism/ +http://biblio.cesga.es:81/search*gag/aXove,+Xosé/axove+xose/7,-1,0,B/frameset&F=axuntanza&1,,3 +http://biblio.cesga.es:81/search*gag/aXove,+Xosé/axove+xose/7,-1,0,B/frameset&F=axuntanza&3,,3 +http://db.zaq.ne.jp/asp/bbs/jttk_baasc506_1/article/36 +http://db.zaq.ne.jp/asp/bbs/jttk_baasc506_1/article/37 +http://db.zaq.ne.jp/asp/bbs/jttk_baasc506_1/article/35 +http://db.zaq.ne.jp/asp/bbs/jttk_baasc506_1/article/21 +http://www.tiroler-adler.com/1Root/Kontinent/6/Staat/7/Bundesland/16/Ort/691/Homepage/f_homepage...1.html +http://yp.gates96.com/4/52/90/87.html +http://yp.gates96.com/4/52/90/95.html +http://yp.gates96.com/4/52/91/4.html +http://yp.gates96.com/4/52/91/39.html +http://yp.gates96.com/4/52/91/42.html +http://yp.gates96.com/4/52/92/33.html +http://yp.gates96.com/4/52/92/93.html +http://yp.gates96.com/4/52/93/6.html +http://yp.gates96.com/4/52/93/98.html +http://yp.gates96.com/4/52/94/8.html +http://yp.gates96.com/4/52/94/14.html +http://yp.gates96.com/4/52/95/92.html +http://yp.gates96.com/4/52/96/16.html +http://yp.gates96.com/4/52/96/32.html +http://yp.gates96.com/4/52/96/72.html +http://yp.gates96.com/4/52/96/90.html +http://yp.gates96.com/4/52/97/1.html +http://yp.gates96.com/4/52/97/53.html +http://yp.gates96.com/4/52/98/34.html +http://yp.gates96.com/4/52/98/84.html +http://yp.gates96.com/4/52/98/97.html +http://yp.gates96.com/4/52/99/55.html +http://yp.gates96.com/4/52/99/68.html +http://yp.gates96.com/14/40/10/3.html +http://yp.gates96.com/14/40/10/86.html +http://yp.gates96.com/14/40/11/53.html +http://yp.gates96.com/14/40/12/74.html +http://yp.gates96.com/14/40/13/11.html +http://yp.gates96.com/14/40/13/34.html +http://yp.gates96.com/14/40/13/45.html +http://yp.gates96.com/14/40/13/79.html +http://yp.gates96.com/14/40/14/3.html +http://yp.gates96.com/14/40/14/6.html +http://yp.gates96.com/14/40/14/25.html +http://yp.gates96.com/14/40/14/84.html +http://yp.gates96.com/14/40/14/88.html +http://yp.gates96.com/14/40/15/39.html +http://yp.gates96.com/14/40/15/40.html +http://yp.gates96.com/14/40/16/64.html +http://yp.gates96.com/14/40/16/92.html +http://yp.gates96.com/14/40/17/69.html +http://yp.gates96.com/14/40/18/42.html +http://yp.gates96.com/14/40/18/82.html +http://yp.gates96.com/14/40/19/36.html +http://www.4positiveimages.com/4positiveimages/727410225/IconBar +http://www.teacherformation.org/html/od/facilitators.cfm/task1,login/discussion_id,2/xid,6559/yid,6157439 +http://www.secinfo.com/dSU5m.74.htm +http://www.secinfo.com/dSU5m.7v.htm +http://www.secinfo.com/dSU5m.6y.htm +http://www.secinfo.com/dSU5m.5c.htm +http://linux.softhouse.com.cn/linux/knowledge/tech/qs/linux5.htm +http://linux.softhouse.com.cn/linux/knowledge/tech/qs/linux10.htm +http://freesoftware.subportal.com/sn/Programming/Visual_Basic_Components_H-P/993.html +http://dk.egroups.com/message/NGHILUAN/2881 +http://dk.egroups.com/message/NGHILUAN/2889 +http://www.cga.state.ct.us/ps98/cbs/H/hj-0084.htm +http://apple.excite.com/entertainment/music/artists_and_genres/jazz/new_world_jazz/afro_cuban/ +http://www.euronet.nl/users/hiroshi/ksweb/interest.htm +http://library.bangor.ac.uk/search/aMollica,+Anthony/amollica+anthony/-5,-1,0,B/browse +http://www.fogdog.com/cedroID/ssd3040183308040/nav/products/featured_brands/14t/all/ +http://www.brio.de/BRIO.catalog/39fe2f8d0912d4962740d472aa780701/UserTemplate/9 +http://www.hig.se/(accessed,autoformat,referrer,sqloutput,tablify)/~jackson/roxen/ +http://www.newstimescybermall.com/Mall/Catalog/Product/ASP/product-id/206059/store-id/1000010991.html +http://www6.163.com/news/p-item/0,1587,economy_1916,00.html +http://ftp.uni-stuttgart.de/pub/systems/sgi/graphics/lib/?D=A +http://preview.egroups.com/message/abdou3/152 +http://ch.php.net/manual/it/function.pg-loimport.php +http://yp.gates96.com/1/94/30/39.html +http://yp.gates96.com/1/94/30/78.html +http://yp.gates96.com/1/94/31/11.html +http://yp.gates96.com/1/94/31/72.html +http://yp.gates96.com/1/94/31/85.html +http://yp.gates96.com/1/94/32/25.html +http://yp.gates96.com/1/94/32/45.html +http://yp.gates96.com/1/94/32/74.html +http://yp.gates96.com/1/94/33/20.html +http://yp.gates96.com/1/94/33/68.html +http://yp.gates96.com/1/94/34/92.html +http://yp.gates96.com/1/94/35/1.html +http://yp.gates96.com/1/94/35/50.html +http://yp.gates96.com/1/94/35/60.html +http://yp.gates96.com/1/94/37/0.html +http://yp.gates96.com/1/94/37/46.html +http://yp.gates96.com/1/94/37/47.html +http://yp.gates96.com/1/94/37/61.html +http://yp.gates96.com/1/94/38/19.html +http://yp.gates96.com/1/94/39/49.html +http://yp.gates96.com/1/94/39/57.html +http://www.gartenfachmarkt.de/beratung_garten/duengen_und_kompostieren/anlage_und_vorarbeiten/fertig.htm +http://support.dell.com/docs/storage/4955r/en/Hw/setup.htm +http://www.hig.se/(clientname,header,sort,sqlquery,sqltable)/~jackson/roxen/ +http://www.mic.hr/PGBURZA:423870 +http://www.mic.hr/PGNEWS:423870 +http://members.tripod.com/Tess_Tom/my_photoalbum/page12.html +http://legalminds.lp.findlaw.com/list/courtinterp-spanish/nav05815.html +http://www.fogdog.com/cedroID/ssd3040183239698/crs/pn__/wld/fogdog_sports/pearl_izumi/road_cycling/apparel/classic_vest.html +http://www.fogdog.com/cedroID/ssd3040183239698/nav/stores/wakeboarding/ +http://troy.lib.sfu.ca/search/slogos/slogos/-5,-1,0,E/frameset&F=slogistics+and+transportation+review&1,,0 +http://themes.tucows.dia.dk/skins/icq/preview/54718.html +http://php.nic.fi/manual/html/function.shm_open.html +http://ftp.fi.debian.org/debian/dists/woody/non-free/binary-m68k/misc/?S=A +http://www.csupomona.edu/reference/java/jdk1.2/docs/api/org/omg/CORBA/class-use/CompletionStatus.html +http://www.trax.nilex.co.uk/trax.cgi/A1C/B1U/A1D/C1R/A1D/B1R/ +http://www.uni-duesseldorf.de/ftp/ftp/software/opt/cpio-2.4.2/?M=A +http://ep.com/js/about/c9079/b0/250918.html +http://polygraph.ircache.net:8181/busi/html/http_-2www.dirtsports.com/index.html-ssi +http://www.chabadlibrary.org/ecatalog/EC06/EC06232.HTM +http://chat.hani.co.kr/NetBBS/Bbs.dll/brief/lst/qqa/f/qqo/PRMY/zka/B23qB2Bm +http://209.207.239.212/bkindex/c1047/f1128.html +http://tv.thevines.com/leaf/AA0000364429/4/1 +http://tv.thevines.com/leaf/AA0000364429/4//&order_by=WORST +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=12,17,20,5,16 +http://yp.gates96.com/4/4/40/22.html +http://yp.gates96.com/4/4/40/29.html +http://yp.gates96.com/4/4/41/11.html +http://yp.gates96.com/4/4/42/0.html +http://yp.gates96.com/4/4/42/27.html +http://yp.gates96.com/4/4/42/89.html +http://yp.gates96.com/4/4/42/99.html +http://yp.gates96.com/4/4/43/40.html +http://yp.gates96.com/4/4/43/69.html +http://yp.gates96.com/4/4/43/85.html +http://yp.gates96.com/4/4/44/27.html +http://yp.gates96.com/4/4/44/28.html +http://yp.gates96.com/4/4/44/36.html +http://yp.gates96.com/4/4/44/86.html +http://yp.gates96.com/4/4/45/76.html +http://yp.gates96.com/4/4/45/82.html +http://yp.gates96.com/4/4/45/86.html +http://yp.gates96.com/4/4/46/61.html +http://yp.gates96.com/4/4/47/1.html +http://yp.gates96.com/4/4/47/41.html +http://yp.gates96.com/4/4/47/42.html +http://yp.gates96.com/4/4/48/66.html +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/ports/misc/geekcode/pkg-descr?only_with_tag=RELEASE_3_4_0 +http://perso.wanadoo.fr/genealogie.aubert.jm/geweb/ff100.htm +http://www.securitiestimes.com.cn/199904/29/data/newfiles/0060080.htm +http://autos.yahoo.co.jp/ucar/m1015/k10152012199906/g21/a101520120210248821003520208199906.html +http://dg.galaxy.com/galaxy/Community/United-States/States/Connecticut/Cities-and-Regions/Guilford/Education/K--12/Middle.html +http://carriage.de/Schoner/info-e/literature/collections/models/ +http://www.amcity.com/orlando/stories/1998/06/29/weekinbiz.html?t=email_story +http://www.icopyright.com/1.1655.94549 +http://biblio.cesga.es:81/search*gag/dMicrosoft+Visual+BASIC+(Archivo+de+ordenador)/dmicrosoft+visual+basic+archivo+de+ordenador/-5,1,1,B/frameset&F=dmicrosoft+project+archivo+de+ordenador&1,1, +http://www.jamba.de/KNet/_KNet-AzI8j1-tGd-13d56/browse.de/node.0/cde7f1uou +http://www.jamba.de/KNet/_KNet-AzI8j1-tGd-13d5e/browse.de/node.0/cde7f1uou +http://www.ioppublishing.com/PEL/help/article/ja30010l2/refs/?topic=refs +http://members.tripod.lycos.co.kr/uuujsh/?N=D +http://www.wlu.ca/~wwwregi/95-96/cal/ucourses/CP/CP417.html +http://books.hyperlink.co.uk/bookinfo/Essential_Papers_on_Messianic_Movements_and_Personalities_in_Jewish_History/0814779433 +http://generalstore.everdream.com/kore/catalog/Office_Supplies/Furniture_&_Accessories/File_Cabinets/Vertical/GRP-US747/product.html +http://satlink.tucows.com/winnt/adnload/54136_29678.html +http://dc.web.aol.com/myrtlebeacharea/penpals/browse.dci?cat=twenties&sort=m +http://itcareers.careercast.com/texis/it/itjs/+nwwBme4WD86e4rwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewDthDo5O5apGdtGwMaBGnDBdDaqd1DBGon5aoDqc1moDtax15oDn55amnVncdpoDta5dc1BodD5adppdGB1DoBon5aqdMpnBoBoVnaMFqtuNfIjIDzmYqwwpBme68D86eihwww5rmerdwwwBrmeZpwww/jobpage.html +http://ring.yamanashi.ac.jp/pub/linux/debian/debian-jp/dists/hamm-jp/hamm/disks-i386/current/base14-3.bin.2.0.11.2-i386 +http://www.ibm.co.jp/pc/thinkpad/pt110/look110.html +http://retailer.gocollect.com/do/session/1912720/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/postcards/index.asp +http://www-rn.informatik.uni-bremen.de/home/X11R6/xc/doc/hardcopy/XProtocol/?N=D +http://cafe3.daum.net/Cafe-bin/bbsList?bbsgrp=SIXTEEN&bbscode=SIXTEENbbs +http://allmacintosh.arrakis.es/adnload/12140.html +http://allmacintosh.arrakis.es/adnload/2476.html +http://www.msb.malmo.se/search*swe/dSkönlitteratur/dskz~cnlitteratur/-5,-1,0,B/2exact&F=dskz~cnliteratur&1,2 +http://tucows.syix.com/winme/preview/137803.html +http://pages.prodigy.net/patotoole/musicman/page6.htm +http://yp.gates96.com/14/43/0/39.html +http://yp.gates96.com/14/43/0/78.html +http://yp.gates96.com/14/43/0/79.html +http://yp.gates96.com/14/43/0/99.html +http://yp.gates96.com/14/43/1/3.html +http://yp.gates96.com/14/43/1/57.html +http://yp.gates96.com/14/43/1/86.html +http://yp.gates96.com/14/43/2/74.html +http://yp.gates96.com/14/43/2/80.html +http://yp.gates96.com/14/43/3/2.html +http://yp.gates96.com/14/43/3/97.html +http://yp.gates96.com/14/43/3/99.html +http://yp.gates96.com/14/43/4/37.html +http://yp.gates96.com/14/43/4/51.html +http://yp.gates96.com/14/43/4/72.html +http://yp.gates96.com/14/43/6/4.html +http://yp.gates96.com/14/43/7/20.html +http://yp.gates96.com/14/43/7/39.html +http://yp.gates96.com/14/43/7/45.html +http://yp.gates96.com/14/43/9/41.html +http://yp.gates96.com/14/43/9/58.html +http://yp.gates96.com/14/43/9/60.html +http://ftp.support.compaq.com/public/dunix/v3.2g/ASE_V1.3/ReleaseNotes.htm +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/mchI1k9vDw6DGJ19bljzJPwhHhJYxAcnAIKgudPEJtzjiTWMWT4U-YMr4m-AccPn7sEIqMzfFTZnQEQBZNx-lh8DEr_c1F3DXpcc4PzhALzHJ76GytRWNCSauwtfVocYmy_RKsP-H9T-UhQgoc9_uexBhD4a +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/IqtI3V1hdRxfYW_4AHOzeXZkuTzyKfveVl4qdYM_2WFldvLDKFgK8SvYa0mSlrWDVodDERGv2jvb2dEN1-mRmY3TBKURFCsqneanb8BNMBeBfqmSnBYuou5RMCmHxXCedHy3TQnL51n3TYbg5exYBWl9FJTcQEIJt2wyyrfB66jP +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/Hk1ILVbQbFwze5TrhlBima0MylJ0gTqcnVeTbMTcn7Gy5GkelYKhUQ7m8P8_K3IkOWfIWbpGOJEuHqJLX5jY_7ygFevbtkNXPvb1yztdy9qzCTsCJvS5uaHN3cZd0LtuoMX3lX7d_-L_PrwRXSfTE3TNvWl-RHiY4Xmxk1fXhD_uwwjDvC7DDsxz66j6 +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/T41IiB449vZ7nrOl2Z_klJHCHQZhigz52e9YVMztVI-K01klBYQrw4VmiKN8JDs9xaeMSWopQs1euSbr6BAiyuqpbSFiiVWObVmWHv031jtdQ1y93wnHhx8PkbrA4hkNhjTPs2mUhBF9wIAJSPCYLkf6W7mCB8ObikqLTuIwBfRtSgMK4Hz9e7Bp +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/CI1IlJNaoNrBcwJYSEcjLyxBnpQHK3wpRPeCR_0u07GznNXQ3Ug57ciOqlfXKlYM1HbRfcvrF5s214yaEHiIizneyWrbSEW_xal49NjQDbWj6R2nEZvDQdDMQEMoTuQlSetyUwMidLBmJJ5v5w9m066en6Yxuzt3RkGIyoHKaVmXgVIYD2Fc40eA +http://www.secinfo.com/dSm4r.997.htm +http://www.secinfo.com/dSm4r.68c.htm +http://www.secinfo.com/dSm4r.69c.htm +http://mirror.cc.utsunomiya-u.ac.jp/mirror/CPAN/modules/by-module/MD5/GAAS/HTML-Parser-3.04.readme +http://polygraph.ircache.net:8181/Game+Controllers/http_-2www.real-e-video.com/price-abuse.html +http://ecomonly.shop.goto.com/z/netadp/search/matches.jhtml?MANUF=Linksys +http://ecomonly.shop.goto.com/z/netadp/search/matches.jhtml?MANUF=Madge +http://freesoftware.subportal.com/sn/Web_Authoring/Misc__Programming_Tools/3100.html +http://www.sam.hi-ho.ne.jp/m-saka/stepwgn/himeji/6scene/ +http://ftp.unina.it/pub/Unix/linux/SuSE/ftp.suse.com/projects/3d/kernel/?N=D +http://www.ld.com/cbd/archive/1999/08(August)/10-Aug-1999/61awd001.htm +http://www.ld.com/cbd/archive/1999/08(August)/10-Aug-1999/61awd004.htm +http://statweb.byu.edu/sasdoc/sashtml/stat/chap2/sect5.htm +http://www.diogenes.de/4DACTION/web_rd_aut_show_authorlist/ID=483367&chr=F +http://web1.localbusiness.com/Story/Email/1,1198,RDU_461041,00.html +http://www.clientwire.com/A55697/tmr.nsf/vwApprovedResumesbyDate!OpenView&Start=55&Count=50&Collapse=48 +http://cpan.nitco.com/modules/by-module/Mail/JWIED/SNMP-Monitor-0.1011.readme +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=237&discrim=178,16,10 +http://www6.compaq.com/products/quickspecs/10135_na/10135_na.PDF +http://www.suk2.com/user/777/20001012.html +http://www.jamba.de/KNet/_KNet-vAy8j1-iFd-13az6/browse.de/node.0/cde7f2elw +http://www.imagesofengland.org.uk/41/69/416915.htm +http://ocean.ntou.edu.tw/search*chi/aLaplante,+Phillip+A./alaplante+phillip+a/7,-1,0,B/frameset&F=alappe+frances+moore&1,,2 +http://ocean.ntou.edu.tw/search*chi/aLaplante,+Phillip+A./alaplante+phillip+a/7,-1,0,B/frameset&F=alappe+frances+moore&2,,2 +http://wap.jamba.de/KNet/_KNet-6Fz8j1-oFd-13b3x/admLogin.de/node.0/cde7f1uou +http://yp.gates96.com/14/49/20/26.html +http://yp.gates96.com/14/49/20/37.html +http://yp.gates96.com/14/49/20/39.html +http://yp.gates96.com/14/49/20/86.html +http://yp.gates96.com/14/49/20/94.html +http://yp.gates96.com/14/49/20/97.html +http://yp.gates96.com/14/49/21/19.html +http://yp.gates96.com/14/49/21/43.html +http://yp.gates96.com/14/49/21/68.html +http://yp.gates96.com/14/49/21/78.html +http://yp.gates96.com/14/49/24/6.html +http://yp.gates96.com/14/49/24/62.html +http://yp.gates96.com/14/49/24/77.html +http://yp.gates96.com/14/49/24/83.html +http://yp.gates96.com/14/49/25/30.html +http://yp.gates96.com/14/49/25/41.html +http://yp.gates96.com/14/49/26/17.html +http://yp.gates96.com/14/49/26/53.html +http://yp.gates96.com/14/49/27/21.html +http://yp.gates96.com/14/49/27/27.html +http://yp.gates96.com/14/49/27/45.html +http://yp.gates96.com/14/49/27/65.html +http://yp.gates96.com/14/49/28/71.html +http://www.boston.digitalcity.com/orangecounty/entertainment/article.dci?aid=1293&start=10 +http://tucows.allnet.it/winme/adnload/143-006-005-021.html +http://tucows.allnet.it/winme/adnload/143-006-005-030.html +http://www.trax.nilex.co.uk/trax.cgi/A1C/B1U/A1D/C1R/A2D/A1U/ +http://www.crosswinds.net/~klinnia/DragonsDomain/Nest/nest.htm +http://mirrors.valueclick.com/backup.pause/modules/by-category/99_Not_In_Modulelist/Memoize/?S=A +http://www.tgw.com/EJr.5ajd/customer/category/product.html?SUBCATEGORY_ID=557 +http://www.sohu.com/business_economy/Company/Computer_Internet/Network_System/Network/ +http://china-water.51.net/oicq/oicq_down.htm +http://ftp.lip6.fr/pub/FreeBSD/development/FreeBSD-CVS/ports/math/plplot/patches/Attic/patch-ac,v +http://library.cuhk.edu.hk/search*chi/cHC427.92.C59/chc++427.92+c59/-5,-1,,E/browse +http://yp.gates96.com/4/8/60/2.html +http://yp.gates96.com/4/8/60/19.html +http://yp.gates96.com/4/8/62/9.html +http://yp.gates96.com/4/8/62/23.html +http://yp.gates96.com/4/8/62/59.html +http://yp.gates96.com/4/8/63/26.html +http://yp.gates96.com/4/8/63/41.html +http://yp.gates96.com/4/8/64/48.html +http://yp.gates96.com/4/8/65/0.html +http://yp.gates96.com/4/8/65/42.html +http://yp.gates96.com/4/8/66/13.html +http://yp.gates96.com/4/8/66/88.html +http://yp.gates96.com/4/8/67/23.html +http://yp.gates96.com/4/8/67/51.html +http://yp.gates96.com/4/8/68/11.html +http://yp.gates96.com/4/8/68/16.html +http://yp.gates96.com/4/8/68/78.html +http://www.outpersonals.com/cgi-bin/w3com/pws/out/CehIaxpSN7cGOeOUjXx_FtrylkakPWisW0DYq0MYmHwGxLBo7shB2XGSeXyvbnsBzHMJTZtmYOUK-XaaAW0Yh88wTY-Mms-hxw67Xaw8WMk3-vUJ4sXm4U7yIGdiN9XoPOqfnODrkqXYztjU6Var +http://www.brd.net/brd-cgi/brd_netzwerk?mailto&router&BZ85G0IL +http://power.luneng.com/power/library/jxgcs/jxgc99/jxgc9912/991204.htm +http://www.egroups.com/messages/Creative_Teaching/72?viscount=-30 +http://www.egroups.com/message/Creative_Teaching/85 +http://ftp.eecs.umich.edu/.1/people/elta/cusm-Javajae-elta/?D=A +http://polygraph.ircache.net:8181/cagliari/WHOWOULD.HTM +http://www.tiscover.ch/1Root/Kontinent/6/Staat/30/Bundesland/33/Ort/1564/Homepage/h_homepage...2.html +http://t-online.de/computer/haupt/intcoh87.htm +http://prodigy-sports.excite.com/ncaab/news/025uwire1 +http://wwwold.ifi.uni-klu.ac.at/Manuals/jdk1.1b3/docs/guide/awt/designspec/graphics/imagescale.html +http://www.taconet.com.tw/a6983/ +http://www.mapion.co.jp/custom/AOL/admi/13/13107/higashimukojima/3chome/index-3.html +http://www.mapion.co.jp/custom/AOL/admi/13/13107/higashimukojima/3chome/index-13.html +http://caller-times.com/autoconv/kickoff98/kickoff30.html +http://www.incestpornstories.com/bisexualbisexual/big-bonedmen/beautiesslanted-eyes/plus-sizeoverweight/{teenlink} +http://qcardsccg.safeshopper.com/8/359.htm?923 +http://qcardsccg.safeshopper.com/8/429.htm?923 +http://qcardsccg.safeshopper.com/8/433.htm?923 +http://lib1.nippon-foundation.or.jp/1997/0486/contents/011.htm +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceOrderStatusOverview-BBC709F1_97EF_F357031944376B6D965FDC23BED4C6F4 +http://in.egroups.com/subscribe/muovimallit +http://multichat.de/fp/talk/cb-funk/4.htm +http://multichat.de/fp/talk/cb-funk/5.htm +http://www.jamba.de/KNet/_KNet-zfB8j1-EFd-13bkr/browse.de/node.0/cde7f2elw +http://www.jamba.de/KNet/_KNet-zfB8j1-EFd-13bl7/showInfo-jobs.de/node.0/cenv0b09a +http://152.80.49.210/PUBLIC/WXMAP/GLOBAL/AVN/2000103000/avn.prp.00-36.swasia.htm +http://retailer.gocollect.com/do/session/1912741/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/help/site_tour/index.asp +http://retailer.gocollect.com/do/session/1912741/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/top_ten.asp?pagenum=2 +http://www.fogdog.com/cedroID/ssd3040183248168/nav/products/winter_sports/1b/shell_jackets/ +http://www.fogdog.com/cedroID/ssd3040183248168/nav/products/featured_brands/3c/all/ +http://kutschen.de/Schoner/literature/Sammlungen/modelle/collections/ +http://el-mundo.es/1999/06/04/television/04N0121.html +http://bitwise.tucows.com/win2k/htmlval2k_license.html +http://bbs.ee.ntu.edu.tw/boards/Saturn/3/7/12/5.html +http://ustlib.ust.hk/search*chi/deconomic+conditions+cameroon+to+1960/deconomic+conditions+cameroon+to+1960/-5,-1,0,B/browse +http://excite.de/kunst/katalog/865 +http://www2.hindustantimes.com/ht/nonfram/280498/detFRO07.htm +http://yp.gates96.com/11/69/0/60.html +http://yp.gates96.com/11/69/1/60.html +http://yp.gates96.com/11/69/1/72.html +http://yp.gates96.com/11/69/2/80.html +http://yp.gates96.com/11/69/3/7.html +http://yp.gates96.com/11/69/3/54.html +http://yp.gates96.com/11/69/3/66.html +http://yp.gates96.com/11/69/3/90.html +http://yp.gates96.com/11/69/3/91.html +http://yp.gates96.com/11/69/4/13.html +http://yp.gates96.com/11/69/4/18.html +http://yp.gates96.com/11/69/4/26.html +http://yp.gates96.com/11/69/4/70.html +http://yp.gates96.com/11/69/5/45.html +http://yp.gates96.com/11/69/5/77.html +http://yp.gates96.com/11/69/6/10.html +http://yp.gates96.com/11/69/6/80.html +http://yp.gates96.com/11/69/7/43.html +http://yp.gates96.com/11/69/7/76.html +http://yp.gates96.com/11/69/8/17.html +http://yp.gates96.com/11/69/8/33.html +http://yp.gates96.com/11/69/8/98.html +http://yp.gates96.com/11/69/9/3.html +http://yp.gates96.com/11/69/9/41.html +http://yp.gates96.com/11/69/9/92.html +http://store.peoplestour.com/kore/catalog/Music/R&B/G_by_artist/104757/product.html +http://free.prohosting.com/~seikyo/speak2.htm +http://pub.chinaccm.com/12/news/200009/16/160724.asp +http://pub.chinaccm.com/12/news/200008/11/155448.asp +http://www.fogdog.com/cedroID/ssd3040183305379/nav/products/featured_brands/12r/spa_products/ +http://itcareers.careercast.com/texis/it/itjs/+EwwBmev6D86ebtwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewGtmoBGnaqdGpdGwBodDacnwmaADdicnmtnaMwDwtnMnDBanDtoDnnGaMw55wqr15nBB5aqwpB1GnaoDhdGMwBodDaBnqrDdcdton5aMFqhTfR20DzmewrwwwpBmGeP0-dmwww5rmeNDwwwBrmeZpwww/jobpage.html +http://www.outdoorwire.com/content/lists/dirt/200004/msg00354.html?{LoadingFrameset} +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=5&discrim=186,22,8 +http://www.teleparc.com/sports/funski/02/03.htm +http://cn.egroups.com/post/safrica_bridge?act=reply&messageNum=43 +http://www.dfae.diplomatie.gouv.fr/culture/france/cinema/documentaires/recherche/francais/ethique.html +http://ring.toyama-ix.net/archives/mac/info-mac/_Communication/ctb/?D=A +http://www.eveclub.com/cgi-bin/eveclub.front/972959528284/Catalog/11000155 +http://www.eveclub.com/cgi-bin/eveclub.front/972959528284/Catalog/2000019 +http://cometweb01.comet.co.uk/do!session=132005&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG5ubLZDXLZolLl3l5jbqLljX5fkkKaotHlob5mloLq1 +http://cometweb01.comet.co.uk/do!session=132005&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG3XqLbdlLov4LfpmLiXvL-Zd5jbkLYozKvot0cZd5ockLYozKvsm0uts0cZX5qkXLjbzKKbiLbsfLpflLkp5 +http://www.ualberta.ca/CNS/RESEARCH/Software/SAS/cms/zfor-hex.htm +http://www.ualberta.ca/CNS/RESEARCH/Software/SAS/os390/zlibname.htm +http://genforum.genealogy.com/cgi-bin/print.cgi?hanrahan::175.html +http://library.bangor.ac.uk/search/dAIDS+(Disease)+--+Risk+factors+--+Psychological+aspects+--+Periodicals/daids+disease+risk+factors+psychological+aspects+periodicals/-5,1,1,B/frameset&F=daids+disease+research&1,1, +http://www.rismedia.com/consumer/27/12194/ +http://www.hole.kommune.no/hole/journweb.nsf/weboffjournal!OpenView&Start=39&Count=50&Expand=38 +http://www.etoys.com/prod/toy/53097261 +http://www.outpersonals.com/cgi-bin/w3com/pws/out/J6tI5danl1CaEvxOmyBVl8pzyaGqhs1RWIGq0aJ2_fwvzv4y9T7bHlxQKPzsrhMRN5HEI_Y9ZKrSvboCZvKhdwPPYK2klPp0EqNMO7Mb8fDTcz6xykQv8YQCQ2dy_iLZjbXwrknXqcH32HVSXAq7iUr4yIVG66IK +http://www.amcity.com/jacksonville/stories/1999/11/22/daily16.html?t=printable +http://moviestore.zap2it.com/browse/MOVIES/BOXERSHO/s.F0FWmEHm +http://moviestore.zap2it.com/browse/MOVIES/SHIRT/s.F0FWmEHm +http://moviestore.zap2it.com/browse/MOVIES/TIE/s.F0FWmEHm +http://moviestore.zap2it.com/browse/MOVIES/WATCH/s.F0FWmEHm +http://yp.gates96.com/11/25/30/0.html +http://yp.gates96.com/11/25/30/47.html +http://yp.gates96.com/11/25/31/87.html +http://yp.gates96.com/11/25/32/3.html +http://yp.gates96.com/11/25/32/61.html +http://yp.gates96.com/11/25/32/97.html +http://yp.gates96.com/11/25/33/6.html +http://yp.gates96.com/11/25/33/81.html +http://yp.gates96.com/11/25/33/83.html +http://yp.gates96.com/11/25/34/10.html +http://yp.gates96.com/11/25/34/35.html +http://yp.gates96.com/11/25/34/88.html +http://yp.gates96.com/11/25/34/90.html +http://yp.gates96.com/11/25/35/95.html +http://yp.gates96.com/11/25/36/19.html +http://yp.gates96.com/11/25/36/98.html +http://yp.gates96.com/11/25/37/61.html +http://yp.gates96.com/11/25/37/74.html +http://yp.gates96.com/11/25/38/2.html +http://yp.gates96.com/11/25/38/62.html +http://yp.gates96.com/11/25/39/1.html +http://yp.gates96.com/11/25/39/25.html +http://yp.gates96.com/11/25/39/85.html +http://yp.gates96.com/11/25/39/95.html +http://www.linux.com/networking/network/industry/server/community/Red_Hat/ +http://www.linux.com/networking/network/industry/server/community/Slashdot/ +http://www.linux.com/networking/network/industry/server/community/growth/ +http://mirror.cc.utsunomiya-u.ac.jp/mirror/CPAN/modules/by-category/16_Server_and_Daemon_Utilities/Server/DRUOSO/Server-FastPL-1.0.0.readme +http://ftp.nacamar.de/pub/NetBSD/NetBSD-current/pkgsrc/parallel/clusterit/pkg/DESCR +http://dk.egroups.com/login.cgi?login_target=%2Fgroup%2FGravesrus +http://www.maxfunds.com/MF1000.nsf/FUNDanalysisPrint/FGOAX +http://www.gbnf.com/genealog2/brothers/html/d0065/I12666.HTM +http://office.net/benelux/nld/downloadcatalog/dldpowerpoint.asp +http://yam.com/en/rand/ent/music/minfo/ +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/Collect_DB_Advers2/2000-09-28/23/?N=D +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=22,11,35 +http://dk.egroups.com/messages/lafz/6 +http://www.online.kokusai.co.jp/Words/V0043555/wrd/G700/words/kana_main.html +http://adelaida.net/music/texts/pink75.html +http://support.tandy.com/support_audio/doc40/40914.htm +http://www.nutritionblvd.com/426162.html +http://www.nutritionblvd.com/426121.html +http://www.nutritionblvd.com/426117.html +http://www.fogdog.com/cedroID/ssd3040183301450/boutique/aaron_chang/ +http://www.fogdog.com/cedroID/ssd3040183301450/boutique/moving_comfort/ +http://www.fogdog.com/cedroID/ssd3040183301450/fly/ +http://in.egroups.com/login.cgi?login_target=%2Fmessage%2Finfogiappone%2F81 +http://in.egroups.com/post/infogiappone?act=reply&messageNum=81 +http://cn.egroups.com/message/1800list/5416 +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www.slac.stanford.edu/grp/arb/tn/arbvol1/ARDB011.pdf +http://crrstv.tucows.com/winnt/adnload/135146_46908.html +http://syix.tucows.com/win2k/adnload/61785_28334.html +http://ftp.ccu.edu.tw/pub/language/tcl/sorted/packages-7.6/sound/xmpeg_0.5/ +http://www.eos.ncsu.edu/linux/LDP/LDP/khg/HyperNews/get/fs/fs/3.html +http://polygraph.ircache.net:8181/http_-2www.tvguide.com/sports/football/http_-2home.netscape.com/http_-2www.premaonline.com/http_-2www.ionet.net/~burndragon/form1.html +http://se.egroups.com/group/MyLuminaGoezBoom +http://www.diogenes.ch/4DACTION/web_rd_aut_show_author/a_id=7056553&tmpl=AUT_00&ID=483371 +http://www3.newstimes.com/archive97/apr0497/tvg.htm +http://dic.empas.com/show.tsp/?q=edger&f=B +http://www.brio.de/BRIO.catalog/39fe2f570905fb6a2740d472aa7806aa/UserTemplate/2 +http://itcareers.careercast.com/texis/it/itjs/+uwwBme7WD86eYtwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewGtmoBGnaqdGpdGwBodDaoDhdGMwBodDa5nq1GoBOanDtoDnnGaiw5roDtBdDanDBnGpGo5naGn31oGnmawGqroBnqB1Gna5O5BnM5aMFqhTfR20DzmehrwwwpBmeZWD86Nwww5rmekdwwwBrmeZpwww/jobpage.html +http://itcareers.careercast.com/texis/it/itjs/+pwwBmet5986twwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewGtmoBGnaqdGpdGwBodDaoDhdGMwBodDa5nq1GoBOanDtoDnnGaiw5roDtBdDanDBnGpGo5naGn31oGnmawGqroBnqB1Gna5O5BnM5aMFqhTfR20DzmehrwwwpBmeZWD86Nwww5rmekdwwwBrmeZpwww/morelike.html +http://biblioteca.upv.es/bib/doc/doc_fisbd/180/132317//C/1825784/0////25/S/MLTPAI +http://www.stanford.edu/~sevls/files/?M=D +http://library.bangor.ac.uk/search/dSystem+analysis+--+Periodicals/dsystem+analysis+periodicals/-17,-1,0,B/browse +http://mirror.ox.ac.uk/Mirrors/ftp.redhat.com/roughcuts/m68k/misc/src/install/pci-probing/CVS/ +http://yp.gates96.com/0/13/10/17.html +http://yp.gates96.com/0/13/11/26.html +http://yp.gates96.com/0/13/12/20.html +http://yp.gates96.com/0/13/12/24.html +http://yp.gates96.com/0/13/12/49.html +http://yp.gates96.com/0/13/13/22.html +http://yp.gates96.com/0/13/13/80.html +http://yp.gates96.com/0/13/15/8.html +http://yp.gates96.com/0/13/16/4.html +http://yp.gates96.com/0/13/16/18.html +http://yp.gates96.com/0/13/16/64.html +http://yp.gates96.com/0/13/17/15.html +http://yp.gates96.com/0/13/18/11.html +http://yp.gates96.com/0/13/18/18.html +http://yp.gates96.com/0/13/19/5.html +http://yp.gates96.com/0/13/19/22.html +http://yp.gates96.com/0/13/19/60.html +http://library.cuhk.edu.hk/search*chi/aYen-shou,+Shih,+904-975./ayen+shou+shih++904++975/-5,-1,0,E/2browse +http://china.sydney2000.com/StaticNews/2000-07-29/News372a86.htm +http://www.fujian-window.com/Fujian_w/news/mzrb1/20000724/3_1.html +http://www.fujian-window.com/Fujian_w/news/mzrb1/20000724/3_2.html +http://legalminds.lp.findlaw.com/list/law-lib/nav07807.html +http://ftp.fi.debian.org/debian/dists/woody/contrib/binary-sparc/tex/?N=D +http://community.webshots.com/photo/3635718/3636284GcTotmmONR +http://www.power2lead.com/Global/English.nsf/pgWWLocations!OpenPage&ExpandSection=23,24,25,17,10 +http://spaindustry.com/por/exp/911.html +http://niagara.tucows.com/winme/preview/10464.html +http://niagara.tucows.com/winme/adnload/138750_30032.html +http://niagara.tucows.com/winme/adnload/138743_30025.html +http://niagara.tucows.com/winme/adnload/138740_30023.html +http://retailer.gocollect.com/do/session/1912780/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/advanced_search.asp +http://preview.egroups.com/messages/UKMatrix +http://fi.egroups.com/login.cgi?login_target=%2Fmessage%2Fhecates_news%2F21 +http://pub.chinaccm.com/02/news/200005/31/133146.asp +http://pub.chinaccm.com/02/news/200005/31/133212.asp +http://localhost/test, +http://kuyper.calvin.edu/fathers2/ANF-02/anf02-25.htm +http://kuyper.calvin.edu/fathers2/ANF-02/anf02-56.htm +http://totalsports.aol.com/stats/bbo/mlb/mlb/990910.cle.AT.cws.box.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/990915.nym.AT.col.box.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/990919.cws.AT.tor.box.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/990926.hou.AT.mil.box.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/991003.nyy.AT.tam.box.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/991006.bos.AT.cle.box.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/ALscores.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/CAT.ROS.pit.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/NYY.CLE.pit.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/mlb.ARI.recap.html +http://totalsports.aol.com/stats/bbo/mlb/mlb/mlb.atl.vs.hou.stat.html +http://www.jpc-music.com/2241771.htm +http://sunsite.org.uk/packages/TeX/uk-tex/macros/latex/contrib/supported/europs/?M=A +http://mitglied.tripod.de/blueblood/forum.html +http://kuyper.calvin.edu/fathers2/NPNF1-06/npnf1-06-92.htm +http://garbage.sonicnet.com/classical/features/Thomas,_Tilson/060500/index04.jhtml +http://dk.egroups.com/post/danish?act=forward&messageNum=6 +http://www.bornloser.com/comics/peanuts/f_profiles/html/f4b1.html +http://www.online.kokusai.co.jp/Home/V0043517/wrd/G100/ +http://www.affiliate.hpstore.hp.co.uk/do/session/380823/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.france.hp.com/Main/acheterhp/ +http://www.bemi-immobilien.de/Landhaus-Bordeaux/Gemeinsam/versicherungen/lebensversicherung/Gemeinsam/Startseite/Top-Darlehens-Konditionen/Gemeinsam/erreichenPartner/email3d.htm +http://sunsite.org.uk/public/pub/Mirrors/ftp.hpc.uh.edu/pub/?D=A +http://genforum.genealogy.com/cgi-bin/print.cgi?tillery::418.html +http://ring.omp.ad.jp/archives/lang/perl/CPAN/authors/id/MSCHWARTZ/?M=A +http://montxsuz.all-hotels.com/usa/massachusetts/plymouth_e1.htm +http://montxsuz.all-hotels.com/usa/massachusetts/brewster_e1.htm +http://montxsuz.all-hotels.com/usa/massachusetts/edgartown_e1.htm +http://montxsuz.all-hotels.com/usa/massachusetts/north_dartmouth_e1.htm +http://montxsuz.all-hotels.com/usa/massachusetts/washington_e1.htm +http://romeo.univ-savoie.fr/winnt/adnload/51179_28892.html +http://www.dispatch.co.za/1998/12/02/sport/FALDO.HTM +http://www.dispatch.co.za/1998/12/02/sport/RACE2.HTM +http://store1.europe.yahoo.com/brink2/2000074707407.html +http://www34.yahoo.co.jp/horse/1999/tokyo/0530/result_08.html +http://members.tripod.co.jp/suiha_izumi/gallery-taikoubou-.htm +http://linuxberg.vol.at/gnomehtml/adnload/020-008-002-004_6145.html +http://books.hyperlink.com/bookdetails/Nuclear_Power_Plants_Worldwide/0810388804 +http://www.hudecek.de/gen/gen57.htm +http://www.hudecek.de/gen/gen61.htm +http://unofficial.capital.edu/students/kralph/ +http://web6.peopledaily.com.cn/gjjrb/200004/home.htm +http://www.gov.hk/hkma/eng/public/sccr/toc.htm +http://www4.50megs.com/johnphil29/86week3injury.htm +http://www4.50megs.com/johnphil29/86week3loupitlog.htm +http://naver22.juniornaver.co.kr/Entertainment_and_Arts/Performing_Arts/Theater/Musical/ +http://198.103.152.100/search*frc/dInfrastructure+(Economics)+--+Canada/dinfrastructure+economics+canada/-5,-1,0,B/frameset&F=dinfrastructure+economics&3,,0 +http://198.103.152.100/search*frc/dInfrastructure+(Economics)+--+Canada/dinfrastructure+economics+canada/-5,-1,0,B/frameset&F=dinfrastructure+economics&5,,0 +http://www.playgirl.dk/oncampus/feature/collegemovies/06.html +http://www.linux.com/networking/support/red_hat/internet/consumer/growth/ +http://www.linux.com/networking/support/red_hat/internet/consumer/mainstream/ +http://no.egroups.com/message/tengu-l/224 +http://no.egroups.com/message/tengu-l/229 +http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.3-4/linux/Documentation/filesystems/romfs.txt?only_with_tag=LINUX-2_3_24 +http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.3-4/linux/Documentation/filesystems/romfs.txt?only_with_tag=LINUX-2_3_22 +http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.3-4/linux/Documentation/filesystems/romfs.txt?only_with_tag=LINUX-2_3_16 +http://sunsite.informatik.rwth-aachen.de/LinuxArchives/slackware/slackware/source/a/e2fsprog/?M=A +http://bbs.syu.ac.kr/NetBBS/Bbs.dll/ipspds018/lst/qqa/f/qqo/008A/zka/B2-kB2-p +http://stulchik.list.ru/catalog/13346.html +http://katalog.wp.pl/www/Biznes_i_Ekonomia/Firmy_Podzial_wg_Branz/Elektrotechnika_i_Energetyka/index25.html +http://www.fogdog.com/cedroID/ssd3040183313356/nav/stores/tennis/ +http://www.fogdog.com/cedroID/ssd3040183313356/customer_service/shop_by_catalog.html +http://193.207.57.3/cgi-win/hiweb.exe/a2/d13/b4,4,1f,4,4,, +http://ring.omp.ad.jp/archives/lang/perl/CPAN/modules/by-authors/id/JPRIT/Envy-2.45.readme +http://193.207.57.3/cgi-win/hiweb.exe/a2/d1342/b4,4,1f,e,e,, +http://library.wuhee.edu.cn/dzsy/military/china/army/002.htm +http://library.wuhee.edu.cn/dzsy/military/china/army/006.htm +http://library.wuhee.edu.cn/dzsy/military/china/army/059.htm +http://library.wuhee.edu.cn/dzsy/military/china/army/095.htm +http://polygraph.ircache.net:8181/http_-2www.geocities.com/TimesSquare/Maze/2075/http_-2www.yahoo.com/Science/Engineering/Mechanical_Engineering/corporate.htm +http://198.103.152.100/search*frc/aGundavaram,+Shishir/agundavaram+shishir/-17,-1,0,B/frameset&F=aguirdham+maureen&1,1 +http://findmail.com/message/geewhiz/21 +http://sound-dist.secured.co.uk/cgi-bin/psProdDet.cgi/19P02|972959597|Luggage|user|0|1,0,0,1 +http://sound-dist.secured.co.uk/cgi-bin/psShop.cgi/add|19P03|972959597|Luggage|user|0|1,0,0,1 +http://nme.com/AST/Discussion_Groups/CDA/Message_Search/1,1105,37_92-0-0-7,00.html +http://namviet.subportal.com/sn/Programming/Visual_Basic_Components_H-P/5638.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4963.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4810.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4735.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/3294.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/3329.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4689.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4646.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4582.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4587.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4154.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4607.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4600.html +http://www2.so-net.ne.jp/cinet/board/log/200001/messages/4571.html +http://www.gotocity.com/local/2/us/KS/g/67455/shopping/ +http://www.mapion.co.jp/custom/AOL/admi/13/13115/ogikubo/1chome/index-1.html +http://www.mapion.co.jp/custom/AOL/admi/13/13115/ogikubo/1chome/index-21.html +http://neuro-www.mgh.harvard.edu/forum_2/ChronicPainF/Capornottocapthatisthe.html +http://www.yagoo.co.kr/stats/pitching.asp?Mlbmanid=MIGDEL7299 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=50&discrim=165,233,7 +http://www.mirror.edu.cn/res/sunsite/pub/academic/literature/book-reviews/1994/8-August/?N=D +http://www.ferien-immobilien.de/ungarn/verkauf/Versteigerungen-IB/Startseite/Allgemeine-IB/Gemeinsam/versicherungen/gebaeude/Gemeinsam/vertriebspartner.htm +http://www.ferien-immobilien.de/ungarn/verkauf/Versteigerungen-IB/Startseite/Allgemeine-IB/Gemeinsam/versicherungen/gebaeude/Gemeinsam/feedback.html +http://www.bjd.com.cn/BJWB/20000401/GB/BJWB^10199^1^01W136.htm +http://pluto.beseen.com/boardroom/u/49766/ +http://amadeus.siba.fi/doc/bitchx/documentation/color.txt +http://www.ealingcommon.londonengland.co.uk/pensions.htm +http://pub8.ezboard.com/fthecriticalpoetsmessageboartheartofcritiquing.showMessage?topicID=11.topic&index=13 +http://pub8.ezboard.com/fthecriticalpoetsmessageboareverythingelse.showMessage?topicID=223.topic&index=10 +http://www.endocrine.ru/Meln_09_10_00/_vti_bin/shtml.exe/meln_post.htm?79 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=9,0+9,3-12,0+18,0 +http://www.jobvillage.com/channel/jobs/media_communication/b.9255.g.1733.html +http://www.teenplatinum.com/barelylegal/no-boundarieshardcore/flashingbarely-legal/sweatingendurance/cuntamateur/chinesepetite/bootygay-bar/lubricationfellatio.html +http://www.babyheirlooms.com/catalog/htmlos.cat/001222.1.5246799112 +http://src.openresources.com/debian/src/utils/HTML/R/change_cur_jutil.html +http://genforum.genealogy.com/caudill/messages/389.html +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959928076/Catalog/1000003 +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959928076/ContentView/1000188/1/1201981 +http://www.marketingtool.com/contribute/webfirm/b.435.r.2416.html +http://dell.excite.co.jp/member_encounters/mailing_list/ml_for_women +http://www.angeredsgymn.se/doc/sdb/en/html/keylist.SIGNSET.html +http://map.ipc.co.jp/asp/onmap/r/new/g-27/f-525628/ +http://www.jpc-music.com/2549026.htm +http://www.egroups.com/message/nandscarolina/324?source=1 +http://www.jpc-music.com/2226499.htm +http://www.jpc-music.com/2226480.htm +http://tucows.bigskysoft.com/winnt/miscaudiont_rating.html +http://tucows.bigskysoft.com/winnt/adnload/69355_28370.html +http://www.hole.kommune.no/hole/journweb.nsf/weboffjournal!OpenView&Start=115.23&Count=50&Expand=130 +http://personal.atl.bellsouth.net/mia/a/j/ajcubas/ +http://yp.gates96.com/7/49/21/96.html +http://yp.gates96.com/7/49/22/39.html +http://yp.gates96.com/7/49/22/60.html +http://yp.gates96.com/7/49/22/70.html +http://yp.gates96.com/7/49/22/75.html +http://yp.gates96.com/7/49/23/8.html +http://yp.gates96.com/7/49/23/30.html +http://yp.gates96.com/7/49/23/43.html +http://yp.gates96.com/7/49/24/7.html +http://yp.gates96.com/7/49/24/8.html +http://yp.gates96.com/7/49/24/27.html +http://yp.gates96.com/7/49/24/49.html +http://yp.gates96.com/7/49/25/92.html +http://yp.gates96.com/7/49/26/56.html +http://yp.gates96.com/7/49/26/77.html +http://yp.gates96.com/7/49/28/23.html +http://yp.gates96.com/7/49/28/34.html +http://yp.gates96.com/7/49/29/56.html +http://yp.gates96.com/7/49/29/60.html +http://sound-dist.secured.co.uk/cgi-bin/psShop.cgi/add|38P08B|972959501|Communications|user|0|1,0,0,1 +http://193.207.57.3/cgi-win/hiweb.exe/a2/d170/b9,4,1f,1c,1c,, +http://wuarchive.wustl.edu/systems/linux/replay/debian/dists/unstable/non-US/binary-hurd-i386/?M=D +http://www.private-immobilien-boerse.de/friesland/verkauf/Ferien-IB/Startseite/Gemeinsam/MarketingStrategie/Allgemeine-IB/Startseite/Exklusiv-IB/Startseite/ +http://citeseer.nj.nec.com/update/269184 +http://citeseer.nj.nec.com/cidcontext/3266491 +http://citeseer.nj.nec.com/cidcontext/3266502 +http://genforum.genealogy.com/cgi-genforum/forums/hinkle.cgi?786 +http://eagle.synet.edu.cn/mirror/www.wisc.edu/grad/catalog/cals/biometry.html +http://cisne.sim.ucm.es/search*spi/cCDR7(035)TRA/ccdr7(035)tra/-5,-1,0,B/frameset&F=ccdr7(058)may&1,1 +http://www.wfg-rhein-lahn.de/goldenes-fass/schrott2.htm +http://www.jamba.nl/KNet/_KNet-6Aw8j1-pC4-ptt0/browse.nl/node.0/cdn40t70v +http://www.dcc.ufmg.br/Entnet/estrem/tsld018.htm +http://sites.uol.com.br/knaumann/DorstnerDrahtwerke.html +http://64.209.212.162/learnlots/step/0,2891,9+47+95+23413+12412_0,00.html +http://www.on-semiconductor.com/pub/prod/0,1824,productsm_ProductSummary_BasePartNumber=LM337A,00.html +http://jxi.gov.cn/yw-gn001.nsf/view!OpenView&Start=39.19&Count=30&Expand=53 +http://systemlogic.neoseeker.com/Games/Products/PC/dropship/dropship_reviews.html +http://link.fastpartner.com/do/session/600373/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/smartguy.php +http://www.bsv.ch/ch/d/sr/0_211_222_1/a10.html +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/contact.netscape.com/contact +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/entertainment.netscape.com/entertainment/ +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/games.netscape.com/computing/games/features/ +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/home.netscape.com/finance/taxes/ +http://link.fastpartner.com/do/session/600379/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/brleksaker.php +http://itcareers.careercast.com/texis/it/itjs/+TwwBmeOWD86eDhwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewPXwotoBwcaqconDBahoDwDqnaqddGmoDwBdGaqdMpwDon5aBnwMax1mtnBoDtaMwoDBnDwDqnapGdqn55n5aGn51MnaMFqryfHfREIDzmUwwwpBme+9D86Exww5rme7dwwwBrmeZpwww/jobpage.html +http://fi.egroups.com/message/handebol_aaagm/5?source=1 +http://www.crutchfield.com/cgi-bin/S-SHC3792E7De/viewcart.asp +http://www.links2go.org/more/www.asle.umn.edu/ +http://yp.gates96.com/7/69/10/58.html +http://yp.gates96.com/7/69/10/64.html +http://yp.gates96.com/7/69/10/76.html +http://yp.gates96.com/7/69/10/91.html +http://yp.gates96.com/7/69/11/31.html +http://yp.gates96.com/7/69/11/67.html +http://yp.gates96.com/7/69/11/70.html +http://yp.gates96.com/7/69/11/88.html +http://yp.gates96.com/7/69/11/96.html +http://yp.gates96.com/7/69/12/25.html +http://yp.gates96.com/7/69/12/29.html +http://yp.gates96.com/7/69/12/61.html +http://yp.gates96.com/7/69/12/65.html +http://yp.gates96.com/7/69/12/73.html +http://yp.gates96.com/7/69/13/30.html +http://yp.gates96.com/7/69/13/36.html +http://yp.gates96.com/7/69/14/8.html +http://yp.gates96.com/7/69/14/32.html +http://yp.gates96.com/7/69/14/54.html +http://yp.gates96.com/7/69/14/62.html +http://yp.gates96.com/7/69/14/83.html +http://yp.gates96.com/7/69/15/34.html +http://yp.gates96.com/7/69/15/87.html +http://yp.gates96.com/7/69/16/18.html +http://yp.gates96.com/7/69/17/5.html +http://yp.gates96.com/7/69/17/22.html +http://yp.gates96.com/7/69/17/44.html +http://yp.gates96.com/7/69/17/86.html +http://yp.gates96.com/7/69/17/88.html +http://yp.gates96.com/7/69/18/16.html +http://yp.gates96.com/7/69/18/83.html +http://yp.gates96.com/7/69/18/88.html +http://yp.gates96.com/7/69/19/0.html +http://yp.gates96.com/7/69/19/1.html +http://yp.gates96.com/7/69/19/97.html +http://213.36.119.69/do/session/152995/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/jeux/jeux_himalaya.html +http://www.egroups.com/post/sikhstudent?act=forward&messageNum=77 +http://ca.yahoo.com/Regional/U_S__States/Wisconsin/Metropolitan_Areas/Milwaukee_Metro/Business_and_Shopping/Shopping_and_Services/Food_and_Drink/Beverages/ +http://www.aelita.net/products/services/library/~archive/Download_redirect/company/news/default.htm +http://mindex.tucows.com/winme/preview/430.html +http://coda.nctu.edu.tw/vendors/DBMaker/DBMaker/driver/PHP/?S=A +http://www.streetprices.com/Electronics/Computer_Hardware_PC/Switches/Monitor/MAKE+BELKIN+COMPONENTS/sortproductbydesc/SP151043.html +http://wynnsystems.com/y9I_5aVd/careerlink.html +http://www.volny.cz/alik/akordy/zizen.htm +http://www.houses-apartment-listings.com/Michigan/city_search_criteria.asp?state=MI&City=CHAMPION +http://pub9.ezboard.com/fpyro1394pyro1394.showAddReplyScreenFromWeb?topicID=345.topic +http://www.maastrek.de/maas/01851471b455eff5cd01/1/0/1 +http://beta.mkn.co.uk/wine/order/champ2?what-mnw9=1 +http://beta.mkn.co.uk/wine/order/champ2?what-mnw14=1 +http://sunsite.org.uk/public/pub/packages/andrew/auis-6.3/overhead/ +http://www.ferien-immobilien.de/Spanien/Verkauf/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/Gemeinsam/Exklusiv-IB/Startseite/Gemeinsam/geschaeftsbedingungen.htm +http://www.trax.nilex.co.uk/trax.cgi/A1S/A2S/A3S/1AL/A2D/A1S/ +http://www.trax.nilex.co.uk/trax.cgi/A1S/A2S/A3S/1AL/A2D/C2S/ +http://tv.thevines.com/leaf/AA0000369148/3/1 +http://tv.thevines.com/leaf/AA0000369148/37/0/&favorite[join]=yes +http://www.centc251.org/forums/aca-1/dispatch.cgi/isowg4/showFolder/100001/1304571 +http://freebsd.ntu.edu.tw/perl/modules/by-module/FileCache/ILYAZ/?D=A +http://www.highwired.net/Sport/Player/0,2291,2037-46698,00.html +http://www.nl.sco.com/unixware/adminguide/qs-11-32.html +http://www.online.kokusai.co.jp/Service/V0043502/wrd/G200/service/service.html +http://www.realize.com/ambe7581.htm,qt=e784fe2f=2a38a234-14-26557ed-80000000-0-0-3-- +http://www.realize.com/am9a7d81.htm,qt=e784fe2f=2a38a234-14-26557ed-80000000-0-0-3-- +http://www.geocities.co.jp/Colosseum/7952/dragon3.html +http://uk.dir.clubs.yahoo.com/Entertainment___Arts/Magic/~other/~White_Pages/2.html +http://yp.gates96.com/13/9/60/95.html +http://yp.gates96.com/13/9/60/97.html +http://yp.gates96.com/13/9/61/12.html +http://yp.gates96.com/13/9/61/42.html +http://yp.gates96.com/13/9/61/52.html +http://yp.gates96.com/13/9/62/13.html +http://yp.gates96.com/13/9/62/19.html +http://yp.gates96.com/13/9/62/32.html +http://yp.gates96.com/13/9/62/44.html +http://yp.gates96.com/13/9/62/75.html +http://yp.gates96.com/13/9/63/71.html +http://yp.gates96.com/13/9/63/89.html +http://yp.gates96.com/13/9/64/16.html +http://yp.gates96.com/13/9/64/64.html +http://yp.gates96.com/13/9/64/83.html +http://yp.gates96.com/13/9/65/15.html +http://yp.gates96.com/13/9/65/39.html +http://yp.gates96.com/13/9/65/81.html +http://yp.gates96.com/13/9/66/19.html +http://yp.gates96.com/13/9/66/51.html +http://yp.gates96.com/13/9/67/72.html +http://yp.gates96.com/13/9/67/75.html +http://yp.gates96.com/13/9/67/93.html +http://yp.gates96.com/13/9/67/94.html +http://yp.gates96.com/13/9/68/9.html +http://yp.gates96.com/13/9/68/14.html +http://yp.gates96.com/13/9/68/23.html +http://yp.gates96.com/13/9/68/39.html +http://yp.gates96.com/13/9/68/68.html +http://yp.gates96.com/13/9/69/22.html +http://yp.gates96.com/13/9/69/62.html +http://shop.intouch.de/cgi-bin/Eternit-Shop/1678827467/IconBar +http://www.jango.com/home_and_garden/outdoor_and_garden/gardening/outdoor_furniture/miscellaneous/?num=1&prod=7 +http://ring.omp.ad.jp/archives/lang/perl/CPAN/authors/id/SHERWOOD/CHECKSUMS +http://www.acad.polyu.edu.hk/spkg/sas8/sasdoc/hrddoc/indfiles/57263.htm +http://ftp.te.fcu.edu.tw/cpatch/system/mbm/source/?D=A +http://web1.localbusiness.com/Story/0,1118,SAN_11751,00.html +http://www.amulation.com/md-l-archive/199902/msg00357.html +http://ads3.zdnet.com/c/g=r1517&c=a53585&camp=c13878&idx=2000.10.30.21.32.11/www.sega.com/seganet +http://pub.chinaccm.com/23/news/200009/30/111206.asp +http://www.online.kokusai.co.jp/Service/V0043534/wrd/G200/service/service.html +http://www.buybuddy.com/sleuth/27/1/1060204/2992/ +http://www.friend4life.com/foreign-affair/infopage/info12655.htm +http://www.friend4life.com/women/info7867.htm +http://www.friend4life.com/women/info11637.htm +http://www.chabadlibrary.org/ecatalog/EC07/EC07328.HTM +http://tulips.ntu.edu.tw/search*chi/cJC311+S275+1992/cjc++311+s275+1992/7,-1,0,E/2browse +http://stationradio.subportal.com/sn/Network_and_Internet/Misc__Networking_Tools/866.html +http://www.canlii.org/ca/regu/sor88-278/sec2.html +http://www.rottentomato.com/movies/titles/traffic/click.php?review=1 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=4,26,16,35,15 +http://www.staroriental.net/nav/soeg/ihf,aai,n2,169,Electric+Wave+Girl+1998.html +http://www.staroriental.net/nav/soeg/ihf,aai,n2,176,Electric+Wave+Girl+1998.html +http://www.teenplatinum.com/barelylegal/bellyovary/parkingjail-bait/oral-sexoral-sex/big-bonedmen/sex/main.html +http://troy.lib.sfu.ca/search/snewsinc/snewsinc/-5,1,1,B/frameset&F=snewsbrief&1,,2 +http://biblio.cesga.es:81/search*gag/dLó%3Bpez+de+Medina,+Juan/dlopez+de+medina+juan/-5,-1,0,B/frameset&F=dlopez+de+ayala+pedro+critica+e+interpretacion&1,,2 +http://proxy.rmcnet.fr/udsp68/commissions.htm +http://proxy.rmcnet.fr/udsp68/csp_colmar.htm +http://yp.gates96.com/4/0/70/88.html +http://yp.gates96.com/4/0/71/51.html +http://yp.gates96.com/4/0/71/57.html +http://yp.gates96.com/4/0/71/84.html +http://yp.gates96.com/4/0/71/85.html +http://yp.gates96.com/4/0/72/84.html +http://yp.gates96.com/4/0/72/94.html +http://yp.gates96.com/4/0/73/15.html +http://yp.gates96.com/4/0/73/92.html +http://yp.gates96.com/4/0/74/96.html +http://yp.gates96.com/4/0/75/23.html +http://yp.gates96.com/4/0/75/94.html +http://yp.gates96.com/4/0/76/41.html +http://yp.gates96.com/4/0/76/82.html +http://yp.gates96.com/4/0/77/64.html +http://yp.gates96.com/4/0/78/93.html +http://yp.gates96.com/4/0/79/72.html +http://yp.gates96.com/4/0/79/82.html +http://fi.egroups.com/message/morehealth/13?source=1 +http://cn.egroups.com/message/Multicultural/489 +http://cn.egroups.com/message/Multicultural/495 +http://cn.egroups.com/message/Multicultural/497 +http://yp.gates96.com/4/1/60/54.html +http://yp.gates96.com/4/1/60/69.html +http://yp.gates96.com/4/1/61/83.html +http://yp.gates96.com/4/1/62/68.html +http://yp.gates96.com/4/1/63/13.html +http://yp.gates96.com/4/1/63/42.html +http://yp.gates96.com/4/1/63/61.html +http://yp.gates96.com/4/1/63/73.html +http://yp.gates96.com/4/1/64/15.html +http://yp.gates96.com/4/1/64/49.html +http://yp.gates96.com/4/1/64/54.html +http://yp.gates96.com/4/1/65/19.html +http://yp.gates96.com/4/1/65/26.html +http://yp.gates96.com/4/1/65/69.html +http://yp.gates96.com/4/1/65/98.html +http://yp.gates96.com/4/1/66/57.html +http://yp.gates96.com/4/1/66/62.html +http://yp.gates96.com/4/1/66/79.html +http://yp.gates96.com/4/1/66/86.html +http://yp.gates96.com/4/1/66/88.html +http://yp.gates96.com/4/1/67/6.html +http://yp.gates96.com/4/1/67/49.html +http://yp.gates96.com/4/1/67/76.html +http://yp.gates96.com/4/1/67/78.html +http://yp.gates96.com/4/1/68/57.html +http://yp.gates96.com/4/1/69/10.html +http://yp.gates96.com/4/1/69/47.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=blich&l=de +http://www.secinfo.com/d17xw.53m.htm +http://www.cs.unm.edu/sheppard-bin/igmdesc.cgi/n=shep/I1475 +http://home.pchome.com.tw/computer/54915491/data/data2.htm +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/folderFrame/100001/0/author/3910318 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=215&discrim=164,80,165 +http://library.bangor.ac.uk/search/cHN582+.R45+1991/chn++582+r45+1991/-5,-1,0,B/bibandlinks&F=chn++573+h313&1,1 +http://mai.flora.org/forum/new-2110 +http://www.tucows.telia.no/winnt/adnload/68747_30295.html +http://www.tucows.telia.no/winnt/adnload/135780_47081.html +http://www.annotate.net/html/Annotate_Directory/Top/Regional/North_America/United_States/Louisiana/Localities/C/Coushatta +http://wine.cc.chuo-u.ac.jp/home/pub/TeX/CTAN/support/mctex/?D=A +http://pub21.ezboard.com/ujaletheadmin.showPublicProfile?language=EN +http://ftp.lip6.fr/pub11/NetBSD/NetBSD-current/src/usr.sbin/quot/Makefile +http://www.hrdc.gc.ca/socpol/cfs/bulletins/jan97/man_f.shtml +http://www.loveme.com/infopage/info23899.htm +http://polygraph.ircache.net:8181/http_-2www.fsa.org/MutareMap.asp +http://www.sdrt.com.cn/tiyuzhichuang/wangqiu/mingxingdangan/4/gelafu.htm +http://home.netvigator.com/~raympoon/digital7.htm +http://www.bemi-immobilien.de/Startseite/www.allgemeine-immobilien-boerse.de/allgemeine-ib/landkreiszwickau/Verkauf/29109700708107kirchbergvillamü/Gemeinsam/3d-service/Top-Darlehens-Konditionen/Startseite/Gemeinsam/immolink/Startseite/froben.htm +http://www.hum.auc.dk/~magnus/MHonArc/NTSEC/frm00999.html +http://www.hum.auc.dk/~magnus/MHonArc/NTSEC/frm09255.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380849/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/entry.asp +http://genforum.genealogy.com/cgi-genforum/forums/skeen.cgi?265 +http://wiem.onet.pl/wiem/00f59f.html +http://www2.ipc.pku.edu.cn/scop/data/scop.1.007.033.001.002.000.html +http://splitrock.themes.tucows.com/cursors/adnload/15789.html +http://splitrock.themes.tucows.com/cursors/adnload/15884.html +http://www.cpami.gov.tw/ymsnp/animal/insect/34654text.htm +http://lateline.muzi.net/ll/fanti/89027.shtml +http://www.hig.se/(accessed,comment,date,header,quote)/~jackson/roxen/ +http://ftpsearch.belnet.be/ftp/packages/Linux-RedHat/up2date/rhl-6.0/alpha/README +http://ftpsearch.belnet.be/ftp/packages/Linux-RedHat/up2date/rhl-6.0/alpha/etc/ +http://ftpsearch.belnet.be/ftp/packages/Linux-RedHat/up2date/rhl-6.0/alpha/lib/ +http://polygraph.ircache.net:8181/services/define/http_-2www.microsoft.com/http_-2www.microsoft.com/ntserver/http_-2www.netscape.com/comprod/mirror/http_-2gateway.olympcfunding.com/products.html +http://polygraph.ircache.net:8181/services/define/http_-2www.microsoft.com/http_-2www.microsoft.com/ntserver/http_-2www.netscape.com/comprod/mirror/http_-2gateway.olympcfunding.com/products/ +http://f7.parsimony.net/forum9177/messages/638.htm +http://f7.parsimony.net/forum9177/messages/594.htm +http://japan.medscape.com/medscape/HIV/journal/1998/v04.n03/expert1098/expert1098.html +http://golfonline.comfluent.net/cgi.pan$advsts&Dicky_Pride&102&lwfth&pga?golfstats +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=93&discrim=5,200,183 +http://girls.4gee.com/japan/azumi_kawashima/big_page/0023.htm +http://www.jobvillage.com/channel/jobs/travel/travel_guide/b.4899.g.37.html +http://www.chaos.dk/sexriddle/b/o/q/p/ +http://www.osiris.978.org/~brianr/mirrors/olga/cowpie/m/mellencamp_john/?N=D +http://www.jpc-music.com/1695294.htm +http://sunsite.org.uk/packages/TeX/uk-tex/macros/latex/contrib/supported/t-angles/?D=A +http://www.shopworks.com/index.cfm/action/info/userid/000B34B5-2F17-19FE-9038010B0A0ADCF2 +http://www.bemi-immobilien.de/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Top-Darlehens-Konditionen/Gemeinsam/Startseite/Gemeinsam/Gemeinsam/versicherungen/gebaeude/Gemeinsam/Inserieren/onlineInserieren.htm +http://www.idgnet.com/crd_playstation_254384.html +http://www.3wbooks.de/BauerGunter/BauerGunter3406402798.htm +http://library.cwu.edu/search/dSports+--+Washington+(State)+--+Periodicals/dsports+washington+state+periodicals/-5,-1,0,B/request&F=dsports+university+of+michigan&1,,2 +http://www.aelita.net/products/library/sitemap/Reg/Subscribe/sitemap/Reg/QuoteRegister/Default.htm +http://topcu.tucows.com/winme/preview/76604.html +http://tonet.com.cn/zhuanyejihua/kaoshijihua/ligonglei/dianzizhuanyezhuanke.htm +http://tonet.com.cn/zhuanyejihua/kaoshijihua/falv2001.htm +http://tonet.com.cn/zhuanyejihua/kaoshijihua/caijinglei/gongshangqiyeguanlibenke.htm +http://ftp.univ-lyon1.fr/faq/by-name/cats-faq/breeds/american-curl +http://www.videos-erotism.com/xhuge/1/hardMid3.html +http://www.zope.org/Wikis/DevSite/Projects/CoreSessionTracking/WikiWikiWeb/map +http://www.v2music.com/Scripts/WebObjects-ISAPI.dll/V2_New_Publisher.woa/74461000003304200000112720000087451/Labels.wo/603110000077451/2.0.0.5.0/3/Webobjects1 +http://books.hyperlink.co.uk/bookinfo/Willa_Cathers_Transforming_Vision/Brienzo/Gary_W./0945636660 +http://ftp.darenet.dk/tucows/winme/adnload/137112_28604.html +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/TEKNIIKKA/korkeakoulukirjastot/yliopisto-+ja+korkeakoulukirjastot/insin%F6%F6rit/kirjastot/ +http://www.pokers.com/asp/sp-asp/_/SZ--2/PD--10017288/posters.htm +http://itcareers.careercast.com/texis/it/itjs/+RwwBmelXD86elmwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewhXwotoBwcaMnmowamoGnqBdGaDntdBowBodD5aqconDBaMwGAnBoDtapd5oBodDaMwDwtnainxawqqd1DBaMFqryfHfREIDzmbwwwpBmezWD86Wwww5rme9cwwwBrmeZpwww/jobpage.html +http://berlin-charlottenburg.de/deutsch/politik/ma/062.htm +http://www.ericsson.cl/cables/protection/index.shtml +http://209.207.239.212/bkindex/c1007/f1401.html +http://209.207.239.212/bkindex/c1007/f1418.html +http://www.neoseeker.com/forums/index.php?function=edit_message&messageid=1037 +http://www.neoseeker.com/forums/index.php?function=edit_message&messageid=1199 +http://www.geocities.co.jp/SweetHome-Green/3692/PROFILE.HTML +http://www.geocities.co.jp/SweetHome-Green/3692/MELINDEX.HTML +http://myhome.naver.com/bora1234/photo.html +http://www.magicvillage.de/magicvillage/computercenter/Grafik%20%26%20Layout/Software/Macintosh/Hotline/PowerBooks/ +http://student.monterey.edu/nr/panditharatnesha/world/ +http://in.egroups.com/message/Michelles__Miracles/657 +http://www.babyheirlooms.com/catalog/htmlos.cat/001248.1.5492769465 +http://republika.pl/raduczulu/counter.html +http://adex3.flycast.com/server/socket/127.0.0.1:2800/click/OnlineCitiesSM/OnlineCitiesInteractiveCityGuides/bd378258019 +http://www.8848.net/fjnews/200007/0728/2000072811393979.htm +http://www.chaos.dk/sexriddle/m/n/x/t/ +http://www.maastrek.de/maas/01eea86f59dac641c053/1/0/4 +http://yp.gates96.com/14/79/82/8.html +http://yp.gates96.com/14/79/82/95.html +http://yp.gates96.com/14/79/82/98.html +http://yp.gates96.com/14/79/83/10.html +http://yp.gates96.com/14/79/83/16.html +http://yp.gates96.com/14/79/83/48.html +http://yp.gates96.com/14/79/84/4.html +http://yp.gates96.com/14/79/84/96.html +http://yp.gates96.com/14/79/85/34.html +http://yp.gates96.com/14/79/85/96.html +http://yp.gates96.com/14/79/86/9.html +http://yp.gates96.com/14/79/86/11.html +http://yp.gates96.com/14/79/86/28.html +http://yp.gates96.com/14/79/86/32.html +http://yp.gates96.com/14/79/86/86.html +http://yp.gates96.com/14/79/86/96.html +http://yp.gates96.com/14/79/87/96.html +http://yp.gates96.com/14/79/88/38.html +http://yp.gates96.com/14/79/88/74.html +http://yp.gates96.com/14/79/88/95.html +http://yp.gates96.com/14/79/89/57.html +http://autos.yahoo.co.jp/ucar/m1010/k10102006199904/g24/a101020060240158710008510205199904_4.html +http://www02.geocities.co.jp/HeartLand-Keyaki/7483/ +http://online.excite.de/wirtschaft/katalog/32476 +http://www9.hmv.co.uk:5555/do/session/1347777/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/Top_Navigation_Bar/top_navbar.html +http://www9.hmv.co.uk:5555/do/session/1347777/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d90_sd0_pt0.html +http://infoserv2.ita.doc.gov/efm/efm.nsf/Sources!OpenView&Start=5&Count=30&Collapse=54 +http://users.ai-lab.fh-furtwangen.de/for_local_use_only/CD-TMFUMV/daten/beisp/05321/?D=A +http://www.babyheirlooms.com/catalog/htmlos.cat/011629.1.0871727476 +http://www.fogdog.com/cedroID/ssd3040183241146/cgi-bin/MyFogdog +http://www.3w-geschichte.de/OReillyJamesT/OReillyJamesT0471287237.htm +http://www.annotate.net/html/Annotate_Directory/Top/Arts/Movies/Titles/W/World_According_to_Garp,The/ +http://dandini.cranfield.ac.uk/vl=-39536559/cl=151/nw=1/rpsv/cw/web/nw1/bargen.htm +http://cgi.superonline.com/cgi-bin/sworld43/thread.pl/forums/sworld43/oss2000/45.html?dir=nextResponse +http://cgi.superonline.com/cgi-bin/sworld43/get/forums/sworld43/oss2000/45.html?admin +http://dogbert.bizit.net/debian/dists/unstable/non-US/non-free/binary-sparc/?M=A +http://ftp.eecs.umich.edu/debian/dists/potato/main/binary-i386/misc/?D=A +http://fi.egroups.com/message/girlscouting/3383 +http://dk.egroups.com/group/scaleauto +http://members.tripod.lycos.co.kr/SM4/paper.htm +http://www.jamba.nl/KNet/_KNet-BqE8j1-JC4-pv4w/browse.nl/node.0/cde7f2elw +http://yp.gates96.com/4/6/10/47.html +http://yp.gates96.com/4/6/10/52.html +http://yp.gates96.com/4/6/10/96.html +http://yp.gates96.com/4/6/11/25.html +http://yp.gates96.com/4/6/11/61.html +http://yp.gates96.com/4/6/11/67.html +http://yp.gates96.com/4/6/11/93.html +http://yp.gates96.com/4/6/12/11.html +http://yp.gates96.com/4/6/12/28.html +http://yp.gates96.com/4/6/12/66.html +http://yp.gates96.com/4/6/12/81.html +http://yp.gates96.com/4/6/12/93.html +http://yp.gates96.com/4/6/13/86.html +http://yp.gates96.com/4/6/13/94.html +http://yp.gates96.com/4/6/14/17.html +http://yp.gates96.com/4/6/14/76.html +http://yp.gates96.com/4/6/15/61.html +http://yp.gates96.com/4/6/16/47.html +http://yp.gates96.com/4/6/16/71.html +http://yp.gates96.com/4/6/17/62.html +http://yp.gates96.com/4/6/18/1.html +http://yp.gates96.com/4/6/18/24.html +http://yp.gates96.com/4/6/18/28.html +http://158.169.50.70/eur-lex/it/lif/dat/1994/it_294D1217_09.html +http://158.169.50.70/eur-lex/it/lif/dat/1995/it_295D0928_02.html +http://158.169.50.70/eur-lex/it/lif/dat/1997/it_297D0904_03.html +http://www.irishnews.com/k_archive/181299/local4.html +http://www.irishnews.com/k_archive/181299/local14.html +http://www.irishnews.com/k_archive/181299/local16.html +http://uk.dir.yahoo.com/Regional/U_S__States/North_Carolina/Cities/Charlotte/Business_and_Shopping/Business_to_Business/Manufacturing/Casting__Moulding__and_Machining/ +http://www.uwec.edu/Academic/English/Projects/VonHaden/ +http://www.playease.com/et/beauty/img/jijinglian/jjl054.htm +http://www.digitaldrucke.de/(aktuell,für,marktplatz,metamorphose,raum,sense)/_fort/html/themen/kultur/digital/digital.htm +http://pub6.ezboard.com/fzfreesubmissiondirectoryplacestosubmitforfree.showMessage?topicID=35.topic +http://pub6.ezboard.com/fzfreesubmissiondirectoryplacestosubmitforfree.showMessage?topicID=12.topic +http://www.emerchandise.com/browse/DISNEY/TOY/b.FAVORITES%20COMICS%20CARTOONS%20DISNEY/s.CgJlPxcV +http://www.centc251.org/forums/aca-1/dispatch.cgi/hsi/showNextUnseen/fol/100001/1302769 +http://911codes.com/games/platform/gameboy/sect/div/cont/list_cheat/spray/y/id/0000010187/gid/0000003974/_cheats/_walkthroughs/_codes/_pc/_n64/_psx/_gameboy/_playstation/ +http://library.bangor.ac.uk/search/dPolice+regulations+--+Great+Britain/dpolice+regulations+great+britain/7,-1,0,E/frameset&F=dpolice+social+work+great+britain+congresses&1,1 +http://www02.u-page.so-net.ne.jp/ta2/grosh/Training/Training9.html +http://ring.shibaura-it.ac.jp/archives/linux/RedHat/redhat/code/i18n/trans/?D=A +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=15,35,22,28,26 +http://ftp.nacamar.de/pub/NetBSD/NetBSD-current/pkgsrc/graphics/ruby-gl/?S=A +http://www.academyfloral.com/state/aliro/flowers/birthdaybouquet1.html +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/KIRJASTO-+JA+TIETOPALVELUT/ammattikorkeakoulukirjastot/ammattikorkeakoulut/p%E4ij%E4t-h%E4meen+koulutuskonserni/kirjastot/ +http://www.jpc-music.com/1409509.htm +http://chat.sportsline.com/u/ce/feature/0,1518,2565545_56,00.html +http://chat.sportsline.com/u/ce/feature/0,1518,1675610_56,00.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380831/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hpstore.hewlett-packard.fr/gp +http://209.207.239.212/bkindex/c1016/f1419.html +http://209.207.239.212/bkindex/c1016/f1424.html +http://www.sports.aol.fr/Jo/Perec_2.html +http://www.citybrazil.com.br/go/smiguelaraguaia/transporte.htm +http://www.fileamerica.com/states/texas/local/cameron/ptax.html +http://www.angelfire.com/nv/bellea +http://school.educities.org/card/a4711862.html +http://school.educities.org/card/a60902.html +http://school.educities.org/card/amy60630.html +http://school.educities.org/card/aney1.html +http://school.educities.org/card/christinelee.html +http://school.educities.org/card/grace3721.html +http://school.educities.org/card/jj1245j.html +http://school.educities.org/card/jyik.html +http://school.educities.org/card/k3813813.html +http://school.educities.org/card/k78780606.html +http://school.educities.org/card/kitty1snoopy.html +http://school.educities.org/card/landy1.html +http://school.educities.org/card/m0522.html +http://school.educities.org/card/mark747.html +http://school.educities.org/card/okdh.html +http://school.educities.org/card/poppybaby.html +http://school.educities.org/card/ry21.html +http://www.secinfo.com/dvtBm.7a.htm +http://www.craft-supplies.co.uk/cgi-bin/psProdDet.cgi/HT206|972959537|Deluxe_Dividers|user|0|0,0,1,1 +http://in.egroups.com/post/book-readers?act=forward&messageNum=3829 +http://www.nacion.co.cr/ln_ee/2000/enero/31/mundo10.html +http://www.bigstar.com/news/sb/index.cfm/4ae0978g371d907g1?fa=today +http://www.bigstar.com/cs/index.cfm/4ae0978g371d907g1?fa=privacy +http://v2.bdnet.com/I/Cailleaux/I/Cannabissimo/fiche_serie.htm +http://ftp.darenet.dk/tucows/winnt/adnload/12475_29978.html +http://ftp.darenet.dk/tucows/winnt/adnload/1879_29966.html +http://www.canit.se/(h1,k15,mail,unix,www)/support/ +http://byron17.home.chinaren.com/lit/novle/maio.htm +http://www.emerchandise.com/browse/PAGEANTS/MUG/b.FAVORITES%20PAGEANTS/s.Q8q0znEj +http://stulchik.list.ru/catalog/10310.html +http://stulchik.list.ru/catalog/10967.2.html +http://dada.tucows.com/adnload/70717_30131.html +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/folderFrame/100001/0/alpha/7677890 +http://webraft.its.unimelb.edu.au/196024/students/cabong/pub/?M=A +http://www.crutchfield.com/S-fFFHlZKyKNq/shop/ +http://www.earthsystems.org/gopher/seacnet/announce97-08-03-14/1994/aug94/94-08-25-18:%20Violence%20in%20Indian%20Country%20Over%20Waste +http://www.brio.de/BRIO.catalog/39fdb65f08c44c28273fd472aa7806e3/UserTemplate/10 +http://www.qsl.net/hj3ufa +http://www-jl.jl.cninfo.net/jlweb/book/wxtd/gu_long/chuliuxiang/bat/009.htm +http://www.intel.fr/support/netport/pro/21402.htm +http://shopping.lycos.co.kr/cgi-bin/LCWB.cgi/957423999/957522544/Catalog/1375/001 +http://www01.u-page.so-net.ne.jp/qc4/sam-ft/gallerycraftspace.html +http://rpmfind.net/linux/RPM/mandrake/usr_src_linux-2.2.16_pcmcia-cs-3.1.14_doc_Tree.html +http://www.chrisgraef.de/chg/webdesigner_medien.html +http://www.opengroup.com/trbooks/186/1864501634.shtml +http://moviestore.zap2it.com/shopcart/s.1GUFVsoF +http://moviestore.zap2it.com/browse/MOVIES/ACTIONFI/s.1GUFVsoF +http://moviestore.zap2it.com/browse/MOVIES/PUPPET/s.1GUFVsoF +http://ocean.ntou.edu.tw/search*chi/m387.224+M178t/m387.224+m178+t/-5,-1,0,E/buttonframe&F=m387.224+m178+m&1,,0 +http://www.egroups.com/message/BalletBuds/25 +http://link.fastpartner.com/do/session/600375/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/create/learn.htm +http://www.vedomosti.spb.ru/2000/arts/spbved-2180-art-27.html +http://www.vedomosti.spb.ru/2000/arts/spbved-2180-art-42.html +http://www.vedomosti.spb.ru/2000/arts/spbved-2180-art-45.html +http://www.vedomosti.spb.ru/2000/arts/spbved-2180-art-46.html +http://www2.ipc.pku.edu.cn/scop/rsgen.cgi?pd=3nla +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959900763/Catalog/1000006 +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959900763/Catalog/1000031 +http://fi.egroups.com/message/gailporter/199 +http://fi.egroups.com/message/gailporter/222 +http://www.egroups.com/messages/X-Air_Ultralight_Aircraft/359 +http://dia.tucows.com/winme/adnload/136838_28375.html +http://dia.tucows.com/winme/adnload/136846_28383.html +http://www.letsmusic.co.kr/directory/weblink/weblink_list/1,1011,100000000186810,00.html +http://www.smcworld.com/smcworld/bp/large/0744_2_1611_2_1611b.html +http://news.pchome.com.tw/ettoday/entertainment/20001028/index-20001028155543020439.html +http://www2.stas.net/lostlane/J.html +http://allmacintosh.arrakis.es/utilsmac_rating.html +http://novel.hichinese.net/zt/zpj/k/kelisidi/kill/008.htm +http://194.174.50.23/cgi-bin/FisRun/InsertExhibitorIntoNotebook/1/interpack99/d/2891 +http://www.loisirs.ch/jifmuf/14/roedrz.html +http://www.linux.com/networking/server/business/operating_system/learning/consumer/ +http://dandini.cranfield.ac.uk/vl=-39685335/cl=158/nw=1/rpsv/cw/www/faqs.htm +http://blisty.internet.cz/1250/9901/19990108a.html +http://www.staroriental.net/nav/soeg/ihf,aai,n2,247,Electric+Wave+Girl+1998.html +http://www.multimania.com/excave/vicking.html +http://students.lsu.edu/students/main.nsf/Pages/CSISAJ1!OpenDocument&ExpandSection=5,14,21,12 +http://www.secinfo.com/dWXc8.bz.htm +http://www.secinfo.com/dWXc8.9d.htm +http://bbs.ee.ntu.edu.tw/boards/RomanceNovel/11/2/9/2/ +http://ftp.nacamar.de/pub/NetBSD/packages/1.4/amiga/emulators/?M=A +http://no.egroups.com/subscribe/windows98 +http://ftp.dei.uc.pt/pub/netscape/communicator/english/4.76/unix/unsupported/linux20_libc5/?D=A +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www.gsb.stanford.edu/sloan/sloan_fellows.html +http://apple.excite.com/entertainment/music/artists_and_genres/alternative_rock/grunge/stone_temple_pilots/merchandise/ +http://home.sprynet.com/~tales/asw2.html +http://fi.egroups.com/post/audiovision?act=reply&messageNum=145 +http://www.zema.ru/post/forum/komi_respublika/usinsk/messages/712 +http://opac.lib.rpi.edu/search/ddesert+ecology/-5,-1,0,B/browse +http://www.arm.com/sitearchitek/support.ns4/html/sdt_debug!OpenDocument&ExpandSection=6,32,7,5 +http://www.linux.com/networking/network/technology/security/community/open_source/ +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=9,33,15,36,22 +http://isbn.nu/0505523892/borders +http://www.informika.ru/text/database/geom/Draw/ris/ris34_1.htm +http://caselaw.lp.findlaw.com/casecode/uscodes/42/chapters/77/subchapters/iii/parts/h/sections/section_6374_notes.html +http://www.cyd.com.cn/zqb/19991104/GB/9672^Q805.htm +http://providenet.tukids.tucows.com/win95nt/9-12/adnload/132963_46167.html +http://www.chaos.dk/sexriddle/e/o/g/k/i/ +http://www2.brent.gov.uk/planning.nsf/013459d30f2ad00680256623005fcc0a/8af30b42469a1215802568720046524a!OpenDocument&ExpandSection=16,13,11,9,15 +http://jje.subportal.com/sn/Multimedia_and_Graphics/MPEG_Audio_Players_and_Editors/9126.html +http://www.ropnet.ru/HyperNews/edit-response.pl/case/2856.html +http://www.eveclub.com/cgi-bin/eveclub.front/972959508447/Catalog/1000045 +http://itcareers.careercast.com/texis/it/itjs/+rwwBmeO9D86MwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewDXnnqrDoqwcaiGoBnapd5oBodDaxw5nmamdq1MnDBwBodDawppcoqwBodD5a15naM15BapGdm1qBodDawxcnaMFqtPfRRZNDzme8xwwwpBme7WD86eLrwww5rm-mwwBrmeZpwww/jobpage.html +http://www.iucr.ac.uk/iucr-top/journalsonline/iucr-top/cif/software/hiccup/prods/?M=A +http://lists.omnipotent.net/mysql/199707/msg00381.html +http://www.yescall.co.kr/kyungheein/ +http://minyos.its.rmit.edu.au/~s9763278/sparks/sparks.html +http://www.movieguide.com/pressroom/events/nbcpresstour/festival_nbcpresstour9.html +http://www.gamers.net/game/190940/reviews +http://www.staroriental.net/nav/soeg/ihf,aai,n2,198,Electric+Wave+Girl+1998.html +http://marysz.freeservers.com/cgi-bin/c/736/64/dXNlcmJhbm5lcg==/gn/6616/ +http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_delta/delta.h?annotate=1.34&sortby=rev +http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_delta/delta.h?annotate=1.28&sortby=rev +http://sunsite.org.uk/public/public/packages/WWW/spinner/?D=A +http://sunsite.org.uk/public/public/packages/WWW/spinner/untared/ +http://www.realbig.com/miata/miata/1998-01/1635.html +http://cky.8k.com/cgi-bin/framed/1359/info/jess.html +http://cky.8k.com/cgi-bin/framed/1359/info/bran.html +http://www.loisirs.ch/jifmuf/10/bhcqud.html +http://naver22.jrnaver.co.kr/Entertainment_and_Arts/Design_Arts/Architecture/Organizations/ +http://www.zing.com/member/?name=birchpole&c=1 +http://student.monterey.edu/nr/porrasjohnny/campus/ +http://ftp.lip6.fr/pub/FreeBSD/development/FreeBSD-CVS/ports/misc/peq/files/patch-ab,v +http://www.multimania.com/lesoir2/news/sept99/quake4.htm +http://www.multimania.com/lesoir2/news/sept99/2309-12.txt +http://www.multimania.com/lesoir2/news/sept99/0609-06.txt +http://www.multimania.com/lesoir2/news/sept99/1309-13.txt +http://homepage1.nifty.com/shiraishi/school/school2.htm +http://ring.htcn.ne.jp/pub/NetBSD/NetBSD-current/pkgsrc/mbone/sdr/pkg/PLIST +http://www.chaos.dk/sexriddle/m/c/z/b/ +http://www.chaos.dk/sexriddle/m/c/z/p/ +http://map.ipc.co.jp/asp/onmap/r/new/g-26/f-523824/ +http://www.nissan.co.jp/RENAULT-DEALERS/PASSPORT/view.cgi/admission/972959650-- +http://novel.hichinese.net/xd/gt/zpj/l/liangfengyi/jingrong/010.htm +http://www.tvstore.com/browse/TV/MAGNET/s.l03qOWiP +http://www.tvstore.com/browse/TV/KEYCHAIN/s.l03qOWiP +http://www.gbnf.com/genealog2/burt/html/d0002/I1199.HTM +http://www.gbnf.com/genealog2/burt/html/d0006/I1187.HTM +http://www.gbnf.com/genealog2/burt/html/d0004/I1521.HTM +http://src.openresources.com/debian/src/graphics/HTML/R/HVcreate.html +http://yomama.tgm.ac.at/doc/susehilf/gnu/vip/Changing.html +http://www.science.uva.nl/pub/NetBSD/NetBSD-current/pkgsrc/sysutils/gmc/pkg/ +http://news.fm365.com/zonghe/20001009/156610.htm +http://homepage1.nifty.com/tojo/shin13.htm +http://www.sf.digitalcity.com/naplesfl/personals/browse.dci?cat=wsw&sort=t +http://plat.debian.or.jp/debian/dists/woody/non-free/binary-hppa/otherosfs/?M=A +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/ports/databases/gdbm/distinfo?only_with_tag=RELEASE_4_1_0 +http://bbs.csie.ntu.edu.tw/txt/Emprisenovel/ebooks/mystery/alisanderla/wsyz/013.txt +http://www.legis.state.ia.us/GA/78GA/Legislation/SCR/00000/SCR00018/?M=D +http://www.mapion.co.jp/custom/AOL/admi/23/23104/kaminagoya/2chome/index-2.html +http://ciscom.cnet.com/hardware/member/entry/0,10285,0-1069-419-1544825,00.html +http://wow-online.vhm.de/Regional/Grossbritannien/Kunst.html +http://www.cs.rit.edu/~hpb/Man/_Man_Openwin_html/html2/sigaction.2.html +http://in.egroups.com/message/talksigncreate/287 +http://rainforest.parentsplace.com/dialog/thread.pl/newclubfoot8/19.html?dir=nextThread +http://ftp.jp.debian.org/debian-non-US/dists/potato/non-US/main/binary-arm/?N=D +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=baumelte&l=de +http://www.chaos.dk/sexriddle/i/f/p/k/h/ +http://unionsoft.narod.ru/3d/anatomy/pages/head1.htm +http://src.openresources.com/debian/src/electronics/acs_021.orig/acs-021.orig/ +http://www.mapion.co.jp/custom/AOL/admi/23/23111/takagicho/2chome/index-45.html +http://dennou-q.geo.kyushu-u.ac.jp/library/Linux/debian-jp/dists/unstable/contrib-jp/binary-m68k/tex/?N=D +http://rapidus.tucows.com/winnt/adnload/54123_28460.html +http://193.207.119.193/MV/gazzette_ufficiali/303-99/8.htm +http://www.emerchandise.com/help_security/b.TV%20FRASIER/s.LoO0xS99 +http://gpul.org/ftp/os/linux/cd-images/other/ISO/suse/?M=A +http://opac.lib.rpi.edu/search/arush+sean+c/-17,-1,0,E/frameset&arush+homer+f&1,,0 +http://genforum.genealogy.com/cgi-genforum/forums/griffin.cgi?3823 +http://www.leo.org/leoclick/dce2b1c893db6a8193428ecad9ecd878+L+1__ +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=55&discrim=178,230,174 +http://www.msb.malmo.se/search*swe/aKling,+Rolf/akling+rolf/7,-1,0,B/browse +http://retailer.gocollect.com/do/session/1912785/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/checkout/shopping_cart.asp +http://st3.yahoo.co.jp/nihondo/k4932828003023.html +http://webtools.familyeducation.com/whatworks/review/front/0,2562,1-10641-2316_-7233-3,00.html +http://www.bretagne-online.com/telegram/htdocs/archive/1997/19970618/sommaire/stpoldeleon.htm +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=234&discrim=235,230,183 +http://www.yagoo.co.kr/stats/batting.asp?Mlbmanid=HAMPAT7709 +http://www.linux.com/networking/network/new/website/suse/SAP/ +http://www.linux.com/networking/network/new/website/suse/security/ +http://javatest.a-net.nl/servlet/pedit.Main/http://www.cdc.gov/ncidod/dpd/parasiticpathways/drinkingwater.htm +http://www.across.or.jp/shizuoka/nbbs.cgi/seibu:n52/post +http://www.across.or.jp/shizuoka/nbbs.cgi/seibu:n52/450 +http://www.across.or.jp/shizuoka/nbbs.cgi/seibu:n52/607 +http://dangerous.co.kr/www.sony.co.jp/ProductsPark/Consumer/Peripheral/MDData/page6.html +http://www2.sega.co.jp/bbs/article/s/sports/47/xvwixh/jlvcgk.html +http://troy.lib.sfu.ca/search/alondon+mathematical+society/alondon+mathematical+society/-5,-1,0,B/frameset&F=alondon+m+c+s&2,,3 +http://pub14.ezboard.com/fbrlproductionsfrm10.showAddTopicScreenFromWeb +http://rex.skyline.net/html/Computers_-_Monitors.html?16,computers,radio,electronics,communication +http://rex.skyline.net/html/Software_-_Developers.html?20,computers,radio,electronics,communication +http://ftp.cwi.nl/static/publications/reports/abs/MAS-R9815.html +http://www.jt.com.br/noticias/98/09/28/sd2.htm +http://www.kentuckyconnect.com/heraldleader/news/080899/sportsdocs/08chuck.htm +http://pix.egroups.com/post/ipe?act=forward&messageNum=5302 +http://tulips.ntu.edu.tw/search*chi/cHT392+Un3/cht++392+un3/-5,-1,,B/browse +http://magazines.sina.com/gourmet/contents/199912/199912-006_3_gb.html +http://collection.nlc-bnc.ca/100/201/300/january/2000/00-06-05/sanctuary.html +http://collection.nlc-bnc.ca/100/201/300/january/2000/00-06-05/blue1.html +http://www.vorlesungen.uni-osnabrueck.de/informatik/pt/code/DiagramPalettes/Components.dpalette2/Image45 +http://www.vorlesungen.uni-osnabrueck.de/informatik/pt/code/DiagramPalettes/Components.dpalette2/Image5 +http://playsite.top263.net/software/hh-13.htm +http://www.dispatch.co.za/1998/12/21/sport/MISS.HTM +http://www.allhealth.com/parentsplace/send/0,3288,14-844-1-fertility-INFERTILITY,00.html +http://www.tucows.telia.no/win2k/preview/37705.html +http://www.peopledaily.co.jp/9803/09/current/newfiles/j1020.html +http://shopping.lycos.co.kr/cgi-bin/LCWB.cgi/957424007/957522556/Catalog/1320/001 +http://shopping.lycos.co.kr/cgi-bin/LCWB.cgi/957424007/957522556/Catalog/1321/001 +http://shopping.lycos.co.kr/cgi-bin/LCWB.cgi/957424007/957522556/Catalog/1328/001 +http://shopping.lycos.co.kr/cgi-bin/LCWB.cgi/957424007/957522556/Catalog/1350/001 +http://shopping.lycos.co.kr/cgi-bin/LCWB.cgi/957424007/957522556/Catalog/1359/001 +http://shopping.lycos.co.kr/cgi-bin/LCWB.cgi/957424007/957522556/ProductView/26897 +http://www.uftree.com/UFT/WebPages/Don_MacFarlane/FEB99/d1/i0001285.htm +http://wap.jamba.de/KNet/_KNet-n4B8j1-DFd-13bgt/showInfo-jambabanner.de/node.0/cde7f1uou +http://launchbase.com/Shopping/Visual_Arts/entertainment/information/Politics.htm +http://launchbase.com/Shopping/Visual_Arts/entertainment/shopping/Electronics.htm +http://www.aoyun.sina.com.cn/news/sports/table/2000-09-15/1/4622.shtml +http://www.eggerwirt.at/1Root/Kontinent/6/Staat/7/Bundesland/21/Ort/129509/Homepage/m_homepage...1.html +http://198.103.152.100/search*frc/dSociologie+rurale+--+Ontario/dsociologie+rurale+ontario/-5,-1,0,B/frameset&F=dsociologie+religieuse+islam&1,,0 +http://msn.excite.co.jp/travel/the_country/kinki/wakayama/hot_spring_of_accommodations/inn_tourist_home_in_wakayama?summary=false +http://search.ibm.co.jp/as400/year2000/v3r2.html +http://www.allgemeine-immobilien-boerse.de/nordrhein-Westfalen/Muehlheim-ruhr/Verkauf/Allgemeine-IB/Startseite/3d-service/Private-IB/Startseite/Gemeinsam/Super-Zins-Konditionen/anforderungsformular.htm +http://spaceports.tucows.com/winnt/adnload/78908_28797.html +http://www.trax.nilex.co.uk/trax.cgi/A1S/A2R/A3R/B1S/A1D/A1S/ +http://www.babyheirlooms.com/catalog/htmlos.cat/041130.1.3206884924 +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/music/misc/thoughts/lit/misc/colorart/misc/freespeech.html +http://www.cs.rit.edu/~hpb/Lectures/2000/JRMS_590/all-2.7.html +http://www.cs.rit.edu/~hpb/Lectures/2000/JRMS_590/all-4.11.html +http://www.refdag.nl/kl/990615klfo01.html +http://pub20.ezboard.com/ftheimperiumknightsfrm11.showMessage?topicID=9.topic +http://retailer.gocollect.com/do/session/1912767/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/advanced_search.asp +http://www.thestateofcolorado.com/saudealersnew.html +http://awelymor.weblogs.co.uk/sdb/en/html/ftp://ftp.suse.com/pub/suse/i386/6.2/suse/n1/ +http://www.mirror.kiev.ua:8083/paper/2000/21/1251/text/21-13-3.htm +http://www.recipezaar.com/browse/0110FC1070110A301109901109E00F06D +http://www.linux.com/networking/network/vpn/server/Unix/ +http://www.gasex.com/main.html?m4m.gallery.twinks +http://www.xtdnet.nl/listarch/linux-router/1998-05-01/nav00046.html +http://www.fogdog.com/cedroID/ssd3040183325831/cgi-bin/CedroCommerce?func=EditBasket +http://www.totalmarketing.com/an/basket.pl/cancel/xwxm6773.94076 +http://ciaoweb.tucows.com/winnt/adnload/56695_29112.html +http://www.brio.de/BRIO.catalog/39fe2f6006e4fc48273fd472aa7806e0/UserTemplate/1 +http://retailer.gocollect.com/do/session/1912715/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/top_ten.asp?pagenum=2 +http://retailer.gocollect.com/do/session/1912715/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/dealer_lookup.asp +http://www.streetprices.com/Electronics/Computer_Hardware_PC/Motherboards/ATX/Slot1/Via_Pro133/sortproductbymake/sortcategorybylowprice/ +http://www.streetprices.com/Electronics/Computer_Hardware_PC/Projectors/MAKE+CTX/sortdetailbystock/sortproductbyhighprice/sortcategorybycount/SP318392.html +http://www.multimania.com/egypt95/img0017.htm +http://dic.empas.com/show.tsp/?q=fourteenthly&f=B +http://linux2.ipc.pku.edu.cn/scop/pdb.cgi?sid=d1repc2 +http://www.schlagertempel.de/RobertPayer/B00000B8D2.htm +http://www.cricinfo.com/link_to_database/INTERACTIVE/MAGAZINE/1996-97/SL_IN_NZ/SL_IN_NZ_FEEDBACK_1.html +http://mediate.magicbutton.net/do/session/625637/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-top50.html +http://www.clickm.dk/Clickmusic_Web_Guide/Bands_and_Artists/B/Better_Than_Ezra/ +http://www.clickm.dk/Clickmusic_Web_Guide/Bands_and_Artists/B/Breeders,_The/ +http://www.maastrek.de/maas/71eb3baf4c78ed98ef94/1/0/4 +http://www.trnonline.com/archives/1999archives/07221999/obits/24620.shtml +http://www.recipezaar.com/browse/0110FC1070110A100F06D0110A00110A3 +http://www.areaguide.net/addlisting.asp?book=box&CatID=516 +http://webraft.its.unimelb.edu.au/196023/students/lucym/ +http://sunsite.org.uk/public/0-Most-Packages/quake/utils/frontends/qshel15b.txt +http://pub14.ezboard.com/flfiaglarafabianisagoddess.emailToFriend?topicID=858.topic +http://www.realize.com/am4d0481.htm,qt=e784fe2f=2a38a234-4-7cf2ef-1-1-0-3-- +http://www.realize.com/am7bcd81.htm,qt=e784fe2f=2a38a234-4-7cf2ef-1-10-0-3-- +http://mailman.real-time.com/rte-crossfire/1993/Dec/msg00022.html +http://mailman.real-time.com/rte-crossfire/1993/Dec/msg00000.html +http://mailman.real-time.com/rte-crossfire/1993/Dec/msg00009.html +http://www.eallinfo.com/A55782/sameeron.nsf/homeFood!OpenPage&ExpandSection=8,4,3,6 +http://www.ami.dk/udgivelser/emne/36.html +http://www-x500-1.uni-giessen.de:8890/Lcn%3dKai%20Cheong%20HO,ou%3dEstates%20Management%20Office,o%3dHong%20Kong%20University%20of%20Science%20and%20Technology,c%3dHK +http://ftp.telepac.pt/pub/cpan/modules/by-module/DBD/DMOW/?D=A +http://members.se.tripod.de/aah/jochumsen/per02614.htm +http://www.academyfloral.com/state/cacat/flowers/funeralofferingshare.html +http://www.hotelboulevard.com/fr/paris/standard/htmlb877e62937802c0678f4638130be1ef0/sessionLang/ANG/prov/browse/cp/75013/resultatSearch.html +http://www.alsapresse.com/jdj/00/03/24/AK/article_4.html +http://www.mairie-montreuil93.fr/ville_pratique/environ/democrat/printemps/_vti_cnf/interstice.htm +http://variety.studiostore.com/help/b.FAVORITES%20COMICS%20CARTOONS%20POWERPUFF/s.UAREyMtL +http://ftp.sektornet.dk/tucows/winme/adnload/137341_28799.html +http://www.eveclub.com/cgi-bin/eveclub.front/972959532302/Catalog/1000046 +http://www.eveclub.com/cgi-bin/eveclub.front/972959532302/ClubBoard/list/1000022 +http://findmail.com/post/geewhiz?act=reply&messageNum=2039 +http://orders.mkn.co.uk/toy/rattles/order/now.en$NOK?what-bells=1 +http://www.buybuddy.com.au/sleuth/26/1/502/10134/ +http://spokesmanreview.sportshuddle.com/sports/baseball/playbetter/ask-expert/vincent3.asp +http://ant.i.hosei.ac.jp/Ant.WWW/PCD0420/HTMLE/29.html +http://ant.i.hosei.ac.jp/Ant.WWW/PCD0420/HTMLE/34.html +http://builder.hw.net/frmRestDir/0,1112,'1~21~325~1~S~074800~90270',00.html +http://builder.hw.net/frmRestDir/0,1112,'1~21~325~1~S~074800~09890',00.html +http://dennou-h.ees.hokudai.ac.jp/library/Linux/debian-jp/dists/hamm-jp/non-free/binary-i386/games/?M=A +http://www.peopledaily.com.cn/GB/paper68/1469/236625.html +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/koffice/kformula/BracketElement.cc?hideattic=1&sortby=rev +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/koffice/kformula/FractionElement.cc?hideattic=1&sortby=rev +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/koffice/kformula/MIMETYPE-Format?hideattic=1&sortby=rev +http://linuxberg.ii.net/conhtml/preview/7963.html +http://213.36.119.69/do/session/152992/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/reserver/hotels.html +http://213.36.119.69/do/session/152992/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.spycamera.com/webcam/ +http://ftp.netc.pt/pub/idgames/levels/doom/d-f/deathme.txt +http://ftp.netc.pt/pub/idgames/levels/doom/d-f/dork.txt +http://ustlib.ust.hk/search*chi/dsea+stories/dsea+stories/-5,-1,0,B/browse +http://members.fortunecity.com/skinweaver/nf/nfpin01.htm +http://se.egroups.com/group/French_ +http://www.gencat.es/cgi-bin/bc/drawer.cgi/LD/0074/L00465?101 +http://oss.sgi.com/cgi-bin/cvsweb.cgi/projects/ogl-sample/main/gfx/lib/glut/glut_shapes.c?sortby=author +http://www.teacherformation.org/html/od/facilitators.cfm/task1,about/discussion_id,2/xid,9456/yid,7276398 +http://genforum.genealogy.com/cgi-genforum/forums/getchell.cgi?230 +http://www9.hmv.co.uk:5555/do/session/1347795/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d100_sd0_pt0.html +http://www.brd.net/brd-cgi/brd_multimedia/bildbearbeitung/WZ01K0DJ/beurteilung/ci=972850465.htm +http://retailer.gocollect.com/do/session/1912745/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/affiliate_network.asp +http://www.fao.org/icatalog/orders/basket.asp?prev2=yes&aries_id=1310 +http://www.realestate-mls.com/list.cgi/VACANT_LAND|WATERFRONT|Edenville!Midland!MI +http://www.geocities.co.jp/SilkRoad-Desert/1661/profile/profile.html +http://hp-partner.whowhere.lycos.com/hp/chick/com/nj/ +http://hp-partner.whowhere.lycos.com/hp/chick/com/next/ +http://hp-partner.whowhere.lycos.com/hp/chick/com/nightflight/ +http://www.emerchandise.com/browse/FRIENDS/TSHIRT/20/10/b.TV%20FRIENDS/s.kGIgjr5i +http://dk.egroups.com/group/anarchymcgill +http://bbs.gznet.edu.cn/cgi-bin/getannounce//groups/GROUP_3/WinNT_Win2k/smthbbs/Dir002 +http://de.excite.de/computer/katalog/12947 +http://www.bizline.co.kr/library/data/002/001/007/008/020/002/000017.html +http://www.bizline.co.kr/library/data/002/001/007/008/020/002/000046.html +http://saleonall.com/cat/OPTOMA/6492/video/projectors/145336/oneprod.html +http://sun1.rrzn-user.uni-hannover.de/jgaertner/matlab/help/techdoc/newfeat/ch213.html +http://sun1.rrzn-user.uni-hannover.de/jgaertner/matlab/help/techdoc/newfeat/newfeat.html +http://excite.de/wirtschaft/katalog/37737 +http://www.digitaldrucke.de/(aktuell,kino,kultur,werbung)/_fort/html/themen/aktuell/events/events.htm +http://www.digitaldrucke.de/(aktuell,kino,kultur,kunst)/suche/uebersicht.html +http://www.online.kokusai.co.jp/Stock_corner/V0043566/wrd/G500/stock_corner/stock_corner.html +http://yp.gates96.com/4/37/0/92.html +http://yp.gates96.com/4/37/1/3.html +http://yp.gates96.com/4/37/1/38.html +http://yp.gates96.com/4/37/1/58.html +http://yp.gates96.com/4/37/2/21.html +http://yp.gates96.com/4/37/3/56.html +http://yp.gates96.com/4/37/3/68.html +http://yp.gates96.com/4/37/3/79.html +http://yp.gates96.com/4/37/4/1.html +http://yp.gates96.com/4/37/4/48.html +http://yp.gates96.com/4/37/4/99.html +http://yp.gates96.com/4/37/5/27.html +http://yp.gates96.com/4/37/6/1.html +http://yp.gates96.com/4/37/6/7.html +http://yp.gates96.com/4/37/6/80.html +http://yp.gates96.com/4/37/7/0.html +http://yp.gates96.com/4/37/7/5.html +http://yp.gates96.com/4/37/7/9.html +http://yp.gates96.com/4/37/7/12.html +http://yp.gates96.com/4/37/7/49.html +http://yp.gates96.com/4/37/7/97.html +http://yp.gates96.com/4/37/8/15.html +http://yp.gates96.com/4/37/8/32.html +http://yp.gates96.com/4/37/8/62.html +http://yp.gates96.com/4/37/8/76.html +http://yp.gates96.com/4/37/8/96.html +http://yp.gates96.com/4/37/9/12.html +http://yp.gates96.com/4/37/9/14.html +http://yp.gates96.com/4/37/9/23.html +http://yp.gates96.com/4/37/9/78.html +http://yp.gates96.com/4/37/9/80.html +http://cgi.cnn.com/US/9601/state_union_poll/state_union_speech/pm/ +http://freethemes.netc.pt/cursors/adnload/16904.html +http://freethemes.netc.pt/cursors/preview/16926.html +http://freethemes.netc.pt/cursors/adnload/16953.html +http://library.bangor.ac.uk/search/dTelevision+broadcasting+of+news+--+Wales/dtelevision+broadcasting+of+news+wales/-17,-1,0,B/frameset&F=dtelevision+broadcasting+moral+and+ethical+aspects&1,1 +http://home.baoding.cn.net/~snowcxm/photoshop/newpage6tp.htm +http://home.baoding.cn.net/~snowcxm/photoshop/newpage6xq2.htm +http://dennou-q.geo.kyushu-u.ac.jp/library/Linux/debian-jp/dists/woody/non-free-jp/binary-sparc/otherosfs/?D=A +http://www.tucows.ch/winnt/toolnt_size.html +http://www.sdinfonet.com.cn/379/26/379269983.htm +http://www.sdinfonet.com.cn/379/26/379269980.htm +http://www.egroups.com/message/wdf/3368 +http://de.excite.de/bildung/katalog/35821 +http://kidneyfailure.shn.net/content/article/1677.57596 +http://kidneyfailure.shn.net/content/article/1677.57625 +http://kidneyfailure.shn.net/content/article/1677.57517 +http://kidneyfailure.shn.net/content/article/1677.57456 +http://kidneyfailure.shn.net/content/article/1677.57562 +http://dia.tucows.com/winme/adnload/138490_29803.html +http://www.nhic.or.kr/netbbs/Bbs.cgi/nhic31062/lst/qqo/004A +http://www.nhic.or.kr/netbbs/Bbs.cgi/nhic31062/qry/zka/B2-kB23p/pno/0/qqatt/^ +http://www.nhic.or.kr/netbbs/Bbs.cgi/nhic31062/qry/zka/B2-kB2-n/pno/0/qqatt/^ +http://www.nhic.or.kr/netbbs/Bbs.cgi/nhic31062/qry/zka/B2-kB2-o/pno/0/qqatt/^ +http://dk.egroups.com/message/tw2002/3626 +http://dk.egroups.com/message/tw2002/3644 +http://www.spiral.at/Katalog/Artikel/8908435/ +http://www.spiral.at/Katalog/Artikel/8908842/ +http://168.160.224.62/insurance/200006/10/114941.asp +http://168.160.224.62/insurance/200006/10/114219.asp +http://tucows.soneraplaza.nl/termnt_license.html +http://pub13.ezboard.com/ubelegruin.showPublicProfile?language=EN +http://troy.lib.sfu.ca/search/tbiometrics/tbiometrics/-5,-1,0,B/exact&F=tbiometrical+genetics+the+study+of+continuous+variation&1,2/limit +http://futures.homeway.com.cn/lbi-html/news/content/20001013/172026.shtml +http://jproxy.uol.es/jproxy/http://www.channel6000.com/sh/sports/columnist/stories/columnists-20001030-154321.html +http://www.linux.com/networking/network/free/release/community/development/ +http://pub17.ezboard.com/fskysurfingskysurfersubb.showAddReplyScreenFromWeb?topicID=4.topic +http://ring.tains.tohoku.ac.jp/pub/linux/debian/debian-jp/dists/woody/contrib-jp/binary-m68k/oldlibs/?D=A +http://10000downloads.subportal.com/sn/Network_and_Internet/Misc__Communications_Tools/12507.html +http://www.hbdaily.com.cn/ctdsb/19991101/GB/ctdsb^1042^06^Ct06b08.htm +http://cytobase.cnusc.fr:8101/textes/PURDmail/1998-12/nav00129.html +http://www.brio.de/BRIO.catalog/39fe2f73050d53aa2741d472aa7806d2/UserTemplate/9 +http://www.anekdot.ru:8084/an/an0007/t000731.html +http://statweb.byu.edu/sasdoc/sashtml/gref/z0265802.htm +http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux/drivers/char/ftape/Makefile?only_with_tag=davem-cvs-merge +http://www.intellicast.com/Golf/World/UnitedStates/Southeast/NorthCarolina/Hawksnest/WINDcast/d1_00/bannerAd.shtml +http://dailynews.sina.com.hk/sinaNews/wiser/hkStock/2000/0720/1418727.html +http://ftp.dti.ad.jp/pub/lang/CPAN/authors/id/A/AG/AGUL/?S=A +http://link.fastpartner.com/do/session/600392/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/jobpilot.php +http://link.fastpartner.com/do/session/600392/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/smartguy.php +http://citeseer.nj.nec.com/cidcontext/1024594 +http://www.burstnet.com/ads/ad4820b-map.cgi/1395444997 +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/kdeutils/kpm/proc.h?r1=1.6&only_with_tag=HEAD +http://www.uftree.com/UFT/WebPages/JenHawkins/ALL/d0/i0001501.htm +http://www.uftree.com/UFT/WebPages/JenHawkins/ALL/d0/i0000641.htm +http://www.uftree.com/UFT/WebPages/JenHawkins/ALL/d1/i0000932.htm +http://www.uftree.com/UFT/WebPages/JenHawkins/ALL/d1/i0000762.htm +http://www.uftree.com/UFT/WebPages/JenHawkins/ALL/d1/i0000997.htm +http://www.uftree.com/UFT/WebPages/JenHawkins/ALL/d1/i0001325.htm +http://www.uftree.com/UFT/WebPages/JenHawkins/ALL/nindex.htm +http://www.primenet.com/~g-lady/Farewell/_borders/ +http://imasy.or.jp/~iwao/hokkaido/kushiro.html +http://citeseer.nj.nec.com/nrelated/0/208436 +http://www.zeal.com/Arts___Entertainment/Literature/Authors/Lovecraft__H_P_/Books/Cthulhu_Campus_Crusade_for_Cthulhu/ +http://ftp1.se.debian.org/debian/dists/woody/contrib/binary-mipsel/mail/?M=A +http://ftp1.se.debian.org/debian/dists/woody/contrib/binary-mipsel/mail/?S=A +http://webtools.familyeducation.com/whatworks/item/front/0,2551,1-10698-1981-,00.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380859/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/REGISTRATION/entry.asp +http://www.collectingnation.com/cgi-bin/bn/view_feedback.mod/pn?HANDLE=pokeweed +http://www.egroups.com/messages/Future-History-L/213 +http://www.egroups.com/message/Future-History-L/192 +http://www.burstnet.com/ads/cb7826a-map.cgi/1384588733 +http://www.cs.com.cn/csnews/articles/142_23823.htm +http://search.yam.com.tw/en/new/edu/hs/voca/tpc_vs/ +http://ftp.univie.ac.at/packages/tex/macros/latex2e/contrib/supported/vmargin/?D=A +http://citeseer.nj.nec.com/cidcontext/3145269 +http://yp.gates96.com/11/72/80/34.html +http://yp.gates96.com/11/72/80/36.html +http://yp.gates96.com/11/72/80/76.html +http://yp.gates96.com/11/72/81/26.html +http://yp.gates96.com/11/72/81/67.html +http://yp.gates96.com/11/72/83/68.html +http://yp.gates96.com/11/72/84/29.html +http://yp.gates96.com/11/72/84/39.html +http://yp.gates96.com/11/72/85/56.html +http://yp.gates96.com/11/72/85/63.html +http://yp.gates96.com/11/72/85/96.html +http://yp.gates96.com/11/72/86/3.html +http://yp.gates96.com/11/72/86/28.html +http://yp.gates96.com/11/72/86/59.html +http://yp.gates96.com/11/72/86/63.html +http://yp.gates96.com/11/72/88/43.html +http://yp.gates96.com/11/72/89/8.html +http://yp.gates96.com/11/72/89/13.html +http://yp.gates96.com/11/72/89/20.html +http://cometweb01.comet.co.uk/do!session=132039&vsid=700&tid=20&cid=37030&mid=1000&rid=1060&chid=1713&url=eqqLmwlGltt5tkkHbqpLZXmLbkZHljlKaltLkilLXalKfkaLbukKeqjLi1 +http://iworld.freethemes.com/savers/adnload/77213.html +http://iworld.freethemes.com/savers/adnload/35420.html +http://www.questlink.com/QL/CDA/Research/ProductBrief/1,1768,0_11201_353170_43264,00.html +http://www.questlink.com/QL/CDA/Research/ProductBrief/1,1768,0_11201_353170_43305,00.html +http://www2.eunet.lv/library/iso/HISTORY/RUSSIA/Mirrors +http://nathanael.upi.jussieu.fr/tele6.nsf/autres+centres+de+formations!OpenPage&ExpandSection=10,3,5,16,14,6 +http://nathanael.upi.jussieu.fr/tele6.nsf/autres+centres+de+formations!OpenPage&ExpandSection=17,3,5,16,14,6 +http://opac.lib.rpi.edu/search/dnatural+history+united+states+historiography+dictionaries/-17,-1,0,B/browse +http://opac.lib.rpi.edu/search/dnatural+history+united+states+historiography+dictionaries/7,-1,0,B/browse +http://www.sportinggreen.com/news/20001014/fbo/fbc/abb/001014.0391.html +http://yp.gates96.com/0/14/10/63.html +http://yp.gates96.com/0/14/10/80.html +http://yp.gates96.com/0/14/11/32.html +http://yp.gates96.com/0/14/11/37.html +http://yp.gates96.com/0/14/11/80.html +http://yp.gates96.com/0/14/13/21.html +http://yp.gates96.com/0/14/13/23.html +http://yp.gates96.com/0/14/13/38.html +http://yp.gates96.com/0/14/13/49.html +http://yp.gates96.com/0/14/13/90.html +http://yp.gates96.com/0/14/14/53.html +http://yp.gates96.com/0/14/14/63.html +http://yp.gates96.com/0/14/14/77.html +http://yp.gates96.com/0/14/15/12.html +http://yp.gates96.com/0/14/15/88.html +http://yp.gates96.com/0/14/15/96.html +http://yp.gates96.com/0/14/16/27.html +http://yp.gates96.com/0/14/16/62.html +http://yp.gates96.com/0/14/16/67.html +http://yp.gates96.com/0/14/16/86.html +http://yp.gates96.com/0/14/16/92.html +http://yp.gates96.com/0/14/17/15.html +http://yp.gates96.com/0/14/17/22.html +http://yp.gates96.com/0/14/17/44.html +http://yp.gates96.com/0/14/18/27.html +http://yp.gates96.com/0/14/18/29.html +http://yp.gates96.com/0/14/18/83.html +http://yp.gates96.com/0/14/19/35.html +http://yp.gates96.com/0/14/19/58.html +http://www.123bestphonerates.com/q/001p/vn/ZWUdEJwdxM.htm +http://www.trax.nilex.co.uk/trax.cgi/A1C/B1U/A2S/B3L/A4S/B1L/ +http://www.trax.nilex.co.uk/trax.cgi/A1C/B1U/A2S/B3L/A4S/C2D/ +http://southwind.themes.tucows.com/skins/icq/preview/68532.html +http://southwind.themes.tucows.com/skins/icq/adnload/77797.html +http://southwind.themes.tucows.com/skins/icq/preview/55623.html +http://southwind.themes.tucows.com/skins/icq/adnload/51324.html +http://southwind.themes.tucows.com/skins/icq/adnload/26609.html +http://southwind.themes.tucows.com/skins/icq/adnload/48629.html +http://southwind.themes.tucows.com/skins/icq/adnload/48628.html +http://www.webcom.com.mx/cronica/1999/mar/09/neg01.html +http://jproxy.uol.es/jproxy/http://mars.jpl.nasa.gov/msp98/news/mpl000207.html +http://jproxy.uol.es/jproxy/http://mars.jpl.nasa.gov/msp98/news/news61.html +http://jproxy.uol.es/jproxy/http://mars.jpl.nasa.gov/msp98/ds2/fact.html +http://jproxy.uol.es/jproxy/http://mars.jpl.nasa.gov/mgs/sci/mola/98lander.html +http://jproxy.uol.es/jproxy/http://mars.jpl.nasa.gov/msp98/news/status990123.html +http://ustlib.ust.hk/search*chi/dmarriage/dmarriage/-5,-1,0,B/exact&F=dmarriage+china&1,4/limit +http://mediate.magicbutton.net/do/session/625641/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-artc.html +http://www.scifi.com/cgi-bin/rbox/articles.pl?1&6&1721&20 +http://www.areteoutdoors.com/contribute/earth/b.97.r.54.g.1706.html +http://members.tripod.lycos.co.kr/ifoo6981/?M=A +http://link.fastpartner.com/do/session/600395/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/bol.php +http://link.fastpartner.com/do/session/600395/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/mediatransfer.php +http://link.fastpartner.com/do/session/600395/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/smartguy.php +http://www.safrex.com/catalog/elite08/elite084c.html +http://www.911codes.com/games/platform/psx/sect/div/cont/list_cheat/spray/y/id/0000005511/gid/0000003893/_cheats/_walkthroughs/_codes/_pc/_n64/_psx/_gameboy/_playstation/ +http://yp.gates96.com/7/44/10/4.html +http://yp.gates96.com/7/44/10/15.html +http://yp.gates96.com/7/44/10/30.html +http://yp.gates96.com/7/44/10/32.html +http://yp.gates96.com/7/44/10/36.html +http://yp.gates96.com/7/44/11/1.html +http://yp.gates96.com/7/44/11/41.html +http://yp.gates96.com/7/44/11/44.html +http://yp.gates96.com/7/44/12/29.html +http://yp.gates96.com/7/44/12/76.html +http://yp.gates96.com/7/44/12/81.html +http://yp.gates96.com/7/44/13/56.html +http://yp.gates96.com/7/44/14/19.html +http://yp.gates96.com/7/44/15/14.html +http://yp.gates96.com/7/44/15/52.html +http://yp.gates96.com/7/44/15/62.html +http://yp.gates96.com/7/44/15/72.html +http://yp.gates96.com/7/44/15/78.html +http://yp.gates96.com/7/44/15/81.html +http://yp.gates96.com/7/44/15/82.html +http://yp.gates96.com/7/44/16/78.html +http://yp.gates96.com/7/44/16/93.html +http://yp.gates96.com/7/44/17/51.html +http://yp.gates96.com/7/44/17/75.html +http://yp.gates96.com/7/44/18/43.html +http://yp.gates96.com/7/44/18/92.html +http://yp.gates96.com/7/44/19/26.html +http://www3.newstimes.com/archive2000/oct17/bze.htm +http://member.aol.co%20m/askmo/ +http://home.excite.co.uk/directory/categories/528195 +http://www.scifi.com/bboard/browse.cgi/1/5/545/11566?pnum=1 +http://member.shangdu.net/home1/havdone/game/gonglue/ljcq.htm +http://member.shangdu.net/home1/havdone/game/gonglue/lishou.htm +http://archiv.leo.org/cgi-bin/leo-md5.pl/pub/comp/usenet/comp.sources.misc/dostrace/ +http://yp.gates96.com/8/70/91/12.html +http://yp.gates96.com/8/70/91/20.html +http://yp.gates96.com/8/70/91/45.html +http://yp.gates96.com/8/70/92/29.html +http://yp.gates96.com/8/70/92/40.html +http://yp.gates96.com/8/70/92/74.html +http://yp.gates96.com/8/70/93/9.html +http://yp.gates96.com/8/70/93/11.html +http://yp.gates96.com/8/70/94/10.html +http://yp.gates96.com/8/70/94/90.html +http://yp.gates96.com/8/70/95/4.html +http://yp.gates96.com/8/70/95/13.html +http://yp.gates96.com/8/70/95/58.html +http://yp.gates96.com/8/70/95/74.html +http://yp.gates96.com/8/70/95/80.html +http://yp.gates96.com/8/70/96/34.html +http://yp.gates96.com/8/70/96/65.html +http://yp.gates96.com/8/70/97/0.html +http://yp.gates96.com/8/70/97/16.html +http://yp.gates96.com/8/70/97/75.html +http://yp.gates96.com/8/70/98/27.html +http://yp.gates96.com/8/70/98/60.html +http://www.icopyright.com/1.1638.306154 +http://www.zeal.com/category/be_zealous.jhtml?cid=828 +http://lib1.nippon-foundation.or.jp/1996/0621/contents/004.htm +http://www.haikou.hainan.gov.cn/pandect/nj/n96jada.htm +http://www.chaos.dk/sexriddle/s/e/x/p/b/m/s/ +http://www.symantec.ca/region/uk/resources/mobile/nav.html +http://retailer.gocollect.com/do/session/1912798/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/products/product_lines.asp +http://polygraph.ircache.net:8181/services/define/http_-2www.microsoft.com/ie/Tabitha/http_-2www.adultlinks.net/gallery.shtml +http://f22.parsimony.net/forum42460/messages/1.htm +http://www.greenleaves.com/bookcat/gb_0722530986.html +http://www.classiccmp.org/mail-archive/classiccmp/1998-06/0638.html +http://www1.onelist.com/dir/Society/Paranormal/UFOs/Biblical_Perspectives +http://home.hiwaay.net/~bjacobs/genealogy/laster/html/d0055/g0000045.html +http://link.fastpartner.com/do/session/600374/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/netmaling.php +http://big5.peopledaily.com.cn/haiwai/200003/03/newfiles/A104.html +http://ustlib.ust.hk/search*chi/achang+chieh+mei/achang+chieh+mei/-5,-1,0,B/frameset&F=achang+chieh+fu&1,,2 +http://teleline.terra.es/personal/mgsair/chtml/ejemplos/marcos1.html +http://myhome.naver.com/toktok01/bbs.php3?p_work=admin&p_page=1 +http://netway.pda.tucows.com/palm/adnload/34443_22051.html +http://netway.pda.tucows.com/palm/adnload/34930_22057.html +http://netway.pda.tucows.com/palm/adnload/34435_22044.html +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/kmusic/brahms/qtWaveTrack.h?sortby=rev&only_with_tag=HEAD +http://sinr.net/book/content/39/8411.html +http://www.egroups.com/post/gvocsa?act=reply&messageNum=145 +http://www.diogenes.ch/4DACTION/web_rd_aut_prview/a_id=7056669&area=&ID=483352 +http://www.brio.de/BRIO.catalog/39fe2f7d06fe4a08273fd472aa7806a9/UserTemplate/1 +http://www3.newstimes.com/archive2000/sep01/rgd.htm +http://community.webshots.com/photo/5886633/5886821zAagKCgZhs +http://community.webshots.com/photo/5886633/5917061PxBHHqElgV +http://www.dnai.com/~mbaum/anita/html/eng/art/images/image38.html +http://www.houses-apartment-listings.com/Michigan/city_search_criteria.asp?state=MI&City=CLINTON +http://www.brio.de/BRIO.catalog/39fdb87c09896af6273fd472aa78076c/UserTemplate/10 +http://www.expressindia.com/ie/daily/19990129/02950495p.html +http://www.linux.com/networking/web/unix/internet/project/security/ +http://www.linux.com/networking/web/unix/internet/project/Red_Hat/ +http://www.linux.com/networking/web/unix/internet/project/freshmeat/ +http://www.linux.com/networking/web/unix/internet/project/?kw_offset=50 +http://ring.yamanashi.ac.jp/pub/linux/debian/debian/dists/Debian2.2r0/non-free/binary-i386/science/?N=D +http://ftp.task.gda.pl/pub/games/idgames/utils/level_edit/acaddoom.txt +http://www.affiliate.hpstore.hp.co.uk/do/session/380864/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/FR/REGISTRATION/entry.asp +http://fi.egroups.com/post/allianc?act=reply&messageNum=2305 +http://polygraph.ircache.net:8181/services/design/company/http_-2burn.ucsd.edu/~abcf +http://polygraph.ircache.net:8181/services/design/company/miami.htm +http://www.utexas.edu/ftp/admin/AI_ATTIC/ATW/Mosaic.instruct/?D=A +http://ftp.du.se/disk3/redhat/updates/powertools/current/alpha/ +http://www.multicosm.com/facade/demo.multicosm.com/facade/www.informationweek.com/mediakit/00/default.html +http://www.multicosm.com/facade/demo.multicosm.com/facade/www.informationweek.com/mediakit/00/about_overview.html +http://www7.tok2.com/home/maki67/menu.htm +http://www.mapion.co.jp/custom/AOL/admi/23/23103/tsujicho/2chome/index-24.html +http://sunsite.org.uk/public/computing/networks/internet/ietf/printmib/printmib-attendees-97apr.txt +http://ftp.univie.ac.at/packages/tex/macros/latex2e/contrib/supported/nomencl/?N=D +http://spaceports.tucows.com/winme/adnload/137993_30287.html +http://habenix.uni-muenster.de/Rektorat/Forschungsberichte-1997-1998/fo05acd01.htm +http://www.power2lead.com/Global/English.nsf/pgWWLocations!OpenPage&ExpandSection=2,25,7,32,18 +http://www.teacherformation.org/html/od/facilitators.cfm/task1,help/discussion_id,2/xid,6155/yid,3651726 +http://itcareers.careercast.com/texis/it/itjs/+IwwBmeS9D867xwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew7hmwGAnBoDtapGdtGwMamnVncdpa51ppdGBaqconDBaqdMM1DoqwBodDaoDVn5BMnDBapGdm1qBaMwDwtnaqGnwBoVnaMFqhgfHNEDzm7wwwpBmeg9D86exqwww5rmeqDwwwBrmeZpwww/morelike.html +http://itcareers.careercast.com/texis/it/itjs/+XwwBmie0B-deaqwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew7hmwGAnBoDtapGdtGwMamnVncdpa51ppdGBaqconDBaqdMM1DoqwBodDaoDVn5BMnDBapGdm1qBaMwDwtnaqGnwBoVnaMFqhgfHNEDzm7wwwpBmeg9D86exqwww5rm-mwwBrmeZpwww/morelike.html +http://members.iinet.net.au/~scott3/legacy/matt.html +http://cn.egroups.com/post/bastardimage?act=forward&messageNum=11 +http://ftp.nodomainname.net/pub/mirrors/.2/gnu/tasks/?N=D +http://ftp.nodomainname.net/pub/mirrors/.2/gnu/tasks/standards.text +http://10000downloads.subportal.com/sn/Utilities/Misc__Utilities/11320.html +http://mindit.netmind.com/proxy/http://www.altera.com/html/tools/swupdates.html +http://www.next.com.hk/mag/419/news/an06.htm +http://www.areteoutdoors.com/channel/air/b.283.g.3871.html +http://troop485.tripod.com/documents/johnwayne.htm +http://troop485.tripod.com/documents/bp-churchhill.htm +http://sound-dist.secured.co.uk/cgi-bin/psProdDet.cgi/22P03|972959558|Security|user|0|1,0,0,1 +http://www9.hmv.co.uk:5555/do/session/1347794/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d120_sd0_pt0.html +http://ftp.du.se/debian/dists/Debian2.2r0/main/disks-m68k/2.2.16-2000-07-14/mac/images-1.44/?S=A +http://opac.lib.ntnu.edu.tw/search*chi/++ftlist/bp20043193/-5,-1,0,B/buttonframe&F=bp20043190&1,1 +http://www.parlament.ch/internet98/Poly/Suchen_amtl_Bulletin/ce98/ete/275.HTM +http://in.egroups.com/messages/svpvril/5195?viscount=-30 +http://in.egroups.com/messages/svpvril/?expand=1 +http://retailer.gocollect.com/do/session/1912744/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/checkout/shopping_cart.asp +http://retailer.gocollect.com/do/session/1912744/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://www18.freeweb.ne.jp/sports/imamako/ +http://www.cs.ucc.ie/javadocs/jdk1.2.2/docs/api/java/awt/geom/class-use/QuadCurve2D.Double.html +http://click-to.tell-a-friend.boardhost.com/tell-a-friend-confirm.cgi?stigmaonline&msg=172 +http://www.emerchandise.com/aboutus/b.TV%20ANGEL/s.2YYjVOgH +http://www.leyou.com/product/ShowResult.php?LY_Category=0531&page=3 +http://cafe6.daum.net/Cafe-bin/Bbs.cgi/rest114pds/qry/zka/B2-kB23o/qqatt/^ +http://sunsite.informatik.rwth-aachen.de/LinuxArchives/sunsite.unc.edu/distributions/linux-router/dists/2.9.6/base/?N=D +http://www-uk5.cricket.org/link_to_database/ARCHIVE/1999-2000/PAK_IN_SL/FANTASY/ +http://findmail.com/message/sangersreview/99 +http://phase.etl.go.jp/mirrors/netlib/utk/people/JackDongarra/SLIDES/osu-498/sld011.htm +http://tucows.datasync.com/winme/preview/75261.html +http://secure.danysoft.com/asp/dany.tienda/1266636789/Catalog +http://www.birding.about.com/hobbies/birding/cs/placesecuador/index_2.htm +http://www.cpami.gov.tw/ymsnp/animal/fauna/nospc385text.htm +http://www.fh-telekom-leipzig.de/hilfe/pak_e/paket_inhalt_jade_dsl.html +http://home.vicnet.net.au/~nunayl/feedback.html +http://www.expage.com/nibina +http://www.expage.com/virtuaalisiittolantallivihko +http://www.expage.com/muittentallijenkisoja +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=9,39,33 +http://retailer.gocollect.com/do/session/1912707/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/top_ten.asp?pagenum=2 +http://www.streetprices.com/Electronics/Other/MAKE+SYMANTEC/sortdetailbystock/SP322647.html +http://www.peopledaily.co.jp/haiwai/199810/09/no_981009003024_6.html +http://mediate.magicbutton.net/do/session/625622/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-artc.html +http://mediate.magicbutton.net/do/session/625622/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-top50.html +http://www.nada.kth.se/systemgruppen/docs/javadoc/jdk-1.3/docs/api/javax/swing/plaf/basic/class-use/BasicSliderUI.ChangeHandler.html +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/Collect_DB_Advers2/2000-09-10/08/?N=D +http://yp.gates96.com/12/57/30/53.html +http://yp.gates96.com/12/57/32/14.html +http://yp.gates96.com/12/57/32/97.html +http://yp.gates96.com/12/57/33/1.html +http://yp.gates96.com/12/57/33/37.html +http://yp.gates96.com/12/57/37/91.html +http://yp.gates96.com/12/57/37/98.html +http://yp.gates96.com/12/57/38/23.html +http://yp.gates96.com/12/57/38/34.html +http://yp.gates96.com/12/57/38/51.html +http://yp.gates96.com/12/57/38/53.html +http://yp.gates96.com/12/57/39/43.html +http://yp.gates96.com/12/57/39/56.html +http://yp.gates96.com/12/57/39/68.html +http://yp.gates96.com/12/57/39/70.html +http://www3.sympatico.ca/jacques.m.boisvert/Data_Distribution.html +http://www.garekiya.com/female/female02-25.html +http://www.brio.de/BRIO.catalog/39fe2f6c06f4cd8e273fd472aa780734/UserTemplate/5 +http://202.99.23.195/GB/channel1/13/20001030/291723.html +http://db.bbc.co.uk/education/gcsebitesize/maths/shape_and_space_i_h/loci_rev.shtml +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceStoreCategories-BBC709F9_97F3_1F2D7EFC4CA45617D914720977E88400 +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceShoppingCartPage-BBC709F9_97F3_1F2D7EFC4CA45617D914720977E88400 +http://polygraph.ircache.net:8181/http_-2www.microsoft.com/frontpage/http_-2www.hercules.com/history.htm +http://www.jbc.org/cgi/content/short/275/36/27501 +http://brazil.mit.edu/sdb/de/html/keylist.NNTP.html +http://ads3.zdnet.com/c/g=r771&c=a53605&idx=2000.10.30.21.30.57/www.micronpc.com/zd/max1299 +http://webtools.familyeducation.com/whatworks/item/front/0,2551,22-9696-6689-473-46499,00.html +http://www.dispatch.co.za/2000/04/08/business/HIGHLOW.HTM +http://generalstore.everdream.com/kore/catalog/Office_Supplies/Forms,_Record_Keeping_&_Reference/Human_Resources/Motivational/brand.html?sort=price&count=0 +http://www.laria.u-picardie.fr/docs/www.linux-france.org/article/securite/intro.html +http://ftp.uni-stuttgart.de/pub/netscape/communicator/slovenian/4.51/windows/windows95_or_nt/ +http://cafe4.daum.net/Cafe-bin/Bbs.cgi/monjatingpds/lst/qqeq/1/zka/B2-kBnNt +http://myhome.shinbiro.com/~funky27/novel18.htm +http://www.apcmag.com/apcweb/reviewsdisc.nsf/aac7d56ca8fd884b852563be00610639/25858e2d9c878e294a2567060015364d!EditDocument +http://www.private-immobilien-boerse.de/nordrhein-Westfalen/luedinghausen/Verkauf/3d-service/Gemeinsam/Immolink/Gemeinsam/erreichenPartner/Private-IB/ +http://www.eos.dk/archive/swing/msg00405.html +http://www.jobvillage.com/channel/jobs/human_resources/benefits_analysis/b.2807.g.1757.html +http://www.hanaga.com.cn/gbjc/tc/jq.htm +http://www.multimap.com/wi/33747.htm +http://www.multimap.com/wi/143959.htm +http://home.freeuk.net/jdl/Left_Navigate.htm +http://www.crit.org/nph-edit.cgi/http://crit.org/pub/ifi.unizh.ch/wagner/just-testing.html +http://www.interessengemeinschaft-musik.de/catalog%20data/body_22.html +http://aleph.tau.ac.il:4500/ALEPH/ENG/ATA/AAS/AAS/FIND-ACC/0333501 +http://www.mojahedin.org/Pages/Mojahed/Mojahed451/rp/rp09.html +http://genforum.genealogy.com/cgi-genforum/forums/lenhart.cgi?158 +http://carriage.de/Schoner/collections/Geschichte/Sammlungen/info-e/ +http://cafe4.daum.net/Cafe-bin/Bbs.cgi/pflhs11pds/rnw/zka/B2-kB2-s +http://ftp.lip6.fr/pub11/NetBSD/arch/hpcmips/pkgstat/20001008.0536/textproc/xerces-j-current/ +http://dk.egroups.com/message/scotdisinfo/306 +http://groups.haas.berkeley.edu/hcs/Docs/SASv8/sasdoc/sashtml/proc/z0360708.htm +http://www.legend-net.com/news/tiyu/messages/474.html +http://www.legend-net.com/news/tiyu/messages/466.html +http://tv.thevines.com/leaf/AA0000373887/3/0/0/&hmode=on +http://vorg1.subportal.com/sn/Business/Enhanced_Calculators/5511.html +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=7,28,31,24,35 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=24,5,17,30,11 +http://ftp.gwdg.de/pub/eff/Global/USA/Legislation/gtda_export.regulations +http://www.dein-schicksal.de/Fotoanzeigen/April_2000/7/17/27/body_57.html +http://www.fujian-window.com/Fujian_w/news/mzrb1/20000630/2_14.html +http://www.webswap.com/shelf/2/17559/sell.html +http://search.leg.wa.gov/wslrcw/RCW%20%2036%20%20TITLE/RCW%20%2036%20.100%20%20CHAPTER/RCW%20%2036%20.100%20.060.htm +http://www.doc.ic.ac.uk/lab/labsrc_area/firstyear/submissions/1997-98/jmc1/labs/Ex02/icc97/?M=A +http://school.educities.org/card/abc0609.html +http://school.educities.org/card/huangmei.html +http://school.educities.org/card/a126457822.html +http://school.educities.org/card/a8911.html +http://school.educities.org/card/aa5117.html +http://school.educities.org/card/b3575610.html +http://school.educities.org/card/c5625.html +http://school.educities.org/card/h1230997.html +http://school.educities.org/card/h224153937.html +http://school.educities.org/card/julie9.html +http://school.educities.org/card/lefe135.html +http://school.educities.org/card/nl123.html +http://school.educities.org/card/s5802.html +http://school.educities.org/card/s58120.html +http://school.educities.org/card/s5931.html +http://school.educities.org/card/s6197.html +http://school.educities.org/card/vov.html +http://school.educities.org/card/xx5331.html +http://darkwing.uoregon.edu/~cblanksh/GeneratedItems/?M=A +http://ciscom.gamecenter.com/Tipcheat/PC/Item/0,128,0-202,00.html +http://rotten-tomatoes.com/movies/browse/1010942/video.php +http://rotten-tomatoes.com/movies/browse/1076825/reviews.php +http://archive.soccerage.com/s/fr/09/98335.html +http://www.ferien-immobilien.de/nordrhein-Westfalen/aachen/Verkauf/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/3d-service/Gemeinsam/erreichenPartner/Gemeinsam/impressum.htm +http://www.ebigchina.com/tool_tellfriend.phtml?code=msg&mid=3174 +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/src/libexec/rpc.rwalld/Makefile?only_with_tag=RELENG_3 +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/src/libexec/rpc.rwalld/Makefile?only_with_tag=MAIN +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/src/libexec/rpc.rwalld/Makefile?only_with_tag=RELENG_3_BP +http://ring.jec.ad.jp/pub/linux/debian/debian/dists/unstable/contrib/binary-sh/admin/?M=A +http://www2.eunet.lv/library/alt/URIKOVA/FORTUNE_D/Mirrors +http://www.hermes.dk/departments/om/publica.shtml +http://208.194.150.10/Ski/Articles/DrDewpoint/001/bannerAd.shtml +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/quanta/quanta/widgets/?sortby=log&only_with_tag=start +http://biblio.cesga.es:81/search*gag/aSempere+Navarro,+Antonio-Vicente/asempere+navarro+antonio+vicente/-5,-1,0,E/frameset&F=asempere+y+guarinos+juan+trad&1,1 +http://www.fractal.com.ru/Component/Toshiba/74Cxx/TC74HC74DS.pdf +http://www.staroriental.net/nav/soeg/ihf,aai,n3,7,Electric+Wave+Girl+1998.html +http://excite.de/auto/katalog/11803 +http://gatekeeper.dec.com/pub/BSD/NetBSD/NetBSD-current/pkgsrc/sysutils/amanda-client/pkg/ +http://www.smcworld.com/smcworld/bp_e/large/0524_2301_002x2301_003x2301_004x2301_005x2301_006x2301_007_2301_005b.html +http://www.kaos.dk/sexriddle/x/j/t/z/d/ +http://www.kaos.dk/sexriddle/x/j/t/z/e/ +http://spartanburg2.edgate.com/blgspringes/school_athletics/parent/ +http://www-personal.engin.umich.edu/~mhaanpaa/?S=D +http://www.amcity.com/jacksonville/stories/2000/05/15/story8.html?t=email_story +http://yp.gates96.com/7/47/40/13.html +http://yp.gates96.com/7/47/42/7.html +http://yp.gates96.com/7/47/43/2.html +http://yp.gates96.com/7/47/43/22.html +http://yp.gates96.com/7/47/43/54.html +http://yp.gates96.com/7/47/44/0.html +http://yp.gates96.com/7/47/45/3.html +http://yp.gates96.com/7/47/45/30.html +http://yp.gates96.com/7/47/45/78.html +http://yp.gates96.com/7/47/45/89.html +http://yp.gates96.com/7/47/46/41.html +http://yp.gates96.com/7/47/46/71.html +http://yp.gates96.com/7/47/48/1.html +http://yp.gates96.com/7/47/48/68.html +http://yp.gates96.com/7/47/48/92.html +http://yp.gates96.com/7/47/49/6.html +http://yp.gates96.com/7/47/49/43.html +http://yp.gates96.com/7/47/49/86.html +http://yp.gates96.com/7/47/49/97.html +http://de.excite.de/bildung/katalog/24692 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=90&discrim=226,20,231 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=90&discrim=226,20,4 +http://www.affiliate.hpstore.hp.co.uk/do/session/380862/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/search.asp +http://www1.zdnet.co.uk/news/news1/ns-1511.html +http://bellona.itworld.com:8080/cwi/reprint/0,1926,NAV63-128-1357-1367_STO48730,00.html +http://wwwhome.cs.utwente.nl/~zwiers/projects/docs/jdk/api/java/util/class-use/SortedMap.html +http://cgi.cnnsi.com/football/nfl/players/Ed.McCaffrey/ +http://fi.egroups.com/messages/philmusic/12006 +http://fi.egroups.com/messages/philmusic/12123 +http://fi.egroups.com/messages/philmusic/213 +http://fi.egroups.com/messages/philmusic/1826 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=22,0+20,0-9,2-~ +http://my.egroups.com/message/gps4gis/164 +http://www.bemi-immobilien.de/Startseite/www.allgemeine-immobilien-boerse.de/allgemeine-ib/landkreiszwickau/Verkauf/29109700708107kirchbergvillamü/Gemeinsam/MarketingStrategie/Gemeinsam/Inserieren/Startseite/Startseite/Gemeinsam/versicherungen/gebaeude/anforderungsformular.htm +http://apple.excite.com/entertainment/fine_arts/classical_music/composers/baroque_composers/albinoni_tomaso/works/ +http://www.lithoquoter.com/Scripts/WebObjects.exe/Printers.woa/609420000046582000001552000000949302/main.wo/7834100000849302/4/-/prime +http://yp.gates96.com/11/75/40/25.html +http://yp.gates96.com/11/75/40/38.html +http://yp.gates96.com/11/75/40/88.html +http://yp.gates96.com/11/75/40/91.html +http://yp.gates96.com/11/75/42/1.html +http://yp.gates96.com/11/75/42/74.html +http://yp.gates96.com/11/75/42/81.html +http://yp.gates96.com/11/75/43/45.html +http://yp.gates96.com/11/75/43/51.html +http://yp.gates96.com/11/75/46/25.html +http://yp.gates96.com/11/75/46/72.html +http://yp.gates96.com/11/75/46/89.html +http://yp.gates96.com/11/75/46/91.html +http://yp.gates96.com/11/75/47/5.html +http://yp.gates96.com/11/75/48/67.html +http://yp.gates96.com/11/75/49/89.html +http://users.telerama.com/~mross/jenny/forsale.html +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=14&discrim=212,57 +http://ring.htcn.ne.jp/archives/NetBSD/NetBSD-1.4.2/atari/binary/security/?N=D +http://library.bangor.ac.uk/search/dCanada+--+Agricultural+resources+--+19th+century/dcanada+agricultural+resources+++19th+century/-5,-1,0,B/exact&F=dcanaanites&1,3 +http://www.brio.de/BRIO.catalog/39fe2f6406e8eec4273fd472aa780738/UserTemplate/5 +http://kuyper.calvin.edu/fathers2/NPNF1-05/npnf1-05-04.htm +http://kuyper.calvin.edu/fathers2/NPNF1-05/npnf1-05-08.htm +http://kuyper.calvin.edu/fathers2/NPNF1-05/npnf1-05-20.htm +http://polygraph.ircache.net:8181/http_-2www.sgi.net/http_-2www.itools.com/research-it/http_-2www.aardvarkclay.com/Themes/http_-2www.snapsite.com/guests/sk8ctrl/public/html/sitemap/sitemap.htm +http://www.genexchange.com/cemlist.cfm?state=mo&county=webster +http://newsone.net/nnr/showart/alt.current-events.haiti/911 +http://212.11.11.62/voyages_degriffes/MEXIQUE/PARIS+-+MEXICO+A%2FR/SAI00511790/ +http://bitwise.linux.tucows.com/x11html/adnload/131942_45932.html +http://www.brio.de/BRIO.catalog/39fe2f740910301a2740d472aa7806aa/UserTemplate/1 +http://singles-ads.theshoppe.com/cgi-bin/c/736/64/dXNlcmJhbm5lcg==/gn/3585/ +http://www.chaos.dk/sexriddle/j/l/v/y/t/ +http://www.interlog.com/~prandall/relations/d0003/g0000795.html +http://ftp.jp.debian.org/debian/dists/woody/non-free/binary-arm/oldlibs/?M=A +http://biblioteca.upv.es/bib/doc/doc_fisbd/129/97268//V/1828099/6////25/N/MLTPAID +http://biblioteca.upv.es/bib/doc/doc_fisbd/129/147168//V/1828099/11////25/N/MLTPAID +http://biblioteca.upv.es/bib/doc/doc_fisbd/129/124846//V/1828099/24////25/N/MLTPAID +http://mirrortucows.technet.it/winme/htmlbeginnerme_size.html +http://www.bcbsal.org/Provider_Dir/pharmacy/state/Georgia/HAWKINSVILLE/index_10201.html +http://www.incestpornstories.com/tinkerbellbeard/ac/plus-sizehealthy/petitevietnamese/slanted-eyes/cuntschoolgirls/high-schoolteenager/cherryunderage.html +http://www.0563.net/imode2/hazu/play/outdoor/nature/nature1.htm +http://www.launch.com/music/songpage/pvn_content/0,5259,1074221,00.html +http://ftp.jp.debian.org/debian/dists/unstable/main/binary-alpha/tex/?S=A +http://iceberg.adhomeworld.com/cgi-win/redirect.exe/896425026 +http://www.nrc-handelsblad.nl/W2/Lab/Baan/000726-a.html +http://www.nrc-handelsblad.nl/W2/Lab/Baan/000718-a.html +http://members.tripod.co.jp/muzyaki/?M=A +http://alfa.nic.in/lsdeb/ls12/ses4/0413039930.htm +http://excite.de/immobilien/katalog/26640 +http://excite.de/immobilien/katalog/27591 +http://excite.de/immobilien/katalog/28370 +http://excite.de/immobilien/katalog/28376 +http://excite.de/immobilien/katalog/26426 +http://excite.de/immobilien/katalog/28458 +http://www.emerchandise.com/aboutus/b.TV%20THE60S/s.qxmvd5Gr +http://www.computerworld.com.cn/99/week/9920/9920c13.asp +http://www.stud.ntnu.no/~oystena/oystena/cache/dvx70a.html +http://nealet.subportal.com/sn/Shell_and_Desktop/Holiday_Screen_Savers/ +http://dk.egroups.com/message/ugm/40?source=1 +http://www1.bdaserver.de/bda/nat/pzt/formel1/gp/mon.html +http://www17.freeweb.ne.jp/diary/t-soken/love-love.htm +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/SaveCounter/2000-10-12/14/971332013437.txt +http://pub3.ezboard.com/f80sxchangegeneraldiscussion.showMessage?topicID=60.topic +http://www.northampton.ac.uk/cgi-bin/liberation/betsie/betsie.pl/0005/www.nene.ac.uk/ncr/enrol/sectn4/pdf/4-5.pdf +http://www.xmission.com/~dkenison/cgi/lwgate.cgi/LDS-BOOKSHELF/archives/v01.n676/Date/article-15.html +http://www.eos.dk/archive/swing/nav08574.html +http://nathanael.upi.jussieu.fr/tele6.nsf/autres+centres+de+formations!OpenPage&ExpandSection=1,4,11,18,5,17 +http://nathanael.upi.jussieu.fr/tele6.nsf/autres+centres+de+formations!OpenPage&ExpandSection=6,4,11,18,5,17 +http://cn.egroups.com/message/highlanderswaps/3351 +http://cn.egroups.com/message/highlanderswaps/3356 +http://www.mobygames.com/user/sheet/view/havelist/so,game_title(game_id)+DESC,game_havelist_id+DESC/userHaveListId,18/userSheetId,832/offset,15/ +http://www.mobygames.com/user/sheet/view/havelist/so,game_title(game_id)+DESC,game_havelist_id+DESC/userHaveListId,18/userSheetId,832/offset,60/ +http://gettosdownloads.subportal.com/sn/Palm_Pilot/Home_and_Hobby/12385.html +http://biblio.cesga.es:81/search*gag/aOurense+(Di%26oacute%3Bcesis).+Obispado+de+Ourense,+ed./aourense+diocesis+obispado+de+ourense+ed/-5,-1,0,B/browse +http://www.beneteau-owners.com/beneteau.nsf/userlistbyboat!OpenView&Start=21.24&Count=45&Expand=39 +http://www.geocities.com/Yosemite/8908/ +http://www.geocities.com/Yosemite/3295/ +http://lists.insecure.org/linux-kernel/2000/Apr/4105.html +http://www.telematik.informatik.uni-karlsruhe.de/osf/sw/v5.0x/lp2/dna500/ +http://atlas.web.cern.ch/Atlas/GROUPS/SOFTWARE/OO/dist/0.0.28/graphics/TreeBuilder/TreeMaker/CVS/?M=A +http://www.21hk.com/book/zt/zt/zpj/c/chichuancilang/txmoxj/012.htm +http://chat.hani.co.kr/NetBBS/Bbs.dll/brief/rcm/zka/B23lBn-t/qqatt/^ +http://www3.buch-per-sms.de/impressum.jsp$ID=To7770mC6889218603037781At0.41865389376542195 +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/151/1997/7/0/904457/ +http://www.mets.com/gameinfo/990504-recap.htm +http://www.mets.com/Video/990709-PiazzaHR_lr.asp +http://www.people.zeelandnet.nl/cn.atlas/compatlasw1.html +http://www.digitaldrucke.de/(aktuell,bekanntschaften,hilfe,marktplatz,nuernberg)/_fort/html/themen/markt/bekannt/bekannt.htm +http://www.staroriental.net/nav/soeg/ihf,acf,s0,359,Gigi+Leung+Wing-Kay.html +http://rapidus.tucows.com/winme/adnload/137435_28887.html +http://library.bangor.ac.uk/search/aBerthoff,+Ann+E/aberthoff+ann+e/-5,-1,0,B/frameset&F=aberthier+rene&1,1 +http://www.teenplatinum.com/barelylegal/underagevirgin/abductionbondage/amateurco-ed/chijapanese/{gaylink} +http://www.paisvirtual.com/informatica/freeware/cltorres/contra.htm +http://library.cuhk.edu.hk/search*chi/aInstitution+of+Civil+Engineers+(Great+Britain)/ainstitution+of+civil+engineers+great+britain/-5,-1,0,B/browse +http://www.digitaldrucke.de/(aktuell,computer,hersteller,hilfe)/_fort/html/themen/computer/hard/links/dell.htm +http://www.angelfire.com/ar/jimbowles/weekofoct3.html +http://www.dtic.mil/envirodod/derpreport95/vol_2/b2_1991.html +http://www.dtic.mil/envirodod/derpreport95/vol_2/b2_2010.html +http://kobe.cool.ne.jp/heartisland/y_top0004.html +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=146&discrim=10,97,3 +http://www.channel7000.com/partners/tv/consumer/partners-tv-consumer-20000207-231308.html +http://www.channel7000.com/partners/tv/consumer/partners-tv-consumer-19991206-195152.html +http://www.channel7000.com/partners/tv/consumer/partners-tv-consumer-990920-105620.html +http://www.channel7000.com/partners/tv/consumer/partners-tv-consumer-990810-082554.html +http://gallery2.simplenet.com/lobby/main/videocaps/lalbrght/conair/laca26.htm +http://www.ld.com/cbd/archive/1999/09(September)/30-Sep-1999/Bawd007.htm +http://www.ld.com/cbd/archive/1999/09(September)/30-Sep-1999/Bawd013.htm +http://chunma.yeungnam.ac.kr/~j4390071/ +http://www.chaos.dk/sexriddle/h/y/z/m/ +http://www.maas.ccr.it/cgi-win/hiweb.exe/a18/d262/b190,8,be,29,29,,b,,be,b, +http://pub17.ezboard.com/fanimesandrpgslinkstositesandotherforums.showMessage?topicID=2.topic +http://www.hotelboulevard.com/fr/riviera/standard/htmled1e03872682f66e105b3c38b4506d50/sessionLang/ANG/search.html +http://bbs.msquare.or.kr/list.bbs/course/old/DiscMath95/9.html +http://www.rezel.enst.fr/ftp/linux/distributions/debian/CD-1/dists/unstable/main/binary-all/mail/?N=D +http://www.ee/epbe/pangandus/9910/0.2.txt +http://shitty.10pics.com/buttfucking/rear/ +http://www.thestateofcolorado.com/hsiwindowdoorlettering.html +http://www.generation-formation.fr/brevesc.htm---o21zAo0UtDo0Ol9A074fo6Td4ezyr6feZJPAPfVbNyqruePl9neNHhIeOkatAhcgNA074wNV8XzAhcgNAPfVbdsNhJI.htm +http://netscape.digitalcity.com/boston/sports/standings.dci?league=NBA&team=BOS +http://netscape.digitalcity.com/boston/sports/attcompare.dci?league=NBA&team=BOS +http://retailer.gocollect.com/do/session/1912752/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://mindit.netmind.com/proxy/http://www.skepdic.com/sympathetic.html +http://mindit.netmind.com/proxy/http://faculty.washington.edu/chudler/moon.html +http://itcareers.careercast.com/texis/it/itjs/++wwBmeE_D86esmwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqew8Qwo5qda5dc1BodDawGnwaGn31oGnmaoDmnpBraADdicnmtnapGdm1qBaBnqrDoqwcatGd1pamnVncdpaMFqoET02fgENDzmezxwwwpBmeC_D86Qwww5rmkmwwBrmeyDwww/morelike.html +http://retailer.gocollect.com/do/session/1912762/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/terms_and_conditions.asp +http://retailer.gocollect.com/do/session/1912762/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://www.writtenbyme.com/cgi-bin/rw_readarticle.cgi/141339880.shtml +http://www.writtenbyme.com/cgi-bin/rw_readarticle.cgi/410769654.shtml +http://www.writtenbyme.com/cgi-bin/rw_readarticle.cgi/190045923.shtml +http://tucows.megalink.com/winme/preview/76155.html +http://www.buybuddy.com/sleuth/17/1/2006/32184/ +http://www.affiliate.hpstore.hp.co.uk/do/session/380853/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/FR/REGISTRATION/entry.asp +http://pchome.net:81/ch/Hw/CAMERA/canoneosd30/canoneosd30.htm +http://pchome.net:81/ch/Hw/CAMERA/kodaknew.htm +http://pchome.net:81/ch/Hw/MODEM/twluc562w2k.htm +http://pchome.net:81/ch/Hw/MONITOR/mag796fd.htm +http://pchome.net:81/ch/Hw/cool/anquanshuileng/anquanshuileng.htm +http://pchome.net:81/ch/Hw/DISPLAY/3dbenchmarks/3dbenchmarks.htm +http://pchome.net:81/ch/Hw/CAMERA/Microdrive.htm +http://pchome.net:81/ch/Hw/harddisk/niyaomaishime.htm +http://www.civila.com/guitar/desenredada/chat/logos/index.html-ssi +http://members.xoom.it/scialpinismo/gitaappenparm/PreviewPages/PreviewPage7.htm +http://cpan.nitco.com/modules/by-module/Mail/ASPIERS/URI-Bookmarks-0.92.readme +http://polygraph.ircache.net:8181/services/design/http_-2www.swnebr.net/~cambridg/http_-2www.cauce.org/Malcolm/ +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_aswkit_aswkit.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_nbilwv_rbpobu.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_jkawvi_messod.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_jkawvi_otdbms.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_jkawvi_hoktlo.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_uhfkhdn_ilaeh.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_xyhsj_pfepjoa.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_alkqaay_mogsts.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_ighrg_ighrg.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_cbfjod_parbe.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_dqnlq_jfspcj.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_phcro_bwlah.html +http://www.asahi-net.or.jp/~yd7k-itu/sbbsindex/old/16_phcro_xoxchqb.html +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/IkhI2h2UISFGhSJ4dK-jGu69npNFUTS7n0SO4q6b8rSzWq_RIDBJOsj9QRxPcb3IZgZlQ5jvjGikzJWNeK-85DucH1Ag5dhhL0czi-GMxyHC1dmfKc0hW5TzqJpnm938SIT3xNrWgjZN66P6 +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/oo1IpLu33emgRiskeudWkzY7LxFY35wz6EqyQ42lguNadi_4qnt4FhGUPOob_C5Wt99hQSEKEuRTRevsau9UYJ9lySivV-u51_OF4aSEhYXTt98QpjnIOFYPV6acMb20In922uOHMyYdC8HXvwhIP-8o8oM4wLBMdll6aW8xe922WllgXE1F5qlvFqyA +http://msdn.microsoft.com/library/devprods/vs6/visualj/vjref/java.sql.DatabaseMetaData136.html +http://msdn.microsoft.com/library/devprods/vs6/visualj/vjref/java.sql.DatabaseMetaData090.html +http://romulus.ehs.uiuc.edu/cgi-bin/lwgate/RADSAFE/archives/radsafe9902/Date/article-572.html +http://spaceports.tucows.com/winme/preview/76400.html +http://www.telecombroker.com/q/001p/ppc3/qG4gs1ewhU.htm +http://ftp.nodomainname.net/pub/mirrors/.2/gnu/graphics/?N=D +http://retailer.gocollect.com/do/session/1912813/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/help/site_tour/index.asp +http://retailer.gocollect.com/do/session/1912813/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/news/index.asp +http://retailer.gocollect.com/do/session/1912813/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/privacy_policy.asp +http://202.101.106.19/dir/100/10a/zzgk/bszn/111.htm +http://www.eveclub.com/cgi-bin/eveclub.front/972959538910/Catalog/1000084 +http://www.eveclub.com/cgi-bin/eveclub.front/972959538910/Club/start/1000000 +http://www.slis.ua.edu/cgi-bin/clickthrough.cgi/CT=http_3a_2f_2fwww_2edermis_2enet_2fbilddb_2fdiagnose_2fenglisch_2fi697015_2ehtm +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/folderFrame/100001/0/rnumber/8467604 +http://www-personal.engin.umich.edu/~vernage/teamweb/team.building/effective.meetings/effective.meetings.facilitation.htm +http://www4.law.cornell.edu/uscode/42/ch87subchIV.head.html +http://yp.gates96.com/7/27/90/10.html +http://yp.gates96.com/7/27/90/11.html +http://yp.gates96.com/7/27/90/30.html +http://yp.gates96.com/7/27/91/72.html +http://yp.gates96.com/7/27/91/76.html +http://yp.gates96.com/7/27/91/85.html +http://yp.gates96.com/7/27/91/92.html +http://yp.gates96.com/7/27/92/61.html +http://yp.gates96.com/7/27/92/72.html +http://yp.gates96.com/7/27/93/10.html +http://yp.gates96.com/7/27/93/17.html +http://yp.gates96.com/7/27/93/30.html +http://yp.gates96.com/7/27/93/65.html +http://yp.gates96.com/7/27/93/76.html +http://yp.gates96.com/7/27/93/99.html +http://yp.gates96.com/7/27/94/37.html +http://yp.gates96.com/7/27/94/85.html +http://yp.gates96.com/7/27/95/5.html +http://yp.gates96.com/7/27/95/14.html +http://yp.gates96.com/7/27/95/55.html +http://yp.gates96.com/7/27/95/57.html +http://yp.gates96.com/7/27/96/21.html +http://yp.gates96.com/7/27/96/49.html +http://yp.gates96.com/7/27/96/50.html +http://yp.gates96.com/7/27/96/55.html +http://yp.gates96.com/7/27/96/92.html +http://yp.gates96.com/7/27/97/24.html +http://yp.gates96.com/7/27/97/73.html +http://yp.gates96.com/7/27/97/98.html +http://yp.gates96.com/7/27/98/26.html +http://yp.gates96.com/7/27/98/62.html +http://yp.gates96.com/7/27/99/15.html +http://yp.gates96.com/7/27/99/52.html +http://www.nrk.no/finnmark/x2_9_98/nyh11.htm +http://www.excelsior.com.mx/9701/970105/nac18.html +http://www.symantec.co.kr/sabu/igear/igear_educ/stories.html +http://www.smcworld.com/smcworld/bp/pre/0204_1_1070.html +http://www.cpami.gov.tw/ymsnp/animal/fauna/nospc708choice.htm +http://pub9.ezboard.com/fdawsonscreek50374helpwanted +http://pub9.ezboard.com/fdawsonscreek50374frm17 +http://www.happychannel.it/turismo/europa/top_news/schede/scheda_991209110434.shtml +http://www.happychannel.it/turismo/europa/top_news/schede/scheda_991111111106.shtml +http://dirs.educationamerica.net/New_York/Localities/N/New_York_City/Manhattan/Business_and_Economy/ +http://dirs.educationamerica.net/New_York/Localities/N/New_York_City/Manhattan/Government/ +http://china-water.51.net/life/life_20.htm +http://china-water.51.net/life/life_22.htm +http://www.egroups.com/message/ramtalk/17801 +http://www.usahardware.com/inet/webSession/shopper/US972959720-31113/store/dept-1 +http://www.usahardware.com/inet/webSession/shopper/US972959720-31113/store/specials +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=97&discrim=2,68,201 +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/quizz/legendes/misc/music/lit/hasard.html +http://findmail.com/group/ken2061 +http://www.affiliate.hpstore.hp.co.uk/do/session/380852/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-photoworld.com/photoworld.asp?lang=f +http://www.affiliate.hpstore.hp.co.uk/do/session/380852/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/SMARTTIPS/traveljournal.asp +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www-med.stanford.edu/school/banner.html +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www-med.stanford.edu/school/neurosurgery.html +http://hotop.on.net.cn/diguo/club/disp.asp?owner=A201&ID=894 +http://hotop.on.net.cn/diguo/club/disp.asp?owner=A201&ID=846 +http://interbaun.tucows.com/winme/preview/577.html +http://www.ferien-immobilien.de/ungarn/verkauf/Gemeinsam/Immolink/Exklusiv-IB/Startseite/3d-service/Private-IB/Startseite/Default.htm +http://www.eos.dk/archive/swing/msg10936.html +http://www.egroups.com/message/ICSIA-PublicForum/138 +http://www.online.kokusai.co.jp/Service/V0043601/wrd/G200/service/service.html +http://debian.tod.net/debian/dists/unstable/main/source/libs/?N=D +http://www.maas.ccr.it/cgi-win/hiweb.exe/a17/d79/b77,e,4d,51,51,819,819,,2,,51,2,4e,,4d,4e, +http://www.redhat.com/mirrors/LDP/LDP/khg/HyperNews/get/fs/fs/9/?N=D +http://ftp.oleane.net/pub/CTAN/systems/knuth/local/man1/?D=A +http://www.jamba.de/KNet/_KNet-_UA8j1-xFd-13bat/browse.de/node.0/cde7f1uou +http://www.jamba.de/KNet/_KNet-_UA8j1-xFd-13bbg/showInfo-jambabanner.de/node.0/cenv0b09a +http://www.tente.de/us/produkte/artikel/af000000736.htm +http://dwp.bigplanet.com/bloomingprairie/look/sitemap.nhtml +http://www.kfh-mainz.de/Organisationen/Ketteler/pf/ws0001.html +http://extreme-dm.com/tracking/reports/dj/nph-reloads.cgi?tag=agmusik +http://www.chaos.dk/sexriddle/c/v/m/v/y/ +http://ring.jec.ad.jp/pub/linux/debian/debian/dists/woody/non-free/binary-i386/electronics/?D=A +http://tongbang-gh.ed.taejon.kr/1998대전시/math/olym/function/m103_003/html/m103_003h01.html +http://www.company-product.com/23063/ +http://members.tripod.lycos.co.kr/re22/CPUCOOL5195/uni2k15/?N=D +http://209.52.189.2/print_message.cfm/stepparents/8279/173602 +http://216.33.87.17/sports/baseball/sba/sba04r.htm +http://www.mc99.co.jp/mvp/member/new/honda/16kr3fj2/search.cgi?_file=038 +http://www.emerchandise.com/browse/EMERCH/COASTERS/s.cU6lmV05 +http://www.emerchandise.com/browse/CHARMED/s.cU6lmV05 +http://www.across.or.jp/nbbs/nbbs.cgi/talk:n18/replyto/462 +http://www.vins-siffert-scea.fr/lycee-seijo/guide/staff/yoshida.htm +http://www.egroups.com/messages/grebel-list/2305 +http://polygraph.ircache.net:8181/services/design/http_-2www.abcjewelry.com/http_-2www.1045fm.com/http_-2www.4sitedesign.com/stp/nbm.html +http://bsd.sinica.edu.tw/cgi-bin/cvsweb.cgi/ports/astro/wmmoonclock/pkg/Attic/DESCR?only_with_tag=RELEASE_4_0_0 +http://biblio.cesga.es:81/search*gag/tMariposas+negras.+1:08,50+min/tmariposas+negras++++1+++08+++50+min/-5,-1,0,B/frameset&F=tmariposa+y+la+hormiga&1,1 +http://polygraph.ircache.net:8181/Cameras/order/rr962.htm +http://polygraph.ircache.net:8181/Cameras/order/dfwmap.htm +http://support.tandy.com/support_audio/doc45/45827.htm +http://image.tulips.tsukuba.ac.jp:70/fif=picture/ECWP/001.fpx&init=-0.23170732,0.0,1.2317073,1.0&rect=0.5,0.25,0.6829269,0.375&wid=600&hei=600&lng=ja&enablePastMaxZoom=OFF&page=uv1-en.html&obj=uv,1.0&cmd=NW +http://pub23.ezboard.com/fcaribbeanvoiceforumsfrm3.showAddTopicScreenFromWeb +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=9,1+0,0-19,0+9,4 +http://vipnet.tucows.com/win2k/adnload/51108_28465.html +http://vipnet.tucows.com/win2k/adnload/38782_28482.html +http://www4.50megs.com/tstazer/edhtms/edbeats.htm +http://www.unterhaltungs-cd.de/ObervellacherBuam/B000025KMT.htm +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=bocarderont&l=fr +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=146&discrim=10,3,211 +http://variety.studiostore.com/help_security/b.TV%20HERCULES/s.cD15jQkr +http://variety.studiostore.com/help_shipping/b.TV%20HERCULES/s.cD15jQkr +http://variety.studiostore.com/product/TSHER0001/b.TV%20HERCULES/s.cD15jQkr +http://variety.studiostore.com/aboutus/b.TV%20HERCULES/s.cD15jQkr +http://www.redrocksports.com/sports/webSession/shopper/RR972959753-31163/store/dept-5/department/dept-5/item/51530 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=135&discrim=165,71,194 +http://www.kagtech.com/SpitfrireKennels +http://www.expage.com/page/thekatshow +http://www.jobvillage.com/channel/jobs/cleaning/gardener/b.4255.g.3878.html +http://www.xmwb.sh.cn/xmwb/20000704/BIG5/14016^6070408.htm +http://www.xmwb.sh.cn/xmwb/20000704/BIG5/14016^7070414.htm +http://dennou-t.ms.u-tokyo.ac.jp/arch/cc-env/Linux/debian-jp/dists/woody-jp/contrib/binary-all/tex/?S=A +http://genforum.genealogy.com/ny/monroe/messages/350.html +http://genforum.genealogy.com/ny/monroe/messages/296.html +http://genforum.genealogy.com/ny/monroe/messages/306.html +http://genforum.genealogy.com/ny/monroe/messages/213.html +http://otenet.themes.tucows.com/fonts/preview/18792.html +http://otenet.themes.tucows.com/fonts/adnload/18828.html +http://otenet.themes.tucows.com/fonts/adnload/18876.html +http://otenet.themes.tucows.com/fonts/preview/18877.html +http://otenet.themes.tucows.com/fonts/adnload/18894.html +http://otenet.themes.tucows.com/fonts/adnload/18910.html +http://otenet.themes.tucows.com/fonts/adnload/18941.html +http://otenet.themes.tucows.com/fonts/adnload/18949.html +http://otenet.themes.tucows.com/fonts/adnload/25945.html +http://ww.egroups.com/message/schoolnet_sadc/96 +http://ww.egroups.com/message/schoolnet_sadc/98 +http://www6.pasta.cs.uit.no/ietf/ietf45/proceedings/I-D/webdav-dublin-core-01.txt +http://www-uk9.cricket.org/link_to_database/INTERACTIVE/SURVEYS/POLLS_DEC1998.html +http://www.ucp.org/ucp_generaldsc.cfm/151/8/35/ucp_disctpc/292/263 +http://www.ucp.org/ucp_generaldsc.cfm/151/8/35/ucp_disctpc/79/79 +http://se.egroups.com/message/DBA/1700 +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/138/2000/6/0/ +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/138/2000/7/0/ +http://www.inf.fu-berlin.de/lehre/WS00/SWT/material/rosebeispiele/interaccess/logicalview/cat32862112022a/cat36e7162c0192/msg343269780227.htm +http://www.private-immobilien-boerse.de/leipzig/verkauf/Gemeinsam/erreichenPartner/IIM-Teil/Startseite/Gemeinsam/versicherungen/gebaeude/Allgemeine-IB/Startseite/ +http://www.private-immobilien-boerse.de/leipzig/verkauf/Gemeinsam/erreichenPartner/IIM-Teil/Startseite/Gemeinsam/versicherungen/gebaeude/Gemeinsam/Immolink/link.htm +http://freetravel.bedandbreakfast.com/Canada/Prince%20Edward%20Island/Little%20Sands.asp +http://freetravel.bedandbreakfast.com/Canada/Prince%20Edward%20Island/Miscouche.asp +http://freetravel.bedandbreakfast.com/Canada/Prince%20Edward%20Island/O'Leary.asp +http://www.buybuddy.com/sleuth/15/1/1070306/519432/ +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/KIRJASTO-+JA+TIETOPALVELUT/ammattikorkeakoulukirjastot/ammattikorkeakoulut/lahti/p%E4ij%E4t-h%E4me/ +http://www.3w-buecher.de/GravesRobert/GravesRobert0140171991.htm +http://www.3w-buecher.de/GravesRobert/GravesRobert1559948345.htm +http://www.3w-buecher.de/GravesRobert/GravesRobert1850897506.htm +http://members.theglobe.com/heliox2/pokepages/ninepic.htm +http://taiwan.vh.org//////Providers/Textbooks/MuscleInjuries/Fig2.html +http://www.globalgarden.com/Tomato/Archives/vol.1/1147.html +http://www.mojahedin.org/Pages/Mojahed/Mojahed442/articles/articlesftx03.html +http://216.34.146.180/161000reu/16hlth6.htm +http://moshkow.sstu.samara.ru/win/BESTER/Encoding_koi +http://in.egroups.com/message/Girl-Scout-Swaps/9 +http://in.egroups.com/message/Girl-Scout-Swaps/31 +http://members.tripod.com/floydechoes/more.htm +http://nanjingnews.jlonline.com/nanjingnews/njrb/20000222/08dushi.htm +http://www.egroups.com/messages/archery/38?expand=1 +http://retailer.gocollect.com/do/session/1912759/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/index.asp +http://home.dqt.com.cn/~ying_jia/wangwen/new/111.htm +http://canoe.com/MLB97FLASF/sep30_fla_sf.html +http://pub2.ezboard.com/fespguitarsmessageboardltdguitarandbassreviews.subscribeUnregisteredToTopic?topicID=8.topic +http://www.catholicstore.com/search/index.cfm/FuseAction/largeImage/SKU/2558/category/Bo/subCategory/AE/subject/17 +http://www.allgemeine-immobilien-boerse.de/bayern/augsburg/Verkauf/Private-IB/Startseite/Gemeinsam/Inserieren/Private-IB/IIM-Teil/Startseite/froben.htm +http://www.infoscape.com.cn:8171/nf/0004/18/nfga1801.htm +http://www.infoscape.com.cn:8171/nf/0004/18/nfga1809.htm +http://www.linux.com/networking/network/kernel/apache/applications/HTTP/ +http://www.linux.com/networking/network/kernel/apache/applications/Linuxcare/ +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=exacerbate&l=en +http://dopey.rediris.es/ftp/mirror/CPAN/modules/by-module/overload/GSAR/Archive-Tar-0.071.readme +http://dopey.rediris.es/ftp/mirror/CPAN/modules/by-module/overload/GSAR/Tie-IxHash-1.21.readme +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=207&discrim=3,201,226 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=207&discrim=3,201,85 +http://www.gsnet.com/bdltg/es/1_136243.html?num=2 +http://www.pinoycentral.com/img/UBB.nsf/e39d540ca6a9104b4825694d006ed185/6668efca7b60518648256966000fd202?Navigate&To=Prev +http://www.academyfloral.com/state/cabel/flowers/harmony.html +http://trading.rakuten.co.jp/items001/4c/0d/10138895/bidlist.html +http://www.cs.uwa.edu.au/programming/jdk1.2.2/api/javax/swing/event/class-use/TableColumnModelListener.html +http://secure.danysoft.com/asp/dany.tienda/803039052/IconBar +http://ftp-stud.fht-esslingen.de/pub/Mirrors/CPAN/modules/by-authors/id/L/LH/LHS/?S=A +http://genforum.genealogy.com/ga/messages/6297.html +http://genforum.genealogy.com/ga/messages/7843.html +http://genforum.genealogy.com/ga/messages/7281.html +http://www.jsinc.com/dd/destnat/sep00/fromcol10090800.asp +http://www.secinfo.com/$/SEC/Filing.asp?T=nDA3.7c_9i4 +http://www.secinfo.com/$/SEC/Filing.asp?T=nDA3.7c_b19 +http://www.sd.digitalcity.com/maconga/penpals/browse.dci?cat=teens +http://www.sd.digitalcity.com/maconga/penpals/browse.dci?cat=seniors&sort=f +http://www.picktips.com/category-1031-1172_1170_1174-4_1_3 +http://www-us6.semiconductors.com/acrobat/datasheets/CR6627_1.pdf +http://ftp.netc.pt/pub/idgames/levels/doom2/deathmatch/p-r/pimp.txt +http://ftp.netc.pt/pub/idgames/levels/doom2/deathmatch/p-r/radiated.txt +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceMallCategories-BBC709FC_97F7_9E91E7C8C7066684B664C77C8575B940 +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceOrderStatusOverview-BBC709FC_97F7_9E91E7C8C7066684B664C77C8575B940 +http://ads.puntopartenza.com/cgi-bin/redirect.cgi/31033638 +http://mediate.magicbutton.net/do/session/625642/vsid/4385/tid/4385/cid/88138/mid/1702/rid/2114/chid/3393/url/http://www.worldgallery.co.uk/frameset-top50.html +http://link.fastpartner.com/do/session/600388/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/netmaling.php +http://www.egroups.com/message/RecipeCollectors2/3785 +http://plat.debian.or.jp/debian/dists/woody/contrib/binary-alpha/admin/?S=A +http://198.103.152.100/search*frc/aFILIPPELLI,+R.L/afilippelli+r+l/-5,-1,0,B/frameset&F=afilion+louis+jacques&1,,0 +http://de.excite.de/wetter/katalog/4206 +http://www.burstnet.com/ads/ad8386a-map.cgi/973225252.925077 +http://www.branchenfuehreronline.de/A/hauptteil_a.html +http://www.linux.com/networking/support/red_hat/internet/test/simple/ +http://www.shopworks.com/ccfarm/index.cfm/action/search/userid/00061450-2F40-19FE-9038010B0A0ADCF2 +http://www.shopworks.com/index.cfm/userid/00061450-2F40-19FE-9038010B0A0ADCF2 +http://pelit.saunalahti.fi/.1/tucows/preview/144491.html +http://pelit.saunalahti.fi/.1/tucows/preview/52377.html +http://www.teacherformation.org/html/od/facilitators.cfm/xid,7238/yid,4053212 +http://tw.yahoo.com/Regional/Countries_and_Regions/China/Provinces__Regions_and_Municipalities/Tianjin/Business/Companies/Utilities/ +http://brain.brent.gov.uk/WebPages.nsf/vWebAllPagesByKey!OpenView&Start=174&Count=60&Expand=194 +http://brain.brent.gov.uk/WebPages.nsf/vWebAllPagesByKey!OpenView&Start=174&Count=60&Expand=227 +http://www.bemi-immobilien.de/Landhaus-Bordeaux/Gemeinsam/versicherungen/unfall/Gemeinsam/erreichenPartner/Startseite/Gemeinsam/MarketingStrategie/Startseite/froben.htm +http://www.bemi-immobilien.de/Landhaus-Bordeaux/Gemeinsam/versicherungen/unfall/Gemeinsam/erreichenPartner/Startseite/Gemeinsam/MarketingStrategie/Gemeinsam/versicherungen/gebaeude/deckungsumfang.htm +http://www.3wposter.com/hake/hkg1701.htm +http://www.citybrazil.com.br/go/mossamedes/utilpub.htm +http://oss.software.ibm.com/developerworks/opensource/cvs/icu4j/icu4j/src/com/ibm/demo/translit/Attic/?sortby=date +http://www.linux.com/networking/network/management/operating_system/enterprise/research/ +http://www.angelfire.com/pq/Prophetess/Prophetess.page3.html +http://www.3w-nostalgie.de/ZeigerMimi/ZeigerMimi007072833X.htm +http://www.excelsior.com.mx/9801/980128/for01.html +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=11&discrim=49,235,5 +http://retailer.gocollect.com/do/session/1912802/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/contact.asp +http://citeseer.nj.nec.com/track/64292/4220924 +http://citeseer.nj.nec.com/correct/318910 +http://citeseer.nj.nec.com/correct/249393 +http://www.chaos.dk/sexriddle/h/y/r/k/ +http://www.hig.se/(aconf,date,doc,insert,return)/~jackson/roxen/ +http://www.hig.se/(aconf,date,doc,gtext,insert)/~jackson/roxen/ +http://mediate.magicbutton.net/do/session/625608/vsid/4573/tid/4573/cid/88043/mid/2247/rid/2383/chid/3527/url/http://www.winesmart.com/expert.asp +http://magazines.sina.com/education/renbun/93/13.html +http://www6.freeweb.ne.jp/art/cilter/kamijo02.htm +http://yp.gates96.com/11/25/50/28.html +http://yp.gates96.com/11/25/50/41.html +http://yp.gates96.com/11/25/50/65.html +http://yp.gates96.com/11/25/50/74.html +http://yp.gates96.com/11/25/50/91.html +http://yp.gates96.com/11/25/50/93.html +http://yp.gates96.com/11/25/50/94.html +http://yp.gates96.com/11/25/51/59.html +http://yp.gates96.com/11/25/51/93.html +http://yp.gates96.com/11/25/52/66.html +http://yp.gates96.com/11/25/54/46.html +http://yp.gates96.com/11/25/54/68.html +http://yp.gates96.com/11/25/54/83.html +http://yp.gates96.com/11/25/54/95.html +http://yp.gates96.com/11/25/54/98.html +http://yp.gates96.com/11/25/55/1.html +http://yp.gates96.com/11/25/55/6.html +http://yp.gates96.com/11/25/55/96.html +http://yp.gates96.com/11/25/56/83.html +http://yp.gates96.com/11/25/56/89.html +http://yp.gates96.com/11/25/57/30.html +http://yp.gates96.com/11/25/57/68.html +http://yp.gates96.com/11/25/58/56.html +http://yp.gates96.com/11/25/58/67.html +http://yp.gates96.com/11/25/59/7.html +http://yp.gates96.com/11/25/59/40.html +http://yp.gates96.com/11/25/59/58.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/misc/legendes/lit/misc/quizz/quizz2.html +http://excite.de/kleinanzeigen/katalog/7100 +http://www.egroups.org/messages/stepup/97 +http://sunsite.org.uk/pub/packages/proftpd/misc/?S=A +http://ring.htcn.ne.jp/archives/lang/perl/CPAN/modules/by-module/CGI/DOUGM/?M=A +http://ring.htcn.ne.jp/archives/lang/perl/CPAN/modules/by-module/CGI/DOUGM/Apache-Scoreboard-0.10.readme +http://ring.htcn.ne.jp/archives/lang/perl/CPAN/modules/by-module/CGI/DOUGM/B-Size-0.04.readme +http://herndon1.sdrdc.com/cgi-bin/can_ind/S8NY00082/1/Y/ +http://in.egroups.com/message/msu-foi/20?source=1 +http://www.worldstocks.de/htm/boersen/asien/indonesien_boerse.htm +http://members.xoom.com/pvmnieuws/movies/movies.html +http://gb.toget.com.tw/article/screensaver/index_a_2.html +http://www.emis.de/journals/EJDE/Volumes/Monographs/Volumes/2000/64/?N=D +http://bsd.wj.o3.net/8/1/18/4.html +http://www.ftp.uni-erlangen.de/pub/mirrors/_other/afterstep.foo.net/apps/asprint/?S=A +http://citeseer.nj.nec.com/cidcontext/3597768 +http://m4.findmail.com/dir/Sports/Soccer/Academic_Study_of_Soccer/History +http://genforum.genealogy.com/cgi-bin/print.cgi?westerman::121.html +http://www-koi.bards.ru/Egorov/part84.htm +http://www-koi.bards.ru/Egorov/part29.htm +http://www-koi.bards.ru/Egorov/part127.htm +http://www-koi.bards.ru/Egorov/part68.htm +http://www.loisirs.ch/emjius/10/brglll.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/quizz/music/computers/legendes/lit/hellequin.html +http://www.redrival.com/dejanss/muzika/exploited/themassacre.html +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/SaveCounter/2000-08-31/13/967698323786.txt +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/SaveCounter/2000-08-31/13/967699453627.txt +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/SaveCounter/2000-08-31/13/967699813970.txt +http://www.chaos.dk/sexriddle/c/v/w/l/o/ +http://www.chaos.dk/sexriddle/c/v/w/l/x/ +http://www.allgemeine-immobilien-boerse.de/Oesterreich/verkauf/IIM-Teil/Startseite/Allgemeine-IB/Gemeinsam/3d-service/info.htm +http://www.marktplatz-hs.de/cgi-bin/ChioEditionShop.s/39fe2eeb0239a4a4273fd47540f806ea/IconBar +http://www.jamba.nl/KNet/_KNet-sDD8j1-GC4-puzu/browse.nl/node.0/cde7f1uou +http://www.icopyright.com/1.1635.66362 +http://www.ld.com/cbd/archive/1999/05(May)/07-May-1999/Vsol004.htm +http://www.infoscape.com.cn:8171/nf/0007/05/nfgz0517.htm +http://209.207.239.212/bkindex/c1034/f1392.html +http://www.gbnf.com/genealogy/rockwel4/html/d0007/I1584.HTM +http://www.gbnf.com/genealogy/rockwel4/html/d0023/I3700.HTM +http://www.hornchurch.londonengland.co.uk/designersgraphic.htm +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/computers/lit/misc/colorart/lit/quizz/ +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/computers/lit/misc/colorart/lit/misc/orders_mag.html +http://www.multimap.com/wi/141313.htm +http://www.multimap.com/wi/141326.htm +http://www.thestateofcolorado.com/aconplumbing.html +http://www.thestateofcolorado.com/aconstairs.html +http://ftp.netc.pt/pub/idgames/levels/doom2/0-9/10level.txt +http://members.tripod.com.br/Magoo13/musicas.htm +http://tucows.bigskysoft.com/winme/adnload/137256_30133.html +http://www.houses-apartment-rentals.com/Texas/city_search_criteria.asp?state=TX&City=CHICOTA +http://se.egroups.com/message/trabalhoseguro/186 +http://www.daysinn.com/ctg/cgi-bin/DaysInn/financial_support/AAAksrACwAAABvyAAQ +http://www.long-life.de/lt040.htm +http://smartnet.tucows.com/winme/meditme_rating.html +http://smartnet.tucows.com/winme/meditme_size.html +http://www.kmoviefc-jp.com/db/prod/pd/k1000003.htm +http://ftp.rge.com/pub/usenet/readers/mac/Mews/?S=A +http://fi.egroups.com/messages/lasermail/298 +http://fi.egroups.com/message/lasermail/295 +http://www.voter.com/home/message/post/1,1559,24-60_2976_2473-,00.html +http://se.egroups.com/message/rv8list/1122 +http://www.ferien-immobilien.de/Rhein-Sieg-kreis/verkauf/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/3d-service/Gemeinsam/Inserieren/Private-IB/Startseite/Default.htm +http://library.bangor.ac.uk/search/aUnited+Kingdom+Reading+Association/aunited+kingdom+reading+association/-17,-1,0,B/exact&F=aunited+kingdom+environmental+law+association&1,2/limit +http://webcenter.travelocity-leisure.netscape.com/DestGuides/0,1840,TRAVELOCITY|1987|5|2,00.html +http://yokohama.cool.ne.jp/michirur/dragon/maria/m2.htm +http://ring.omp.ad.jp/archives/NetBSD/packages/pkgsrc/graphics/Ngraph/patches/?D=A +http://mitglied.tripod.de/argewesterwald/jr/jrfo3.htm +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=3,16,10 +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=28,16,10 +http://avdistrict.edgate.com/hhs/pa_rc_gre.html +http://pub26.ezboard.com/fdysfuctionalrealityfrm2.showAddReplyScreenFromWeb?topicID=32.topic&index=1 +http://www.geocities.co.jp/Playtown-Domino/5245/guti.html +http://www.haikou.hi.cn/Pandect/hknj98/nj98d1.html +http://retailer.gocollect.com/do/session/1912800/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/help/site_tour/index.asp +http://ftp.unina.it/pub/Pcibm/pcdemos/ftp.hornet.org/graphics/images/1998/b/?M=A +http://variety.studiostore.com/browse/ABUGSLIFE/FIGURINE/s.qjEoNLlG +http://yp.gates96.com/11/76/10/13.html +http://yp.gates96.com/11/76/10/18.html +http://yp.gates96.com/11/76/11/63.html +http://yp.gates96.com/11/76/14/45.html +http://yp.gates96.com/11/76/14/65.html +http://yp.gates96.com/11/76/14/77.html +http://yp.gates96.com/11/76/15/1.html +http://yp.gates96.com/11/76/15/68.html +http://yp.gates96.com/11/76/15/97.html +http://yp.gates96.com/11/76/16/2.html +http://yp.gates96.com/11/76/16/59.html +http://yp.gates96.com/11/76/16/64.html +http://yp.gates96.com/11/76/16/79.html +http://yp.gates96.com/11/76/17/10.html +http://yp.gates96.com/11/76/17/52.html +http://yp.gates96.com/11/76/19/9.html +http://yp.gates96.com/11/76/19/11.html +http://yp.gates96.com/11/76/19/17.html +http://yp.gates96.com/11/76/19/19.html +http://www.debian.org.cn/Bugs/db/67/67207-b.html +http://www.bemi-immobilien.de/Exklusiv-IB/Startseite/Gemeinsam/immolink/Gemeinsam/Inserieren/Startseite/Gemeinsam/versicherungen/unfall/Gemeinsam/3d-service/info.htm +http://www.private-immobilien-boerse.de/baden-wuertemberg/calw/Verkauf/Gemeinsam/versicherungen/gebaeude/Gemeinsam/erreichenPartner/Private-IB/IIM-Teil/Startseite/frinfo.htm +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=21,0-(14,0)+9,5 +http://www.thesite.msnbc.com/tlkbck/comment/2100652/0,7436,80913-291181,00.html +http://202.109.72.57:8077/article/19991130/1741.htm +http://www.mit.edu/afs/athena.mit.edu/astaff/project/eolcdev/arch/sgi_62/ +http://www.metromix.com/top/1,1419,M-Metromix-Home-reviews!PlaceDetail-13623,00.html +http://ring.jec.ad.jp/pub/linux/debian/debian/dists/woody/non-free/binary-powerpc/news/?M=A +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceStoreCategories-BBC70A07_97FC_42E663949129E2030ACC2E97E71CD8B3 +http://grwy.online.ha.cn/paoe/about/aoe2.htm +http://www.2pl.com/b/ar/to/1/01/01/v1/1010178470-3.htm +http://www.digitaldrucke.de/(aktuell,marktplatz,nuernberg,sense,werbung)/suche/uebersicht.html +http://ustlib.ust.hk/search*chi/aswiss+radio+symphony+orchestra/aswiss+radio+symphony+orchestra/-5,-1,0,B/frameset&F=aswiss+society+for+soil+and+rock+mechanics&1,1 +http://www.ecatsbridge.com/BiB/static/sims/bbljuly99/00000101843221172F1.htm +http://www.videogames.com/psx/sports/freestyle99/screen.html?page=19 +http://www.mojahedin.org/Pages/Mojahed/Mojahed474/sci/sci02.html +http://www.shopworks.com/bigmountain/index.cfm/action/cart/userid/000E50D6-1185-19FE-A703010D0A0A8CF2 +http://polygraph.ircache.net:8181/http_-2www.horizonfinance.com/~xionthia/as/ +http://yp.gates96.com/14/76/30/16.html +http://yp.gates96.com/14/76/30/81.html +http://yp.gates96.com/14/76/31/12.html +http://yp.gates96.com/14/76/31/37.html +http://yp.gates96.com/14/76/31/68.html +http://yp.gates96.com/14/76/32/11.html +http://yp.gates96.com/14/76/32/50.html +http://yp.gates96.com/14/76/32/68.html +http://yp.gates96.com/14/76/33/26.html +http://yp.gates96.com/14/76/33/53.html +http://yp.gates96.com/14/76/35/11.html +http://yp.gates96.com/14/76/35/26.html +http://yp.gates96.com/14/76/35/47.html +http://yp.gates96.com/14/76/35/74.html +http://yp.gates96.com/14/76/36/16.html +http://yp.gates96.com/14/76/37/23.html +http://yp.gates96.com/14/76/37/56.html +http://yp.gates96.com/14/76/37/82.html +http://yp.gates96.com/14/76/38/76.html +http://yp.gates96.com/14/76/39/20.html +http://yp.gates96.com/14/76/39/25.html +http://yp.gates96.com/14/76/39/28.html +http://yp.gates96.com/14/76/39/33.html +http://yp.gates96.com/14/76/39/61.html +http://yp.gates96.com/14/76/39/69.html +http://yp.gates96.com/14/76/39/91.html +http://www-usa8.cricket.org/link_to_database/ARCHIVE/ARTICLES/JAN-JUN_1996/PRESS_REACTIONS_AUS_18MAR1996 +http://www-usa8.cricket.org/link_to_database/ARCHIVE/ARTICLES/JAN-JUN_1996/LOSS_WI_CRICKET_11MAR1996.html +http://www-usa8.cricket.org/link_to_database/ARCHIVE/ARTICLES/JAN-JUN_1996/SPINNERS_TALES_11JAN1996 +http://hurweb01.hurriyetim.com.tr/hur/turk/98/11/19/gundem/31gun.htm +http://library.cuhk.edu.hk/search*chi/aKuan,+Jui-hsuan./akuan+jui+hsuan/-5,-1,0,E/exact&F=akuan+jui+hsuan&1,22 +http://library.cuhk.edu.hk/search*chi/aKuan,+Jui-hsuan./akuan+jui+hsuan/-5,-1,0,E/frameset&F=akuan+jung&1,,0 +http://ring.toyama-ix.net/archives/pc/winsock-l/Windows95/Finger/fing32l.txt +http://cometweb01.comet.co.uk/do!tid=20&rtid=1&vsid=700&session=132044&mid=1000&rid=1060&cid=37030&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplGGolLarZLq4fLpmiLXv-KmooLckYLoznGmpq0qsc0mojLbkYLozvGotc0ZdoLckYLozvGsmv0qmc0jXfLkVZLdocLkYoLzcj1XfkLVZXLqkXLjbzKcob5qroLkVrLoizKlZd5fjYHfklKkZlLjjbLoZbLpl51ubZLDXZLollK3ljLbqlKjXfLkkaHotl4obmLloqL +http://student.monterey.edu/nr/riveradebranepom/campus/ +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/listUnseen/fol/100001/20,0/5170254 +http://www.ibiblio.org/pub/Linux/distributions/debian/contrib/binary-all/otherosfs/?D=D +http://www.ilmessaggero.it/hermes/19980909/01_NAZIONALE/SPETTACOLI/E.htm +http://ayasii.virtualspace.net/html/1207/12071611_himemiya02.htm +http://retailer.gocollect.com/do/session/1912732/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/about.asp +http://retailer.gocollect.com/do/session/1912732/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/exclusives/newintros.asp +http://retailer.gocollect.com/do/session/1912732/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/dealer_lookup.asp +http://se.egroups.com/subscribe/pretty_of_five +http://home.neo.rr.com/keeter/pics.html +http://www.peopledaily.co.jp/haiwai/199910/12/newfiles/E108.html +http://www.telematik.informatik.uni-karlsruhe.de/osf/sw/v4.0x/lp2/snt100/?M=A +http://www.alyon.org/perso/1001-sciences/sciences_citoyens/agronomie/agronomie/intervenants.htm +http://www.2pl.com/b/no/fi/3/02/24/b1/3022400016-11131.htm +http://channel.nytimes.com/indexes/2000/07/21/sports/hockey/ +http://space.tin.it/io/fivird/REM/eng/albums/lyrics/documentfr.html +http://www.kurit.com/girls/galleryf.cgi?mp_code=7332&service=girls +http://store.efunctional.com/nokia.html +http://dk.egroups.com/login.cgi?login_target=%2Fmessage%2Fbonsai-cz%2F274 +http://bbs.kcm.co.kr/NetBBS/Bbs.dll/boliviabbs/opn/zka/B2-kB2Fq/qqo/007D/qqatt/^ +http://www.loisirs.ch/cvljnq/10/yrespd.html +http://www.primenet.com/~trakker/events/abcforum.htm +http://www.primenet.com/~trakker/events/frame_abcforum.htm +http://www.fogdog.com/cedroID/ssd3040183253760/nav/products/featured_brands/12r/gift_packs/ +http://www.fogdog.com/cedroID/ssd3040183253760/nav/products/featured_brands/12r/windshirts/ +http://www.oreilly.com/homepages/dtdparse/docbook/3.0/dtdent/simmod02.htm +http://dk.egroups.com/group/SCMHCSC +http://www.ycwb.com.cn/gb/2000/01/11/ycwb/dsxw/9.html +http://dk.egroups.com/message/teenhealth/1620 +http://nbzhuhq1.top263.net/htm/y/y14-5.htm +http://adserver.latimes.com/editions/orange/20001030/t000103739.html +http://adserver.latimes.com/editions/orange/20001030/t000103751.html +http://library.bangor.ac.uk/search/cWS+200+G4655+1999/cws++200+g4655+1999/-17,-1,0,B/frameset&F=cws++141+j74+h+1989&2,,2 +http://ftpsearch.belnet.be/pub/os/linux/SuSE-Linux/i386/6.4/disks/rescue +http://www.rarf.riken.go.jp/archives/tex-archive/macros/latex//contrib/supported/elsevier/model-harv.pdf +http://www.diogenes.ch/4DACTION/web_glob_showhtml/path=leser/verlag/index.html&ID=483373 +http://crn.com/Components/emailArticle.asp?ArticleID=2114 +http://link.fastpartner.com/do/session/600410/vsid/1970/tid/1970/cid/135878/mid/1060/rid/1488/chid/1970/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/speednames.php +http://link.fastpartner.com/do/session/600410/vsid/1970/tid/1970/cid/135878/mid/1060/rid/1488/chid/1970/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/nordicliving.php +http://ftp.gigabell.net/pub/FreeBSD/FreeBSD-stable/packages/emulators/ +http://ftp.gigabell.net/pub/FreeBSD/FreeBSD-stable/packages/print/ +http://emplois.fr.net/archive062000/2348.html +http://variety.studiostore.com/browse/ANASTASIA/_/b.FAVORITES%20COMICS%20ANIMFEAT/s.eKoxAPfo +http://www.geocities.co.jp/HeartLand-Gaien/3163/choko.htm +http://members.tripod.com/~moviemaniac1/moviesR/Rocketman.html +http://wiem.onet.pl/wiem/0006ac-sp1.html +http://msdn.microsoft.com/library/devprods/vs6/visualj/vjref/java.net.UnknownHostException001.html +http://www.tiscover.ch/1Root/Kontinent/6/Staat/30/Bundesland/31/Ort/1732/Homepage/m_homepage...2.html +http://power.luneng.com/power/library/jzjs/jzjs99/jzjs9903/990311.htm +http://citeseer.nj.nec.com/cidcontext/1976718 +http://in.egroups.com/messages/srcg/2 +http://sunsite.informatik.rwth-aachen.de/cgi-bin/ftp/ftpshow/pub/comp/Linux/debian/dists/potato/main/disks-sparc +http://pd.shiseido.co.jp/s9701unt/html/unt00025.htm +http://www.kame.tadaima.com/9721036/taro1.html +http://www.kame.tadaima.com/9721036/taro8.html +http://www.unc.edu/courses/chem41/classnotes/41s6/sld008.htm +http://a1sexpics.com/butts/buttfucking/ +http://moundoflove.com/buttfucking/butts/asslickinganal.html +http://www.digitaldrucke.de/(arbeitsvermittlung,hilfe,nuernberg)/_fort/html/themen/hilfe/hilfe.htm +http://freethemes.netc.pt/preview/15221.html +http://freethemes.netc.pt/preview/51972.html +http://freethemes.netc.pt/preview/74442.html +http://cn.tech.yahoo.com/000913/23/1dpl.html +http://cn.tech.yahoo.com/000913/23/1dp2.html +http://wap.jamba.de/KNet/_KNet-JgK8j1-FGd-13di8/browse.de/node.0/cde7f1uou +http://imageserver2.tibetart.com:8087/fif=fpxbuddhist/43.fpx&init=0.0,0.0,1.0,1.0&rect=-0.25,0.25,0.25,0.75&wid=280&hei=400&lng=en_US&enablePastMaxZoom=OFF&page=image.html&obj=uv,1.0&cmd=S +http://www.ozemail.com.au/~pballard/gnt_hidden123/mar12.htm +http://www.ozemail.com.au/~pballard/gnt_hidden123/act9.htm +http://www.ozemail.com.au/~pballard/gnt_hidden123/rom7.htm +http://www.ozemail.com.au/~pballard/gnt_hidden123/2co13.htm +http://www.ozemail.com.au/~pballard/gnt_hidden123/heb12.htm +http://www.ozemail.com.au/~pballard/gnt_hidden123/jam4.htm +http://ftp.darenet.dk/tucows/winnt/adnload/1449_29554.html +http://www.chaos.dk/sexriddle/w/j/u/o/ +http://www.chaos.dk/sexriddle/w/j/u/v/ +http://opac.lib.rpi.edu/search/tmcgraw+hill+series+in+advanced+chemistry/-5,-1,0,B/frameset&tmcgraw+hill+series+in+advanced+chemistry&9,,42 +http://www.zcu.cz/ftp/mirrors/pgp/6.5/6.5.1/win/ +http://webpolitik.subportal.com/sn/Multimedia_and_Graphics/Misc__Graphics_Tools/12852.html +http://ftp.lip6.fr/pub2/perl/CPAN/doc/manual/html/lib/SysV/SysV.html +http://bbs.gznet.edu.cn/cgi-bin/getannounce//groups/GROUP_9/Telecom/friend/fbf/ewqtr +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9709/date/article-10.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9709/date/article-88.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9709/date/article-92.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9709/date/article-177.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9709/date/article-178.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9709/date/article-229.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9709/date/article-288.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9709/date/article-293.html +http://www.usq.edu.au/unit-1997/fullspec/54081s2x.htm +http://sound-dist.secured.co.uk/cgi-bin/psProdDet.cgi/15P04|972959617|Helmet|user|0|1,0,0,0 +http://www.buybuddy.com.au/sleuth/8/1/5010204/40843/ +http://www.maxpages.com/vote.cgi?site=pokemonyellow1&pg=Home +http://rex.skyline.net/html/Automobiles_-_Dealers_-_Used.html?64,outdoor,transportation,collectibles,transportation +http://www.linux.com/networking/network/communications/management/updates/Windows_NT/ +http://retailer.gocollect.com/do/session/1912735/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/top_ten.asp?pagenum=1 +http://amarilloglobenews.com/stories/031000/ +http://www.egroups.com/post/swish?act=reply&messageNum=275 +http://www.apcmag.com/apcweb/reviewsdisc.nsf/aac7d56ca8fd884b852563be00610639/af5bb64432e7f9444a2565240026bbbf!Navigate&To=PrevMain +http://best.netease.com/guestbook/personal/zhuirinew3.html +http://best.netease.com/cgi-bin/view/viewbasic.cgi?japanboy4 +http://www.ftp.uni-erlangen.de/cgi-bin/view/pub/mirrors/redhat/current/i386/doc/gsg/ch-basics.htm +http://www.ftp.uni-erlangen.de/cgi-bin/view/pub/mirrors/redhat/current/i386/doc/gsg/p5202.htm +http://splitrock.themes.tucows.com/preview/77000.html +http://splitrock.themes.tucows.com/preview/25855.html +http://splitrock.themes.tucows.com/preview/134493.html +http://splitrock.themes.tucows.com/preview/14722.html +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=13,0-22,0+15,0-0,2 +http://www.icopyright.com/1.1634.64625 +http://mvweb.de/olympia/nachrichten/sportarten/ergebnisse/bdt-190900-438-dpa_153140.html +http://www.rge.com/pub/tex/fonts/armtex/v2.0/examples/plain/ +http://www.club-internet.fr/cgi-bin/h?Antibes +http://www.caprili.it/santantimo.htm +http://dic.empas.com/show.tsp/?q=%C3%EB%C8%EF%20%F6%AD%FD%E9&f=B +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=98&discrim=2,38 +http://www.artex.firenze.it/_qualitart/articoli/zoom/02235.htm +http://home.powertech.no/huftis/w3c/TR/WAI-WEBCONTENT-NO-NYN/checkpoint-list.txt +http://mtlab.biol.tsukuba.ac.jp/WWW/PDB2/PCD0467/htmls/07.html +http://library.cuhk.edu.hk/search*chi/aShu,+Tien-min./ashu+tien+min/-5,-1,0,B/exact&F=ashu+tsung+chiao&1,6 +http://www.trnonline.com/archives/2000archives/05242000/how_now_joe_brown/23506.shtml +http://www.bemi-immobilien.de/Exklusiv-IB/Startseite/Gemeinsam/versicherungen/gebaeude/Gemeinsam/MarketingStrategie/Gemeinsam/erreichenPartner/Gemeinsam/versicherungen/lebensversicherung/Startseite/frinfo.htm +http://santabarbarashops.com/Mall/Stores/StoreInfo/asp/store-id/1000007121.html +http://www.angelfire.com/ok/americassweetheart/UNique.html +http://ukinvest.ukwire.com/articles/199909070731000375A.html +http://www.streetprices.com/Electronics/Consumer/Camcorders/Digital/sortproductbylowprice/SP374033.html +http://www.streetprices.com/Electronics/Consumer/Camcorders/Digital/sortproductbylowprice/SP363722.html +http://www.streetprices.com/Electronics/Consumer/Camcorders/Digital/sortproductbylowprice/SP288187.html +http://www.streetprices.com/Electronics/Consumer/Camcorders/Digital/sortproductbylowprice/SP288192.html +http://www.bemi-immobilien.de/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/Gemeinsam/versicherungen/gebaeude/Startseite/Gemeinsam/Gemeinsam/immolink/Top-Darlehens-Konditionen/anforderungsformular.htm +http://celes.subportal.com/sn/Business/Standard_Calculators/index1.html +http://www.linux.com/networking/network/networking/it/future/firewall/ +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=198&discrim=87,19,3 +http://www.hig.se/(append,define,language,quote,tablify)/~jackson/roxen/ +http://www.guba.com/114/236/12fE/index-3.phtml +http://genforum.genealogy.com/tn/messages/7906.html +http://207.138.41.133/message/BienestarCalifornia/16 +http://207.138.41.133/message/BienestarCalifornia/26 +http://chasnaz.freeyellow.com/email.html +http://genforum.genealogy.com/cgi-bin/print.cgi?mcevoy::217.html +http://www.civila.com/brasil/fov/ +http://www.emerchandise.com/associates/b.FAVORITES%20PAGEANTS/s.oAq5vp1w +http://www.emerchandise.com/help_security/b.FAVORITES%20PAGEANTS/s.oAq5vp1w +http://www.z-plus.de/freizeit/kino/galerie/roula/kritikwelt.html +http://www.angelfire.com/mo2/MrMime2000/wewon.html +http://www.gazeta.com/Iso/Regiony/Lodz/Raporty/Jedzenie/Jedz/020jed.html +http://www.sportas.de/ddsup00.htm +http://muc-zvs-web1.goethe.de/an/mel/wabhorst/dtourism.htm +http://www.cardina.net/~erps +http://www.polbox.com/p/paruwa/spec.html +http://ww2.comune.fe.it/cgi-win/hiweb.exe/a2/d72/b31,e,1f,b,b,50,50,,3,,1f,3,9,,1f,9, +http://www.ld.com/cbd/archive/1999/03(March)/29-Mar-1999/15awd002.htm +http://dk.egroups.com/post/cbradio?act=reply&messageNum=823 +http://aecjobbank.com/texis/script/newjobs/+lww7mwww0xBV6e52iHwwwesPBB2eZmwwwt6erV0Vwwwh6er6Gswwwt6er6bgwwwt6etDL-www+6ethrCwwxeRT43eR4mwwwt6etrvuwwwn6KeU-wwwmcmrmwxerjmx7mwww1hzmww-eHxww/jobdirectory.html +http://www.envy.nu/summerslip/past.html +http://www.envy.nu/summerslip/leave.html +http://home.pacific.net.sg/~kinnkinn/ +http://www.bluesapphires.net/ladies/lv0444.shtml +http://www.freerepublic.com/forum/a4148bd.htm +http://www.sdinfonet.com.cn/024/32/024329969.htm +http://www.sdinfonet.com.cn/024/32/024329953.htm +http://www.jpc-music.com/8754347.htm +http://www.jpc-music.com/5183511.htm +http://www.jamba.nl/KNet/_KNet-ytO8j1-7D4-pwef/browse.nl/node.0/cde7f38ny +http://dk.egroups.com/message/noholdsbarred/210 +http://uoi.tucows.com/winme/preview/75912.html +http://207.197.132.133/lobbyists/98profiles/556.htm +http://www.jobvillage.com/channel/jobs/protective_services/private_investigator/g.4.html +http://www.jobvillage.com/channel/jobs/protective_services/private_investigator/b.8946.g.4179.html +http://aleph.tau.ac.il:4500/ALEPH/eng/ATA/AAS/AAS/SET-MAIL/381462/11/ +http://www-rn.informatik.uni-bremen.de/home/X11R6/xc/lib/font/Speedo/?D=A +http://www.brio.de/BRIO.catalog/39fe2f7006f69fb6273fd472aa78073d/UserTemplate/6 +http://cardiology.medscape.com/IMNG/ClinPsychNews/1998/v26.n07/cpn2607.34.01.html +http://www.incestpornstories.com/hot-hardcore-fuckingbanging/plus-sizewhale/slutspretty/slutsbest-friends/erectionfellatio/bisexualtinkerbell.html +http://yp.gates96.com/7/65/10/40.html +http://yp.gates96.com/7/65/11/15.html +http://yp.gates96.com/7/65/11/34.html +http://yp.gates96.com/7/65/11/69.html +http://yp.gates96.com/7/65/11/88.html +http://yp.gates96.com/7/65/12/95.html +http://yp.gates96.com/7/65/13/82.html +http://yp.gates96.com/7/65/13/91.html +http://yp.gates96.com/7/65/13/93.html +http://yp.gates96.com/7/65/14/2.html +http://yp.gates96.com/7/65/14/8.html +http://yp.gates96.com/7/65/15/31.html +http://yp.gates96.com/7/65/15/38.html +http://yp.gates96.com/7/65/15/51.html +http://yp.gates96.com/7/65/15/95.html +http://yp.gates96.com/7/65/15/96.html +http://yp.gates96.com/7/65/16/4.html +http://yp.gates96.com/7/65/16/20.html +http://yp.gates96.com/7/65/16/58.html +http://yp.gates96.com/7/65/17/22.html +http://yp.gates96.com/7/65/17/66.html +http://yp.gates96.com/7/65/18/37.html +http://yp.gates96.com/7/65/18/69.html +http://yp.gates96.com/7/65/18/97.html +http://yp.gates96.com/7/65/19/0.html +http://yp.gates96.com/7/65/19/12.html +http://yp.gates96.com/7/65/19/16.html +http://yp.gates96.com/7/65/19/28.html +http://yp.gates96.com/7/65/19/37.html +http://yp.gates96.com/7/65/19/44.html +http://dyade.inrialpes.fr/aaa/public/java/jdk1.3/docs/api/javax/swing/plaf/basic/class-use/BasicSplitPaneUI.KeyboardUpLeftHandler.html +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/asiasanahaku/kalatalous/ty%F6voimapolitiikka/pienet+ja+keskisuuret+yritykset/maatilatalous/ +http://www.ferien-immobilien.de/ungarn/verkauf/Gemeinsam/MarketingStrategie/Allgemeine-IB/Private-IB/Private-IB/Startseite/Default.htm +http://ftp.du.se/disk2/CPAN/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/WWW/libwww-perl-5.43.readme +http://ftp.du.se/disk2/CPAN/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/WWW/libwww-perl-5.46.readme +http://ftp.du.se/disk2/CPAN/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/WWW/webchat-0.05.readme +http://209.0.220.240/biz/541519/541-389-1493.htm +http://www.shsu.edu/wcb/schools/SHSU/sed/rmzoubi/12/forums/forum54/wwwboard.html +http://retailer.gocollect.com/do/session/1912768/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/news/index.asp +http://romulus.ehs.uiuc.edu/cgi-bin/lwgate/RADSAFE/archives/radsafe9610/Date/article-33.html +http://romulus.ehs.uiuc.edu/cgi-bin/lwgate/RADSAFE/archives/radsafe9610/Date/article-31.html +http://www.acfas.ca/congres/congres67/S408.htm +http://pub1.ezboard.com/fthehawkeyehotspotfrm16.showMessage?topicID=178.topic +http://archives.marshall.edu/~mccomas/cd315-spring00-list/1549.html +http://www.asiastockwatch.com/AsiaStockWatch_-_Cached/Articles/asw_recommend_friend_con/1,1145,617_1_1:3,00.html +http://wiem.onet.pl/wiem/014a7e.html +http://linux99.inrialpes.fr/linux/RPM/kondara/1.2/errata/bugfixes/i586/System_Environment_Daemons.html +http://linux99.inrialpes.fr/linux/RPM/kondara/1.2/errata/bugfixes/i586/User_Interface_X.html +http://cn.egroups.com/login.cgi?login_target=%2Fmessage%2FWeb_Holidays%2F35 +http://library.bangor.ac.uk/search/aEuropean+Academy+of+Allergology+and+Clinical+Immunology/aeuropean+academy+of+allergology+and+clinical+immunology/7,-1,0,B/bibandlinks&F=aeuropean+association+for+animal+production+commission+on+animal+management&1,1 +http://www4.freeweb.ne.jp/art/fujiso/gehp/pge222.html +http://pnews.jcc.co.jp/scoop/9905/990506kk2-3ss.html +http://ring.nii.ac.jp/archives/linux/Vine/Vine-1.1/kernel-2.2.x-kit/RPMS/ +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=81&discrim=8,230,214 +http://www.emerchandise.com/browse/BUFFYTHEVAMP/KEYCHAIN/b.TV%20BUFFYTHEVAMP/s.DfgPpLQw +http://www.emerchandise.com/browse/BUFFYTHEVAMP/MAGNET/s.DfgPpLQw +http://www.koms.de/I-Data/Upgrades/HostCom/Cx/isp/?S=A +http://www.back2roots.org/Aminet/Forums/Util--Wb--Amero36/ +http://www.hig.se/(autoformat,define,en,modified,referrer)/~jackson/roxen/ +http://216.35.79.131/sites/gunits/052302u.html +http://216.35.79.131/sites/gunits/052303u.html +http://216.35.79.131/sites/gunits/032883u.html +http://itcareers.careercast.com/texis/it/itjs/+4wwBmecXD86ExwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewShwAwMwoacnwmamnpcdOMnDBaMwoDBnDwDqnanDtoDnnGaDnBidGAaoDqc1mna5BGdDtaADdicnmtnaGn31oGnmaMFqtwAwMwoDzmeZxwwwpBmIe0B-decrwww5rmeAdwwwBrmeZpwww/morelike.html +http://troy.lib.sfu.ca/search/tadvocate+vanc/tadvocate+vanc/7,-1,0,B/browse +http://210.159.30.200:8080/-_-http://www2s.biglobe.ne.jp/~proton/kokuritu/ +http://210.159.30.200:8080/-_-http://www2s.biglobe.ne.jp/~proton/mituzawa/mitusta.html +http://config.tucows.com/win2k/monitor2k_size.html +http://config.tucows.com/win2k/adnload/136674_47327.html +http://www.thisisyork.com/york/news/YORK_NEWS_CAMPAIGNS_POSTOFFICE5.html +http://yp.gates96.com/5/78/0/35.html +http://yp.gates96.com/5/78/0/41.html +http://yp.gates96.com/5/78/0/65.html +http://yp.gates96.com/5/78/0/79.html +http://yp.gates96.com/5/78/0/81.html +http://yp.gates96.com/5/78/1/33.html +http://yp.gates96.com/5/78/1/76.html +http://yp.gates96.com/5/78/2/0.html +http://yp.gates96.com/5/78/2/65.html +http://yp.gates96.com/5/78/3/37.html +http://yp.gates96.com/5/78/4/31.html +http://yp.gates96.com/5/78/4/60.html +http://yp.gates96.com/5/78/4/73.html +http://yp.gates96.com/5/78/5/28.html +http://yp.gates96.com/5/78/5/65.html +http://yp.gates96.com/5/78/6/12.html +http://yp.gates96.com/5/78/6/38.html +http://yp.gates96.com/5/78/6/99.html +http://yp.gates96.com/5/78/7/48.html +http://yp.gates96.com/5/78/8/49.html +http://yp.gates96.com/5/78/8/55.html +http://yp.gates96.com/5/78/8/71.html +http://yp.gates96.com/5/78/9/19.html +http://yp.gates96.com/5/78/9/94.html +http://link.fastpartner.com/do/session/600420/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/fastpartner.php +http://www.highwired.net/Guidance/UniversalNav/Redirect/0,5314,15089-15089-728,00.html +http://ring.tains.tohoku.ac.jp/archives/lang/perl/CPAN/modules/by-module/Math/ILYAZ/os2/?S=A +http://www.outpersonals.com/cgi-bin/w3com/pws/out/DzRIZER-v0LffJEf3raIMcG3_vXLUQncNB0JHLK7Xt_XcNu5W9Xwg3bnK7e0BWrbchX2jMSNnK6eY6UuDPq6GFLMrzB0DcydY5VgMGVRUFbdksWiDCuTI0LBo3psuJxBJjEd +http://www.outpersonals.com/cgi-bin/w3com/pws/out/vihIvBk0g-CdjheZ4MILAcJAB--YtsE3nzjAldQSrSojV9JzVQJV-1yVbCi9rsPamZBGc9GfXE6dq1sCz-CnrfwDCHqr_nfUtl2qUN5oWAHphPSuuQXCc2fjfBv3EI-W4XBgp-ANhxEJS0536665 +http://www.outpersonals.com/cgi-bin/w3com/pws/out/VihIDgZ6TF6W8zfPesIFMiw-CNzcKPLyYr5OXnsaqepOa1j4Wz2V-pVOhRfX5lUkxRpYs_BkTdpvjf7zUAk3RdhEaXDfmzm4RA2CLjQ84zSbEZ_Vil1cFFmY0FFZr5oIErljk11AnTlYM6y066jO +http://www.outpersonals.com/cgi-bin/w3com/pws/out/dRhIQJ3pEIfD5uG_JFeaP3_7Bke37Z5pJi0A-hZ_-kxEK4Z1jl3HNb6d3hgJ7UZ34jMQGSNzhYuMNxB-oyBon62h9GWx3Xt1Zk_o4kS3s9ybikCpzetMwprVGDCC-YzllwvEWxmP66jF +http://www.v2music.com/Scripts/WebObjects-ISAPI.dll/V2_New_Publisher.woa/24161000003783000000741030000081551/v2tvindex.wo/810000000071551/1.0.4/3/Webobjects1 +http://www.maas.ccr.it/cgi-win/hiweb.exe/a17/d3345/b77,c,4d,469,469,46e,46e,168e,168e,,51,,4d,51, +http://findmail.com/messages/themcse/102 +http://netcon.tucows.com/winme/adnload/136907_28427.html +http://netcon.tucows.com/winme/adnload/136906_30076.html +http://www.jyu.fi/~heili/tietoverkot/?S=A +http://www1.onelist.com/dir/1/16/483/32773?st=10 +http://www1.onelist.com/messages/animadores +http://seussville.com/teachers/authors/ayre.html +http://seussville.com/teachers/authors/corm.html +http://www.tente.de/sw/produkte/rubriksuche/aa000001461.htm +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=57&discrim=165,57,164 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=57&discrim=165,57,207 +http://jars.developer.com//classes/jresout.cgi?resource=2897 +http://members.tripod.co.jp/spirits/?S=A +http://homepages.go.com/homepages/i/u/g/iuguy22/ +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=21,5,24 +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=31,5,24 +http://troy.lib.sfu.ca/search/delectrolytes+periodicals/delectrolytes+periodicals/-5,-1,0,B/exact&F=delectrolytes+congresses&1,3 +http://www.rdg.ac.uk/ITS/Topic/Stats/StGSAS8_01/SAS8/af/z0254912.htm +http://www.rdg.ac.uk/ITS/Topic/Stats/StGSAS8_01/SAS8/af/z0254924.htm +http://ring.jec.ad.jp/local/mirror/FreeBSD-current/snapshots/i386/5.0-20000902-CURRENT/compat20/ +http://ring.jec.ad.jp/local/mirror/FreeBSD-current/snapshots/i386/5.0-20000902-CURRENT/dict/ +http://ring.jec.ad.jp/local/mirror/FreeBSD-current/snapshots/i386/5.0-20000902-CURRENT/manpages/ +http://www.xmission.com/~dkenison/cgi/lwgate.cgi/KLR650/archives/v02.n1682/date/article-7.html +http://ring.toyama-ix.net/pub/linux/Vine/Vine-2.0/ppc/?S=A +http://romulus.ehs.uiuc.edu/cgi-bin/lwgate/RADSAFE/archives/radsafe9907/Date/article-80.html +http://www.officeqmart.com/cgi-bin/qmart.front/972959552267/Catalog/3000033 +http://www.checkout.com/member/movies/title/member_reviews_form/1,7722,882122,00.html +http://mindit.netmind.com/proxy/http://www.siennasoft.com/english/order/orders_retail.shtml +http://pelit.saunalahti.fi/.1/tucows/adnload/267_29529.html +http://pelit.saunalahti.fi/.1/tucows/adnload/7574_29534.html +http://zenha.myrice.com/2/23.htm +http://zenha.myrice.com/2/20.htm +http://citeseer.nj.nec.com/cachedpage/62677/1 +http://citeseer.nj.nec.com/check/248055 +http://www.3wbooks.de/BrackRuth/BrackRuth3258053200.htm +http://preview.egroups.com/group/u_exactus +http://preview.egroups.com/group/ticovista +http://www.linux.com/networking/linux/support/va_linux_systems/price/sales/ +http://kulichki-mac.rambler.ru/moshkow/akm/zercalo/kosmix/03.html +http://innopac.lib.tsinghua.edu.cn:2080/search*chi/tStructure+and+bonding+&%2359%3B+70/tstructure+and+bonding+++70/19,-1,0,B/browse +http://www.science.uva.nl/pub/NetBSD/NetBSD-current/pkgsrc/archivers/gcpio/files/ +http://www-d0.fnal.gov/d0dist/dist/releases/pmc04.00.00/calibration_management/?S=A +http://mvweb.de/olympia/nachrichten/sportarten/news/bdt-290900-158-dpa_173282.html +http://www.scifi.com/bboard/browse.cgi/3/1/69/57?pnum=2 +http://www.diogenes.ch/4DACTION/web_rd_aut_prview/a_id=7056459&area=&ID=483365 +http://mirror.cc.utsunomiya-u.ac.jp/mirror/CPAN/authors/id/L/LA/LAXEN/?D=A +http://www.affiliate.hpstore.hp.co.uk/do/session/380856/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.france.hp.com/Main/acheterhp/ +http://library.cuhk.edu.hk/search*chi/aLu,+Li,+1914-/alu+li+1914/-5,-1,0,B/frameset&F=alu+li+chun&1,1 +http://www-usa4.cricket.org/link_to_database/ARCHIVE/2000-01/IND_LOCAL/WOMEN/OTHERS/KLCA-SL/SQUADS/ +http://www.babyheirlooms.com/catalog/htmlos.cat/041141.1.4425650346 +http://193.207.57.3/cgi-win/hiweb.exe/a2/d9/b1305,4,5,,1f,5, +http://www.icopyright.com/1.1664.228033 +http://www.trax.nilex.co.uk/trax.cgi/A1C/B1S/1AR/A2S/A1S/D1L/ +http://www.trax.nilex.co.uk/trax.cgi/A1C/B1S/1AR/A2S/A1S/A2S/ +http://www.ferien-immobilien.de/baden-wuertemberg/calw/Verkauf/Gemeinsam/Inserieren/Private-IB/Gemeinsam/Super-Zins-Konditionen/3d-service/info.htm +http://sunsite.informatik.rwth-aachen.de/LinuxArchives/redhat/releases/guinness/i386/en/dosutils/fips15c/restorrb/ +http://213.36.119.69/do/session/153002/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/connaitre/revue-presse_titres.html +http://pub19.ezboard.com/uvinylangel.showPublicProfile?language=EN +http://boeing_dude.tripod.com/id125_m.htm +http://members.fortunecity.com/greatway1/gallery-pageother-0.htm +http://www.searchtraffic.com/wsignup.php3?owor12 +http://www.staroriental.net/nav/soeg_c/ihf,acv,s0,194,陳慧ç³.html +http://www.jpc-music.com/5864555.htm +http://oaziz.narod.ru/kuhn/uzb/sal_f1.html +http://preview.egroups.com/message/4aromatherapy/1112 +http://www.luecos.de/webguides/reisen/travelpictures/europe +http://www.maas.ccr.it/cgi-win/hiweb.exe/a18/d47/b47,8,be,29,29,,38,,be,38, +http://www.chaos.dk/sexriddle/k/u/u/a/ +http://www.chaos.dk/sexriddle/k/u/u/d/ +http://student.monterey.edu/nr/nielsenadamp/campus/ +http://excite.de/gesundheit/katalog/3727 +http://www.ozemail.com.au/~jcai/page19.html +http://www.ozemail.com.au/~jcai/page24.html +http://www.hantsnet.co.uk/scrmxn/c23173.html +http://www.fogdog.com/cedroID/ssd3040183334784/content/fan/subway_series/ +http://www.fogdog.com/cedroID/ssd3040183334784/boutique/arnette/ +http://www.fogdog.com/cedroID/ssd3040183334784/boutique/hi-tec/ +http://www.fogdog.com/cedroID/ssd3040183334784/boutique/marmot/ +http://ftpsearch.belnet.be/packages/CPAN/modules/by-module/Stat/ENNO/ +http://go1.163.com/_NTES/~yejingsong/03/y18/506.htm +http://sinr.net/book/content/343/26710.html +http://www.ramada.com/ctg/cgi-bin/Ramada/progpack/AAAksrACwAAABtrAAV +http://library.bangor.ac.uk/search/aBoer,+J.+H.+de+(Jan+Hendrik),+1899-/aboer+j+h+de+jan+hendrik+1899/-5,-1,0,B/buttonframe&F=aboer+dirk+jan+den&1,1 +http://library.cuhk.edu.hk/search*chi/a三çœå ‚(åƒä»£ç”°å€,+Tokyo,+Japan)/a%7B213024%7D%7B214d49%7D%7B213840%7D+%7B213458%7D%7B213073%7D%7B214c24%7D%7B213455%7D+tokyo+japan/-5,-1,0,B/browse +http://ibm1.cicrp.jussieu.fr/ibmc/classref/ref/ISetCanvas--Style_DSC.htm +http://amateur-alley.porncity.net/169/ +http://www.teacherformation.org/html/od/facilitators.cfm/task1,about/discussion_id,2/xid,1989/yid,5768630 +http://www.shopworks.com/index.cfm/action/mallcat/mallcatlevel/2/parentmallcat/6/userid/000056F0-2E26-19FE-AF65010C0A0A8CF2 +http://retailer.gocollect.com/do/session/1912760/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/shipping_policy.asp +http://news.novgorod.ru/news/2001/4/1/8/-1 +http://news.novgorod.ru/news/2001/4/3/8/-1 +http://sp201.unige.ch:49213/cxxdoc/classref/ref/ITimingTestStopwatch_DSC.htm +http://netscape.digitalcity.com/boston/localexperts/profile.dci?screenName=PSYWU +http://netscape.digitalcity.com/boston/localexperts/profile.dci?screenName=Mende67 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=17,2,26,33,23 +http://www.multicosm.com/facade/www.isinet.com/isilinks/isilinks.html +http://kutschen.de/Schoner/Info-d/history/history/literature/ +http://troy.lib.sfu.ca/search/dengineering+research+periodicals/dengineering+research+periodicals/-5,-1,0,B/frameset&F=dengineering+research+grants+canada&3,,4 +http://member.nifty.ne.jp/y-shibata/pc/pch2.htm +http://stocks.tradingcharts.com/stocks/charts/iops-bb/m +http://www.kaos.dk/sexriddle/x/j/c/s/z/ +http://www.bioimages.org.uk/HTML/R138925.HTM +http://pub22.ezboard.com/fawolpaintballfrm1.threadControl?topicID=82.topic +http://www.incestpornstories.com/hot-hardcore-fuckingbanging/plus-sizewhale/body-shotstounge/fuckinghardcore/barely-legalbackseat/{gaylink} +http://www.buybuddy.com/sleuth/27/1/1060904/5811/ +http://www.loisirs.ch/gtfmjv/9/nkrlua.html +http://vorg1.subportal.com/sn/Utilities/File_Maintenance_and_Repair_Utilities/6387.html +http://smartnet.tucows.com/winme/adnload/138584_30392.html +http://ftpsearch.belnet.be/mirrors/src.doc.ic.ac.uk/usenet/usenet-by-hierarchy/comp/emacs/?D=A +http://genforum.genealogy.com/cgi-genforum/forums/green.cgi?7578 +http://cio.cisco.com/warp/public/789/33.html +http://www7.freeweb.ne.jp/diary/bru_dog/tk/ +http://www.chinabyte.com/staticpages/software/software_download/GRBA/software_download_23274_GRBA.html +http://www.chinabyte.com/staticpages/software/software_download/GRBA/software_download_9599_GRBA.html +http://www.seekon.com/L/US/IL/Abingdon +http://freethemes.arrakis.es/skins/winamp/adnload/25359.html +http://www.hig.se/(accessed,modified,remove_cookie,smallcaps,sqlquery)/~jackson/roxen/ +http://cn.egroups.com/message/SF-users/218 +http://cn.egroups.com/message/SF-users/235 +http://www.chaos.dk/sexriddle/r/f/y/c/ +http://www.chaos.dk/sexriddle/r/f/y/e/ +http://www.chaos.dk/sexriddle/r/f/y/g/ +http://yp.gates96.com/13/50/10/33.html +http://yp.gates96.com/13/50/10/49.html +http://yp.gates96.com/13/50/10/55.html +http://yp.gates96.com/13/50/10/98.html +http://yp.gates96.com/13/50/11/35.html +http://yp.gates96.com/13/50/11/73.html +http://yp.gates96.com/13/50/11/94.html +http://yp.gates96.com/13/50/12/39.html +http://yp.gates96.com/13/50/13/8.html +http://yp.gates96.com/13/50/13/67.html +http://yp.gates96.com/13/50/14/8.html +http://yp.gates96.com/13/50/14/11.html +http://yp.gates96.com/13/50/14/47.html +http://yp.gates96.com/13/50/16/18.html +http://yp.gates96.com/13/50/16/58.html +http://yp.gates96.com/13/50/17/33.html +http://yp.gates96.com/13/50/18/13.html +http://yp.gates96.com/13/50/18/49.html +http://yp.gates96.com/13/50/18/54.html +http://yp.gates96.com/13/50/19/0.html +http://cn.egroups.com/post/romtrade?act=reply&messageNum=3851 +http://members.fortunecity.com/toleransi/sorbonne.html +http://ring.htcn.ne.jp/pub/lang/perl/CPAN/modules/by-module/PPM/MURRAY/?S=A +http://sunsite.berkeley.edu/PhiloBiblon/BITAGAP/BIB/BIB5648.html +http://sunsite.berkeley.edu/PhiloBiblon/BITAGAP/BIB/BIB7392.html +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus53940/eus53960/eus54753/eus543189/eus550516/ +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus53940/eus53960/eus54753/eus543189/eus550528/ +http://shn.webmd.com/roundtable_printing/774674 +http://www.zi.unizh.ch/software/unix/statmath/sas/sasdoc/lgref/z0205140.htm +http://www.hblb.org.uk/hblbweb.nsf/$Pages/NewsArchive1!OpenDocument&ExpandSection=16,12,3,13,5,6,9 +http://www.uni-duesseldorf.de/ftp/ftp/pf/share/fvwm-2.0.45/?S=A +http://members.tripod.com/~PhyrePhox/mcse/70-088.htm +http://extreme-dm.com/tracking/reports/dj/nph-ref1.cgi?tag=nimrood +http://opac.lib.ntnu.edu.tw/search*chi/++ftlist/bp20040397/-5,-1,0,B/frameset&F=bp20040402&1,1 +http://209.0.220.240/spec/txve.htm +http://209.0.220.240/spec/tyai.htm +http://ftp.up.pt/Linux/Linus/net-source/www/clients/netscape/?M=A +http://ftp.up.pt/Linux/Linus/net-source/www/clients/netscape/?D=A +http://www.jobvillage.com/channel/jobs/health_care/nursing/licensed_practical_nurse/b.9505.g.1766.html +http://www.zope.org/Members/stevea/CoadObjectModels/BackLinks/backlinks +http://www.mairie-montreuil93.fr/ville_pratique/environ/energie/mve/media/?D=A +http://member.shangdu.net/home2/chr/jishang/hongkong/inxg-6.html +http://www.wild-dog.com/activity/touring/idx/page_18_1.html +http://members.tripod.co.jp/susu/?M=A +http://www.dulux.co.uk/UKRETAIL:623356687:DFinity.1QJiP4jMLco +http://www.kordic.re.kr/~trend/Content326/agriculture04.html +http://www.kordic.re.kr/~trend/Content326/agriculture09.html +http://ftp.lip6.fr/pub12/OpenBSD/src/gnu/egcs/config/mh-aix43 +http://ftp.lip6.fr/pub12/OpenBSD/src/gnu/egcs/config/mh-elfalphapic +http://ftp.lip6.fr/pub12/OpenBSD/src/gnu/egcs/config/mt-x86pic +http://www.ecatsbridge.com/BiB/static/sims/bbljuly99/00000101758612773F1.htm +http://pub20.ezboard.com/faustralianslotcarreviewhoracing.showMessage?topicID=2.topic&index=47 +http://ring.omp.ad.jp/archives/NetBSD/packages/pkgsrc/games/exchess/pkg/DESCR +http://homepage.renren.com/sandybay/help.htm +http://no.egroups.com/post/oslosynth?act=reply&messageNum=634 +http://www.brio.de/BRIO.catalog/39fe2f940703266c273fd472aa7806a8/UserTemplate/2 +http://www.50megs.com/prettysenshi/captures/ep3/SMep3.html +http://www.thisislancashire.co.uk/lancashire/archive/1999/11/05/CHORNEWS5VQ.html +http://au.yahoo.com/Regional/U_S__States/California/Metropolitan_Areas/San_Francisco_Bay_Area/Entertainment_and_Arts/Restaurants/Coffee_and_Tea_Houses/ +http://www.niwl.se/WAIS/30002/30002360.htm +http://www.infoscape.com.cn:8178/gb/content/2000-08/16/content_6082.htm +http://link.fastpartner.com/do/session/600419/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/mondosoft.php +http://www.canit.se/(c1,f3,ftp,generellt,irc,mail)/support/ +http://citeseer.nj.nec.com/cidcontext/3787443 +http://www.affiliate.hpstore.hp.co.uk/do/session/380878/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/entry.asp +http://www.usq.edu.au/unit-1997/fullspec/51129s3x.htm +http://worldres.lycos.com/script/gen_mr.asp?hotel_id=6354&n=1518 +http://www.members.aon.at/~kleindlp/neue_seite_4.htm +http://210.169.76.95/html/tai_0043/bat_1180.html +http://oneplace.adbureau.net/accipiter/adclick/site=ONEPLACE/area=INDEX/POSITION=FOOTER/AAMSZ=468x60/ACC_RANDOM=262411779164 +http://www.service911.com/mvu/step/0,2632,6+34+90+23506+13880_4,00.html +http://ftp.lip6.fr/pub11/NetBSD/NetBSD-current/src/usr.sbin/kvm_mkdb/Makefile +http://www.bemi-immobilien.de/Private-IB/Startseite/Startseite/Gemeinsam/versicherungen/unfall/Gemeinsam/immolink/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/versicherungen/gebaeude/anforderungsformular.htm +http://wap.jamba.de/KNet/_KNet-BOC8j1-LFd-13bpy/showInfo-hilfe.de/node.0/cenv0b09a +http://wap.jamba.de/KNet/_KNet-BOC8j1-LFd-13bq0/browse.de/node.0/cde7f1uou +http://cnnews.sina.com/kwongzhou/china/2000/1026/2083022_2.html +http://www.msb.malmo.se/search*swe/dFlygplanskonstruktion/dflygplanskonstruktion/-5,-1,0,B/frameset&F=dflygolyckor&4,,6 +http://home.hanmir.com/~100sun/joo4.htm +http://www.szed.com/szsb/19990629/GB/default.htm +http://www.szed.com/szsb/19990629/GB/4-NPCLASS.HTM +http://www.szed.com/szsb/19990629/GB/7-NPCLASS.HTM +http://www2.kbank.no/Web/nlpublish.nsf/Published/ord_og_uttrykk!OpenDocument&ExpandSection=15,24,26,25 +http://movies.exit.de/lichtsammler/images/tunnel/gross/sw_kb/?D=A +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=5,34,38 +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=21,34,38 +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=31,34,38 +http://fi.egroups.com/login.cgi?login_target=%2Fmessage%2Fgamp%2F1734 +http://de.excite.de/katalog/katalog/9231 +http://www-win.rusf.ru/esli/rubr/books/es0500di.htm +http://www.jamba.de/KNet/_KNet-yjF8j1-8Gd-13cj6/browse.de/node.0/cde7f1uou +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/misc/lit/programs/misc/math/lit/athalie.html +http://ftp.fi.debian.org/debian/dists/Debian2.2r0/contrib/binary-powerpc/interpreters/?S=A +http://jupiter.u-3mrs.fr/~msc41www/releves/04350110.HTM +http://ocean.ntou.edu.tw/search*chi/dDigital+modulation/ddigital+modulation/7,-1,0,E/frameset&F=ddigital+techniques+signal+processing&4,,0 +http://pub20.ezboard.com/fcharmingtailsresourcetradeyoursportscardshere.unsubscribeUnregisteredToTopic?topicID=43.topic +http://www.kaos.dk/sexriddle/x/w/k/u/q/ +http://www.kaos.dk/sexriddle/x/w/k/u/t/ +http://216.205.158.3/smm/programs/CDG_Player/wwwboard/messages/27.html +http://216.205.158.3/smm/programs/CDG_Player/wwwboard/messages/60.html +http://fen.com/whatworks/review/edit/1,2560,1-9696-5539-0-45394,00.html +http://yp.gates96.com/8/74/30/30.html +http://yp.gates96.com/8/74/31/1.html +http://yp.gates96.com/8/74/32/12.html +http://yp.gates96.com/8/74/32/60.html +http://yp.gates96.com/8/74/32/92.html +http://yp.gates96.com/8/74/33/41.html +http://yp.gates96.com/8/74/33/55.html +http://yp.gates96.com/8/74/33/57.html +http://yp.gates96.com/8/74/33/95.html +http://yp.gates96.com/8/74/34/21.html +http://yp.gates96.com/8/74/34/23.html +http://yp.gates96.com/8/74/34/79.html +http://yp.gates96.com/8/74/35/3.html +http://yp.gates96.com/8/74/35/22.html +http://yp.gates96.com/8/74/35/79.html +http://yp.gates96.com/8/74/36/31.html +http://yp.gates96.com/8/74/36/84.html +http://yp.gates96.com/8/74/37/58.html +http://yp.gates96.com/8/74/37/77.html +http://yp.gates96.com/8/74/37/89.html +http://yp.gates96.com/8/74/37/97.html +http://yp.gates96.com/8/74/39/43.html +http://yp.gates96.com/8/74/39/63.html +http://yp.gates96.com/8/74/39/88.html +http://www9.hmv.co.uk:5555/do/session/1347828/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/newmenu.html +http://www9.hmv.co.uk:5555/do/session/1347828/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/departments/d80_sd0_pt0.html +http://gladstone.uoregon.edu/~sme28057/arch181-202/assign2/?M=A +http://cco.cisco.com/univercd/cc/td/doc/product/core/7206/7206ig/trble6ug.pdf +http://210.32.1.18/goldbook/humor/mh/c/changgu/1/028.htm +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=17,28,24,31,11 +http://www.spiral.at/Katalog/Artikel/7561032/ +http://www.crutchfield.com/cgi-bin/S-Ql7dbZlSZa2/viewcart.asp +http://www.fogdog.com/cedroID/ssd3040183327788/nav/products/winter_sports/1b/shell_pants/ +http://www.fogdog.com/cedroID/ssd3040183327788/nav/products/winter_sports/1j/oakley/ +http://www.fogdog.com/cedroID/ssd3040183327788/nav/products/winter_sports/1l/day_packs/ +http://www.thestateofcolorado.com/pglblock.html +http://www.staroriental.net/nav/soeg/ihf,adj,s0,259,Kristy+Yeung+Gung-Yu.html +http://pcmcia.sourceforge.org/cgi-bin/HyperNews/get/pcmcia/toshiba/38.html +http://sunsite.org.uk/public/public/packages/Dr-Fun/df9412/?N=D +http://nt.mortgage101.com/partner-scripts/1144.asp?p=mig&pw=600 +http://biblioteca.upv.es/bib/doc/doc_fisbd/17/87050//C/1828104/3////25/N/MLTPAI +http://130.80.29.3/content/houston/k-12/hanc/ +http://javatest.a-net.nl/exhibits/default.htm +http://javatest.a-net.nl/museum_info/job_opportunities.asp +http://books.hyperlink.co.uk/booklist/Alphabet_Workbook/Cheney/Martha/1565658396 +http://kobe.cool.ne.jp/orera/guestbook.html +http://ftp.eecs.umich.edu/pub/NetBSD/packages/1.4.1/vax/audio/ +http://ftp.eecs.umich.edu/pub/NetBSD/packages/1.4.1/vax/editors/ +http://ftp.eecs.umich.edu/pub/NetBSD/packages/1.4.1/vax/tk80/ +http://www.zdnet.de//news/artikel/1999/03/09001-wc.html +http://neptune.guestworld.com/gear/gateway.cfm?action=private&owner=sitonga7 +http://www.de.lycos.de/dir/Reisen_und_Regionen/L%E4nder_und_St%E4dte/Deutschland/Schleswig-Holstein/St%E4dte_und_Orte/St%E4dte_und_Orte_P_bis_S/ +http://www.mirror.edu.cn/res/sunsite/pub/academic/music/album-reviews/1995/9-September/?M=A +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=213&discrim=176,11,57 +http://europa.eu.int/abc/doc/off/bull/el/9705/x085.htm +http://europa.eu.int/abc/doc/off/bull/el/9705/x209.htm +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=15,0+17,0-3,0-9,0 +http://www.ferien-immobilien.de/baden-wuertemberg/stuttgart/Verkauf/Gemeinsam/MarketingStrategie/Ferien-IB/Startseite/Gemeinsam/Super-Zins-Konditionen/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/indexbeginn.htm +http://www.ferien-immobilien.de/baden-wuertemberg/stuttgart/Verkauf/Gemeinsam/MarketingStrategie/Ferien-IB/Startseite/Gemeinsam/Super-Zins-Konditionen/Gemeinsam/impressum.htm +http://www.chaos.dk/sexriddle/s/e/x/v/i/a/w/ +http://pub4.ezboard.com/fscarletstreethorroritalianstyle.showAddReplyScreenFromWeb?topicID=15.topic +http://ftp.dti.ad.jp/pub/lang/CPAN/authors/id/P/PJ/PJF/ +http://www.highwired.net/Paper/EmailToFriend/1,2102,302-183023,00.html +http://ftpsearch.belnet.be/mirror3/ftp.kde.org/pub/kde/Incoming/Attic/old/1.1.2/apps/ide/?D=A +http://www.affiliate.hpstore.hp.co.uk/do/session/380877/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-creativeworld.com/creativeworld.asp?lang=f +http://expert.cc.purdue.edu/~steinfoc/assignment3/assig3.html +http://www.wyborcza.com/Ascii/Raporty/Filmowa/277rap.html +http://www.redhat.com/mirrors/LDP/LDP/LG/issue50/misc/pollman/?D=A +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=148&discrim=142,11,200 +http://www.marktplatz-hs.de/cgi-bin/ChioEditionShop.s/39fe2ee602379b7e273fd47540f806e1/Catalog +http://www.affiliate.hpstore.hp.co.uk/do/session/380836/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/SMARTTIPS/createbroch.asp +http://joy1.alpha-g.ne.jp/tree/user/a/amuro/2_index.shtml +http://time.188.net/movie/star/taiwan/2/pic/image36.htm +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=25,1,36,31,11 +http://bsd.sinica.edu.tw/cgi-bin/cvsweb.cgi/ports/audio/kdemultimedia11-i18n/Attic/pkg-comment?only_with_tag=RELEASE_2_2_7 +http://www.landfield.com/ftp/usenet/news.answers/bicycles-faq/?S=A +http://wap.jamba.de/KNet/_KNet-puF8j1-aGd-13clg/browse.de/node.0/cenv0b09a +http://www.empas.com/search/all.html?q=%C0%CC%B7%D3%B4%D9 +http://www.linux.com/networking/server/install/howto/website/developers/ +http://aecjobbank.com/texis/script/newjobs/+NwxBm6ev7I1wwwhmrmwxetiAw/jobdirectory.html +http://www.egroups.com/message/ijtihadmk/5 +http://www.egroups.com/message/ijtihadmk/11 +http://www.realize.com/am67bd81.htm,qt=e784fe2f=2a38a234-7-da6e2d-0-0-0-3-- +http://www.realize.com/p643c81.htm,qt=e784fe2f=2a38a234-7-da6e80-0-0-0-3-- +http://moneysaver.net/netcall/?almktng +http://www.agria.hu/bikersmeeting/archivum/talalkozo/foto/taj.cgi?15n +http://link.fastpartner.com/do/session/600401/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/company/ +http://198.103.152.100/search*frc/aDidsbury,+Howard+F.,+1924-/adidsbury+howard+f+1924/-5,-1,0,B/frameset&F=adidier+marcel&1,,0 +http://198.103.152.100/search*frc/aDidsbury,+Howard+F.,+1924-/adidsbury+howard+f+1924/-5,-1,0,B/frameset&F=adidier+michel&1,,0 +http://www.medoc-ias.u-psud.fr:81/synoptic/gif/001020/?D=A +http://shop.goto.com/compperiph/periph/cdrom/search/sidexside.jhtml?s=1&sort_up=LOW_PRICE +http://excite.de/wirtschaft/katalog/1356 +http://excite.de/wirtschaft/katalog/2631 +http://www.areteoutdoors.com/channel/earth/caving/b.89.g.473.html +http://www.areteoutdoors.com/channel/earth/caving/b.91.g.473.html +http://bo.ole.com/actualidad/articulo/html/act13873.htm +http://www.dulux.co.uk/UKRETAIL:446033260:DFinity.1QJiP4jMomdoclfieh +http://www.linux.com/networking/network/release/sap/hardware/firewall/ +http://genforum.genealogy.com/cgi-genforum/forums/hendrix.cgi?430 +http://www.chaos.dk/sexriddle/s/p/w/c/ +http://198.103.152.100/search*frc/tCanada+in+the+21st+century.+II,+Resources+and+technology/tcanada+in+the+21st+century+ii+resources+and+technology/-5,-1,0,B/frameset&F=tcanada+in+the+21st+century+no+01&1,1 +http://books.hyperlink.co.uk/bookinfo/Sunk_Costs_and_Market_Structure/Sutton/John/0262193051 +http://members.tripod.com/theshavedbeaver/site2/s2laststand.html +http://members.tripod.com/theshavedbeaver/site2/s2s1ep21.html +http://www.ytmag.com/cgi-bin/redirect.cgi/602479760 +http://www18.freeweb.ne.jp/school/syodou/you005.htm +http://www.fogdog.com/cedroID/ssd3040183334500/nav/products/featured_brands/2h/replica_jerseys/ +http://www.fogdog.com/cedroID/ssd3040183334500/nav/products/featured_brands/2h/replica_jerseys/4.html +http://www.fogdog.com/cedroID/ssd3040183334500/crs/nvCZ/wld/fogdog_sports/champion/fan_memorabilia/apparel/vlade_divac_replica_jersey.html +http://www.jobvillage.com/channel/jobs/travel/travel_guide/b.4897.g.5299.html +http://www.bcbsal.org/Provider_Dir/pharmacy/state/Oregon/HILLSBORO/index_29061.html +http://www.maas.ccr.it/cgi-win/hiweb.exe/a17/d2066/b77,c,4d,469,469,1b65,1b65,,51,811,4d,51,811,, +http://www.loisirs.ch/bbewxu/2/wofyff.html +http://mitglied.tripod.de/Jag3/jag3b.htm +http://linuxberg.starhub.net.sg/x11html/preview/9016.html +http://linuxberg.starhub.net.sg/x11html/preview/9062.html +http://linuxberg.starhub.net.sg/x11html/preview/9103.html +http://linuxberg.starhub.net.sg/x11html/preview/9820.html +http://linuxberg.starhub.net.sg/x11html/preview/10370.html +http://linuxberg.starhub.net.sg/x11html/preview/9965.html +http://linuxberg.starhub.net.sg/x11html/preview/10117.html +http://linuxberg.starhub.net.sg/x11html/preview/10129.html +http://linuxberg.starhub.net.sg/x11html/preview/10152.html +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=150&discrim=251,11,3 +http://totalsports.aol.com/stats/bbo/int/20000624/tol.at.swb.game.html +http://excite.de/gesundheit/katalog/41575 +http://bbs.csie.ntu.edu.tw/txt/Emprisenovel/ebooks/other/hsiao_yi/jqhy/007.txt +http://www.memorialcup99.com/HockeyStLouisArchive/nov17_stl.html +http://www.letsmusic.com/directory/theme/genre_each/1,1137,Z-ã„´-124-2-2,00.asp +http://rainforest.parentsplace.com/dialog/get/bedwetting/29/2.html?outline=-1 +http://www.volny.cz/j_medkova/p05.html +http://www.maas.ccr.it/cgi-win/hiweb.exe/a17/d2072/b77,c,4d,51,51,815,815,818,7d9,,51,7d9,818,, +http://collection.nlc-bnc.ca/100/200/301/ccmd-ccg/ccmd_report-e/rpt1e.pdf +http://cn.egroups.com/post/export-import-indonesia?act=forward&messageNum=595 +http://www.secinfo.com/$/SEC/Filing.asp?T=1zBgb.6t_9yc +http://www.realize.com/am81.htm,qt=4619dc8c=279e650e-c-16fba7d-1-0-0-0-- +http://amadeus.siba.fi/doc/php3-ldap/html/features.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.ada-fetchrow.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.array-pop.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.current.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.ftp-size.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.getmyinode.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.gmdate.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.hw-getusername.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.icap-list-alarms.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.ifx-free-char.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.imap-reopen.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.is-link.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.is-string.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.mcal-event-set-recur-monthly-wday.html +http://amadeus.siba.fi/doc/php3-ldap/html/function.mhash-get-block-size.html +http://wwws.br-online.de/geld/boerse/980420/110001.html +http://family.go.com/Categories/reviews/Features/family_2000_01/dony/dony0100craftapple/ +http://family.go.com/Categories/reviews/Features/family_2000_01/dony/dony0100craftcactus/ +http://family.go.com/Categories/reviews/Features/family_2000_01/dony/dony0100petvetticks/ +http://www.maastrek.de/maas/d49da6854db9e797f212/1/0/1 +http://astro1.chungnam.ac.kr/NetBBS/Bbs.dll/astromov/lst/qqadm/1/zka/B2-kB2Bl/qqo/004D +http://channel.cnnsi.com/basketball/college/2000/ncaa_tourney/west/news/2000/03/25/keady_ap/lg_keady_ap.html +http://incmagazine.com/articles/details/0,3532,AGD5_ART13806_CNT56_GDE30,00.html +http://incmagazine.com/research/details/0,3470,AGD5_CNT49_GDE30_RSC16754,00.html +http://gatekeeper.dec.com/pub/linux/lorax/i386/misc/src/anaconda/balkan/CVS/ +http://adex3.flycast.com/server/socket/127.0.0.1:2800/click/OnlineCitiesSM/OnlineCitiesInteractiveCityGuides/bd720350329 +http://www.proviser.co.uk/regional/towns/alford/street_maps/alpha_b.html +http://www.fogdog.com/cedroID/ssd3040183255203/ +http://www.columbia.edu/~wl158/OCD.htm +http://www.irishnews.com/Archive2000/29052000/international.html +http://www.irishnews.com/Archive2000/29052000/sportinter.html +http://38scbshop.freeyellow.com/download.html +http://news.dinf.ne.jp/news/fj/rec/animation/msg01441.html +http://datastore.tucows.com/winnt/adnload/5372_28388.html +http://pages.infinit.net/limal/visage/chap17.htm +http://www.hotelboulevard.com/fr/paris/standard/htmlc258073cfbe254c1722c86e0aec5f5da/sessionLang/ANG/search.html +http://www.icopyright.com/1.1642.213678 +http://wiem.onet.pl/wiem/012aa2.html +http://www.secinfo.com/dRRsz.9e.htm +http://lily.nju.edu.cn/literature/cangshu/wx/wra/ysz/16.htm +http://home.swipnet.se/~w-15978/ +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www.stanford.edu/dept/EIS/moral_responsibility.htm +http://smb.slac.stanford.edu/cgi-bin/nph-proxy.cgi/000/http/www.stanford.edu/dept/EIS/hardin_review.htm +http://www.uni-duesseldorf.de/ftp/pf/share/flex-2.5.2/man/man1/?S=A +http://mindit.netmind.com/proxy/http://www.ninds.nih.gov/health_and_medical/pubs/chronic_pain_htr.htm +http://mindit.netmind.com/proxy/http://www.smalltime.com/notvictims/cutting.html +http://www.peopledaily.co.jp/zdxw/7/19991231/19991231001085.html +http://pokemonothin.8m.com/cgi-bin/c/736/64/dXNlcmJhbm5lcg==/gn/4638/ +http://www.chaos.dk/sexriddle/s/e/x/u/y/n/d/ +http://www.bestinfo.net.cn/bsti_kjhy/kyys/bjkyys/arim/technical.html +http://www.leicos.de/webguides/fun_lifestyle/unterhaltung/43101.html +http://209.207.239.212/bkindex/c1047/f1423.html +http://cylis.lib.cycu.edu.tw/search*chi/tEncyclopaedia+of+mathematical+sciences+&%2359%3B+v.+65/tencyclopaedia+of+mathematical+sciences+v+++65/-17,-1,0,B/frameset&F=tencyclopaedia+of+mathematical+sciences+v+++48&1,1 +http://www.sanxia.net/beauty/Nanako/313.htm +http://www.sanxia.net/beauty/Nanako/323.htm +http://mirrortucows.technet.it/winme/adnload/138469_29790.html +http://www.fogdog.com/cedroID/ssd3040183321970/nav/stores/walking/ +http://www.fogdog.com/cedroID/ssd3040183321970/customer_service/employment.html +http://mirror.pku.edu.cn/www.berkeley.edu/ls.berkeley.edu/lscr/services/backups/UCBackup.html +http://retailer.gocollect.com/do/session/1912804/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/postcards/index.asp +http://www.uni-duesseldorf.de/ftp/pf/share/ddd-1.4d/man/man1/?M=A +http://www.uni-duesseldorf.de/ftp/pf/share/ddd-1.4d/man/man1/?S=A +http://javatest.a-net.nl/servlet/pedit.Main/http://www.zdnet.com/special/stories/wireless/0,10676,2557092-8,00.html +http://ftp.sunet.se/pub/os/FreeBSD/development/FreeBSD-CVS/ports/archivers/makeself/ +http://www.jamba.nl/KNet/_KNet-QYL8j1-2D4-pw4k/browse.nl/node.0/cde7f1uou +http://www.discoveromaha.com/shared/health/adam/ency/imagepage/1090.000233.html +http://home.dqt.com.cn/cgi-bin/push/setluntan?luntan=64 +http://sjsulib1.sjsu.edu:81/search/dbusiness+periodicals/-5,-1,1,B/frameset&dbusiness+vocational+guidance&2,,3 +http://www-d0.fnal.gov/d0dist/dist/releases/psim01.01.00/cft_tuple/VERSION +http://pub3.ezboard.com/fmcdonaldscollectorsclubauctions.subscribeUnregisteredToTopic?topicID=136.topic +http://shopping.lycos.co.kr/cgi-bin/LCWB.cgi/957424027/957522583/Catalog/1301/001 +http://www.cs.kuleuven.ac.be/~java/docs/jdk1.3/docs/api/java/sql/class-use/DriverPropertyInfo.html +http://www.buybuddy.com/sleuth/27/1/1060701/505427/ +http://web4.sportsline.com/u/football/nfl/players/splits/4451_split.htm +http://mirror.cc.utsunomiya-u.ac.jp/mirror/FreeBSD/ports/alpha/packages-5-current/japanese/?M=A +http://no.egroups.com/login.cgi?login_target=%2Fgroup%2Ftkd-full +http://www.bemi-immobilien.de/Ferien-IB/Startseite/Gemeinsam/MarketingStrategie/Gemeinsam/immolink/Gemeinsam/3d-service/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/MarketingStrategie/Strategie.htm +http://www.bemi-immobilien.de/Ferien-IB/Startseite/Gemeinsam/MarketingStrategie/Gemeinsam/immolink/Gemeinsam/3d-service/Startseite/www.ferien-immobilien.de/ferien-ib/startseite/Gemeinsam/versicherungen/gebaeude/deckungsumfang.htm +http://www.3wposter.com/czaja/czj2002.htm +http://pub19.ezboard.com/fallamericanbaseballleagueplayersneeded.showMessage?topicID=6.topic +http://ftp.uni-mannheim.de/info/OReilly/nutshell/practcpp/disk/doit/?N=D +http://www02.geocities.co.jp/HeartLand-Kaede/4970/index2.htm +http://www.selbstmachen.de/shops/pop/infotext/8008.htm +http://dennou-t.ms.u-tokyo.ac.jp/arch/cc-env/Linux/debian-jp/dists/unstable/contrib-jp/binary-alpha/doc/?D=A +http://genforum.genealogy.com/cgi-genforum/forums/flynn.cgi?1004 +http://www.iwon.com/home/movies/movies_filmography_page/0,13178,Marguerite+Hickey,00.html +http://cometweb01.comet.co.uk/do!tid=20&rtid=2&vsid=700&session=132028&mid=1000&rid=1060&cid=37030&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG5ubLZDXLZolLl3l5jbqLlci5XqVLkXsLkao4tloHbmlLoq5 +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus65300/eus65303/eus77824/eus541028/eus168664/ +http://user.chollian.net/~iipuni/pds1/?M=A +http://tucows.ciaoweb.it/winnt/adnload/73935_29937.html +http://home2.keyciti.com/x2001/ +http://www.amateurplatinum.com/teenagerclique/fagbodyshots/elbow-greaseac/plus-sizemen/butt-fuckpartner/actionextreme/hitting-itendurance.html +http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.3-4/linux/Documentation/filesystems/vfs.txt?only_with_tag=LINUX-2_3_99_pre4 +http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.3-4/linux/Documentation/filesystems/vfs.txt?only_with_tag=LINUX-2_3_17 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=3,0+18,0-0,0-3,0 +http://www.skaninforma.no/nord-troendelag/leksvik-h.htm +http://194.128.65.4/pa/cm199798/cmwib/wb971115/nil.htm +http://www.on.fuchu.or.jp/~oimatudo/englishmisomanzyu.htm +http://map.ipc.co.jp/asp/onmap/connect/g-2/a-719/ +http://cherokee1.edgate.com/goucheres/ed_current.html +http://www.online.kokusai.co.jp/Service/V0043594/wrd/G200/service/service.html +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=21,16,7 +http://binary.tucows.com/winnt/adnload/70807_30160.html +http://binary.tucows.com/winnt/adnload/1422_28846.html +http://genforum.genealogy.com/cgi-genforum/forums/theroux.cgi?69 +http://rex.skyline.net/navigate.cgi?news,ice,women,resources,living +http://umweb2.unitedmedia.com/creators/rugrats/archive/rugrats-20001015.html +http://retailer.gocollect.com/do/session/1912824/vsid/2089/tid/2089/cid/621609/mid/1540/rid/1520/chid/2083/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLlmo5larLZqVLafpLmiXLvlmHolaLrZqLpl4/url/http://www.gocollect.com/product_display/products/product_lines.asp +http://retailer.gocollect.com/do/session/1912824/vsid/2089/tid/2089/cid/621609/mid/1540/rid/1520/chid/2083/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLlmo5larLZqVLafpLmiXLvlmHolaLrZqLpl4/url/http://www.gocollect.com/clubhouse/suggestions.asp +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=146&discrim=146,7,19 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=146&discrim=146,7,231 +http://login.hq.cricinfo.org/link_to_database/ARCHIVE/1996-97/OD_TOURNEYS/SINWS/SINWS-MATCHES/SL_ZIM_SINWS_ODI5_03SEP1996_DAILY_MR.html +http://preview.egroups.com/group/God_Calling +http://www.fogdog.com/cedroID/ssd3040183340945/nav/products/outlet/1b/sunglasses_optics/ +http://www.fogdog.com/cedroID/ssd3040183340945/nav/products/outlet/1c/dc/ +http://www.fogdog.com/cedroID/ssd3040183340945/customer_service/contact_us.html +http://link.fastpartner.com/do/session/600424/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/itjobbank.php +http://link.fastpartner.com/do/session/600424/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/index.php +http://pub2.ezboard.com/fteamnexgenforumhelpnexgennexencodestudio.unsubscribeUnregisteredToTopic?topicID=29.topic +http://www02.geocities.co.jp/SiliconValley-PaloAlto/1763/event/ni2k/ni2k.htm +http://yp.gates96.com/7/89/60/35.html +http://yp.gates96.com/7/89/61/4.html +http://yp.gates96.com/7/89/61/38.html +http://yp.gates96.com/7/89/62/80.html +http://yp.gates96.com/7/89/63/8.html +http://yp.gates96.com/7/89/63/16.html +http://yp.gates96.com/7/89/65/10.html +http://yp.gates96.com/7/89/65/42.html +http://yp.gates96.com/7/89/65/54.html +http://yp.gates96.com/7/89/65/88.html +http://yp.gates96.com/7/89/65/98.html +http://yp.gates96.com/7/89/66/26.html +http://yp.gates96.com/7/89/66/55.html +http://yp.gates96.com/7/89/67/28.html +http://yp.gates96.com/7/89/68/67.html +http://yp.gates96.com/7/89/69/63.html +http://yp.gates96.com/7/89/69/73.html +http://www.mediko.de/news/alt.support.eating-disord/19944.html +http://www.mediko.de/news/alt.support.eating-disord/19975.html +http://www13.cplaza.ne.jp/musicnavi/i-mode/id/KICS113.html +http://home.beseen.com/community/alienpilot/AbductionTheory.html +http://www.hausbau-finder.de/festpreis/anbieter/A11/A11_05_eg.htm +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=237&discrim=10,15,200 +http://ftp.eecs.umich.edu/pub/NetBSD/packages/1.3.3/mac68k/kde/ +http://www.leg.wa.gov/pub/rcw%20-%20text/title_49/chapter_028/rcw_49_28_065.txt +http://fi.egroups.com/login.cgi?login_target=%2Fmessages%2Fdfbl%2F77 +http://ring.omp.ad.jp/pub/NetBSD/NetBSD-current/src/sys/arch/sgimips/dev/?D=A +http://retailer.gocollect.com/do/session/1912781/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/postcards/index.asp +http://providenet.tucows.com/win2k/adnload/136128_47180.html +http://providenet.tucows.com/win2k/adnload/38527_29571.html +http://no.egroups.com/dir/1/16/476/32069/32291/104313/293356 +http://www.playease.com/et/beauty/img/lingmuyamei/lmam043.htm +http://202.99.23.201/gb/special/node_484.htm +http://202.99.23.201/gb/special/node_518.htm +http://202.99.23.201/gb/special/node_531.htm +http://ring.jec.ad.jp/archives/NetBSD/NetBSD-current/pkgsrc/fonts/acroread-chsfont/README.html +http://www.gaiax.com/~dengeki/lineb.html?haru_da_pump +http://cafe2.daum.net/Cafe-bin/Bbs.cgi/naturalproductspds/qry/zka/B2-kB27p/qqatt/^ +http://cafe2.daum.net/Cafe-bin/Bbs.cgi/naturalproductspds/qry/zka/B2-kB23t/qqatt/^ +http://cafe2.daum.net/Cafe-bin/Bbs.cgi/naturalproductspds/qry/zka/B2-kB23r/qqatt/^ +http://my.egroups.com/group/uk-mac-dev +http://www.f20.parsimony.net/forum35990/archiv.htm +http://findmail.com/group/Costumers +http://variety.studiostore.com/browse/PEOPLE/b.FAVORITES%20PEOPLE/s.ZaC1r6Q6 +http://www.chinawolf.com/~warson/japan/chichuan/cat/jiangzuo/020.htm +http://www.branchen-vermittler.de/Branchen/Mecklenburg/Mecklenburg_Region_3/Neustrelitz/kopf_neustrelitz.html +http://www.xmission.com/(art,ftp,geek,music,music,caffiene,art,toys,dots,edge,misc,shopping,ftp,places,privacy,geek,cuseeme,apocalypse,people,stuffiuse,places,privacy,stuffiuse)/~bill/links.html +http://www.cs.helsinki.fi/linux/linux-kernel/Year-1999/1999-49/1283.html +http://www.ecotec.co.jp/view/arc/f/free/33/umcotk/zxlqox.html +http://www.ecotec.co.jp/view/arc/f/free/33/tgiotk/uftfwm.html +http://www.ecotec.co.jp/view/arc/f/free/33/purotk/qxxotk.html +http://www.ecotec.co.jp/view/arc/f/free/33/purotk/sewotk.html +http://www.ecotec.co.jp/view/arc/f/free/33/purotk/sjkfwm.html +http://www.ecotec.co.jp/view/arc/f/free/33/hazfwm/llhetk.html +http://www.ecotec.co.jp/view/arc/f/free/33/bvtctk/eptrik.html +http://www.ecotec.co.jp/view/arc/f/free/33/rvkptk/syurzz.html +http://library.cuhk.edu.hk/search*chi/a��頦��哨蕭嚙賢��鞈�嚙è¸ï¿½ï¿½ï¿½+1934-/a{214b33}{213021}{214451}+1934/-5,-1,0,B/frameset&F=a{214b33}{213021}{213c63}&6,,7 +http://mitglied.tripod.de/~haubentaucher/bilder.htm +http://amc.hollywood.com/maltin/v/valleyofthekings-1954.htm +http://amc.hollywood.com/maltin/v/vannuysblvd-1979.htm +http://amc.hollywood.com/maltin/v/venicevenice-1992.htm +http://amc.hollywood.com/maltin/v/vicesquad-1931.htm +http://amc.hollywood.com/maltin/v/violette-1978.htm +http://amc.hollywood.com/maltin/v/voiceofthewhistler-1945.htm +http://amc.hollywood.com/maltin/v/vulturethe-1967.htm +http://members.tripod.co.jp/hatahata/hikoki/?D=A +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/SaveCounter/2000-10-23/07/972255822718.txt +http://www.mapion.co.jp/custom/AOL/admi/23/23105/matsubaracho/5chome/index-43.html +http://search.chollian.net/cgi-bin/filter.cgi?cid=1109&g=11 +http://search.chollian.net/cgi-bin/filter.cgi?cid=1109&p=5 +http://www.linux.com/networking/network/new/website/applications/business/ +http://www.fogdog.com/cedroID/ssd3040183313598/nav/products/w_golf/1s/ball_retrievers/ +http://www.fogdog.com/cedroID/ssd3040183313598/nav/products/w_golf/1t/biographical_books/ +http://rammstein.sonicnet.com/artists/news/1090.jhtml +http://rammstein.sonicnet.com/allmusic/ai_bio.jhtml?ai_id=1090 +http://www.ycwb.com.cn/gb/2000/08/18/ycwb/gnxw/7.html +http://www.vorlesungen.uni-osnabrueck.de/informatik/c98/code/19/?D=A +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/SaveCounter/2000-10-23/11/972270515716.txt +http://www.affiliate.hpstore.hp.co.uk/do/session/380869/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/entry1.asp +http://uk.biz.yahoo.com/mutual_funds/micropal/lf/fund/008776/properf.html +http://troy.lib.sfu.ca/search/aasociacion+argentina+de+ciencias+naturales/aasociacion+argentina+de+ciencias+naturales/-5,-1,0,E/frameset&F=aasociacion+argentina+de+ciencias+naturales&1,,0 +http://uk.dir.yahoo.com/Regional/U_S__States/Virginia/Metropolitan_Areas/Charlottesville_Metro/Travel_and_Transportation/Accommodation/Caravan_Parks_and_Camp_Sites/ +http://uk.dir.yahoo.com/Regional/U_S__States/Virginia/Metropolitan_Areas/Charlottesville_Metro/Travel_and_Transportation/Accommodation/Hotels/ +http://library.cwu.edu/search/cQA76.73.A35+T75/cqa+++76.73+a35+t75/-5,-1,0,B/marc&F=cqa+++76.73+a8+j33+1985&1,1, +http://www.tages-anzeiger.ch/sport/nagano/0902/olymp_art4.htm +http://finance.sina.com.cn/globe/globe/2000-03-16/23725.html +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=9,3-9,0+0,1-0,3 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=9,3-9,0+0,1-9,3 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=9,3-9,0+0,1-19,0 +http://temps-libre.promovacances.net/D02/BH/BDANE/voyagealacarte.htm +http://sunsite.org.uk/public/computing/networks/internet/ietf/98aug/imapext-attendees-98aug.txt +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=124&discrim=221,178 +http://cpan.nettuno.it/authors/Ilya_Zakharevich/modules/FreezeThaw-0.41.readme +http://cpan.nettuno.it/authors/Ilya_Zakharevich/modules/Math-Pari-2.001700.readme +http://ricoh.co.jp/SHOGI/emate/tanigawa/tume0069a.html +http://troy.lib.sfu.ca/search/dlatin+america+periodicals/dlatin+america+periodicals/-5,-1,0,B/marc&F=dlatin+america+pest+control+industry&1,1, +http://moviestore.zap2it.com/browse/MOVIES/COLLECTI/s.w2bwHPkr +http://moviestore.zap2it.com/browse/MOVIES/BUNDLE/s.w2bwHPkr +http://moviestore.zap2it.com/browse/MOVIES/BOWL/s.w2bwHPkr +http://moviestore.zap2it.com/browse/MOVIES/JEWELRY/s.w2bwHPkr +http://moviestore.zap2it.com/browse/MOVIES/COMIC/s.w2bwHPkr +http://www9.hmv.co.uk:5555/do/session/1347801/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/Top_Navigation_Bar/top_banner.html +http://www3.adobe.com/type/browser/F/P_103/F_FRAK-70005000.html +http://ftp.netc.pt/pub/idgames/levels/doom2/deathmatch/j-l/kewl.txt +http://ftp.netc.pt/pub/idgames/levels/doom2/deathmatch/j-l/ledges-z.txt +http://park.org:8888/Japan/CSK/hyakki/zukan/turezure/ue/c_tirizuka.html +http://pub4.ezboard.com/fscarletstreetfilmmusic.unsubscribeUnregisteredToTopic?topicID=54.topic +http://tucows.niagara.com/win2k/adnload/37364_29149.html +http://wap.jamba.de/KNet/_KNet-JGG8j1-eGd-13cre/showInfo-special1.de/node.0/cde7f1uou +http://www.personalmd.com/news/n0706062122.shtml +http://ds.dial.pipex.com/tmc/ConfPresentations/s2000/NetworkingJ/msconfig.htm +http://calcul.si.uji.es/Programes/SAS/proc/z0325264.htm +http://www.kaos.dk/sexriddle/x/m/k/i/i/ +http://ring.toyama-ix.net/archives/lang/perl/CPAN/clpa/1998-08/?N=D +http://ring.toyama-ix.net/archives/lang/perl/CPAN/clpa/1998-08/?S=A +http://www.spiral.at/Katalog/Artikel/0879070/ +http://homepage1.nifty.com/nao~nao/pages/profile.html +http://www.ferien-immobilien.de/friesland/verkauf/Gemeinsam/Inserieren/Allgemeine-IB/3d-service/Allgemeine-IB/Startseite/ +http://www.ferien-immobilien.de/friesland/verkauf/Gemeinsam/Inserieren/Allgemeine-IB/3d-service/Gemeinsam/erreichenPartner/email3d.htm +http://www.thestateofcolorado.com/m1jerepair.html +http://www.legis.state.pa.us/WU01/LI/BI/TI/1989/0/MNTENNIS.HTM +http://www.legis.state.pa.us/WU01/LI/BI/TI/1989/0/MNTRASH.HTM +http://www.shop4magazines.com/pg004752.htm +http://www.shop4magazines.com/pg005070.htm +http://www.shop4magazines.com/pg005084.htm +http://fi.egroups.com/login.cgi?login_target=%2Fmessage%2Fsocalscan%2F5293 +http://www.incestpornstories.com/hot-hardcore-fuckingbanging/bootsfeet-/hitting-itsmacking/{hardcorelink} +http://www.columbia.edu/~mkn12/Nominees.html +http://www.generation-formation.fr/pdetail.htm---o21zAo06Rxo0Ol9A074fo6s0Md6jIHeNHhIeOkn2ApvFFo6s5dfexiWo2W81N3OsPeaR2VeuzlEdRsR3djaPfdNjfco41qrfP6sWd6wuCoz4ZteOgKHekLVSePl8vNhiWhAhcgNAPfVbdsNhJl.htm +http://tiscover.at/1Root/Kontinent/6/Staat/7/Bundesland/20/Ort/212/Sonstige_Sportstaette/276591/Bericht/berw...1.html +http://fi.egroups.com/message/meterreader/207?source=1 +http://polygraph.ircache.net:8181/services/design/http_-2www.arthritis.org/http_-2www.alameda-vcf.org/http_-2www.microsoft.com/ie/ie.htm +http://www.fortunecity.com/lavender/deathrace/251/billy.html +http://ftpsearch.belnet.be/packages/CPAN/modules/by-module/AppleII/?N=D +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=7,34,29,16,25 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=21,34,29,16,25 +http://www.ftp.uni-erlangen.de/pub/unix/BSD/FreeBSD/FreeBSD-current/ports/irc/tirc/ +http://retailer.gocollect.com/do/session/1912840/vsid/1696/tid/1696/cid/604361/mid/1540/rid/1420/chid/1725/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLlmo5larLZqVLafpLmiXLvlmHolaLrZqLpl4/url/http://www.gocollect.com/company_info/about.asp +http://retailer.gocollect.com/do/session/1912840/vsid/1696/tid/1696/cid/604361/mid/1540/rid/1420/chid/1725/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLlmo5larLZqVLafpLmiXLvlmHolaLrZqLpl4/url/http://www.gocollect.com/company_info/terms_and_conditions.asp +http://businessrecorder.com/story/S0024/S2401/S2401113.htm +http://arabia.com/article/0,1690,Sports|20732,00.html +http://www.worldmedicus.com/servlet/Controller/$7006041629a50000.sj_viewa/ +http://myhome.naver.com/chocobini/company.html +http://builder.hw.net/frmMessageFront/1,1079,'1~21~0~8~1~2348~9590',00.html +http://pub1.ezboard.com/fcrossstitchcorner504212000shepherdsbushretreat.showAddReplyScreenFromWeb?topicID=48.topic&index=5 +http://www.parisnights.de/fanfiction/archive/authors/andrews/stories/bright.htm +http://198.103.152.100/search*frc/cCA1+MPR+NS51+98Y25/cca1+mpr+ns51+98y25/7,-1,0,E/2browse +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus51605/eus147927/eus269761/eus269920/eus918452/ +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus51605/eus147927/eus269761/eus269920/eus918493/ +http://www.computing.net/cgi-bin/report.pl/windows95/wwwboard/forum/3119.html|21 +http://www.kiarchive.ru:8093/pub/misc/books/Camelot/Vasilyev/Forgotten_Road/ +http://yp.gates96.com/4/9/50/30.html +http://yp.gates96.com/4/9/51/1.html +http://yp.gates96.com/4/9/51/88.html +http://yp.gates96.com/4/9/51/92.html +http://yp.gates96.com/4/9/52/3.html +http://yp.gates96.com/4/9/52/53.html +http://yp.gates96.com/4/9/52/67.html +http://yp.gates96.com/4/9/53/25.html +http://yp.gates96.com/4/9/53/50.html +http://yp.gates96.com/4/9/53/96.html +http://yp.gates96.com/4/9/54/40.html +http://yp.gates96.com/4/9/54/57.html +http://yp.gates96.com/4/9/54/77.html +http://yp.gates96.com/4/9/55/57.html +http://yp.gates96.com/4/9/55/71.html +http://yp.gates96.com/4/9/56/1.html +http://yp.gates96.com/4/9/56/98.html +http://yp.gates96.com/4/9/57/6.html +http://yp.gates96.com/4/9/57/90.html +http://yp.gates96.com/4/9/58/91.html +http://yp.gates96.com/4/9/58/96.html +http://yp.gates96.com/4/9/59/29.html +http://yp.gates96.com/4/9/59/33.html +http://yp.gates96.com/4/9/59/84.html +http://yp.gates96.com/4/9/59/97.html +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/151/1997/5/0/900308/ +http://www2.odn.ne.jp/~cao20970/affair/oh/ha-342 +http://www2.odn.ne.jp/~cao20970/affair/oh/ha-346 +http://wap.jamba.de/KNet/_KNet-lvH8j1-nGd-13d1j/browse.de/node.0/cdzqggtyb +http://www.danielwebster.org//hallofusa/thestampact/HENDRICKFISHER.COM//thestampact/ +http://news.cn.tom.com/maya/cnnav/01/item/2000_09/309490.shtml +http://polygraph.ircache.net:8181/services/design/http_-2www.paducahrotary.org/pbcmap.htm +http://polygraph.ircache.net:8181/services/design/http_-2www.paducahrotary.org/mainpage.htm +http://www.debian.org.cn/Bugs/db/23/23547.html +http://www.debian.org.cn/Bugs/db/54/54172.html +http://www.adetti.iscte.pt/ADETTI/Security/HowTo/Java/jdk1.2.1/docs/guide/beans/spec/beancontext.fm7.html +http://www.users.qwest.net/~campputz/page413.htm +http://flybird.soyou.edu.cn/item/2000-07-31/164671.html +http://www.cognigen.net/corporate/trainers.cgi?full-timer +http://www.babyheirlooms.com/catalog/htmlos.cat/041143.1.1156359481 +http://ramdam.com/art/k/katerine.htm +http://ramdam.com/art/k/krapulax.htm +http://aleph.tau.ac.il:4501/ALEPH/eng/ATA/AAM/AAM/SET-MAIL///1249009 +http://online.linux.tucows.com/conhtml/adnload/8973_2294.html +http://www.arrakis.es/~lady_cel/frcontenf.htm +http://online.linux.tucows.com/conhtml/adnload/39034_1349.html +http://online.linux.tucows.com/conhtml/adnload/51651_2248.html +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=23,0+14,0-13,0-13,0 +http://www.ferien-immobilien.de/Westerwald/verkauf/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/Gemeinsam/Inserieren/Private-IB/Gemeinsam/suche.htm +http://www.linux.com/networking/network/it/alternative/developers/Apple/ +http://www.sanxia.net/beauty/Nanako/418.htm +http://www-usa8.cricket.org/link_to_database/ARCHIVE/1999-2000/OTHERS+ICC/NORTHANTS_IN_WI/ARTICLES/ +http://gds.cc.va.us:8888/Mcn%3dMELISSA%20BACK,%20ou%3dSV.CC.VA.US,%20ou%3dFaculty%20%26%20Staff,%20o%3dvccs,%20c%3dUS +http://www.allgemeine-immobilien-boerse.de/nordrhein-Westfalen/luedinghausen/Verkauf/Ferien-IB/Startseite/Gemeinsam/erreichenPartner/Versteigerungen-IB/Startseite/IIM-Teil/Startseite/froben.htm +http://198.103.152.100/search*frc/dIndustrial+relations+--+Germany+(West)+--+History/dindustrial+relations+germany+west+history/-5,-1,0,B/frameset&F=dindustrial+relations+germany+dictionaries&1,,0 +http://secure.danysoft.com/asp/dany.tienda/892496425/Catalog +http://yp.gates96.com/13/57/90/23.html +http://yp.gates96.com/13/57/90/91.html +http://yp.gates96.com/13/57/91/68.html +http://yp.gates96.com/13/57/92/22.html +http://yp.gates96.com/13/57/92/49.html +http://yp.gates96.com/13/57/92/73.html +http://yp.gates96.com/13/57/93/75.html +http://yp.gates96.com/13/57/94/16.html +http://yp.gates96.com/13/57/94/62.html +http://yp.gates96.com/13/57/94/99.html +http://yp.gates96.com/13/57/95/19.html +http://yp.gates96.com/13/57/95/34.html +http://yp.gates96.com/13/57/95/84.html +http://yp.gates96.com/13/57/96/22.html +http://yp.gates96.com/13/57/96/24.html +http://yp.gates96.com/13/57/96/52.html +http://yp.gates96.com/13/57/96/70.html +http://yp.gates96.com/13/57/97/39.html +http://yp.gates96.com/13/57/97/55.html +http://yp.gates96.com/13/57/98/4.html +http://yp.gates96.com/13/57/98/41.html +http://yp.gates96.com/13/57/98/58.html +http://yp.gates96.com/13/57/98/98.html +http://yp.gates96.com/13/57/98/99.html +http://yp.gates96.com/13/57/99/79.html +http://carriage.de/Schoner/Info-d/history/literature/literature/ +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/lit/computers/misc/unitest/misc/computers/programs/simple/simple.html +http://kwic.tucows.com/partners/flyswat/get_acx.html +http://sp201.unige.ch:49213/cxxdoc/ioc/concepts/c2g2rcsm.htm +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=0,2-0,1-21,0+9,1 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=237&discrim=10,2,183 +http://firstweb.tucows.com/win2k/adnload/58783_28760.html +http://www.boerseninfos.de/dynamic/ak/mk/news/719350-20000830-104827.html +http://baseball.mainichi.co.jp/life/family/syuppan/wakaru/wakaru-j/10/01/01.html +http://helios.nlib.ee/search*est/dsÃĩjalised+blokid/dsw~ajalised+blokid/-5,-1,0,B/exact&F=dsw~ajalised+konfliktid&1,58/limit +http://helios.nlib.ee/search*est/dsÃĩjalised+blokid/dsw~ajalised+blokid/-5,-1,0,B/frameset&F=dsw~ajalised+konfliktid&11,,58 +http://lexicon.linux.tucows.com/conhtml/adnload/8642_2088.html +http://ua.php.net/manual/es/function.pg-fieldisnull.php +http://www.babyheirlooms.com/catalog/htmlos.cat/041132.1.4352706945 +http://www.civila.com/guitar/chat/desenredada/juegos/ +http://sunsite.org.uk/public/pub/packages/info-mac/pilot/?N=D +http://www.aelita.net/products/products/support/news/Reg/Subscribe/company/contact/default.htm +http://cn.egroups.com/message/newsclips/295 +http://www.jornada.unam.mx/2000/sep00/000922/oriente-y.htm +http://members.tripod.co.jp/mosokke/dubair01ghe.html +http://202.99.23.245/zdxw/21/20000217/200002172112.html +http://link.fastpartner.com/do/session/600412/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/speednames.php +http://link.fastpartner.com/do/session/600412/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/nordicliving.php +http://link.fastpartner.com/do/session/600412/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/local/redirect.php +http://iant.subportal.com/sn/Utilities/System_Maintenance_and_Repair_Utilities/2128.html +http://polygraph.ircache.net:8181/client/http_-2www.scubaring.com/http_-2www.aaainvestments.com/http_-2www.primenet.com/~stmmoon/stmbik.html +http://itcareers.careercast.com/texis/it/itjs/+wwwBme89D86qxwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewGtmoBGnaqdGpdGwBodDanDtoDnnGaMw55wqr15nBB5aoDhdGMwBodDa5nq1GoBOaDnBidGAapGdBdqdc5aGn31oGnmanLpnGonDqnaMFqhTfR20DzmehrwwwpBme26D86eSqwww5rmePdwwwBrmeZpwww/morelike.html +http://itcareers.careercast.com/texis/it/itjs/+awwBme3AT+6ezqwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewGtmoBGnaqdGpdGwBodDanDtoDnnGaMw55wqr15nBB5aoDhdGMwBodDa5nq1GoBOaDnBidGAapGdBdqdc5aGn31oGnmanLpnGonDqnaMFqhTfR20DzmehrwwwpBme26D86eSqwww5rmeEdwwwBrmeZpwww/jobpage.html +http://itcareers.careercast.com/texis/it/itjs/+vwwBme26D86eSqwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewGtmoBGnaqdGpdGwBodDanDtoDnnGaMw55wqr15nBB5aoDhdGMwBodDa5nq1GoBOaDnBidGAapGdBdqdc5aGn31oGnmanLpnGonDqnaMFqhTfR20DzmehrwwwpBme26D86eSqwwwGzmwwww5rmeEdwwwBrmeZpwww/morelike.html +http://www.starcities.com/usa/ca/carlsbad/ +http://www.3w-geschichten.de/PlumptreGeorge/PlumptreGeorge1857938461.htm +http://residence.educities.edu.tw/goyen/ +http://polygraph.ircache.net:8181/http_-2www.whowhere.com/http_-2www.primenet.com/~mmfact/http_-2www.microsoft.com/ie/download/ +http://polygraph.ircache.net:8181/http_-2www.whowhere.com/http_-2www.primenet.com/~mmfact/http_-2www.infohwy.com/odframes.html +http://www.linux.com/networking/network/management/industry/internet/services/ +http://cn.egroups.com/message/ruosulista/1176 +http://ftp.jp.debian.org/debian/dists/unstable/main/binary-i386/tex/?M=A +http://de.excite.de/bildung/katalog/17722 +http://de.excite.de/bildung/katalog/17893 +http://de.excite.de/bildung/katalog/17879 +http://www.emerchandise.com/browse/BUFFYTHEVAMP/PIN/b.TV%20BUFFYTHEVAMP/s.Xpiu5LCZ +http://variety.studiostore.com/browse/VARIETY/CAMERA/s.dmZspziz +http://carriage.de/Schoner/Sammlungen/models/info-e/Info-d/ +http://www.gazeta.com/Iso/Plus/Kraj/Prezyden/Ak/700kwa.html +http://www.linux.com/networking/network/networking/developers/operating_system/Debian/ +http://online.linux.tucows.com/conhtml/adnload/8808_32695.html +http://149.221.91.10/news/lokales/wermelskirchen/ +http://opac.lib.rpi.edu/search/avirgin+vision+limited/7,-1,0,B/frameset&avirginia+cooperative+fisheries+research+unit&1,1 +http://www.emerchandise.com/browse/DISNEY-FAM/ACTIONFI/b.FAVORITES%20KIDSSTUFF%20DISNEY-FAM/s.erm2bF5K +http://polit.kulichki.net/moshkow/PXESY/GORIN/ +http://polit.kulichki.net/moshkow/COPYRIGHT/stolyarov.txt +http://www.science.uva.nl/pub/NetBSD/NetBSD-current/pkgsrc/textproc/rman/pkg/DESCR +http://cgi.www.4tourism.com/uk/wareham65426.html +http://cgi.www.4tourism.com/uk/wareham22477.html +http://www.ccnet.com/affif/_themes/sumipntg/_vti_cnf/?M=A +http://web.tin.it/regionesardegna/ital/lavpubb/bandi_contratti/schema5_1q.htm +http://ring.htcn.ne.jp/archives/text/CTAN/macros/latex/contrib/other/apa/ +http://ftpsearch.belnet.be/packages/CPAN/modules/by-module/Callback/Callback-1.02.readme +http://iant.subportal.com/sn/Utilities/Misc__Utilities/12800.html +http://yp.gates96.com/2/51/0/86.html +http://yp.gates96.com/2/51/1/72.html +http://yp.gates96.com/2/51/2/10.html +http://yp.gates96.com/2/51/3/7.html +http://yp.gates96.com/2/51/3/50.html +http://yp.gates96.com/2/51/4/90.html +http://yp.gates96.com/2/51/5/6.html +http://yp.gates96.com/2/51/5/42.html +http://yp.gates96.com/2/51/5/50.html +http://yp.gates96.com/2/51/6/49.html +http://yp.gates96.com/2/51/8/12.html +http://yp.gates96.com/2/51/8/50.html +http://yp.gates96.com/2/51/9/82.html +http://yp.gates96.com/2/51/9/94.html +http://archive.soccerage.com/s/fr/09/37602.html +http://archive.soccerage.com/s/fr/09/39203.html +http://ftp.ring.gr.jp/archives/NetBSD/NetBSD-1.4.1/pmax/binary/security/ +http://www.yorosiku.net:8080/-_-http://www.us-japan.org/otr/ +http://support.dell.com/docs/storage/dlt1/ug/sp/jumpers.htm +http://moviestore.zap2it.com/browse/MOVIES/MOUSEPAD/s.uiIfdEiW +http://moviestore.zap2it.com/browse/MOVIES/STANDUP/s.uiIfdEiW +http://focusin.ads.targetnet.com/ad/id=animeart&opt=cin&cv=210&uid=972942857 +http://www.emerchandise.com/browse/SATNIGHTLIVE/SWEATSHI/s.pJ2FFfba +http://www.realize.com/p5dee81.htm,qt=e784fe2f=2a38a234-e-1ade986-0-0-0-3-- +http://support.tandy.com/support_audio/doc30/30780.htm +http://sun1.rrzn-user.uni-hannover.de/jgaertner/matlab/help/techdoc/umg/chlabel2.html +http://sun1.rrzn-user.uni-hannover.de/jgaertner/matlab/help/techdoc/umg/chprin12.html +http://www.es.co.nz/~rotary.home.html +http://www.excelsior.com.mx/9802/980217/nac18.html +http://dante.bdp.it/cgi-bin/poseidon_v2.0/reflect/poseidon/disc/biblioteca1/1316779952/prevarticle +http://dennou-t.ms.u-tokyo.ac.jp/arch/cc-env/Linux/debian-jp/dists/stable/non-free-jp/binary-alpha/net/?D=A +http://guest/forestpatholog/diseases/annosus.html +http://guest/forestpatholog/diseases/rot.html +http://no.egroups.com/message/readbygrade3/2029 +http://www.cybercd.de/artist/Fabri,+Stafke.htm +http://www.jamba.de/KNet/_KNet-zQG8j1-hGd-13cwi/admLogin.de/node.0/cenv0b09a +http://www.digitaldrucke.de/(aktuell,computer,marktplatz,sense,tausch)/_fort/html/themen/computer/computer.htm +http://ring.tains.tohoku.ac.jp/pub/linux/debian/debian-jp/dists/potato/contrib-jp/source/news/?S=A +http://strategis.ic.gc.ca/sc_indps/recboats/frndoc/3g.html +http://ftp.eq.uc.pt/software/unix/Linux/redhat/redhat-6.2/i386/doc/gsg/figs/rpmlite/?M=A +http://www.judds-resort.com/judds/Lake-Winni-pike-lodge/upload/upload/photo/fallphoto/boat/12.html +http://ftp.eecs.umich.edu/.7/NetBSD/NetBSD-current/src/usr.sbin/cnwctl/ +http://ftp.eecs.umich.edu/.7/NetBSD/NetBSD-current/src/usr.sbin/mailwrapper/ +http://ftp.eecs.umich.edu/.7/NetBSD/NetBSD-current/src/usr.sbin/traceroute6/ +http://ftp.eecs.umich.edu/.7/NetBSD/NetBSD-current/src/usr.sbin/yppoll/ +http://pelit.saunalahti.fi/.3/linuxberg/conhtml/preview/8785.html +http://www.asahi-net.or.jp/~rz3n-snd/kitakan/kamiyosida.html +http://www.chaos.dk/sexriddle/s/e/x/q/x/k/l/ +http://www.chaos.dk/sexriddle/s/e/x/q/x/k/y/ +http://ring.jec.ad.jp/archives/text/CTAN/dviware/umddvi/libcompat/?S=A +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/OCtIhwK0_lecIJU9yN87J4DTFWqXdztVO8nfP1zxdwq79fkod_IhHN3-iHbCrlaXZ5ATMMc_Gb5Zt_RdtVOloKJ1Z7DGqz2vE9vOjESyOqryETO-lNa0NWtCoTJH_QGCfq7ss5VGa1MO3iLryKZ2gIVI_Lonfx_bC9m7 +http://seniorfriendfinder.com/cgi-bin/w3com/pws/ffsenior/D-tI2p4N__5TTgffRqVzdrKNYFZc3jj2Oatw29gt_YiNBPXUlYZaTA2ndP2CrwlrdiMS8YzPKxDR7Vp4ZBqD3d5o3MwYrYIxk31YsVtP3yFS2bLdZcBGLKdyNUc9yYgvGsGMXAMcEAUJPjtRqUVzDpuhHzS6V_U76I6G +http://my.egroups.com/subscribe/enemapix +http://yp.gates96.com/0/23/40/60.html +http://yp.gates96.com/0/23/40/82.html +http://yp.gates96.com/0/23/41/67.html +http://yp.gates96.com/0/23/43/71.html +http://yp.gates96.com/0/23/43/75.html +http://yp.gates96.com/0/23/44/64.html +http://yp.gates96.com/0/23/44/73.html +http://yp.gates96.com/0/23/44/84.html +http://yp.gates96.com/0/23/45/19.html +http://yp.gates96.com/0/23/46/9.html +http://yp.gates96.com/0/23/46/26.html +http://yp.gates96.com/0/23/46/37.html +http://yp.gates96.com/0/23/46/92.html +http://yp.gates96.com/0/23/47/39.html +http://yp.gates96.com/0/23/47/52.html +http://yp.gates96.com/0/23/48/52.html +http://yp.gates96.com/0/23/49/12.html +http://yp.gates96.com/0/23/49/90.html +http://retailer.gocollect.com/do/session/1912812/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/help/index.asp +http://retailer.gocollect.com/do/session/1912812/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/sports/index.asp +http://203.93.50.148:2222/*0110http://www.snweb.com/gb/people_daily/2000/10/20/i1020004.htm +http://cn.egroups.com/messages/romtrade/5024 +http://members.tripod.co.jp/medo/_private/ +http://dbc.copystar.com.tw/DelphiChat/200001/msg0325.htm +http://tucows.pi.be/winnt/diskcnt_license.html +http://millennium.fortunecity.com/ruthven/144/5041.htm +http://news.pchome.com.tw/ttv/finance/20000616/ +http://library.bangor.ac.uk/search/dEcology+--+Poland+--+Periodicals/decology+poland+periodicals/-17,-1,0,B/frameset&F=decology+north+america+congresses&1,1 +http://www.could.be/travel/north_america/united_states/lodge_2.htm +http://genforum.genealogy.com/cgi-bin/print.cgi?huntington::195.html +http://www.bemi-immobilien.de/Ferien-IB/Startseite/Gemeinsam/immolink/Gemeinsam/MarketingStrategie/Gemeinsam/erreichenPartner/Gemeinsam/3d-service/Top-Darlehens-Konditionen/anforderungsformular.htm +http://members.tripod.co.jp/snowmen/?D=A +http://ftp.unicamp.br/pub/FAQ/sf/alt_history/part6 +http://www.affiliate.hpstore.hp.co.uk/do/session/380884/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/REGISTRATION/entry.asp +http://grid9.linux.tucows.com/x11html/adnload/9444_3744.html +http://www.linux.com/networking/network/communications/tools/web/support/ +http://www.linux.com/networking/network/communications/tools/web/alternative/ +http://cometweb01.comet.co.uk/do!tid=20&rtid=1&vsid=700&session=132030&mid=1000&rid=1060&cid=37030&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplGGolLarZLq4fLpmiLXv-KmooLckYLoznGmpq0qsc0mojLbkYLozvGotc0ZdoLckYLozvGsmv0qmc0jXfLkVZLdocLkYoLzcj1XfkLVZXLqkXLjbzKcob5qroLkVrLoizKlZd5fjYHfklKkZlLjjbLoZbLpl51ubZLDXZLollK3ljLbqlKjXfLkkaHotl4obmLloqL +http://yp.gates96.com/14/77/20/1.html +http://yp.gates96.com/14/77/20/3.html +http://yp.gates96.com/14/77/20/32.html +http://yp.gates96.com/14/77/20/55.html +http://yp.gates96.com/14/77/21/7.html +http://yp.gates96.com/14/77/22/20.html +http://yp.gates96.com/14/77/22/26.html +http://yp.gates96.com/14/77/22/50.html +http://yp.gates96.com/14/77/23/63.html +http://yp.gates96.com/14/77/23/96.html +http://yp.gates96.com/14/77/25/53.html +http://yp.gates96.com/14/77/26/8.html +http://yp.gates96.com/14/77/26/32.html +http://yp.gates96.com/14/77/27/0.html +http://yp.gates96.com/14/77/27/55.html +http://yp.gates96.com/14/77/27/78.html +http://yp.gates96.com/14/77/28/8.html +http://yp.gates96.com/14/77/28/53.html +http://yp.gates96.com/14/77/28/57.html +http://yp.gates96.com/14/77/28/99.html +http://yp.gates96.com/14/77/29/96.html +http://mirror.nucba.ac.jp/mirror/FreeBSD/FreeBSD-stable/ports/cad/xcircuit/files/?D=A +http://pub3.ezboard.com/BBSForum.showForumSearch?boardName=jenxforum&forumName=jenxforumfrm0 +http://genforum.genealogy.com/cgi-genforum/forums/hi.cgi?415 +http://elib.zib.de/pub/opt-net/msc/msc-90-xx/90c15/v93w20n4 +http://biblio.cesga.es:81/search*gag/aDittrich,+Stefan/adittrich+stefan/-5,-1,0,E/frameset&F=adittman+richard+h+coaut&1,,0 +http://biblio.cesga.es:81/search*gag/aDittrich,+Stefan/adittrich+stefan/-5,-1,0,E/frameset&F=adittmar+jorge&1,1 +http://biblio.cesga.es:81/search*gag/aDittrich,+Stefan/adittrich+stefan/-5,-1,0,E/exact&F=adivis+jan&1,4 +http://www.doc.ic.ac.uk/~gwsb98/bucket/Wine-20001026/etc/?D=A +http://news.fm365.com/xinwen/guoji/20000531/72641.htm +http://www.newquestcity.com/templates/eventout.cfm?nqc=TN0730 +http://www.rhena.de/kempinsk1.htm +http://www.jamba.de/KNet/_KNet-tkL8j1-PGd-13dss/showInfo-wir.de/node.0/cenvd8eze +http://www.jamba.de/KNet/_KNet-tkL8j1-PGd-13dsv/browse.de/node.0/ceo0fdeye +http://cpan.nitco.com/modules/by-module/String/BLCKSMTH/?N=D +http://www.digitaldrucke.de/(hilfe,nuernberg)/_fort/html/themen/computer/soft/links/intuit.htm +http://www.jeunesdocteurs.com/fplr/56/08.html +http://simf1.tripod.com/Rio.htm +http://www.mirror.kiev.ua:8083/paper/1998/17/1251/people.htm +http://web2.sportsline.com/u/baseball/mlb/2000PO_stats/tpSTLw.htm +http://www15.freeweb.ne.jp/art/charukun/yusuke.htm +http://map.ipc.co.jp/asp/onmap/r/new/g-24/f-905972/ +http://www.affiliate.hpstore.hp.co.uk/do/session/380882/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/REGISTRATION/entry.asp +http://www.webcrawler.com/education/arts_and_humanities/visual_arts/art_history/c19th/arts_and_crafts/mackintosh_cr/structures/ +http://polygraph.ircache.net:8181/wwwboard/http_-2www.microsoft.com/msoffice/frontpage/http_-2www.linkstar.com/home/partners/marketlink-international-inc +http://polygraph.ircache.net:8181/wwwboard/http_-2www.microsoft.com/msoffice/frontpage/ECA2.htm +http://polygraph.ircache.net:8181/wwwboard/http_-2www.microsoft.com/msoffice/frontpage/http_-2www.intac.com/~dversch/catalog.html +http://excite.de.netscape.com/kunst/katalog/24315 +http://www.outpersonals.com/cgi-bin/w3com/pws/out/KhhIzVYqtXJlJzGPqrqzbJbUw7ERB8P7PSm9mTaj3BkJF6tLfllGlz2yKgLweoM1LPKLdHjjKv8zfb9tb2yojpTmzt6264ZE3V9vWzxY1mZnhDOG1vlwPrnwH5OCJM6C98fbjgZX66II +http://mirror.nucba.ac.jp/mirror/Netscape/netscape6/french/6_PR2/windows/win32/?S=A +http://www.linux.com/networking/server/install/howto/red_hat/package/ +http://www.nissan.co.jp/RENAULT-DEALERS/PASSPORT/view.cgi/proof/972959618-- +http://brain.brent.gov.uk/WebPages.nsf/vWebAllPagesByKey!OpenView&Start=97&Count=60&Expand=152 +http://i-mode.kakiko.com/deaitomo/mag/magurox/1405b.html +http://www.ring.gr.jp/pub/NetBSD/arch/amiga/snapshot/20000115-1.4P/binary/security/ +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=18,0+20,0-17,0-0,0 +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/www/anoncvs.html?annotate=1.2&sortby=rev +http://ftp.jp.debian.org/debian/dists/woody/non-free/binary-sh/hamradio/?M=A +http://netscape.complete-skier.com/resorts/survey/submit.asp?ResortID=772 +http://nathanael.upi.jussieu.fr/tele6.nsf/autres+centres+de+formations!OpenPage&ExpandSection=9,17,2,16,5,14 +http://www.egroups.com/messages/zingiber/238 +http://www.umr.edu/~rhall/class/sap/sap8/demo.html +http://209.207.239.212/bkindex/c1043/f1202.html +http://se.egroups.com/message/ackmud/104 +http://school.educities.org/card/cug55.html +http://school.educities.org/card/wgl.html +http://school.educities.org/card/a77125.html +http://school.educities.org/card/apple6128.html +http://school.educities.org/card/c369852.html +http://school.educities.org/card/cges4216.html +http://school.educities.org/card/cges6307.html +http://school.educities.org/card/eaa.html +http://school.educities.org/card/f129235832.html +http://school.educities.org/card/g1546.html +http://school.educities.org/card/h223422022.html +http://school.educities.org/card/lemon6112.html +http://school.educities.org/card/st6408.html +http://www.dulux.co.uk/UKRETAIL:1243142410:DFinity.1QJiP4jRACol +http://www.iagora.com/pages/bbaddpost/::bb_id=148:mid=43302:thread_id=8185:parent_id=43302::lang=de +http://www.iagora.com/pages/bbaddpost/::bb_id=148:mid=43431:thread_id=8185:parent_id=43431::lang=de +http://www.egroups.com/message/intelligent_humor/875 +http://club.telepolis.com/klvinbc/fotosb.htm +http://plat.debian.or.jp/debian/dists/woody/non-free/binary-mips/editors/?D=A +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=207&discrim=3,12,63 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=207&discrim=3,12,237 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=207&discrim=3,12,120 +http://www.jamba.de/KNet/_KNet-_tJ8j1-AGd-13ddq/browse.de/node.0/cdel3j591 +http://immihelpdownloads.subportal.com/sn/Utilities/System_Analysis_Utilities/2980.html +http://dwp.bigplanet.com/crestinginc/discussion/edit.nhtml +http://dwp.bigplanet.com/crestinginc/discussion/list.nhtml?profile=discussion +http://194.128.65.4/pa/cm199900/cmwib/wb991127/ahead.htm +http://61.128.218.34/book/hhsh/wu/wolongsheng/jiangxue/055.htm +http://gd.cnread.net/cnread1/wgwx/t/tuwen/kxj/035.htm +http://gd.cnread.net/cnread1/wgwx/t/tuwen/kxj/041.htm +http://www.redrocksports.com/sports/webSession/shopper/RR972959743-31143/store/dept-5/department/dept-5/item/50110 +http://www.redrocksports.com/sports/webSession/shopper/RR972959743-31143/store/dept-5/department/dept-5/item/51530 +http://www.redrocksports.com/sports/webSession/shopper/RR972959743-31143/store/dept-5/department/dept-5/item/51510 +http://www.yorku.ca/org/yusa/who99/wh02.html +http://www1.onelist.com/message/ar8200/3350 +http://www.kodak.se/US/en/corp/features/kern/jodi/index.shtml +http://cafe3.daum.net/Cafe-bin/Bbs.cgi/semtle15pds/rnw/zka/B2-kB27k +http://my.egroups.com/messages/dcfwriters/187?expand=1 +http://link.fastpartner.com/do/session/600414/vsid/1970/tid/1970/cid/135878/mid/1060/rid/1488/chid/1970/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/gosafe.php +http://www.tiscover.com/1Root/Kontinent/6/Staat/7/Bundesland/20/Ort/108147/Bauernhof/315126/Homepage/f_homepage...2.html +http://ring.omp.ad.jp/archives/NetBSD/packages/pkgsrc/net/gnut/patches/?D=A +http://www.mtranslations.cz/40/cs/dictionary/dictionary_index.html +http://pub10.ezboard.com/BBSSystem.handleLoginCheck?action=forgotPassword&boardName=alakazamslair +http://tour.stanford.edu/cgi/locate3.prl/139.6/jMtlo +http://www.shopworks.com/index.cfm/action/search/userid/00042DDE-2F63-19FE-9038010B0A0ADCF2 +http://thestar.com/back_issues/ED20001004/life/20000820LFE01_AH-BATH.html +http://thestar.com/back_issues/ED20001004/life/20000818LFE01_LI-DEPRESS.html +http://thestar.com/back_issues/ED20001004/life/20000806LFE01_AH-DAHLIAS.html +http://www.hole.kommune.no/hole/journweb.nsf/7e180336094ef23a412568cd004a5093/466e7592a4c6c7ccc12568e3004402e8!Navigate&To=Prev +http://mailthat.subportal.com/sn/Multimedia_and_Graphics/Graphics_Editors/3752.html +http://www.gbnf.com/genealogy/rockwel4/html/d0014/I6348.HTM +http://www.lookforforestry.com/catalog/FORSALE/FORKLIFT/JCB/930RTFL/ +http://www.espl.org/mearscol/pagendxs/stockley/d1828.htm +http://in.egroups.com/messages/eyecandy/1290 +http://in.egroups.com/message/eyecandy/1264 +http://in.egroups.com/message/eyecandy/1271 +http://www.ferien-immobilien.de/bayern/deggendorf/Verkauf/Exklusiv-IB/Startseite/3d-service/Gemeinsam/Immolink/Gemeinsam/vertriebspartner.htm +http://linux99.inrialpes.fr/linux/RPM/redhat/6.2/i386/Distribs.html +http://students.lsu.edu/students/main.nsf/Pages/CSISAJ1!OpenDocument&ExpandSection=4,13,11,10 +http://www.doc.ic.ac.uk/lab/labsrc_area/firstyear/submissions/1997-98/jmc1/labs/Ex04/jwb97/?S=A +http://www.iabusnet.org:90/forums/aca-1/dispatch.exe/survey/folderFrame/100001/0/alpha/2509069 +http://www.scifi.com/bboard/browse.cgi/1/5/545?lnum=4223 +http://www.fogdog.com/cedroID/ssd3040183304719/customer_service/ +http://www.fogdog.com/cedroID/ssd3040183304719/nav/products/winter_sports/1b/suits/ +http://www.gpul.org/ftp/lang/java/JDK/jdk1.1.6-docs/api/java.lang.Math.html +http://www.gpul.org/ftp/lang/java/JDK/jdk1.1.6-docs/api/java.lang.IncompatibleClassChangeError.html +http://www.staroriental.net/nav/soeg/ihf,aai,n2,418,Electric+Wave+Girl+1998.html +http://www.parentsplace.com/expert/lactation/basics/qa/0,3459,5757,00.html +http://www.francetrade.fr/opcvm/details/4/44200.html +http://www.francetrade.fr/opcvm/details/4/42876.html +http://genforum.genealogy.com/cgi-bin/print.cgi?phillippines::319.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380860/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-photoworld.com/photoworld.asp?lang=f +http://ftp.eq.uc.pt/software/unix/Linux/docs/HOWTO/translations/italian/distributions/?M=A +http://store1.europe.yahoo.com/brink2/2000074017704.html +http://store1.europe.yahoo.com/brink2/2000073276003.html +http://www.cbe21.com.cn/xueke/dili/jiaoxuezs/ziliaojn/tupianhc/i0733.htm +http://www.networkpatternmatching.com/inventory/L/Limoges-American/Limoges-American-Tea-Rose-(Green).html +http://www.networkpatternmatching.com/inventory/L/Limoges-American/Limoges-American-Toledo-Delight-(Sand).html +http://ftp.debian.org/dists/sid/non-free/binary-hppa/games/?M=A +http://www.angelfire.com/vt/kAoZzZ +http://yp.gates96.com/14/28/60/15.html +http://yp.gates96.com/14/28/60/17.html +http://yp.gates96.com/14/28/60/41.html +http://yp.gates96.com/14/28/60/75.html +http://yp.gates96.com/14/28/60/83.html +http://yp.gates96.com/14/28/60/87.html +http://yp.gates96.com/14/28/61/96.html +http://yp.gates96.com/14/28/62/12.html +http://yp.gates96.com/14/28/62/28.html +http://yp.gates96.com/14/28/62/45.html +http://yp.gates96.com/14/28/62/74.html +http://yp.gates96.com/14/28/63/24.html +http://yp.gates96.com/14/28/63/45.html +http://yp.gates96.com/14/28/64/33.html +http://yp.gates96.com/14/28/65/84.html +http://yp.gates96.com/14/28/66/28.html +http://yp.gates96.com/14/28/66/49.html +http://yp.gates96.com/14/28/67/15.html +http://yp.gates96.com/14/28/67/17.html +http://yp.gates96.com/14/28/67/92.html +http://yp.gates96.com/14/28/67/95.html +http://yp.gates96.com/14/28/68/10.html +http://yp.gates96.com/14/28/69/20.html +http://yp.gates96.com/14/28/69/64.html +http://yp.gates96.com/14/28/69/74.html +http://www.cs.kuleuven.ac.be/documentation/Sun/WorkShop/html_docs/c-plusplus/stdlibcr/deq_4164.htm +http://no.egroups.com/message/Holiday-Best/571?source=1 +http://www.outpersonals.com/cgi-bin/w3com/pws/out/G1hIPcWIQWr-i3fHpjDuaPPPdDR9n25II-MFpjX9vR_df0A3ukwPXLd19bYe7oxRH5Zr5z3G_wJnwM6gAVSOlRUN-p5MKYEBVJa1T-GaZS44Z98yjSST2LfXzEdc9Xqp8W0jRiNL6iAX +http://msn.expedia.co.uk/wg/Asia/China/P31642.asp +http://www.angelfire.com/fl2/gulfcoastsoftball/images/?N=D +http://www.greenleaves.com/bookcat/gb_0879513802.html +http://cn.egroups.com/post/Digitrends_Daily?act=reply&messageNum=210 +http://www.bookhome.net/wuxia/hzlz/li/031.html +http://gb.toget.com.tw/intro/game_action/game_action_click/19990804_3190_dl.html +http://www.mbnet.mb.ca/gray/cgrcc.html +http://www.civila.com/noticias/chat/logos/juegos/esgratis/logos/index.html-ssi +http://www.ytmag.com/cgi-bin/redirect.cgi/1197948180 +http://debian.tod.net/debian/dists/sid/contrib/binary-arm/admin/?M=A +http://haste.co.kr/www.amaquest.com.tw/support.htm +http://www.diogenes.ch/4DACTION/web_rd_aut_frlist_az/ID=483376&chr=A +http://ads.neoseeker.com/remoteclick/GB972959289/ +http://urawa.cool.ne.jp/whoinside/cg/cgframe2.htm +http://excite.de/bildung/katalog/33148 +http://plat.debian.or.jp/debian-archive/dists/Debian-2.0/hamm/binary-m68k/news/ +http://wwwpriv.uni-koblenz.de:81/~admin/Doku/HtmlTutor/tcdkc.htm +http://platsbanken.amv.se/kap/text/62/000907,150090,120901,40,1427050362.shtml +http://216.35.79.131/sites/gunits/022140u.html +http://www.hotelboulevard.com/fr/paris/standard/htmle55cd396d0d1450ad1eddadf65bd6574/sessionLang/ANG/prov/browse/cp/75011/resultatSearch.html +http://www.ftp.uni-erlangen.de/cgi-bin/view/pub/unix/Linux/MIRROR.KDE/unstable/apps/README +http://www.ftp.uni-erlangen.de/pub/unix/Linux/MIRROR.KDE/unstable/apps/network/ +http://www.ycwb.com.cn/gb/2000/04/28/dnzk/itkx/3.html +http://polygraph.ircache.net:8181/http_-2www.microsoft.com/guestbook/http_-2www.nmpinc.com/cfiguest.htm +http://www.our-home.org/giulianovallemani/success.htm +http://retailer.gocollect.com/do/session/1912838/vsid/2312/tid/2312/cid/573127/mid/1020/rid/2147/chid/2210/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLlZe5ofpLqjXLpl4/url/http://www.gocollect.com/product_display/products/product_lines.asp +http://binary.tucows.com/win2k/adnload/60913_29719.html +http://www.allhealth.com/kickbutt/qa/0,4801,6565_168263-1,00.html +http://library.cuhk.edu.hk/search*chi/tChinese+history+series.+[Motion+picture]/tchinese+history+series/-5,1,1,B/frameset&F=tchinese+history+index+to+learned+articles+1902+1962&1,1, +http://cafe4.daum.net/Cafe-bin/Bbs.cgi/culturalistpds/lst/qqeq/1/zka/B2-kB27p +http://lib1.nippon-foundation.or.jp/1997/0012/contents/086.htm +http://members.tripod.com/~theernest/lit/long.html +http://de.excite.de/auto/katalog/13030 +http://www.szinfo.com/book/ke/fam/nk1/wlsf/001.htm +http://www.backflip.com/members/cquinn/466730/sort=1/ +http://130.158.208.53/WWW/PDB2/PCD4711/htmls/49.html +http://astronomysite.com/mapug1/15/msg15752.htm +http://astronomysite.com/mapug1/15/msg15922.htm +http://astronomysite.com/mapug1/15/msg15970.htm +http://astronomysite.com/mapug1/12/msg12909.htm +http://astronomysite.com/mapug1/9/msg9909.htm +http://astronomysite.com/mapug1/7/msg7248.htm +http://astronomysite.com/mapug1/7/msg7288.htm +http://astronomysite.com/mapug1/7/msg7300.htm +http://astronomysite.com/mapug1/7/msg7277.htm +http://astronomysite.com/mapug1/3/msg3386.htm +http://astronomysite.com/mapug1/0/msg898.htm +http://astronomysite.com/mapug1/2/msg2146.htm +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/ports/x11-fm/systemg/pkg/Attic/DESCR +http://www.posterwelt.de/byers/bye2506.htm +http://www.5a8.com/book/wg/zpj/f/fajieyefu/huimie/003.htm +http://www.5a8.com/book/wg/zpj/f/fajieyefu/huimie/015.htm +http://businessrecorder.com/story/S0015/S1510/top +http://sunsite.org.uk/Mirrors/ftp.microsoft.com/bussys/winnt/winnt-public/fixes/usa/nt351/hotfixes-postsp5/sec-fix/?S=A +http://sunsite.org.uk/Mirrors/ftp.microsoft.com/bussys/winnt/winnt-public/fixes/usa/nt351/hotfixes-postsp5/sec-fix/readme.txt +http://www.angelfire.com/ky/dodone/HistJ.html +http://www.cricinfo.com/link_to_database/ARCHIVE/1997-98/WI_IN_PAK/WI_IN_PAK_NOV-DEC1997_WI-SQUAD.html +http://www.egroups.com/message/-Girlhelp-/3251 +http://www.egroups.com/message/-Girlhelp-/3268 +http://202.130.244.3/wuliwangye/help/help.htm +http://ftp.gwdg.de/pub/EMIS/EMS/journals/SLC/divers/mirror.html +http://ftp.gwdg.de/pub/EMIS/EMS/journals/SLC/divers/s20ghinelli.html +http://ftp.gwdg.de/pub/EMIS/EMS/journals/SLC/divers/s25dress.html +http://ftp.gwdg.de/pub/EMIS/EMS/journals/SLC/divers/s30wen.html +http://ftp.gwdg.de/pub/EMIS/EMS/journals/SLC/divers/slc41email.html +http://guardian.co.uk/Print/0,3858,3889048,00.html +http://genforum.genealogy.com/mccallum/messages/187.html +http://genforum.genealogy.com/mccallum/messages/192.html +http://genforum.genealogy.com/mccallum/messages/133.html +http://genforum.genealogy.com/mccallum/messages/95.html +http://genforum.genealogy.com/mccallum/messages/82.html +http://genforum.genealogy.com/mccallum/messages/30.html +http://dekooi.tucows.com/win2k/adnload/37333_29427.html +http://dekooi.tucows.com/win2k/adnload/37624_29418.html +http://dekooi.tucows.com/win2k/preview/139483.html +http://www.zurich-schweiz.ch/static/it/peraziende/grandiimprese/riskmanagement/procedere_con_metodo/gestione_del_rischio/ +http://cn.egroups.com/login.cgi?login_target=%2Fmessage%2Fcertdev%2F373 +http://www.angelfire.com/pa2/DreamAvs/ +http://www.madisonmag.com/sh/entertainment/stories/entertainment-20000713-013454.html +http://variety.studiostore.com/browse/WHATSNEW/SHIRT/b.FAVORITES%20WHATSNEW/s.GqXR0UHu +http://variety.studiostore.com/browse/WHATSNEW/MUG/b.FAVORITES%20WHATSNEW/s.GqXR0UHu +http://www.ecs.soton.ac.uk/~ecc/teaching/java/ExampleCode/Chapter10/s03/ +http://ftp.nacamar.de/pub/NetBSD/packages/1.4/alpha/cross/?M=A +http://www.he.ctc.org.cn/ctc2/news/internet/develop/news0413-7.htm +http://www.he.ctc.org.cn/ctc2/news/internet/invest/news0523-4.htm +http://www.he.ctc.org.cn/ctc2/news/internet/invest/news0514-1.htm +http://www.he.ctc.org.cn/ctc2/news/internet/politics/news0518-1.htm +http://www.linux.com/networking/network/applications/industry/trade_show/internet/ +http://www.linux.com/networking/network/applications/industry/trade_show/Motorola/ +http://www.linux.com/networking/network/applications/industry/trade_show/distro/ +http://iinet.tukids.tucows.com/mac/5-8/macmulti58_license.html +http://www.leg.wa.gov/pub/rcw%20-%20text/title_48/chapter_098/rcw_48_98_005.txt +http://universal.eud.com/1999/02/28/28304AA.shtml +http://www.firstview.com/WRTWfall97/MAX_MARA/P033.html +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/SOSIAALI-+JA+TERVEYSALA/tietoverkot/suositukset/tietotekniikka/sanat/getdoc.akM?document_id=479 +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/SOSIAALI-+JA+TERVEYSALA/tietoverkot/suositukset/tietotekniikka/sanat/www/ +http://ns.studenti.to.it/~s86852/applets/tetris.htm +http://www.egroups.com/message/grebel-list/1014 +http://emedici.net/www.homesbyavi.com/canadian_site/communities/evergreen/evergreen.html +http://ring.toyama-ix.net/pub/net/wu-ftpd/wu-ftpd/binaries/?N=D +http://ring.nii.ac.jp/archives/text/CTAN/support/vmspell/?N=D +http://ftpsearch.belnet.be/packages/CPAN/modules/by-authors/John_Macdonald/CHECKSUMS +http://students.depaul.edu/~eephrem/piazza123 +http://students.depaul.edu/~eephrem/maqdoomi.html +http://ftp.unina.it/pub/Unix/KDE/stable/2.0/distribution/deb/?D=A +http://www.dulux.co.uk/UKRETAIL:1433075516:DFinity.1QJiP4jMofi7bof +http://yp.gates96.com/14/20/10/26.html +http://yp.gates96.com/14/20/10/34.html +http://yp.gates96.com/14/20/10/63.html +http://yp.gates96.com/14/20/11/36.html +http://yp.gates96.com/14/20/11/73.html +http://yp.gates96.com/14/20/12/93.html +http://yp.gates96.com/14/20/13/42.html +http://yp.gates96.com/14/20/13/44.html +http://yp.gates96.com/14/20/14/9.html +http://yp.gates96.com/14/20/15/62.html +http://yp.gates96.com/14/20/15/77.html +http://yp.gates96.com/14/20/16/52.html +http://yp.gates96.com/14/20/16/70.html +http://yp.gates96.com/14/20/16/83.html +http://yp.gates96.com/14/20/17/91.html +http://yp.gates96.com/14/20/17/98.html +http://yp.gates96.com/14/20/18/8.html +http://yp.gates96.com/14/20/18/73.html +http://yp.gates96.com/14/20/19/38.html +http://yp.gates96.com/14/20/19/42.html +http://yp.gates96.com/14/20/19/56.html +http://www.wco.com/~havok/wellington.html +http://opac.lib.ntnu.edu.tw/search*chi/++ftlist/bbm0019678/7,-1,0,E/frameset&F=bbm0019685&1,1 +http://cdrom.zeelandnet.nl/elfsound/archief.htm +http://businessrecorder.com/story/S0055/S5527/top +http://www.private-immobilien-boerse.de/DominikanischeRep/verkauf/Versteigerungen-IB/Startseite/Gemeinsam/GmbH-Kauf-Verkauf-Insolvenz-konkurs/Startseite/IIM-Teil/Startseite/froben.htm +http://ring.nii.ac.jp/archives/lang/perl/CPAN/doc/manual/html/pod/perlfunc/utime.html +http://yp.gates96.com/14/21/10/71.html +http://yp.gates96.com/14/21/11/15.html +http://yp.gates96.com/14/21/12/55.html +http://yp.gates96.com/14/21/12/58.html +http://yp.gates96.com/14/21/13/94.html +http://yp.gates96.com/14/21/14/7.html +http://yp.gates96.com/14/21/14/12.html +http://yp.gates96.com/14/21/14/32.html +http://yp.gates96.com/14/21/14/96.html +http://yp.gates96.com/14/21/15/3.html +http://yp.gates96.com/14/21/15/51.html +http://yp.gates96.com/14/21/16/32.html +http://yp.gates96.com/14/21/16/87.html +http://yp.gates96.com/14/21/17/19.html +http://yp.gates96.com/14/21/17/31.html +http://yp.gates96.com/14/21/18/15.html +http://yp.gates96.com/14/21/18/68.html +http://yp.gates96.com/14/21/19/56.html +http://cafe2.daum.net/Cafe-bin/Bbs.cgi/kjbugopds/lst/qqa/f/zka/B2-kB2Rt +http://legalminds.lp.findlaw.com/list/courtinterp-spanish/frm04580.html +http://legalminds.lp.findlaw.com/list/courtinterp-spanish/frm04611.html +http://genforum.genealogy.com/cgi-genforum/forums/sweden.cgi?5207 +http://variety.studiostore.com/main/b.FAVORITES%20NOSTALGI%20CLASTV%20ILOVELUCY/s.VfgR3aEr +http://variety.studiostore.com/help/b.FAVORITES%20NOSTALGI%20CLASTV%20ILOVELUCY/s.VfgR3aEr +http://bsd.sinica.edu.tw/cgi-bin/cvsweb.cgi/ports/x11-clocks/xalarm/patches/Attic/patch-aa?only_with_tag=RELEASE_2_2_8 +http://gd.cnread.net/cnread1/ztxs/h/henggouzhengshi/eld/013.htm +http://gd.cnread.net/cnread1/ztxs/h/henggouzhengshi/eld/022.htm +http://gd.cnread.net/cnread1/ztxs/h/henggouzhengshi/eld/024.htm +http://ftp.unina.it/pub/Amiga/NetBSD/NetBSD-current/xsrc/xc/lib/xkbfile/?N=D +http://202.99.23.245/zdxw/17/20000217/200002171734.html +http://sunsite.org.uk/packages/netbsd/NetBSD-current/pkgsrc/net/batchftp/files/ +http://www.highwired.net/Activity/PrintArticle/0,1640,1326-186648,00.html +http://phpbuilder.net/forum/archives/1/2000/10/1/104426?&print_mode=1 +http://www.cognos.co.uk/de/vertriebspartner/vertriebspartner_plz.html +http://citeseer.nj.nec.com/cidcontext/3974259 +http://fi.egroups.com/message/free-classifieds/4556?source=1 +http://genforum.genealogy.com/cgi-genforum/forums/epler.cgi?2 +http://no.egroups.com/post/relations_iVillage?act=reply&messageNum=5 +http://198.103.152.100/search*frc/lHD69+P75H84/lhd+++69+p75+h84/-5,-1,0,E/frameset&F=lhd+++69+p75+k47+1984&1,1 +http://www.4positiveimages.com/4positiveimages/921456486/UserTemplate/2 +http://haha.3322.net/donghua/agui/adi/6.htm +http://mediate.magicbutton.net/do/session/625591/vsid/4573/tid/4573/cid/88043/mid/2247/rid/2383/chid/3527/url/http://www.winesmart.com/CaseDetails.asp?idCase=66 +http://www.lettera.de/tp/deutsch/inhalt/lis/8676/1.html +http://www.citybrazil.com.br/sc/regioes/joinville/expressoes.htm +http://webcvs.kde.org/cgi-bin/cvsweb.cgi/www/food/worse_is_better.html?sortby=date +http://yp.gates96.com/7/45/60/13.html +http://yp.gates96.com/7/45/61/3.html +http://yp.gates96.com/7/45/61/60.html +http://yp.gates96.com/7/45/62/37.html +http://yp.gates96.com/7/45/62/48.html +http://yp.gates96.com/7/45/62/70.html +http://yp.gates96.com/7/45/64/9.html +http://yp.gates96.com/7/45/64/33.html +http://yp.gates96.com/7/45/64/43.html +http://yp.gates96.com/7/45/64/55.html +http://yp.gates96.com/7/45/65/14.html +http://yp.gates96.com/7/45/65/48.html +http://yp.gates96.com/7/45/65/57.html +http://yp.gates96.com/7/45/66/27.html +http://yp.gates96.com/7/45/67/51.html +http://yp.gates96.com/7/45/68/12.html +http://yp.gates96.com/7/45/68/78.html +http://yp.gates96.com/7/45/69/25.html +http://www.msb.malmo.se/search*swe/aHarley,+Robert/aharley+robert/-5,-1,0,B/browse +http://www.superdownloads.com.br/linkinvalido.cfm?ID=748 +http://linuz.sns.it/doc/howto/en/html/AI-Alife-HOWTO-6.html +http://www.linux.com/networking/network/market/tools/applications/ +http://www.linux.com/networking/network/market/tools/frame_relay/ +http://www.linux.com/networking/network/market/tools/e-commerce/ +http://opac.lib.ntnu.edu.tw/search*chi/aUnited+Nations.+Dept.+of+Economic+and+Social+Affairs/aunited+nations+dept+of+economic+and+social+affairs/7,-1,0,B/frameset&F=aunited+nations+economic+and+social+commission+for+asia+and+the+pacific&6,,7 +http://www.affiliate.hpstore.hp.co.uk/do/session/380863/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/assistance/entry.asp +http://www.affiliate.hpstore.hp.co.uk/do/session/380863/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/entry.asp +http://www.shmoo.com/mail/ids/oct99/msg00288.html +http://bsd.sinica.edu.tw/ftp_pub/NetBSD/packages/1.3/hp300/?M=A +http://bsd.sinica.edu.tw/ftp_pub/NetBSD/packages/1.3/hp300/archivers/ +http://www.affiliate.hpstore.hp.co.uk/do/session/380868/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/REGISTRATION/entry.asp +http://www.insideneworleans.com/shared/health/adam/ency/imagepage/1562.000872.html +http://ring.omp.ad.jp/archives/NetBSD/packages/pkgsrc/devel/xxgdb/patches/patch-ac +http://genforum.genealogy.com/casey/messages/327.html +http://genforum.genealogy.com/casey/messages/164.html +http://genforum.genealogy.com/casey/messages/337.html +http://genforum.genealogy.com/casey/messages/73.html +http://genforum.genealogy.com/casey/messages/57.html +http://genforum.genealogy.com/casey/messages/50.html +http://genforum.genealogy.com/casey/messages/23.html +http://genforum.genealogy.com/casey/messages/116.html +http://www.msb.malmo.se/search*swe/aNorman,+Karin,+1947-/anorman+karin+1947/-5,-1,0,B/frameset&F=anorman+leslie&1,1 +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/folderFrame/100001/0/rnumber/9096335 +http://www.mindspring.com/~arachnid/?S=D +http://www6.freeweb.ne.jp/business/n-bns/hre/ +http://news.swww.com.cn/wccdaily/review/200005/29/html/0908.htm +http://tucows.hom.net/croomnt_rating.html +http://www.trax.nilex.co.uk/trax.cgi/A1C/A2S/1AS/A4L/A4D/B1R/ +http://www.trax.nilex.co.uk/trax.cgi/A1C/A2S/1AS/A4L/A4D/A5L/ +http://www.5a8.com/book/kh/zg/zpj/h/heju/001.htm +http://www.5a8.com/book/kh/zg/zpj/h/heju/002.htm +http://www.luckyman.de/computer/hpaccess/java_cgi/java_applet/linien/applet_linien_nav1.htm +http://www.secure-me.net/information/kb/POP +http://in.egroups.com/message/BodybuildingContests/2804 +http://in.egroups.com/message/BodybuildingContests/2820 +http://in.egroups.com/message/BodybuildingContests/2822 +http://theconnection.vnunet.com/Analysis/Stfriend/70206 +http://www.yorosiku.net:8080/-_-http://www.nrcse.washington.edu/newsletter/newsletter.pdf +http://www.britishairways.nl/regional/barbados/docs/spec_world_offer.shtml +http://www.xmwb.sh.cn/xmwb/19981117/BIG5/13421^4111719.htm +http://www.z-plus.de/TEXTE/HOMEPAGE/HILFE/HILFE_SURFTIPS201099/text5.html +http://uzgamez.subportal.com/games/previews/0900/westwood/russian_general.html +http://bsd.sinica.edu.tw/ftp_pub/NetBSD/packages/1.3/sun3/?D=A +http://my.egroups.com/messages/dcfwriters/132?expand=1 +http://my.egroups.com/message/dcfwriters/147 +http://my.egroups.com/message/dcfwriters/149 +http://oss.sgi.com/cgi-bin/cvsweb.cgi/projects/failsafe/FailSafe/failsafe/scripts/?only_with_tag=MAIN +http://sound-dist.secured.co.uk/cgi-bin/psShop.cgi/add|8P007|972959615|Warm===and===Dry|user|0|1,0,0,1 +http://www.alsapresse.com/jdj/00/01/13/MA/photo_6.html +http://www.highwired.net/ESchoolDrive/Frameset/0,5592,13577-52,00.html +http://uk.sports.yahoo.com/000922/59/ak705.html +http://universal.eud.com/1999/02/26/26204DD.shtml +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/ports/audio/gkrellmvolume/pkg-descr?only_with_tag=MAIN +http://www3.skolverket.se/kursinfo/99_00/skolform/21/alt_nav/S_52S_10S_36VAV_SVSTEK_1715.HTML +http://www3.skolverket.se/kursinfo/99_00/skolform/21/alt_nav/S_52S_10S_36VAV_SVSTEK_1719.HTML +http://www.wsrn.com/apps/research/history.xpl?s=CMDCD&f=HISTORY +http://www.wsrn.com/apps/charts/?s=CMDCD&data=Z10 +http://pub3.ezboard.com/utherealcharron.showPublicProfile?language=EN +http://ring.shibaura-it.ac.jp/archives/graphics/gimp/gtk/binary/DEBIAN/stable/?S=A +http://209.52.189.2/discussion.cfm/autism/29762/198522 +http://www.affiliate.hpstore.hp.co.uk/do/session/380851/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/assistance/entry.asp +http://www01.sankei.co.jp/advertising/furusato/tokuhain/9810/1018sindou.html +http://kulichki-mac.rambler.ru/abiturient/ak.htm +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=3,0+9,1-20,0+9,0 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=3,0+9,1-20,0+18,0 +http://ballesta.inrialpes.fr/Infos/Personnes/Christophe.Rippert/ressources/tutorial/security1.2/summary/glossary.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380872/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.france.hp.com/main/respect/ +http://www11.cplaza.ne.jp/babyweb/bbs/bdnmp01/no24/99N.html +http://www.homeway.com.cn/lbi-html/news/zhxw/gatxw/20000922/165807.shtml +http://gd.cnread.net/cnread1/yqxs/d/dingqianrou/ssqj/009.htm +http://library.bangor.ac.uk/search/tBiol.+philos/tbiol+philos/-17,-1,0,B/frameset&F=tbioindicators+and+environmental+management&1,1 +http://dante.bdp.it/cgi-bin/poseidon_v2.0/reflect/poseidon/disc/peacelink-scuola/70630505/view/1 +http://www.indian-express.com/ie/daily/19980626/17750374.html +http://www.indian-express.com/ie/daily/19980626/17751044.html +http://www.indian-express.com/ie/daily/19980626/17751334.html +http://www.indian-express.com/ie/daily/19980626/17751494.html +http://polygraph.ircache.net:8181/services/define/http_-2www.disney.com/links.html +http://pub10.ezboard.com/fsavings4yousavings4you.subscribeUnregisteredToTopic?topicID=56.topic +http://www8.freeweb.ne.jp/shopping/arthome/arthome/menu.html +http://rainforest.parentsplace.com/dialog/get/medinfo/4/1.html?outline=3 +http://www.emerchandise.com/aboutus/b.TV%20SATNIGHTLIVE/s.afJ7iGE2 +http://ring.omp.ad.jp/archives/NetBSD/packages/pkgsrc/net/arpwatch/pkg/?S=A +http://ring.omp.ad.jp/archives/NetBSD/packages/pkgsrc/net/arpwatch/pkg/DESCR +http://210.178.135.1/netbbs/Bbs.cgi/nhic30872/qry/zka/B2-kBI-o/pno/0/qqo/004A/qqatt/^ +http://yp.gates96.com/8/48/0/54.html +http://yp.gates96.com/8/48/1/98.html +http://yp.gates96.com/8/48/2/23.html +http://yp.gates96.com/8/48/3/13.html +http://yp.gates96.com/8/48/3/14.html +http://yp.gates96.com/8/48/3/23.html +http://yp.gates96.com/8/48/3/84.html +http://yp.gates96.com/8/48/4/5.html +http://yp.gates96.com/8/48/4/72.html +http://yp.gates96.com/8/48/5/4.html +http://yp.gates96.com/8/48/5/49.html +http://yp.gates96.com/8/48/6/38.html +http://yp.gates96.com/8/48/6/89.html +http://yp.gates96.com/8/48/8/10.html +http://yp.gates96.com/8/48/8/41.html +http://yp.gates96.com/8/48/8/87.html +http://news.medscape.com/adis/CDI/2000/v19.n02/cdi1902.02.biel/cdi1902.02.biel-01.html +http://www.parsonstech.com/genealogy/trees/PKINGMAN/d2438.htm +http://www.parsonstech.com/genealogy/trees/PKINGMAN/d2502.htm +http://www.chaos.dk/sexriddle/j/c/b/o/ +http://www.outpersonals.com/cgi-bin/w3com/pws/out/FahI8ikSPIvk79ErK106-87Jy3U1_XgCksR4DWkUOldKaD_pciJBXOOmI2Sr4jXlDCT9Mkz59aBZhyyi3xxBeYROt0IpVObKZD4YcwBAhl9afrfb6y3nWI3SwdRE_Vp3d80RzmrDkPVZYQkJyvOgorzS +http://opac.lib.rpi.edu/search/dchemicals+dictionaries/-5,-1,0,E/frameset&dchemicals+catalogs&3,,0 +http://opac.lib.rpi.edu/search/dchemicals+dictionaries/-5,-1,0,E/frameset&dchemicals+catalogs+periodicals&1,1 +http://opac.lib.rpi.edu/search/dchemicals+dictionaries/-5,-1,0,E/frameset&dchemicals+dictionaries&3,,0 +http://opac.lib.rpi.edu/search/dchemicals+dictionaries/-5,-1,0,E/frameset&dchemicals+economic+aspects+united+states&1,,0 +http://www.jsonline.com/news/state/oct00/lambeau31103000a.asp +http://polygraph.ircache.net:8181/used/http_-2www.scubaring.com/http_-2www.alpinehotel.com/chinese/chine.htm +http://www.kaos.dk/sex-riddle/k/a/k/i/p/g/g/e/ +http://haikou.hainan.gov.cn/ghgl/ghsc/hkfg3020.html +http://variety.studiostore.com/main/VARIETY/s.Fz90iGDh +http://library.cuhk.edu.hk/search*chi/cPN595.C6I18+1993/cpn++595+c6+i18+1993/-5,1,1,E/frameset&F=cpn++595+c6+k6+1997&1,1, +http://library.cuhk.edu.hk/search*chi/cPN595.C6I18+1993/cpn++595+c6+i18+1993/-5,1,1,E/frameset&F=cpn++595+c6+l515&1,1, +http://link.fastpartner.com/do/session/600425/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/learn.htm +http://www.nanyang.com.my/20001020/articles/15-10-2000k16.htm +http://202.99.23.245/rmrb/199912/11/newfiles/col_19991211001063_zhxw.html +http://help.sap.com/saphelp_45b/helpdata/en/a7/2872510a6c11d28a220000e829fbbd/frameset.htm +http://www.s10.sexshare.com/~pornking/hardcore/43.html +http://www.gbnf.com/genealogy/Lawler99/html/d0102/I1772.HTM +http://ring.edogawa-u.ac.jp/pub/linux/RedHat/aic/OLD/aic7xxx-5.0.x/boot_disks/5.0.11/SuSE/?D=A +http://www.t-online.de/sport/inhalte/adispi51.htm +http://ftp.lip6.fr/pub11/FreeBSD/development/FreeBSD-CVS/src/kerberos5/usr.sbin/k5stash/ +http://education.legend-net.com/xinwen/gaokao/zl5/zhsh/3/zhshyk.html +http://www.contractorresource.com/Wyoming/Cody/ +http://213.36.119.69/do/session/152998/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/boutique/ +http://213.36.119.69/do/session/153000/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/reserver/hotels.html +http://213.36.119.69/do/session/153000/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www3.travelprice.com/voyages/recherche.phtml +http://ftp.unina.it/pub/TeX/macros/latex/contrib/supported/combine/?D=A +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=237&discrim=178,2,11 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=237&discrim=178,2,233 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=237&discrim=178,2,5 +http://www12.freeweb.ne.jp/novel/urufu24/linkz/ug1.html +http://www12.freeweb.ne.jp/novel/urufu24/linkz/pv.html +http://computers.kharkov.ua/win/43/ +http://www.1001e.net/nk4/022.htm +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=4&discrim=93,164,176 +http://dic.empas.com/show.tsp/?q=revisable&f=B +http://yp.gates96.com/0/28/30/45.html +http://yp.gates96.com/0/28/30/46.html +http://yp.gates96.com/0/28/31/24.html +http://yp.gates96.com/0/28/32/64.html +http://yp.gates96.com/0/28/33/28.html +http://yp.gates96.com/0/28/33/85.html +http://yp.gates96.com/0/28/33/87.html +http://yp.gates96.com/0/28/33/96.html +http://yp.gates96.com/0/28/34/52.html +http://yp.gates96.com/0/28/35/7.html +http://yp.gates96.com/0/28/36/23.html +http://yp.gates96.com/0/28/36/52.html +http://yp.gates96.com/0/28/37/50.html +http://yp.gates96.com/0/28/38/85.html +http://yp.gates96.com/0/28/39/16.html +http://www.fan590.com/JamMoviesReviewsE/earth_king.html +http://www.sportbuecher.de/shop/3-88034-750-6.html +http://www.msb.malmo.se/search*swe/aWhitaker,+Galvin,+Utgivare/awhitaker+galvin/-5,-1,0,B/exact&F=awhitburn+joel&1,2 +http://ftp.sunet.se/pub/security/vendor/microsoft/winnt/frn/nt40/?M=A +http://www.intervoz.com.ar/2000/03/02/op_n04.htm +http://www.ntut.edu.tw/~s7370840/8-19.htm +http://www.back2roots.org/Music/Files/Wondergirl%20-%20You%26Me/ +http://www.private-immobilien-boerse.de/nordrhein-Westfalen/Muehlheim-ruhr/Verkauf/3d-service/IIM-Teil/Startseite/Gemeinsam/Inserieren/IIM-Teil/Startseite/frinfo.htm +http://web.singnet.com.sg/~spirit5/letters/oct2000/frankm1025-3.htm +http://web.singnet.com.sg/~spirit5/letters/oct2000/davidp1025.htm +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=decuplicavamo&l=it +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=decuplichiate&l=it +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=decuplichereste&l=it +http://members.tripod.com/~OZEMU/cgi-bin/ +http://ring.tains.tohoku.ac.jp/archives/pack/dos/hardware/midi/?D=A +http://kutschen.de/Schoner/info-e/info-e/collections/literature/ +http://www.jamba.de/KNet/_KNet-MJJ8j1-DGd-13dgc/showInfo-special1.de/node.0/cde7f1uou +http://www.jamba.de/KNet/_KNet-MJJ8j1-DGd-13dgy/browse.de/node.0/cenv0b09a +http://in.egroups.com/message/sfconsim-l/6415 +http://genforum.genealogy.com/cgi-genforum/forums/vt.cgi?4123 +http://www.linux.com/networking/network/sap/article/price/VA_Linux_Systems/ +http://www.linux.com/networking/network/sap/article/price/regulation/ +http://slacvx.slac.stanford.edu/sldmcwww/mc/MC74BB_98R16B_WIN_ALL.HTML +http://www.xmission.com/~dkenison/cgi/lwgate.cgi/KLR650/archives/v02.n1611/date/article-15.html +http://www.iwon.com/home/movies/movies_filmography_page/0,13178,Macon+McCalman,00.html +http://excite.de/spiele/katalog/26997 +http://www.trax.nilex.co.uk/trax.cgi/A1C/B1S/B2R/A2U/B3S/B1R/ +http://www.power2lead.com/Global/English.nsf/pgWWLocations!OpenPage&ExpandSection=2,6,27,9,26 +http://itcareers.careercast.com/texis/it/itjs/+owwBm1eP0-dzwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewDPwdGpdGwBodDa5dhBiwGna5O5BnManDtoDnnGa5nDodGa5BwhhaidGAanLpnGonDqnaqdMp1BnGamnVncdpaMFqhTfR20Dzme8twwwpBmer+D86e9qwww5rmeZpwwwBrmeZpwww/morelike.html +http://pub4.ezboard.com/fnationoferidinegeneral.showAddReplyScreenFromWeb?topicID=615.topic&index=2 +http://www.chaos.dk/sexriddle/m/i/s/x/ +http://kiasuplanet.subportal.com/sn/Games/Tetris_Clone_Games/5532.html +http://kiasuplanet.subportal.com/sn/Games/Tetris_Clone_Games/11418.html +http://kiasuplanet.subportal.com/sn/Games/Tetris_Clone_Games/676.html +http://www.rge.com/pub/networking/ldap/umich/max500/beta/?M=A +http://my.egroups.com/dir/Health/Fitness/Exercise_Equipment +http://my.egroups.com/messages/prevention +http://pub4.ezboard.com/factiveprodiscussioncommunityactivitiesquestions.showMessage?topicID=12.topic +http://www.look4cranes.com/catalog/AUCTIONRESULT/AGGREGATE+-+CONVEYOR+%2F+FEEDER+%2F+STACKER/POWERSCREEN/ +http://www.fogdog.com/cedroID/ssd3040183344300/cgi-bin/MyFogdog +http://www.fogdog.com/cedroID/ssd3040183344300/nav/products/featured_brands/3b/gloves_mittens/ +http://www.houses-apartment-listings.com/Washington/city_search_criteria.asp?state=WA&City=CONCONULLY +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/c23417.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x12810.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x14250.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x14507.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x15988.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x17214.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x18550.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x19113.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x1949.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x21473.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x31101.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x3585.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x44035.html +http://www.brunel.ac.uk/~ccusjpe/linux/howto/Consultants-HOWTO/x4711.html +http://www.online.kokusai.co.jp/Home/V0043638/wrd/G100/ +http://ftp.lip6.fr/pub5/FreeBSD/branches/-current/ports/print/ghostscript5/ +http://ftp.lip6.fr/pub5/FreeBSD/branches/-current/ports/print/texinfo/ +http://ftpsearch.belnet.be/mirrors/ftp.isc.org/pub/usenet/control/ats/?N=D +http://garbo.uwasa.fi/pub/linux/distributions/SuSE/7.0/dosutils/exceed/USER/HOSTEX/SCHEME/?D=A +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/showNextUnseen/fol/100001/922702 +http://link.fastpartner.com/do/session/600391/vsid/1314/tid/1314/cid/134340/mid/1060/rid/1180/chid/1314/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/local/redirect.php +http://www.jamba.de/KNet/_KNet-wEF8j1-bGd-13cma/showInfo-datenschutz.de/node.0/cenvptf1i +http://www.jamba.de/KNet/_KNet-wEF8j1-bGd-13cmd/browse.de/node.0/cenv0b09a +http://www-usa6.cricket.org/link_to_database/PLAYERS/RSA/T/THOMPSON_DS_03003252/ +http://sunsite.org.uk/public/public/packages/WWW/emacs-w3/?S=A +http://www.excelsior.com.mx/9811/981129/buh25.html +http://www.anixter.nl/SBJEVE/170699-2155-01.html +http://innopac.lib.tsinghua.edu.cn:2082/search*chi/aBrooks,+Jane+B./abrooks+jane+b/-5,-1,0,B/browse +http://tour.stanford.edu/cgi/options.prl/95.70/gMcto +http://www.cksd.edgate.com/emeraldheightses/elections/students/the_parties/ +http://novel.hichinese.net/comment/comment.php?page=2091&action=write +http://205.161.150.96/cgi-bin/c2k/additem.html&item=204578 +http://www.nhic.or.kr/netbbs/Bbs.cgi/nhic31282/qry/zka/B2-kB2-m/pno/0/qqo/004A/qqatt/^ +http://scripts.infoart.ru/magazine/znamia/n4-20/shpakov.htm +http://excite.de/bildung/katalog/19909 +http://911codes.com/games/platform/n64/sect/div/cont/list_cheat/spray/y/id/0000009557/gid/0000003573/_cheats/_walkthroughs/_codes/_pc/_n64/_psx/_gameboy/_playstation/ +http://ftp.jp.debian.org/debian/dists/stable/main/source/web/?M=A +http://www.fogdog.com/cedroID/ssd3040183335913/nav/products/featured_brands/3c/all/ +http://his.luky.org/ML/linux-users.3/msg08073.html +http://yomiuri-1422.excite.co.jp/entertainment/animated_cartoon_comic/each_work_title/ha_line/ha +http://yomiuri-1422.excite.co.jp/entertainment/animated_cartoon_comic/each_work_title/ha_line/hu_he/berserk +http://library.cwu.edu/search/dWorld+War,+1914-1918+--+Diplomatic+history/dworld+war+1914+1918+diplomatic+history/-5,-1,0,B/exact&F=dworld+war+1914+1918+diplomatic+history&1,49 +http://www.utdallas.edu/dept/sci_ed/Caribbean/images/Jennifer%20Jordan/Antigua%20Mangrove/?N=D +http://www.baustoffhandel.de/service/faqs/faq-tapezieren.htm +http://muc-zvs-web1.goethe.de/ms/bud/film/un_f2.htm +http://www.online.kokusai.co.jp/Map/V0043636/wrd/G1000/map/sitemap.html +http://win.www.citycat.ru/funny/fido/2000_05/25.html +http://nathanael.upi.jussieu.fr/tele6.nsf/autres+centres+de+formations!OpenPage&ExpandSection=9,1,7,13,15,6 +http://yp.gates96.com/11/79/50/1.html +http://yp.gates96.com/11/79/50/92.html +http://yp.gates96.com/11/79/52/64.html +http://yp.gates96.com/11/79/54/79.html +http://yp.gates96.com/11/79/54/81.html +http://yp.gates96.com/11/79/56/28.html +http://yp.gates96.com/11/79/56/30.html +http://yp.gates96.com/11/79/56/46.html +http://yp.gates96.com/11/79/56/83.html +http://yp.gates96.com/11/79/57/10.html +http://yp.gates96.com/11/79/57/33.html +http://yp.gates96.com/11/79/58/1.html +http://yp.gates96.com/11/79/58/48.html +http://yp.gates96.com/11/79/58/82.html +http://yp.gates96.com/11/79/59/62.html +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/ELINKEINO-+JA+YRITYSTOIMINTA/Matkailu+-+maantiede/matkailu/linja-autoliikenne/joukkoliikenne/aikataulut/ +http://cn.egroups.com/message/romtrade/3823 +http://www.idgnet.com/idgns/1999/07/16/SmallFrenchBusinessesMoveSlowlyTo.shtml +http://www-d0.fnal.gov/d0dist/dist/releases/psim01.01.00/Exceptions/?M=A +http://www.4positiveimages.com/4positiveimages/781560892/Catalog +http://dellnet.excite.fr/yellow_pages/annuaire/823 +http://ftp.chg.ru/pub/math/grace/MIRRORS +http://ftp.chg.ru/pub/math/grace/aux/ +http://legalminds.lp.findlaw.com/list/lawlibref-l/mail8.html +http://carriage.de/Schoner/modelle/models/Info-d/Sammlungen/ +http://chunma.yeungnam.ac.kr/~j4390214/경기ìƒìŠ¹.htm +http://members.tripod.co.jp/stpp/?M=A +http://map.ipc.co.jp/asp/onmap/connect/f-525598/g-28/ +http://www.fortunecity.com/business/lerner/101/form.html +http://www.sportskorea.net/BBS/Bbs/db/L019/act/new/bnum/000060/zka/6/o/6/drc/f +http://ftp.jp.debian.org/debian/dists/Debian2.2r0/main/binary-all/hamradio/?M=A +http://admin.afiliando.com/do/session/189476/vsid/1507/tid/1507/cid/23455/mid/1025/rid/1168/chid/1205/parser/yes/imref/eqqLmwlGltt5tkpHrYjLXofLklkKZljLkju5lZa5l0/url/http://www.submarino.com.mx/toy/home.asp +http://www.gasex.com/gay.male.erotica/penis.gay.twink.men.html +http://ftpsearch.belnet.be/mirrors/ftp.isc.org/pub/usenet/control/ak/?S=A +http://gb.toget.com.tw/intro/desktop_wallpaper/desktop_wallpaper_idol/20000417_7747_dl.html +http://yp.gates96.com/13/50/50/27.html +http://yp.gates96.com/13/50/52/20.html +http://yp.gates96.com/13/50/52/31.html +http://yp.gates96.com/13/50/52/44.html +http://yp.gates96.com/13/50/53/33.html +http://yp.gates96.com/13/50/53/45.html +http://yp.gates96.com/13/50/53/72.html +http://yp.gates96.com/13/50/54/34.html +http://yp.gates96.com/13/50/54/62.html +http://yp.gates96.com/13/50/54/83.html +http://yp.gates96.com/13/50/54/84.html +http://yp.gates96.com/13/50/55/5.html +http://yp.gates96.com/13/50/55/61.html +http://yp.gates96.com/13/50/55/75.html +http://yp.gates96.com/13/50/56/0.html +http://yp.gates96.com/13/50/56/15.html +http://yp.gates96.com/13/50/56/21.html +http://yp.gates96.com/13/50/56/29.html +http://yp.gates96.com/13/50/57/2.html +http://yp.gates96.com/13/50/57/54.html +http://yp.gates96.com/13/50/58/9.html +http://yp.gates96.com/13/50/58/34.html +http://yp.gates96.com/13/50/59/64.html +http://yp.gates96.com/13/50/59/70.html +http://yp.gates96.com/13/50/59/75.html +http://yp.gates96.com/13/50/59/85.html +http://www.ilmessaggero.it/hermes/19990419/07_MARCHE/40/AGRI.htm +http://www.ilmessaggero.it/hermes/19990419/07_MARCHE/40/NERA.htm +http://amigos.com/cgi-bin/w3com/pws/ffe/IURImAxosglBgN4t3Iz538S9DOsFp6mHl6tpYJehgGibFrnWNcTM3WIsDckFomPqZ-JB8f_Qj8Aua4sE4AFvcFyidtj2iI6k1zPchuFbLwWMCo3hr8eXPNuxbHPQdRvo8J246667 +http://amigos.com/cgi-bin/w3com/pws/ffe/F3hIBiydr9mPRNSqk-dll3MTqIZCaRN3wRH0-H7o4qF0vlfPBXUV-Vhn028iva56e-GCSyYZKBQxuCJO8Y2JF25fVTkPHzFtrNMoOVhEp2n7Y11PhN9pvFNyqgssdZW8Eay0XJsP0vuD4oCbmJVx +http://home.digitalcity.com/boston/sportsguy/main.dci?page=curse2 +http://ftpsearch.belnet.be/mirror/ftp.funet.fi/pub/Linux/doc/logos/.cap/?S=A +http://ftpsearch.belnet.be/mirror/ftp.funet.fi/pub/Linux/doc/logos/.cap/?D=A +http://my.netian.com/~52tour/kyung1.html +http://aol.weather.com/weather/radar/single_site/us_ny_allegany.html +http://www-usa16.cricket.org/link_to_database/GROUNDS/RSA/CENTURION/ +http://polygraph.ircache.net:8181/prodev/career/http_-2www.getstats.com/http_-2www.shindex.com/in_dex/in_dex.html +http://polygraph.ircache.net:8181/prodev/career/http_-2www.getstats.com/http_-2www.microsoft.com/msoffice +http://www.5a8.com/book/wg/cp/p/puge/zhizhunv/005.htm +http://tukids.raha.com/crafts/preview/52044.html +http://tukids.raha.com/crafts/preview/52401.html +http://buc.co.kr/www.ecs.com.tw/ +http://wap.jamba.de/KNet/_KNet-EDS8j1-KHd-13gbq/showInfo-werbung.de/node.0/cde7f1uou +http://www.launch.com/music/songpage/1,4425,322514,00.html +http://www.emerchandise.com/browse/BUFFYTHEVAMP/CAP/b.TV%20BUFFYTHEVAMP/s.NGdTZGLC +http://www.emerchandise.com/browse/BUFFYTHEVAMP/STICKER/b.TV%20BUFFYTHEVAMP/s.NGdTZGLC +http://www.emerchandise.com/help_security/b.TV%20BUFFYTHEVAMP/s.NGdTZGLC +http://yp.gates96.com/14/70/50/9.html +http://yp.gates96.com/14/70/50/23.html +http://yp.gates96.com/14/70/50/24.html +http://yp.gates96.com/14/70/50/40.html +http://yp.gates96.com/14/70/50/47.html +http://yp.gates96.com/14/70/50/79.html +http://yp.gates96.com/14/70/50/89.html +http://yp.gates96.com/14/70/51/83.html +http://yp.gates96.com/14/70/52/98.html +http://yp.gates96.com/14/70/53/46.html +http://yp.gates96.com/14/70/54/4.html +http://yp.gates96.com/14/70/54/24.html +http://yp.gates96.com/14/70/54/97.html +http://yp.gates96.com/14/70/55/51.html +http://yp.gates96.com/14/70/57/51.html +http://yp.gates96.com/14/70/58/3.html +http://yp.gates96.com/14/70/58/84.html +http://yp.gates96.com/14/70/59/0.html +http://opac.lib.ntnu.edu.tw/search*chi/++ftlist/bp20046027/-5,-1,0,B/frameset&F=bp20046031&1,1 +http://www.free-phone.com/q/001p/ppc2/KtIYye9a8Pw.htm +http://www.1stemlm.com/q/001p/ppc2/7kwUxQYfGMk.htm +http://sports.excite.com/ten/grand_german +http://www.omniseek.com/dir/Arts+%26+Humanities/Fine+Arts/Ceramics/Organizations/Australia/ +http://ftp1.service.digital.com/patches/public/vms/axp/v7.1-2/dec-axpvms-vms712_usb-v0100--4.pcsi-dcx_axpexe +http://ftp1.service.digital.com/patches/public/vms/axp/v7.1-2/vms712_acrtl-v0100.README +http://ftp1.service.digital.com/patches/public/vms/axp/v7.1-2/vms712_acrtl-v0100.html +http://ftp1.service.digital.com/patches/public/vms/axp/v7.1-2/vms712_dqconfig-v0200.README +http://ftp1.service.digital.com/patches/public/vms/axp/v7.1-2/vms712_ds20e-v0100.html +http://ftp1.service.digital.com/patches/public/vms/axp/v7.1-2/vms712_shadowing-v0300.CVRLET_TXT +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=barrissait&l=fr +http://dk.egroups.com/message/M-1911/4394 +http://www.netsh.com.cn/wwwboardm/526/messages/2116.html +http://www.netsh.com.cn/wwwboardm/526/messages/2270.html +http://www.netsh.com.cn/wwwboardm/526/messages/773.html +http://www.netsh.com.cn/wwwboardm/526/messages/2058.html +http://www.netsh.com.cn/wwwboardm/526/messages/2329.html +http://www.netsh.com.cn/wwwboardm/526/messages/1813.html +http://linux.softhouse.com.cn/linux/knowledge/tech/HOWTO/Java-CGI-HOWTO-7.html +http://news.novgorod.ru/news/2000/9/22/2/12 +http://news.novgorod.ru/news/2000/9/24/2/12 +http://homepage1.nifty.com/sigenyan/nikki9.htm +http://perso.club-internet.fr/guige/ncpc78.htm +http://www.vr-homes.com/usa/California/Cities/Victorville/Travel/Maps_Images/ +http://www.incestpornstories.com/cum-sex-pics/underagecoed/spankingsweating/hardendurance.html +http://www.freeforums.com/forums/Hardball/000008-000007.asp +http://www.freeforums.com/forums/Hardball/000005-000001.asp +http://www.freeforums.com/forums/Hardball/000004-000001.asp +http://rex.skyline.net/html/Internet_Chat_Sites.html?315,computers,video,internet,computers +http://rex.skyline.net/html/Computers_-_Hardware.html?14,computers,video,internet,computers +http://194.128.65.4/pa/cm199899/cmhansrd/vo990216/text/90216w20.htm +http://pub14.ezboard.com/fyamguyskoflastblade.showMessage?topicID=3.topic +http://plant.reedexpo.ca/www.partnership.ca/?S=A +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=168&discrim=109,5,168 +http://www.aelita.net/products/~archive/Download_redirect/solutions/solutions/services/products/default.htm +http://www.jpc-music.com/7041801.htm +http://home.c2i.net/entreprenor/java/ra.html +http://gxschool.beelink.com.cn/mid_edu/midschool/geography3/t4cd7z/4d7z3.3_1.htm +http://ricoh.co.jp/SHOGI/emate/basic/mate3003a.html +http://www.diogenes.ch/4DACTION/web_rd_aut_frlist_az/ID=483385&chr=K +http://www.ebigchina.com/msg_post.phtml?cu=1003 +http://www.bemi-immobilien.de/allgemeine-ib/startseite/Gemeinsam/erreichenPartner/Gemeinsam/versicherungen/lebensversicherung/Gemeinsam/immolink/Gemeinsam/MarketingStrategie/Gemeinsam/Inserieren/onlineInserieren.htm +http://ftp.tku.edu.tw/OS/Linux/distributions/RedHat/rawhide/i386/doc/rhinst/stylesheet-images/?S=A +http://www.egroups.com/message/kicken/284 +http://www.guangmingdaily.com.cn/0_gm/1999/12/19991222/big5/gm^18278^2^GM2-2216.htm +http://brightnet.pda.tucows.com/www.psionsite.rcsed.ac.uk/ +http://www.symatrixinc.com/website/website.nsf/0/3e40df86fb357cd5882568720079613f!OpenDocument&ExpandSection=9,22,1,11 +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=durereste&l=it +http://click-to.tell-a-friend.boardhost.com/tell-a-friend-confirm.cgi?ylihilseen&msg=25 +http://www.gbgm-umc.org/EllisvilleMO/10-04-00.pdf +http://www.marketingtool.com/contribute/webfirm/b.435.r.2626.g.4134.html +http://www.chaos.dk/sexriddle/h/a/w/l/ +http://www.chaos.dk/sexriddle/h/a/w/t/ +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=3,0+9,5-0,3+( +http://www.guba.net/101/136/125E/index-4.phtml +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=3,0+9,5-0,3+21,0 +http://www.guba.net/101/136/125E/index-7.phtml +http://www.guba.net/101/136/125E/index-15.phtml +http://ftpsearch.belnet.be/ftp/mirror2/ftp.cert.dfn.de/pub/vendor/sun/security-alert/security-alert-108.txt +http://ftpsearch.belnet.be/ftp/mirror2/ftp.cert.dfn.de/pub/vendor/sun/security-alert/security-alert-170.txt +http://www.tente.de/us/produkte/rubriksuche/ad000000699.htm +http://www.angelfire.com/ky/kysweetpea/ +http://yp.gates96.com/7/69/60/1.html +http://www.amulation.com/md-l-archive/199908/frm00208.html +http://yp.gates96.com/7/69/60/4.html +http://yp.gates96.com/7/69/60/33.html +http://yp.gates96.com/7/69/60/49.html +http://yp.gates96.com/7/69/60/71.html +http://nanjingnews.jlonline.com/nanjingnews/njrb/20000226/04tiyu.htm +http://yp.gates96.com/7/69/61/44.html +http://yp.gates96.com/7/69/61/69.html +http://yp.gates96.com/7/69/61/82.html +http://yp.gates96.com/7/69/61/85.html +http://yp.gates96.com/7/69/62/4.html +http://yp.gates96.com/7/69/63/34.html +http://yp.gates96.com/7/69/63/48.html +http://yp.gates96.com/7/69/63/66.html +http://yp.gates96.com/7/69/64/22.html +http://www.bemi-immobilien.de/IIM-Teil/Startseite/Gemeinsam/MarketingStrategie/Gemeinsam/Inserieren/Startseite/Gemeinsam/versicherungen/unfall/Gemeinsam/3d-service/info.htm +http://yp.gates96.com/7/69/64/26.html +http://yp.gates96.com/7/69/65/89.html +http://yp.gates96.com/7/69/67/11.html +http://yp.gates96.com/7/69/67/28.html +http://yp.gates96.com/7/69/67/33.html +http://yp.gates96.com/7/69/67/70.html +http://yp.gates96.com/7/69/68/22.html +http://yp.gates96.com/7/69/68/72.html +http://yp.gates96.com/7/69/68/92.html +http://members.tripod.com/~katenleo/fading21.html +http://yp.gates96.com/7/69/69/6.html +http://members.tripod.com/~katenleo/fading26.html +http://yp.gates96.com/7/69/69/36.html +http://yp.gates96.com/7/69/69/91.html +http://yp.gates96.com/7/69/69/98.html +http://www.tribuneindia.com/98oct11/head1.htm +http://fi.egroups.com/message/internet-sig-announce/3 +http://info.verwaltung.uni-freiburg.de/doc/susehilf/pak/paket_inhalt_libxml.html +http://www.planetweb.com/cgi-bin/listmanager.pl/NETLINK-CUST/archives/1998Mar30-Apr05.archive/Date/article-23.html +http://www.maasvlakte-cam.nl/webcams/11/katowice__poland/2000/06/13/ +http://www.eveclub.com/cgi-bin/eveclub.front/972959521459/Home +http://totalsports.aol.com/stats/bbo/int/20000413/nor.at.lou.box.html +http://totalsports.aol.com/stats/bbo/int/20000413/ott.at.buf.game.html +http://fi.egroups.com/message/stccg-badlands/67 +http://www.fogdog.com/cedroID/ssd3040183315704/nav/stores/books_videos/ +http://xf-bbs.hb.cninfo.net/~socrates/sportold/images/football/_vti_cnf/ +http://cisc.tu-graz.ac.at/igi/lehre/semD_ss99/gruppe3/node10.html +http://in.egroups.com/message/sfconsim-l/8643 +http://ftp.cc.chuo-u.ac.jp/home/pub/lang/perl/CPAN/modules/by-authors/Karl_Glazebrook/ExtUtils-F77-1.13.readme +http://ftp.cc.chuo-u.ac.jp/home/pub/lang/perl/CPAN/modules/by-authors/Karl_Glazebrook/PGPLOT-2.17.readme +http://coe.ier.hit-u.ac.jp/BibEc/data/Papers/wopwobaiu2243.html +http://coe.ier.hit-u.ac.jp/BibEc/data/Papers/wopwobaiu2386.html +http://books.hyperlink.co.uk/bookinfo/Travel_Journal/0864427972 +http://dbc.copystar.com.tw/DelphiChat/200001/msg0650.htm +http://dbc.copystar.com.tw/DelphiChat/200001/msg0655.htm +http://dbc.copystar.com.tw/DelphiChat/200001/msg0666.htm +http://dbc.copystar.com.tw/DelphiChat/200001/msg0673.htm +http://dbc.copystar.com.tw/DelphiChat/200001/msg0681.htm +http://dbc.copystar.com.tw/DelphiChat/200001/msg0692.htm +http://www.expage.com/page/cavypigsponser +http://kernel2.adver.com.tw/Counter/log/kernel2.adver.com.tw/SaveCounter/2000-10-05/13/?S=A +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=210&discrim=214,253 +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=2&discrim=247,212,237 +http://wwwtios.cs.utwente.nl/archive/wilyfans/frm01740.html +http://z-06.land-sbg.gv.at/pressebuero/lpb/unserland/apr00/3.htm +http://z-06.land-sbg.gv.at/pressebuero/lpb/unserland/apr00/52.htm +http://gladstone.uoregon.edu/~sola/Stories/ +http://adetti.iscte.pt/RSI/HowTo/Java/jdk1.2.1/docs/guide/2d/api-jpeg/serialized-form.html +http://ocean.ntou.edu.tw/search*chi/aSloan,+Richard+P.,+jt.+ed./asloan+richard+p/-5,-1,0,E/frameset&F=asloan+irving+j&2,,0 +http://ttzcomputers.subportal.com/sn/Programming/C_and_C___Tools_and_Components/13286.html +http://ttzcomputers.subportal.com/sn/Programming/C_and_C___Tools_and_Components/1551.html +http://ftp.uni-stuttgart.de/pub/unix/tools/system/top/m/?N=D +http://no.egroups.com/message/romtrade/5216 +http://dk.egroups.com/message/Gunsmithing/80 +http://www.msb.malmo.se/search*swe/dMichelsen,+Hans/dmichelsen+hans/-5,-1,0,B/frameset&F=dmichels+robert&1,1 +http://solar.rtd.utk.edu/friends/news/omri/1998/05/980506I.html(opt,mozilla,pc,russian,koi8,default) +http://www.geocities.co.jp/HeartLand/6163/link8.htm +http://tucows.austria.com/sync95_size.html +http://tucows.austria.com/adnload/1082_30337.html +http://www.hotelboulevard.com/fr/paris/standard/html7752b1d358fd6459ebca66776e896614/sessionLang/ANG/prov/browse/cp/75015/resultatSearch.html +http://210.178.135.1/netbbs/Bbs.cgi/nhic30872/qry/zka/B2-kB2-o/pno/0/qqo/000A/qqatt/^ +http://210.178.135.1/netbbs/Bbs.cgi/nhic30872/new/pno/0/pno/0/qqo/000A +http://cometweb01.comet.co.uk/do!tid=20&rtid=2&vsid=700&session=132041&mid=1000&rid=1060&cid=37030&chid=1713&url=eqqLmwlGltt5tkZHljbLqkZHlkrHhlZHdfjKYfkLlkZ5ljjLboZLbplG5ubLZDXLZolLl3l5jbqLlci5XqVLkXsLkao4tloHbmlLoq5 +http://polygraph.ircache.net:8181/http_-2www.webtechs.com/html-val-svc/f-agents.html +http://www.linux.com/networking/network/development/communications/server/distro/ +http://www.linux.com/networking/network/development/communications/server/competition/ +http://www.linux.com/networking/network/development/communications/server/certification/ +http://www.linux.com/networking/network/development/communications/server/future/ +http://www.linux.com/networking/network/development/communications/server/Updates/ +http://people.freebsd.org/~knu/cgi-bin/cvsweb.cgi/ports/net/epic4/pkg/Attic/ +http://polygraph.ircache.net:8181/mo/mo_links/http_-2www.whowhere.com/tax_cuts.html +http://www.gov.ie/iveagh/angloirish/bloodysunday/summary4.htm +http://polygraph.ircache.net:8181/http_-2www.real-e-video.com/ftp_-2ftp.mpgn.com/Gaming/ADND/Worlds/BirthRight/MailingListArchive/Contents.htm +http://www.centc251.org/forums/aca-1/dispatch.cgi/isowg4/showNextUnseen/fol/100001/1323398 +http://www.centc251.org/forums/aca-1/dispatch.cgi/isowg4/folderFrame/100008/0/def/1323639 +http://user.alpha.co.kr/~selly/profile/main2.htm +http://polygraph.ircache.net:8181/company/http_-2www.aaainvestments.com/http_-2triad.cyberserv.com/http_-2207.90.134.3/miami/ +http://ring.htcn.ne.jp/pub/FreeBSD/FreeBSD-current/ports/archivers/zip/ +http://www.medoc-ias.u-psud.fr:81/synoptic/gif/950902/?S=A +http://in.egroups.com/message/GQRP/975 +http://idgnow.uol.com.br/idgnow/pcnews/2000/07/0046 +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/kdebase/po/Attic/kdmconfig.pot?only_with_tag=beta1-0_2 +http://us.mandrakesoft.com/cgi-bin/cvsweb.cgi/kdebase/po/Attic/kwm.pot?only_with_tag=beta1-0_2 +http://lists.omnipotent.net/mysql/199912/msg02189.html +http://kyoto.cool.ne.jp/ryou_1125/lmax/list2.html +http://www.infodog.com/RESULTS/1998092302/1998092302800.HTM +http://www.infodog.com/RESULTS/1998092302/1998092302575.HTM +http://bedandbreakfast.com/bbc/p618230.asp +http://solaris.license.virginia.edu/os_product_patches/patches/5.5.1/103640-28/SUNWscpu/ +http://www.secinfo.com/d1Z36p.5n.htm +http://cn.egroups.com/messages/conscious_creation/2087 +http://www.brio.de/BRIO.catalog/39fdb4fb08541c02273fd472aa7806a2/UserTemplate/13 +http://www.chaos.dk/sexriddle/o/m/e/z/ +http://cgi.tbs.co.jp/cdtv/songdb/song1897-j.html +http://www.niwl.se/wais/new/12/12116.htm +http://bsdweb.pasta.cs.uit.no/bsdweb.cgi/~checkout~/pkgsrc/editors/vim-xaw/pkg/?sortby=log +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=boguerait&l=fr +http://www.medbulletin.com/scripts/medscape/jobsbystate.pl/diima00001/ND +http://ttz.soyou.edu.cn/tgyd/item/2000-05-31/3214.html +http://ttz.soyou.edu.cn/tgyd/item/2000-05-25/2973.html +http://ttz.soyou.edu.cn/tgyd/item/2000-05-23/2825.html +http://javatest.a-net.nl/servlet/pedit.Main/http://salon.com/tech/feature/2000/02/25/chatscan/ +http://javatest.a-net.nl/servlet/pedit.Main/http://www.wired.com/news/news/technology/story/20734.html +http://www.jps.net/fehlberg/diem9.html +http://chellobe.linux.tucows.com/x11html/adnload/9798_3876.html +http://chellobe.linux.tucows.com/x11html/preview/58190.html +http://internet.exit.de/akpolitik/Extern.htm +http://www.launch.com/music/albumpage/pvn_content/0,5258,163242_track,00.html +http://merumo.ne.jp/backno/i/00005163/20001001060103_024859.html +http://ftpsearch.belnet.be/mirrors/ftp.isc.org/pub/usenet/control/bc/?N=D +http://www-lehre.inf.uos.de/manuals/jdk1.2/docs/api/javax/swing/text/html/parser/class-use/Element.html +http://ftp.tku.edu.tw/OS/FreeBSD/ports/biology/deft/distinfo +http://javatest.a-net.nl/servlet/pedit.Main/http://www.cavejunction.com/phones/gower1.html +http://javatest.a-net.nl/servlet/pedit.Main/http://www.cavejunction.com/phones/contel1.html +http://www.allkorea.co.jp/cgi-bin/allkorea.front/972959966349/Catalog/1000002 +http://yp.gates96.com/5/82/41/1.html +http://yp.gates96.com/5/82/41/52.html +http://yp.gates96.com/5/82/41/59.html +http://yp.gates96.com/5/82/42/40.html +http://yp.gates96.com/5/82/42/73.html +http://yp.gates96.com/5/82/43/4.html +http://yp.gates96.com/5/82/43/20.html +http://yp.gates96.com/5/82/44/60.html +http://yp.gates96.com/5/82/44/95.html +http://yp.gates96.com/5/82/45/36.html +http://yp.gates96.com/5/82/45/43.html +http://yp.gates96.com/5/82/45/90.html +http://yp.gates96.com/5/82/46/37.html +http://yp.gates96.com/5/82/46/83.html +http://yp.gates96.com/5/82/47/22.html +http://yp.gates96.com/5/82/47/53.html +http://yp.gates96.com/5/82/48/8.html +http://yp.gates96.com/5/82/48/23.html +http://yp.gates96.com/5/82/48/41.html +http://yp.gates96.com/5/82/48/76.html +http://yp.gates96.com/5/82/49/5.html +http://yp.gates96.com/5/82/49/22.html +http://yp.gates96.com/5/82/49/37.html +http://yp.gates96.com/5/82/49/39.html +http://yp.gates96.com/5/82/49/65.html +http://yp.gates96.com/5/82/49/90.html +http://www.mirror.kiev.ua:8084/paper/1998/35/1251/power.htm +http://www.science.uva.nl/pub/NetBSD/NetBSD-current/pkgsrc/textproc/html/Makefile +http://www.fiss.at/1Root/Kontinent/6/Staat/7/Bundesland/16/Ort/708/Infrastruktur/7435/Homepage/homepage...1.html +http://linux.tnc.edu.tw/CPAN/authors/id/C/CH/CHOGAN/Apache-SetWWWTheme-1.02.readme +http://linux.tnc.edu.tw/CPAN/authors/id/C/CH/CHOGAN/Apache-SetWWWTheme-1.04.readme +http://linux.tnc.edu.tw/CPAN/authors/id/C/CH/CHOGAN/Apache-SetWWWTheme-1.05.readme +http://wufs.wustl.edu/vlander/vl_0002/browse/html/B0XX/22b090b4.htm +http://www.dnet.org/My_Locality/View_Statement.dnet/OH/43230-1863&SubjectItemID=6406&IssueID=47541&ElectionActivityID=4443&SubjectHolder=3462&type=Office&debate=yes +http://members.tripod.co.jp/suguruE/_private/ +http://members.tripod.lycos.nl/Kreeklaan/id19_cf.htm +http://forums.multimania.fr/general/login/login.phtml?_login=%2Flire%2Fjeuxvideospro%2Findex.phtml%3Fcollapse%3D1 +http://excite.de.netscape.com/jobs/katalog/30434 +http://excite.de.netscape.com/jobs/katalog/27370 +http://excite.de.netscape.com/jobs/katalog/127 +http://yp.gates96.com/2/54/20/79.html +http://yp.gates96.com/2/54/21/27.html +http://yp.gates96.com/2/54/22/14.html +http://yp.gates96.com/2/54/22/48.html +http://yp.gates96.com/2/54/22/78.html +http://yp.gates96.com/2/54/23/20.html +http://yp.gates96.com/2/54/23/62.html +http://yp.gates96.com/2/54/23/69.html +http://yp.gates96.com/2/54/24/1.html +http://yp.gates96.com/2/54/24/61.html +http://yp.gates96.com/2/54/24/95.html +http://yp.gates96.com/2/54/25/2.html +http://yp.gates96.com/2/54/25/16.html +http://yp.gates96.com/2/54/25/53.html +http://yp.gates96.com/2/54/25/67.html +http://yp.gates96.com/2/54/25/94.html +http://yp.gates96.com/2/54/26/3.html +http://yp.gates96.com/2/54/26/30.html +http://yp.gates96.com/2/54/26/65.html +http://yp.gates96.com/2/54/27/31.html +http://yp.gates96.com/2/54/27/41.html +http://yp.gates96.com/2/54/27/53.html +http://yp.gates96.com/2/54/27/71.html +http://yp.gates96.com/2/54/27/79.html +http://yp.gates96.com/2/54/27/80.html +http://yp.gates96.com/2/54/28/13.html +http://yp.gates96.com/2/54/28/14.html +http://yp.gates96.com/2/54/28/24.html +http://yp.gates96.com/2/54/28/34.html +http://yp.gates96.com/2/54/28/96.html +http://yp.gates96.com/2/54/29/49.html +http://ftp.sunet.se/pub/NT/mirror-microsoft/KB/Q134/3/40.TXT +http://members.tripod.com/joellogan/_cranedisc/000001d9.htm +http://members.tripod.com/joellogan/_cranedisc/000001cd.htm +http://www.ualberta.ca/CNS/RESEARCH/Software/SAS/vms/z-inf-zd.htm +http://www1.galaxy.com/galaxy/Leisure-and-Recreation/Games/Computer-Games/Titles/Virtual-Reality/Golf.html +http://www1.galaxy.com/galaxy/Leisure-and-Recreation/Games/Computer-Games/Titles/Virtual-Reality/Red-Planet.html +http://www.uni-duesseldorf.de/ftp/ftp/software/opt/zlib-1.1.2/?N=D +http://acbanks.know-where.com/acbanks/cgi/selection?place=Cavecreek&state=AZ +http://yp.gates96.com/10/26/70/49.html +http://yp.gates96.com/10/26/70/83.html +http://yp.gates96.com/10/26/72/40.html +http://yp.gates96.com/10/26/74/89.html +http://yp.gates96.com/10/26/75/15.html +http://yp.gates96.com/10/26/75/19.html +http://yp.gates96.com/10/26/76/87.html +http://yp.gates96.com/10/26/78/18.html +http://yp.gates96.com/10/26/78/76.html +http://yp.gates96.com/10/26/78/78.html +http://yp.gates96.com/10/26/78/81.html +http://cpan.nitco.com/modules/by-module/Devel/ADESC/Pod-DocBook-0.03.readme +http://www2.el-mundo.es/nuevaeconomia/2000/NE047/NE047-03b.html +http://www.familyeducation.com/whatworks/inappr_material/entry/1,2549,1-10119-1948-3469,00.html +http://ftp.nodomainname.net/pub/linux/daemons/raid/beta/ +http://192.80.57.161/corp/press/vannet.html +http://digilander.iol.it/mirkodeli/Stagioni/CI6_index.html +http://www.world-of-webs.de/magdeburg-in-bildern/_inhalt/_statnif/rechts/035.htm +http://ftpsearch.belnet.be/mirrors/src.doc.ic.ac.uk/usenet/usenet-by-hierarchy/rec/travel/?D=A +http://mirrortucows.technet.it/winme/netmiscme_rating.html +http://my.egroups.com/message/imperiumlarp/3148 +http://ep.com/js/about/c7857/b0/34551.html +http://webcrawler-sports.excite.com/ncaab/matchup/pafmax/ +http://www2.dbusiness.com/Quotes/1,1125,MSP_CORE,00.html?Ticker=CORE +http://tucows.wlink.com.np/regist95_size.html +http://www.babyheirlooms.com/catalog/htmlos.cat/041162.1.5960744054 +http://www.v2music.com/Scripts/WebObjects-ISAPI.dll/V2_New_Publisher.woa/71113000008423000000947720000021551/Labels.wo/168310000011551/1.0.1/3/Webobjects1 +http://www.v2music.com/Scripts/WebObjects-ISAPI.dll/V2_New_Publisher.woa/71113000008423000000947720000021551/Labels.wo/168310000011551/1.1.3.0.0/3/Webobjects1 +http://www.adcentral.com/cgi-bin/w3com/pws/adsites/vNhIXgVh_sji0rjcKc_GbuSlgBaEnCmKXU4ARmeefaqktCE3zwLsoXKDK_dlzoBzk2Ygr2cAuqN51PKOA0JxjzLEpPe-kic9TtvUJMbXG9Dlw8SggmHugQpwzjo-NiuofbUz4obq +http://ring.omp.ad.jp/archives/NetBSD/NetBSD-current/src/distrib/i386/floppies/ramdisk-big/Makefile +http://unofficial.capital.edu/students/alittle/ +http://213.36.119.69/do/session/153005/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/reserver/promotions/promo9.html +http://213.36.119.69/do/session/153005/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/GB_EN/ +http://www.riello-hamburg.de/mSerieRSBLU_130_465kw.htm +http://tucows.knoware.nl/winnt/filesplitnt_license.html +http://www.kaos.dk/sex-riddle/k/a/k/i/n/h/b/b/ +http://www.kaos.dk/sex-riddle/k/a/k/i/n/h/b/c/ +http://caller-times.com/1999/july/13/today/national/3143.html +http://news.fm365.com/jiaoyu/20000804/113896.htm +http://variety.studiostore.com/browse/ILOVELUCY/CAP/b.FAVORITES%20NOSTALGI%20CLASTV%20ILOVELUCY/s.qyPsT2fz +http://www.ferien-immobilien.de/bayern/ingolstadt/Verkauf/Gemeinsam/Immolink/3d-service/Private-IB/Startseite/Gemeinsam/vertriebspartner.htm +http://jefferson.village.virginia.edu/wax/japanese/0front/cd/1/1a2a9a2.html +http://space.tin.it/scuola/ermenegh/thewall/il2.htm +http://www.maasvlakte-cam.nl/webcams/17/kremlin__moscou__russia/2000/02/29/?D=A +http://pub17.ezboard.com/fecilordsoflightgeneral.showMessage?topicID=211.topic +http://pub17.ezboard.com/fecilordsoflightgeneral.showMessage?topicID=214.topic +http://pub17.ezboard.com/fecilordsoflightgeneral.showMessage?topicID=210.topic +http://www.kaos.dk/sexriddle/x/u/e/s/p/ +http://www.kaos.dk/sexriddle/x/u/e/s/q/ +http://amc.hollywood.com/maltin/k/kellysheroes-1970.htm +http://amc.hollywood.com/maltin/k/kidsarealrightthe-1979.htm +http://amc.hollywood.com/maltin/k/killingofsistergeorgethe-1968.htm +http://amc.hollywood.com/maltin/k/kingandcountry-1964.htm +http://amc.hollywood.com/maltin/k/kinglear-1987.htm +http://amc.hollywood.com/maltin/k/kingofthezombies-1941.htm +http://amc.hollywood.com/maltin/k/kingqueenknave-1972.htm +http://amc.hollywood.com/maltin/k/kissthe-1988.htm +http://www.egroups.com/login.cgi?login_target=%2Fgroup%2Ft-ida +http://polygraph.ircache.net:8181/faculty/http_-2www.stopwaste.org/freecontent.html +http://kutschen.de/Schoner/literature/Literatur/models/collections/ +http://www.incestpornstories.com/cum-sex-pics/anal-sexone-night-stand/big-bonedpleasantly-plump/smallwomen/{hardcorelink} +http://www.nytimes.com/library/financial/102897market-turmoil.html +http://polygraph.ircache.net:8181/services/define/http_-2www.microsoft.com/ie/http_-2www.ci.alameda.ca.us/main_left.html +http://polygraph.ircache.net:8181/services/define/http_-2www.microsoft.com/ie/http_-2www.ci.alameda.ca.us/dream.htm +http://www.chiayi.gob.tw/ +http://www.maas.ccr.it/cgi-win/hiweb.exe/a17/d77/b77,c,4d,51,51,df1,df1,,4e,2b62,4d,4e,2b62,, +http://citeseer.nj.nec.com/cidcontext/6361 +http://citeseer.nj.nec.com/cidcontext/6456 +http://utenti.tripod.it/Psychozine/Grunge/Creed_MyOwnPrison.htm +http://tucows.multiweb.net/winme/adnload/138210_30315.html +http://tucows.multiweb.net/winme/adnload/138190_29551.html +http://tucows.multiweb.net/winme/adnload/138218_29576.html +http://tucows.multiweb.net/winme/preview/138219.html +http://playsky.home.chinaren.com/star_region/11.htm +http://tucows.phnet.fi/winme/adnload/137614_29054.html +http://www.fortunecity.com/millennium/blyton/118/www.bih.net.ba/~sda +http://www11.informatik.tu-muenchen.de/lehre/lectures/ws2000-01/hypermedia/extension/html-kurz/hm2.2.4.2-navigation.html +http://ads.puntopartenza.com/cgi-bin/redirect.cgi/31033737 +http://www.eud.com/1997/03/20/20324A.shtml +http://ftp.net.uni-c.dk/pub/linux/mandrake/i586/Mandrake/mdkinst/usr/share/locale/gl/?N=D +http://no.sport.yahoo.com/s/snowboard-1.html +http://www.egroups.com/login.cgi?login_target=%2Fmessages%2Fshamanism%2F1311 +http://yp.gates96.com/5/82/70/13.html +http://yp.gates96.com/5/82/70/74.html +http://yp.gates96.com/5/82/71/30.html +http://yp.gates96.com/5/82/71/44.html +http://yp.gates96.com/5/82/72/22.html +http://yp.gates96.com/5/82/72/72.html +http://yp.gates96.com/5/82/72/88.html +http://yp.gates96.com/5/82/73/60.html +http://yp.gates96.com/5/82/73/79.html +http://yp.gates96.com/5/82/74/21.html +http://yp.gates96.com/5/82/74/59.html +http://yp.gates96.com/5/82/74/62.html +http://yp.gates96.com/5/82/74/75.html +http://yp.gates96.com/5/82/74/78.html +http://yp.gates96.com/5/82/75/30.html +http://yp.gates96.com/5/82/75/32.html +http://yp.gates96.com/5/82/75/82.html +http://yp.gates96.com/5/82/76/16.html +http://yp.gates96.com/5/82/76/43.html +http://yp.gates96.com/5/82/76/72.html +http://yp.gates96.com/5/82/77/48.html +http://yp.gates96.com/5/82/77/99.html +http://yp.gates96.com/5/82/78/73.html +http://yp.gates96.com/5/82/79/28.html +http://yp.gates96.com/5/82/79/70.html +http://yp.gates96.com/5/82/79/83.html +http://polygraph.ircache.net:8181/http_-2www.microsoft.com/ie/http_-2www.petrophysics.com/http_-2www.uio.no/~thomas/lists/info.html +http://www.munster-express.ie/000623/sports1.htm +http://cisne.sim.ucm.es/search*spi/aThiollier,+François-Joël,+int./athiollier+francois+joel+int/-5,-1,0,B/marc&F=athion+soriano+molla+dolores&2,,2 +http://www.zjdaily.com.cn/gb/2000/10/05/zjrb0625/guoji/6.htm +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceStoreCategories-BBC70A38_9815_E7A26CDF19A4AB167DD4B69EFB5B17FC +http://commerce.was-inc.com/cgi-bin/abtwsam.dll/LbkWebCommerceUserProfile-BBC70A38_9815_E7A26CDF19A4AB167DD4B69EFB5B17FC +http://www.shopworks.com/tools/index.cfm/action/search/userid/0003875B-2E5B-19FE-AF65010C0A0A8CF2 +http://www.doofpot.nl/~lists/bugtraq/October-99/frm00087.html +http://shop.citde.net/b79923.htm +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=divinizzarono&l=it +http://pub8.ezboard.com/fwrestlecarwwf.showAddReplyScreenFromWeb?topicID=38.topic +http://amrr.com/agents/contact.html?Agents_id=4046 +http://www.intellicast.com/LocalWeather/World/UnitedStates/Southeast/NorthCarolina/CarolinaBeach/RAINcast/d1_12/bannerAd.shtml +http://www.ferien-immobilien.de/schleswig-holstein/nordfriesland/Verkauf/Gemeinsam/versicherungen/gebaeude/Allgemeine-IB/IIM-Teil/Startseite/Gemeinsam/Inserieren/inserieren.htm +http://www.ferien-immobilien.de/schleswig-holstein/nordfriesland/Verkauf/Gemeinsam/versicherungen/gebaeude/Allgemeine-IB/IIM-Teil/Startseite/Gemeinsam/feedback.html +http://de.excite.com/jobs/katalog/10349 +http://pub16.ezboard.com/frealitycheck95307youadoreus.showAddReplyScreenFromWeb?topicID=33.topic +http://www.maas.ccr.it/cgi-win/hiweb.exe/a17/d2424/b77,e,4d,51,51,df1,df1,,978,,51,978,815,,51,815, +http://dk.egroups.com/message/noholdsbarred/2138 +http://kr.news.yahoo.com/headlines/so/20001029/hankook/2000102919513187338.html +http://www.buybuddy.com/sleuth/27/1/11002/508910/ +http://yp.gates96.com/13/95/50/10.html +http://yp.gates96.com/13/95/50/47.html +http://yp.gates96.com/13/95/51/16.html +http://yp.gates96.com/13/95/51/17.html +http://yp.gates96.com/13/95/51/21.html +http://yp.gates96.com/13/95/51/76.html +http://yp.gates96.com/13/95/53/5.html +http://yp.gates96.com/13/95/54/17.html +http://yp.gates96.com/13/95/54/44.html +http://yp.gates96.com/13/95/54/67.html +http://yp.gates96.com/13/95/54/80.html +http://yp.gates96.com/13/95/55/67.html +http://yp.gates96.com/13/95/56/15.html +http://yp.gates96.com/13/95/56/91.html +http://yp.gates96.com/13/95/57/9.html +http://yp.gates96.com/13/95/57/12.html +http://yp.gates96.com/13/95/57/24.html +http://yp.gates96.com/13/95/57/30.html +http://yp.gates96.com/13/95/57/46.html +http://yp.gates96.com/13/95/58/38.html +http://yp.gates96.com/13/95/58/52.html +http://yp.gates96.com/13/95/58/80.html +http://yp.gates96.com/13/95/59/40.html +http://yp.gates96.com/13/95/59/78.html +http://ftp.net.uni-c.dk/pub/linux/mandrake/i586/Mandrake/mdkinst/usr/share/locale/gv/?S=A +http://home.swipnet.se/~w-10458/sksida.htm +http://www.irishnews.com/k_archive/260799/nnews14.html +http://dennou-q.geo.kyushu-u.ac.jp/library/Linux/debian-jp/dists/potato-jp/contrib/binary-all/admin/?M=A +http://ayasii.virtualspace.net/html/1104/11041141_syuuei_yosimi008.htm +http://ayasii.virtualspace.net/html/1104/11041104_nakamura_yuma_2_027.htm +http://kikakusvr3.city.yokohama.jp/yhspot/ysc/prelaunch.html +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=0,1-20,0-9,1-9,2 +http://209.52.189.2/discussion.cfm/disco_music/7738/79749 +http://www.du-et.net/cgi/mail.cgi?NickName=coota +http://ustlib.ust.hk/search*chi/a%7B214c7d%7D%7B213837%7D%7B213c44%7D%7B213779%7D%7B214267%7D%7B21586d%7D%7B21515b%7D%7B21517c%7D%7B213966%7D/a{214c7d}{213837}{213c44}{213779}{214267}{21586d}{21515b}{21517c}{213966}/7,-1,0,B/browse +http://user.alpha.co.kr/~backspin/CGI-BIN/upload/files/ +http://194.174.50.23/cgi-bin/FisRun/InsertExhibitorIntoNotebook/1/interpack99/e/1217 +http://www.paxcapital.com/news/datacenter/200010/27/20001027180508_01.shtml +http://www.paxcapital.com/news/datacenter/200010/27/20001027175828_07.shtml +http://www.paxcapital.com/news/datacenter/200010/27/20001027173309_53.shtml +http://www.paxcapital.com/news/datacenter/200010/27/20001027165004_52.shtml +http://genforum.genealogy.com/cgi-bin/print.cgi?lantz::325.html +http://mirror.cc.utsunomiya-u.ac.jp/mirror/FreeBSD/ports/alpha/packages-current/x11-toolkits/?D=A +http://hotop.on.net.cn/diguo/club/disp.asp?owner=A205&ID=914 +http://www.babyheirlooms.com/catalog/htmlos.cat/041137.1.3501106310 +http://debian.linux.org.tw/debian/dists/frozen/non-free/binary-m68k/mail/?N=D +http://cafe5.daum.net/Cafe-bin/Cafe.cgi/member?cafe=LOTTEcleaning +http://www-d0.fnal.gov/cgi-bin/cvsweb.cgi/root_gui/data/?sortby=date +http://www.concentric.net/~Psaros/DbzUncensored/editorial/edit06-07-98.html +http://www.jobvillage.com/channel/jobs/travel/travel_guide/b.4897.g.5093.html +http://www.jobvillage.com/channel/jobs/travel/travel_guide/b.4897.g.5070.html +http://www.cricket.org/link_to_database/ARCHIVE/1999/OTHERS+ICC/NL_LOCAL/EERSTEKL/VCC_ASIAN-SHAH_EERSTEKL_16MAY1999.html +http://health.phinfo.sc.cn/navigator/illness_treatment/diseases_conditions/bone_diseases/spinal_column_injury/default.htm +http://cn.egroups.com/message/dfwscan/1412 +http://www.babyheirlooms.com/catalog/htmlos.cat/001255.1.1999922108 +http://ibm1.cicrp.jussieu.fr/ibmc/classref/ref/UFullStopNumber_DSC.htm +http://pda.tucows.fi/palm/adnload/33651_21862.html +http://www.fogdog.com/cedroID/ssd3040183330232/nav/products/nhl/chicago_blackhawks/fan/gender/fashion_polo_shirts/ +http://www.fogdog.com/cedroID/ssd3040183330232/nav/products/nhl/chicago_blackhawks/fan/gender/nylon_jackets/ +http://www.5a8.com/book/wg/zpj/d/delaisai/mgbj/004.htm +http://www.5a8.com/book/wg/zpj/d/delaisai/mgbj/050.htm +http://jars.developer.com//classes/jresout.cgi?resource=1133 +http://dwp.bigplanet.com/billbritton/files/edit.nhtml +http://members.tripod.co.jp/snow4/?D=A +http://www.lanoticia.com.ni/cronologico/2000/julio/15sabado/capital/capital5.html +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/151/1996/4/0/870960/ +http://mayu.sourceforge.net/cgi-bin/nph-ml.cgi/000/http/www.geocrawler.com/archives/3/151/1996/4/0/870950/ +http://ftp.ccu.edu.tw/pub/packages/dns/bind/src/8.1.1/ +http://www.chez.com/photographies/photos/paysage/page8.htm +http://www.ayto-malaga.es/Organismos/Urbanismo/PGMOM/Hojas/calificacion/3/47/34734.htm +http://www.symatrixinc.com/website/website.nsf/0/3e40df86fb357cd5882568720079613f!OpenDocument&ExpandSection=3,24,5,18 +http://www.symatrixinc.com/website/website.nsf/0/3e40df86fb357cd5882568720079613f!OpenDocument&ExpandSection=9,24,5,18 +http://variety.studiostore.com/browse/STARWARSTRIL/PHOTO/b.MOVIES%20STARWARSSAGA%20STARWARSTRIL/s.5FhZToe4 +http://www.stud.ntnu.no/~kjonigse/pod/ +http://eastday.com/epublish/gb/paper10/20001025/class001000011/hwz225792.htm +http://eastday.com/epublish/gb/paper10/20001025/class001000011/hwz225253.htm +http://www.jamba.de/KNet/_KNet-KdS8j1-IHd-13g8y/browse.de/node.0/cergpnwyt +http://www.la-verdad.com/pg000828/suscr/primera.htm +http://www.centc251.org/forums/aca-1/dispatch.cgi/hsi/listUnseen/fol/100020/20,0/1338881 +http://ftp.du.se/disk4/FreeBSD/ports/ports/japanese/libicq/pkg-comment +http://www.geocities.com/SunsetStrip/Towers/2395/ +http://www.geocities.com/joanna_luo +http://www.geocities.com/eric_wang_tafe +http://www.geocities.com/shsugiharto +http://wynnsystems.com/79I_5ase/seek/modifyUser.html +http://www.uk.cricket.org/link_to_database/INTERACTIVE/REVIEWS/BOOKS/barry14.html +http://perso.wanadoo.fr/alain.falgas/poesie1.htm +http://www.linux.com/networking/network/windows_nt/support/tools/SAP/ +http://www.rdnet.nl/provstaten1999/491ps.html +http://www.thisislancashire.co.uk/lancashire/archive/1998/03/19/FEATURES3VQ.html +http://myhome.naver.com/myclass46 +http://www.bride.ru/htcgi/ladies/in-26-30/index3.html +http://www.internet-verzeichnis.de/branchen/schuhreparaturen/nordrhein-westfalen/ +http://dk.egroups.com/post/SonyMavica?act=reply&messageNum=3370 +http://www.sneezy.org/Databases/Composers/Instrumentation/008889.html +http://www.sneezy.org/Databases/Composers/Instrumentation/009161.html +http://fatema2.math.nat.tu-bs.de/doc/sdb/de/html/keylist.LARGEEBDA.html +http://ssb.no/kommuner/hoyre_side.cgi?region=1931 +http://www.egroups.com/subscribe/mentemalata +http://www.debian.org.cn/Bugs/db/67/67056-b.html +http://dk.egroups.com/message/ssrdistribution/775?source=1 +http://link.fastpartner.com/do/session/600429/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/shopnett.php +http://ftp.uk.debian.org/debian/dists/stable/main/binary-arm/text/?D=A +http://www.bemi-immobilien.de/IIM-Teil/Startseite/Top-Darlehens-Konditionen/Gemeinsam/3d-service/Startseite/Gemeinsam/erreichenPartner/Top-Darlehens-Konditionen/anforderungsformular.htm +http://www.fujian-window.com/Fujian_w/news/mdrb/000816t/1_4.html +http://scholar.lib.vt.edu/VA-news/WDBJ-7/script_archives/98/0798/070498/?D=A +http://polygraph.ircache.net:8181/services/define/html/President.asp +http://old-maps.co.uk/10lancs191/HTML/nav_19034001g.htm +http://www.hanter21.co.kr/NetBBS/Bbs.dll/prdata/lst/qqa/f/qqo/000D/zka/B2-kB2-r +http://w3.webtourist.net/travel/europe/italy/milan/quarkallsuites.htm +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=9,5+0,0-9,6-0,1 +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=brillantant&l=fr +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=brillantais&l=fr +http://www.mathquest.com/~sarah/HTMLthreads/geopre.descriptions.html +http://www.retrobytes.org/classiccmp/9706/msg00827.html +http://www.retrobytes.org/classiccmp/9706/msg01408.html +http://www.rdnet.nl/provstaten1999/552ps.html +http://retailer.gocollect.com/do/session/1912828/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/checkout/shopping_cart.asp +http://retailer.gocollect.com/do/session/1912828/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/exclusives/limited_editions.asp +http://retailer.gocollect.com/do/session/1912828/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/company_info/privacy_policy.asp +http://de.news.yahoo.com/000322/36/nfqj.html +http://www.kl.gz.cn/~cco/FUNA022K.htm +http://www.launch.com/music/artistpage/pvn_content/0,5219,1013738_videos,00.html +http://www14.freeweb.ne.jp/play/kiryuus/keith-burn1-end.htm +http://variety.studiostore.com/help/b.MOVIES%20STARWARSSAGA%20STARWARSTRIL/s.BmesFhV7 +http://biblioteca.upv.es/bib/doc/doc_siglibros/1828105/26/25/////MLTPAID/Materia%20Lengua%20inglesa%20técnica:%20254/V +http://www.outpersonals.com/cgi-bin/w3com/pws/out/_AhIPkFr0_eq7P6TUMbkQGJgpHJOXqtNLZQ55qFmeZARJaJUKHP9RBX3tPWaLEWVLZ_-PAErnbukTTJzs-x0hew4G_r3S85M8fDFaJcIVi3EA4TxNjTbbGIaSLhr8VdNICuBwhPmgZEt662B +http://www.outpersonals.com/cgi-bin/w3com/pws/out/IxhI6dPotFAZDugwPbV2pjvsgvIvAP-oFtIZfMptEKMo48cUO8RmvG3Akuk2tktzM_RYBY3yIQE6nl7I2moLEV_nScO7wTfWpFfPR7LHZ3ntJxKS8-a_IukWT4q_o6mjhGw8SSwm +http://www.rge.com/pub/languages/perl/clpa/1995-11/171 +http://www.rge.com/pub/languages/perl/clpa/1995-11/186 +http://www.newmgm.com/cgi-bin/c2k/title_talent.html&id=146091&title_star=FOURFEAT +http://www.koreaweekly.co.kr/entertain/book/200009/en20000922185938E701133.htm +http://www.koreaweekly.co.kr/entertain/book/200008/en20000824183337E701112.htm +http://www.genome.wustl.edu:8021/pub/gsc10/nci/wl/wl72/?N=D +http://yp.gates96.com/13/50/70/33.html +http://yp.gates96.com/13/50/70/36.html +http://yp.gates96.com/13/50/70/53.html +http://yp.gates96.com/13/50/71/74.html +http://yp.gates96.com/13/50/72/13.html +http://yp.gates96.com/13/50/72/17.html +http://yp.gates96.com/13/50/72/83.html +http://yp.gates96.com/13/50/73/48.html +http://yp.gates96.com/13/50/73/79.html +http://yp.gates96.com/13/50/73/96.html +http://yp.gates96.com/13/50/74/14.html +http://yp.gates96.com/13/50/74/57.html +http://yp.gates96.com/13/50/75/13.html +http://yp.gates96.com/13/50/75/19.html +http://yp.gates96.com/13/50/75/30.html +http://yp.gates96.com/13/50/75/42.html +http://yp.gates96.com/13/50/75/53.html +http://yp.gates96.com/13/50/75/90.html +http://yp.gates96.com/13/50/77/45.html +http://yp.gates96.com/13/50/77/51.html +http://yp.gates96.com/13/50/77/79.html +http://yp.gates96.com/13/50/78/12.html +http://yp.gates96.com/13/50/78/47.html +http://yp.gates96.com/13/50/78/69.html +http://yp.gates96.com/13/50/78/96.html +http://www.tel.de/s/M/MSS.htm +http://linux.usu.edu/LDP/LDP/LG/issue23/shoham/node4.html +http://www.monaco.gouv.mc/dataweb/gouvmc.nsf/(NewsActu)/d28eaee29b3287d4c1256905004e1ef1!OpenDocument&ExpandSection=9,3,10.1,7,10.4,10.2,5,8,4 +http://fi.egroups.com/post/romtrade?act=reply&messageNum=5198 +http://www.outpersonals.com/cgi-bin/w3com/pws/out/erhIHCd-6X--WwWIQBR9tYYraJWo8ugur0GyAl8pg21sE-lotAURKodv9HAYnRuTT4ZM0aCKsA5ZVLlq8sgiFNqA4DyAY_GVTyPIEARrzArj8JrWabVCSpg03afQ_Xg3DaCQA17080y7T4EZ +http://oneplace.adbureau.net/accipiter/adclick/site=ONEPLACE/area=INDEX/POSITION=BLOCK_1/AAMSZ=120x90/ACC_RANDOM=619055616855 +http://cafe6.daum.net/Cafe-bin/Bbs.cgi/MyLoveNYpds/qry/zka/B2-kB23m/qqatt/^ +http://cafe6.daum.net/Cafe-bin/Bbs.cgi/MyLoveNYpds/qry/zka/B2-kB2-s/qqatt/^ +http://sas.uoregon.edu/sashtml/proc/z0292518.htm +http://www02.geocities.co.jp/PowderRoom-Rose/1346/flower02image.html +http://www02.geocities.co.jp/PowderRoom-Rose/1346/sozaiheart2.html +http://www.jamba.de/KNet/_KNet-sXN8j1-9Hd-13ej3/admLogin.de/node.0/cdn3r3qy3 +http://iccardreader.co.kr/ +http://online.linux.tucows.com/conhtml/ser_irc_size.html +http://www.fogdog.com/cedroID/ssd3040183339940/nav/products/winter_sports/1b/bibs/ +http://www.fogdog.com/cedroID/ssd3040183339940/nav/products/winter_sports/1c/jackets/ +http://www.fogdog.com/cedroID/ssd3040183339940/nav/products/winter_sports/1d/heavyweight_tops/ +http://www.affiliate.hpstore.hp.co.uk/do/session/380883/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/assistance/entry.asp +http://www.kaos.dk/sex-riddle/k/a/k/i/l/y/t/c/ +http://www.kaos.dk/sex-riddle/k/a/k/i/l/y/t/o/ +http://ftp1.se.debian.org/debian/dists/stable/main/disks-alpha/2.2.8-2000-03-08/jensen/ +http://213.36.119.69/do/session/153006/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/FR/contact/recrute.htm +http://www10.freeweb.ne.jp/photo/myukun2/cosplay/000130/0130_40.htm +http://l-infonet.phkk.fi/fi/TIETOPALVELUT/JULKINEN+HALLINTO/tiedonhaku/artikkelit/hakupalvelut/l%E4%E4ketiede/tietokannat/ +http://202.109.72.57/article/20000903/67099.htm +http://www.outpersonals.com/cgi-bin/w3com/pws/out/5xhIsrJ5LBhn_gBogN2-VgQ1DA6WvBlLMjSoxYeQAJ1ig69sK1i1DhQ5hA3iOw7y6Wb_HDA2rkG5aJy9DrUMZxD31cyUqEqg7LeZ3pssb70DsyPc1sGCTVIRFBz1Nb_1ikEcJ3ds +http://ftp.gwdg.de/pub/misc/standards/infomagic/nist/oiw/agreemnt/read_me.txt +http://linuxberg.arrakis.es/conhtml/adnload/8894_17109.html +http://ring.toyama-ix.net/archives/pc/winsock-l/WWW-Browsers/Plug-In/ppp16124.txt +http://opac.lib.ntnu.edu.tw/search*chi/++ftlist/bp20040288/-5,-1,0,B/frameset&F=bp20040286&1,1 +http://ftp.darenet.dk/tucows/winme/adnload/137475_28966.html +http://ftp.darenet.dk/tucows/winme/adnload/137525_29009.html +http://elib.zib.de/pub/UserHome/Mueller/Course/Tutorial/Postscript/US/?M=A +http://greenpeace.lu/Admin/usage/weekly/1999/01/03/ +http://greenpeace.lu/Admin/usage/weekly/1998/04/26/ +http://greenpeace.lu/Admin/usage/weekly/1998/08/16/ +http://greenpeace.lu/Admin/usage/weekly/1997/10/12/ +http://retailer.gocollect.com/do/session/1912819/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/clubhouse/index.asp +http://www.kusastro.kyoto-u.ac.jp/LCs/index/AURAU.html +http://www.linux.com/networking/network/windows_nt/support/microsoft/Red_Hat/ +http://www.linux.com/networking/network/windows_nt/support/microsoft/operating_system/ +http://www.linux.com/networking/network/windows_nt/support/microsoft/SAP/ +http://www.linux.com/networking/network/windows_nt/support/microsoft/Unix/ +http://www.linux.com/networking/network/windows_nt/support/microsoft/pop-3/ +http://www.cs.rit.edu/photo_album/smr3632.html +http://www.cpan.dk/CPAN/modules/by-authors/id/C/CH/CHRMASTO/?D=A +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/lit/misc/unitest/lit/music/midi/ego.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/lit/misc/unitest/lit/music/midi/lit/multiple.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/lit/misc/unitest/lit/music/midi/misc/dissert.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/computers/lit/misc/unitest/lit/music/midi/misc/peanuts.html +http://www.eastsidejournal.com/sited/retr_story.pl/25409 +http://yp.gates96.com/8/46/50/23.html +http://yp.gates96.com/8/46/52/6.html +http://yp.gates96.com/8/46/52/10.html +http://yp.gates96.com/8/46/52/18.html +http://yp.gates96.com/8/46/52/25.html +http://yp.gates96.com/8/46/53/78.html +http://yp.gates96.com/8/46/53/95.html +http://yp.gates96.com/8/46/54/26.html +http://yp.gates96.com/8/46/54/41.html +http://yp.gates96.com/8/46/54/64.html +http://yp.gates96.com/8/46/54/76.html +http://yp.gates96.com/8/46/54/92.html +http://yp.gates96.com/8/46/55/62.html +http://yp.gates96.com/8/46/55/94.html +http://yp.gates96.com/8/46/55/98.html +http://yp.gates96.com/8/46/56/19.html +http://yp.gates96.com/8/46/56/42.html +http://yp.gates96.com/8/46/56/86.html +http://yp.gates96.com/8/46/58/53.html +http://yp.gates96.com/8/46/58/57.html +http://yp.gates96.com/8/46/59/41.html +http://yp.gates96.com/8/46/59/44.html +http://yp.gates96.com/8/46/59/84.html +http://yp.gates96.com/8/46/59/99.html +http://www.158.com.cn/news/2000/09/03/58946.htm +http://www.pobladores.com/territorios/juegos/Shanodin/pagina/2 +http://www.otemachi.ibm.co.jp/pc/vlp/ca20/32l9068/price.html +http://www.gutenberg2000.de/lessing/sinnged/sinna10.htm +http://www.gutenberg2000.de/lessing/sinnged/sinn138.htm +http://www.gutenberg2000.de/lessing/sinnged/sinnc27.htm +http://www.gutenberg2000.de/lessing/sinnged/sinnc06.htm +http://calcul.si.uji.es/Programes/SAS/stat/chap4/sect5.htm +http://calcul.si.uji.es/Programes/SAS/stat/chap4/sect6.htm +http://link.fastpartner.com/do/session/600436/vsid/3194/tid/3194/cid/137201/mid/1060/rid/2105/chid/3194/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/learn.htm +http://www.linux.com/networking/network/red_hat/performance/workstations/business/ +http://ftp.dei.uc.pt/pub/faqs/backrubs/faq/?D=A +http://www2.el-mundo.es/nuevaeconomia/2000/NE022/NE022-16b.html +http://ring.toyama-ix.net/pub/linux/linuxppc-jp/2.0/UsersGuide/?N=D +http://www.egroups.com/message/swchicks-rpg/763 +http://webraft.its.unimelb.edu.au/705195/students/caitlinb/pub/?N=D +http://cn.egroups.com/message/indexinvesting/17 +http://networkdesigner.subportal.com/sn/Programming/Setup_Utilities/11753.html +http://www.imagestation.com/member/?name=Mermaid34v&c=1 +http://crn.com/Components/TalkBack/tb-read.asp?ArticleId=8463 +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/misc/lit/computers/music/linux/misc/thoughts/turingtest.html +http://www.egroups.com/message/house_caliburnus/1479 +http://pub14.ezboard.com/BBSForum.showForumSearch?boardName=bleemtest +http://spaceports.tucows.com/winme/adnload/136943_28461.html +http://www.cerent.com/warp/public/767/spcl/vaccess/req-lab.html +http://www.ualberta.ca/icons/icons/numbers/Big-orange-thin/ +http://www.gencat.es/cgi-bin/bc/drawer.cgi/LD/0004/A00027?98 +http://interhotel.com/romania/en/hoteles/49235.html +http://www.infoscape.com.cn:8171/nf/0001/19/nfzx1908.htm +http://www.hurriyetim.com/akdeniz/turk/00/05/25/akdhab/62akd.htm +http://www.hurriyetim.com/akdeniz/turk/00/05/25/akdhab/38akd.htm +http://dennou-t.ms.u-tokyo.ac.jp/arch/cc-env/Linux/debian-jp/dists/woody-jp/contrib/binary-ia64/misc/?M=A +http://www.angelfire.com/vt/Mystical2 +http://www.indonesiansources.com/HELP/COOKIES.HTM +http://members.nbci.com/cmeadows/gvi/45regt/45gvibat.html +http://members.nbci.com/cmeadows/gvi/45regt/45gvicob.html +http://landview.census.gov/hhes/www/housing/soma/char96/ch96tab5.html +http://www.legis.state.pa.us/WU01/LI/BI/TI/1985/0/MNPENNSYLVANIAdENERGYdASSISTANCEdANDdCONSERVATIONdACT.HTM +http://www.legis.state.pa.us/WU01/LI/BI/TI/1985/0/MNPENNSYLVANIAdSEWAGEdFACILITIESdACT.HTM +http://www.legis.state.pa.us/WU01/LI/BI/TI/1985/0/MNPODIATRYdPRACTICEdACT.HTM +http://www.legis.state.pa.us/WU01/LI/BI/TI/1985/0/MNPRESIDENT.HTM +http://www.legis.state.pa.us/WU01/LI/BI/TI/1985/0/MNPRIVATEdMORTGAGEdINSURANCEdACT.HTM +http://www.legis.state.pa.us/WU01/LI/BI/TI/1985/0/MNPROJECTd500.HTM +http://www.legis.state.pa.us/WU01/LI/BI/TI/1985/0/MNPUBLICdWORKSdCONTRACTdREGULATIONdLAW.HTM +http://oss.sgi.com/cgi-bin/cvsweb.cgi/inventor/apps/samples/4view/Attic/Imakefile?only_with_tag=MAIN +http://oss.sgi.com/cgi-bin/cvsweb.cgi/inventor/apps/samples/4view/Attic/Imakefile?only_with_tag=HEAD +http://www4.50megs.com/justiceinn/charpages/leaves/707.html +http://www4.50megs.com/justiceinn/charpages/leaves/859.html +http://www4.50megs.com/justiceinn/charpages/leaves/171.html +http://www4.50megs.com/justiceinn/charpages/leaves/114.html +http://megalink.tucows.com/win2k/adnload/38582_28844.html +http://members.tripod.lycos.nl/monthlysports/hello_and_welkom_at_the_new.htm +http://coe.ier.hit-u.ac.jp/BibEc/data/Papers/nbrnberwo4558.html +http://coe.ier.hit-u.ac.jp/BibEc/data/Papers/nbrnberwo4462.html +http://coe.ier.hit-u.ac.jp/BibEc/data/Papers/nbrnberwo4813.html +http://pub4.ezboard.com/factiveprodiscussioncommunityhottopicsresidentsandalcohol.showMessage?topicID=3.topic +http://207.138.41.133/subscribe/IndoVStudio +http://www.biuemountain.com/eng3/karen/EArejoice.html +http://polygraph.ircache.net:8181/wwwboard/capabilities/http_-2www.westnebr.net/http_-2www.excite.com/grservic.htm +http://pub7.ezboard.com/fturonneuemissionennebenwerteundsonstigewerte.showAddReplyScreenFromWeb?topicID=58.topic +http://dk.egroups.com/post/badbart-showdown?act=forward&messageNum=679 +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus62920/eus62921/eus64894/eus170276/eus163832/ +http://www.algonet.se/~d88628/engelsk/various.htm +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=220&discrim=220,215,11 +http://www.z-plus.de/TEXTE/INETCO/AUSG20000524/text7.html +http://www.gbnf.com/genealog2/varner/html/d0059/I11636.HTM +http://www.musiciansfriend.com/ex/ds/live/001030183152064208037007463633 +http://www.musiciansfriend.com/ex/ds/home/001030183152064208037007463633?dbase=info,order_info.html +http://www.musiciansfriend.com/ex/ds/guitar/amps/001030183152064208037007463633?dbase=info,contact.html +http://pix.egroups.com/message/ipe/1642?source=1 +http://213.36.119.69/do/session/153008/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://resa.travelprice.com/CallCenter/InitCommunicationAgence +http://213.36.119.69/do/session/153008/vsid/1113/tid/1113/cid/28507/mid/1020/rid/1041/chid/1103/parser/yes/imref/eqqLmwlGltt5tkqHoXsLbimLofZLbkZHljlK6IlK/url/http://www.travelprice.com/DE_DE/ +http://www.egroups.com/message/peninsulaserv/567 +http://www.scifi.com/bboard/browse.cgi/1/5/545/12425?pnum=3 +http://no.egroups.com/post/icc-info?act=reply&messageNum=759 +http://www.chaos.dk/sexriddle/s/e/x/e/c/s/l/ +http://www.chaos.dk/sexriddle/s/e/x/e/c/s/t/ +http://www.nissan.co.jp/RENAULT-DEALERS/PASSPORT/view.cgi/search/972959630-- +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=6,29,20,36,32 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=7,29,20,36,32 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=27,29,20,36,32 +http://dada.linuxberg.com/gnomehtml/adnload/31471_2540.html +http://augustasports.com/football99/college/box_50347.shtml +http://augustasports.com/football99/college/box_50365.shtml +http://augustasports.com/football99/college/box_50423.shtml +http://www.linux.com/networking/network/enterprise/e-commerce/management/open_source/ +http://usol.pdacentral.com/winnt/preview/1946.html +http://usol.pdacentral.com/winnt/preview/78287.html +http://usol.pdacentral.com/winnt/preview/1338.html +http://usol.pdacentral.com/winnt/preview/12860.html +http://usol.pdacentral.com/winnt/preview/6920.html +http://usol.pdacentral.com/winnt/preview/51381.html +http://ring.htcn.ne.jp/pub/lang/perl/CPAN/authors/id/W/WO/?N=D +http://grybrd.subportal.com/sn/Network_and_Internet/Text_Chat_Clients/index1.html +http://www.gurlpages.com/lacej/part13.html +http://ring.shibaura-it.ac.jp/archives/mac/info-mac/game/com/wolf/?D=A +http://cgi.cnnsi.com/baseball/mlb/nl/gamelog/2000/10/07/mets_giants/ +http://my.egroups.com/messages/not_honyaku/236 +http://members.tripod.com/agran_gassendi/Countdown.htm +http://www.tccomputers.com/cgi-bin/bp/1878637479/showcase/showcase.htm +http://207.138.41.133/message/AikensTrivia/264 +http://207.138.41.133/message/AikensTrivia/276 +http://www.shumway.org/thetree/ped13583.htm +http://link.fastpartner.com/do/session/600421/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/dk/ +http://link.fastpartner.com/do/session/600421/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/politiken.php +http://link.fastpartner.com/do/session/600421/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/company/jobs.htm +http://in.egroups.com/message/canada/856 +http://in.egroups.com/message/canada/883 +http://debian.tod.net/OpenBSD/src/lib/libssl/README.OPENBSD +http://www.emerchandise.com/main/EMERCH/s.1M38gYrZ +http://www.emerchandise.com/browse/TOYSTORY2/FIGURINE/b.FAVORITES%20COMICS%20ANIMFEAT%20TOYSTORY2/s.1M38gYrZ +http://quotidiano.monrif.net/chan/cronaca_nazionale:410879.1:/1999/12/24 +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=baignes&l=fr +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=baignas&l=fr +http://www.egroups.com/message/swchicks-rpg/93 +http://usuarios.tripod.es/jlgolis/id142_l.htm +http://www9.freeweb.ne.jp/shopping/nossy/baby/200-59.html +http://www9.freeweb.ne.jp/shopping/nossy/baby/305-36.html +http://ftp.tku.edu.tw/OS/NetBSD/NetBSD-1.3.2/alpha/binary/kernel/?D=A +http://www-1.cisco.com/univercd/cc/td/doc/product/wanbu/82/access/fpmpmm12/fpmmappe.pdf +http://pub17.ezboard.com/fartofnorrathfavoritepaintings.threadControl?topicID=56.topic +http://itcareers.careercast.com/texis/it/itjs/+pwwBmew_D86eGrwwwqFqygdMpwDOeWXqqBcneWkjnwBneWkxqBOeWRlmmOtFqewyXwotoBwcaMwDwtnanmowcdt1naqconDBaGncwBodD5ropa5BGwBnton5amnVncdpaMwGAnBoDtanMwocaGn51MnaMFqryfHfREIDzmbwwwpBmFe-B-dehxwww5rmXmwwBrmeZpwww/morelike.html +http://www.thestateofcolorado.com/aoubicycling.html +http://www.freespeech.org/DISjak/disnews/maillist.html +http://www.freespeech.org/DISjak/sport/schwimm/bestlist.html +http://www.amigos.com/cgi-bin/w3com/pws/ffe/_MhIXE2wgPJZ1X047wqRwM-olUgaV3vI6fBPmDsoD0c26y7TrHjLUhhhTSIZ2PRmqLmBVyInWJLkLGkKScrdFyX1uyXCZhvaWFvbnSFioewAURJcXQC-hJE5KczVcMUiq3ncgKjQh7nynQEu662C +http://m.home.cern.ch/m/mrashid/www/cuisine/cuisin13.htm +http://m.home.cern.ch/m/mrashid/www/cuisine/cuisin28.htm +http://www.dayoo.com/channel/stock/news/cjzh/09/0921/06.htm +http://webcvs.kde.org/cgi-bin/cvsweb.cgi/KodeKnight/lib/Makefile.am?r1=1.3&sortby=rev +http://www.fogdog.com/cedroID/ssd3040183315779/nav/products/featured_brands/12p/all/ +http://www.fogdog.com/cedroID/ssd3040183315779/nav/stores/baseball/ +http://www.fogdog.com/cedroID/ssd3040183315779/nav/stores/squash/ +http://www9.hmv.co.uk:5555/do/session/1347832/vsid/199/tid/199/cid/1061396/mid/1020/rid/1052/chid/1029/parser/yes/imref/eqqLmwlGltt5tkeHjskKZlkKrhlK/url/http://www.hmv.co.uk/hmv/newmenu.html +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=9,36,8 +http://www.arm.com/sitearchitek/support.ns4/html/cores_faq!OpenDocument&ExpandSection=24,36,8 +http://www.hig.se/(append,countdown,set,sqloutput,sqltable)/~jackson/roxen/ +http://ring.jec.ad.jp/archives/linux/kernel.org/kernel/people/mingo/raid-patches/raid-2.2.17-A0 +http://www.wsrn.com/apps/links/?s=BKIRF +http://www.auto.ru/wwwboards/mercedes/0163/ +http://www.auto.ru/wwwboards/mercedes/0142/ +http://www.auto.ru/wwwboards/mercedes/0132/ +http://www.auto.ru/wwwboards/mercedes/0002/ +http://www.auto.ru/wwwboard/mercedes/0014/ +http://www.presa.spb.ru/newspapers/dp/arts/dp-178-art-12.html +http://pub8.ezboard.com/fnirlcomcenterracetalk.showMessage?topicID=8.topic +http://www.allhealth.com/pregnancy/labor/qa/0,3105,599,00.html +http://www3.newstimes.com/archive99/sep0499/lce.htm +http://jupiter.u-3mrs.fr/~msc41www/PSHTM/PS4330.HTM +http://www.gpul.org/ftp/os/linux/cd-images/other/suse/dosutils/pfdisktc/ +http://platsbanken.amv.se/kap/text/88/001025,010050,240907,10,0107051488.shtml +http://www.angel-bastel-zoo.de/detail/detail_811_3.htm +http://members.nbci.com/cmeadows/gvi/3battn/3bgvicob.html +http://www.chaos.dk/sexriddle/s/e/x/x/p/o/r/ +http://www.asiastockwatch.com/sg/Forum/ForumDetails/0,1819,561_1_2:15,00.html +http://mysanantonio.sportshuddle.com/sports/football/health/advisors/workouts/huff12.asp +http://mysanantonio.sportshuddle.com/sports/football/health/advisors/workouts/huff1.asp +http://ring.data-hotel.net/pub/linux/debian/debian-jp/dists/unstable/contrib/source/math/ +http://www.tel.de/s/I/IFG.htm +http://www.tel.de/s/I/IFHV.htm +http://chat.hr-online.de/fs/buecherbuecher/buch/kerr.html +http://mirror.cc.utsunomiya-u.ac.jp/mirror/FreeBSD/branches/2.2-stable/src/sys/dev/ +http://mirror.cc.utsunomiya-u.ac.jp/mirror/FreeBSD/branches/2.2-stable/src/sys/nfs/ +http://www.malaysia.net/lists/sangkancil/1998-12/msg01044.html +http://biblio.cesga.es:81/search*gag/aFerreiro,+Martín/aferreiro+martin/-5,1,1,E/frameset&F=aferreiro+manuel&4,,4 +http://www.ferien-immobilien.de/DominikanischeRep/verkauf/Exklusiv-IB/Startseite/Gemeinsam/MarketingStrategie/Exklusiv-IB/Startseite/Gemeinsam/erreichenPartner/email3d.htm +http://www.ferien-immobilien.de/DominikanischeRep/verkauf/Exklusiv-IB/Startseite/Gemeinsam/MarketingStrategie/Exklusiv-IB/Startseite/Gemeinsam/IIMMitglieder.htm +http://chunma.yeungnam.ac.kr/~home/home13/msgboard/msgboard.cgi?cmd=list&stat=start +http://link.fastpartner.com/do/session/600413/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/local/redirect.php +http://www.eyeball.symantec.co.uk/region/se/sepress/20000418111220.htm +http://www.rezel.enst.fr/ftp/linux/distributions/debian/CD-1/dists/frozen/main/binary-all/news/?D=A +http://www.latimes.com/editions/orange/20001028/p000103070_ome0014.html +http://www.chaos.dk/sexriddle/j/c/u/t/ +http://cometweb01.comet.co.uk/do!session=132050&vsid=694&tid=20&cid=37044&mid=1000&rid=1060&chid=1711&url=eqqLmwlGltt5tkkHbqpLZXmLbkZHljlKaltLkilLXalKfkaLbukKeqjLi1 +http://perso.wanadoo.fr/jm.michaud/electronique_index.htm +http://dk.egroups.com/messages/Gunsmithing/1446?viscount=-30 +http://www-d0.fnal.gov/d0dist/dist/releases/psim01.02.00/pmcs_met/VERSION +http://mirror.cc.utsunomiya-u.ac.jp/mirror/CPAN/authors/id/P/PM/?N=D +http://www.movieguide.com/pressroom/events/amcinema96/award_amcinema965.html +http://www.sda.t-online.de/reise/index/aktrex201.htm +http://dic.empas.com/show.tsp/SMASHER +http://www.3w-posters.com/tomlinson.htm +http://www.3w-posters.com/tuttle.htm +http://www.xmission.com/(art,dots,ftp,geek,misc,music,caffiene,art,toys,dots,edge,misc,shopping,ftp,places,privacy,geek,cuseeme,apocalypse,people,stuffiuse,places,stuffiuse)/~bill/links.html +http://www.osiris.978.org/~brianr/mirrors/olga/main/g/gangi_mike/?N=D +http://www.best.com/~workpage/g/57/300g.htm +http://www.cyd.com.cn/zqb/19991109/GB/9677^Q212.htm +http://edu.news.chinaren.com/161/10112157.shtml +http://users.info.unicaen.fr/~jjousset/perso/html/entrainperso/page.html +http://www.wordtheque.com/owa-wt/wordtheque_dba.w.t?w=destituiscono&l=it +http://www.uk.multimap.com/p/browse.cgi?pc=B771AA&cat=loc +http://www.auxerre.culture.gouv.fr/culture/actualites/conferen/bonneuil-duffour.htm +http://www.auxerre.culture.gouv.fr/culture/actualites/communiq/mediaBonneuil-Duffour.htm +http://www.ancientsites.com/~Ftagn_Sithathor +http://biblioteca.upv.es/bib/doc/doc_fisbd/86/127697//C/1820009/0////25/N/MLTPAI +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus53930/eus169714/eus169722/eus542057/eus542410/ +http://www.kfi640.com/shared/mod_perl/looksmart/looksmart/eus1/eus53930/eus169714/eus169722/eus542057/eus542106/ +http://pub26.ezboard.com/fathanasiafrm1.showMessage?topicID=113.topic +http://www.sourceforge.net/softwaremap/trove_list.php?form_cat=186&discrim=186,226,251 +http://www.linux.com/networking/network/community/future/news/services/ +http://www.linux.com/networking/network/community/future/news/operating_system/ +http://www.linux.com/networking/network/community/future/news/?kw_offset=50 +http://www.linux.com/networking/network/development/unix/open_source/commercial/ +http://ring.shibaura-it.ac.jp/pub/misc/ham/funet/packet/00Index +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=3,0+20,0+17,0-( +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=3,0+20,0+17,0-9,1 +http://www.vorlesungen.uni-osnabrueck.de/informatik/c98/aufgaben/code/aufg50/ProcessInfo/ProcessInfo.bundle/Resources/?D=A +http://wap.jamba.de/KNet/_KNet-xOQ8j1-xHd-13fk7/showInfo-special1.de/node.0/cde7f1uou +http://nx5.salon.com/books/col/keil/2000/05/02/too_old/index2.html +http://pcmagazin.de/news/artikel/1999/04/29016-wf.htm +http://www.redrival.com/rgrascher/ +http://208.184.36.144/cwi/subscriptions/privacy_policy/0,1323,NAV47-68-85-98_STO52856,00.html +http://www.staroriental.net/nav/soeg_c/ihf,aol,n12,1,TVB香港å°å§2000.html +http://www.staroriental.net/nav/soeg_c/ihf,aol,n12,6,TVB香港å°å§2000.html +http://166.111.104.242/uscode/30/541b.head.html +http://stocks.tradingcharts.com/stocks/charts/fwrx/dchart.php?S=fwrx&T=d +http://genforum.genealogy.com/cgi-bin/print.cgi?plemmons::57.html +http://www.geocities.co.jp/Hollywood-Studio/3572/geodiary.html +http://www.luf.org/~jwills/LufWiki/view.cgi/Tech/ +http://www.doc.ic.ac.uk/lab/labsrc_area/firstyear/submissions/cs1/labs/Ex01/arr00/?M=A +http://citeseer.nj.nec.com/ps/332798 +http://citeseer.nj.nec.com/addcomment/332798 +http://citeseer.nj.nec.com/cidcontext/4075337 +http://ftp.te.fcu.edu.tw/cpatch/helputil/answerworks/?M=A +http://ftp.te.fcu.edu.tw/cpatch/helputil/answerworks/d2hpro4ethanks.htm +http://link.fastpartner.com/do/session/600423/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/join/programmes/mondosoft.php +http://link.fastpartner.com/do/session/600423/vsid/2870/tid/2870/cid/136966/mid/1060/rid/1926/chid/2870/parser/yes/imref/eqqLmwlGltt5tkcHXpqLmXoLqkbLokZHljlK/url/http://www.fastpartner.com/company/ +http://library.cuhk.edu.hk/search*chi/dEnglish+language+--+Clauses./denglish+language+clauses/7,-1,0,B/browse +http://www04.u-page.so-net.ne.jp/yd5/yuma/top/home.html +http://www.smartshop.com/cgi-bin/main.cgi?c=1905&ssa=26 +http://www.smartshop.com/cgi-bin/main.cgi?c=1943&ssa=26 +http://se.egroups.com/dir/Business/Management/Project_and_Program_Management/Training?st=10 +http://www.hpl.online.sh.cn/WENXUE/tongsuo/wuxia/gulong/xueying/_vti_cnf/hs~001.htm +http://news.medscape.com/adis/PEON/public/archive/1999/toc-0221.html +http://news.medscape.com/adis/PEON/public/archive/1999/toc-0197.html +http://tucows.hongkong.com/winnt/adnload/4256_29575.html +http://www.etang.com/local/shenzhen/shopping/shop/0318mans02.htm +http://www.etang.com/local/shenzhen/shopping/shop/0319foll.htm +http://www.etang.com/local/shenzhen/shopping/shop/0319jialjs.htm +http://www.staffan.addr.com/cgi-bin/woda/icq.cgi/Edit?_id=2a5e +http://www.linux.com/networking/network/operating_system/kernel/distro/?printable=yes +http://www.linux.com/networking/network/operating_system/kernel/distro/commercial/ +http://www.linux.com/networking/network/operating_system/kernel/distro/white_dwarf/ +http://dir.dig.co.kr/parents/textbook/20301030101.html +http://www.affiliate.hpstore.hp.co.uk/do/session/380895/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/fr/CASHBACK/entry.asp +http://ccuftp.ccu.edu.tw/pub1/chinese/linux/clinux/c1/?N=D +http://cgi.cnnsi.com/basketball/college/women/boxscores/2000/03/07/cbp_rak +http://www.adcentral.com/cgi-bin/w3com/pws/adsites/5BRIztXQWHs_H_kyq8hmyrHpmCLb5RfQ09-DcKP1B6mZibAiJTLy1w3iiFS15WkFiCHMuMtjNK5FtHPDtZ7rxwckgoj0GaicnAZxhJLQ3zWaLoNUq8eTpG7wCxe3TWAb66jt +http://www.varsity.cam.ac.uk/varsity/live/2000/listings.nsf/44bbd1c2a6305036802567fb0081c76b!OpenView&Grid=1&Date=1999-04-06 +http://students.lsu.edu/students/main.nsf/Pages/CSISAJ1!OpenDocument&ExpandSection=15,21,5,4 +http://students.lsu.edu/students/main.nsf/Pages/CSISAJ1!OpenDocument&ExpandSection=18,21,5,4 +http://www.getplus.co.jp/category/catinet.homepagew2.asp +http://www.motorradversand.de/cgi-bin/antrieb/kettensatz_komplett_suzuki/RK82K872/beurteilung.htm +http://202.99.23.245/zdxw/13/20000328/200003281335.html +http://proxy.tiscover.com/1Root/Kontinent/6/Staat/7/Bundesland/22/Ort/120/Infrastruktur/299270/Homepage/homepage...1.html +http://www.jamba.de/KNet/_KNet-RcO8j1-cHd-13eq4/browse.de/node.0/cdel3j591 +http://www.jamba.de/KNet/_KNet-RcO8j1-cHd-13eqf/showInfo-wir.de/node.0/cde7f1uou +http://pub6.ezboard.com/fcrazyassmb47001generalshiznit.threadControl?topicID=685.topic +http://perso.infonie.fr/imagestld/photojyg5/images/alive5/?D=A +http://members.spree.com/sip1/take5planet/videos.htm +http://ae.boston.com/haiku/vote?haiku_id=4484 +http://adex3.flycast.com/server/socket/127.0.0.1:2800/click/OnlineCitiesSM/OnlineCitiesInteractiveCityGuides/bd129601192 +http://www.digitaldrucke.de/(aktuell,computer,marktplatz,shopping,verkehr)/suche/uebersicht.html +http://www.digitaldrucke.de/(aktuell,computer,hersteller,marktplatz,verkehr)/_fort/html/themen/computer/hard/herstell.htm +http://bbs.kcm.co.kr/NetBBS/Bbs.dll/kcmmission/lst/qqeq/1/zka/B2-kD2-l/qqo/004A +http://bbs.kcm.co.kr/NetBBS/Bbs.dll/kcmmission/rcm/zka/B2-kD2-l/qqo/004A/qqatt/^ +http://ftp.eq.uc.pt/software/lang/tcl/ftp.scriptics.com/nightly-cvs/tk/library/?S=A +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-141.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-165.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-241.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-239.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-150.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-44.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-12.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-4.html +http://www.infomedia.it/cgi-bin/lwgate/JAVA-IT/archives/java-it.log.9704/Subject/article-27.html +http://yp.gates96.com/5/88/50/47.html +http://yp.gates96.com/5/88/50/94.html +http://yp.gates96.com/5/88/51/20.html +http://yp.gates96.com/5/88/52/11.html +http://yp.gates96.com/5/88/52/26.html +http://yp.gates96.com/5/88/53/86.html +http://yp.gates96.com/5/88/53/99.html +http://yp.gates96.com/5/88/54/48.html +http://yp.gates96.com/5/88/55/29.html +http://yp.gates96.com/5/88/55/31.html +http://yp.gates96.com/5/88/55/41.html +http://yp.gates96.com/5/88/55/62.html +http://yp.gates96.com/5/88/55/77.html +http://yp.gates96.com/5/88/56/62.html +http://yp.gates96.com/5/88/56/93.html +http://yp.gates96.com/5/88/59/61.html +http://ceu.fi.udc.es:8000/mc/maillist/99-02/2090.918081010.176207534.html +http://ceu.fi.udc.es:8000/mc/maillist/99-02/1123.920140263.921690399.html +http://ceu.fi.udc.es:8000/mc/maillist/99-02/19089.918231855.610311830.html +http://ceu.fi.udc.es:8000/mc/maillist/99-02/16059.919279797.801472096.html +http://ceu.fi.udc.es:8000/mc/maillist/99-02/24001.919906575.275033199.html +http://ceu.fi.udc.es:8000/mc/maillist/99-02/14848.918256026.548154577.html +http://ceu.fi.udc.es:8000/mc/maillist/99-02/10783.918253985.660158806.html +http://ceu.fi.udc.es:8000/mc/maillist/99-02/27581.918670666.1055622954.html +http://www.activedayton.com/sportsticker/stnd/current/BBH.STAT.FSLKISLTRT.html +http://www.teenplatinum.com/barelylegal/japanesewomen/boots/petitesmall/explodingblowjob/eunuchbodyshots/homosexualass.html +http://books.hyperlink.co.uk/xt1/Methodology_for_the_Harmonization_of_European_Occupational_Accident_Statistics/9282641007 +http://www.jpc-music.com/2563637.htm +http://www.jpc-music.com/8168850.htm +http://www.expage.com/sugarshackstablesapryl +http://www.egroups.com/messages/svlug/31105 +http://www.chinawolf.com/~warson/japan/chichuan/bride/mldxn/009.htm +http://www.chinawolf.com/~warson/japan/chichuan/bride/mldxn/011.htm +http://yp.gates96.com/11/78/70/19.html +http://yp.gates96.com/11/78/70/95.html +http://yp.gates96.com/11/78/71/64.html +http://yp.gates96.com/11/78/71/65.html +http://yp.gates96.com/11/78/72/30.html +http://yp.gates96.com/11/78/73/35.html +http://yp.gates96.com/11/78/74/0.html +http://yp.gates96.com/11/78/75/58.html +http://yp.gates96.com/11/78/76/75.html +http://yp.gates96.com/11/78/77/36.html +http://yp.gates96.com/11/78/77/64.html +http://yp.gates96.com/11/78/78/20.html +http://yp.gates96.com/11/78/78/33.html +http://yp.gates96.com/11/78/78/70.html +http://yp.gates96.com/11/78/78/93.html +http://yp.gates96.com/11/78/79/3.html +http://yp.gates96.com/11/78/79/50.html +http://ben.aspads.net/ex/c/190/649604396 +http://www.lifl.fr/PRIVATE/Manuals/java/jdk1.2/docs/api/java/applet/class-use/AudioClip.html +http://dic.empas.com/show.tsp/?q=cea&f=B +http://beautifulthemes.subportal.com/sn/Utilities/Disk_Maintenance_and_Repair_Utilities/5294.html +http://ustlib.ust.hk/search*chi/anational+bureau+of+economic+research/anational+bureau+of+economic+research/-5,-1,0,E/frameset&F=anational+bureau+of+asian+and+soviet+research+u+s&1,,0 +http://www.canlii.org/ca/regl/dors99-120/art5.html +http://www.canlii.org/ca/regl/dors99-120/partie144284.html +http://www.incestpornstories.com/freshmanteen/eggbirth-canal/loverdrag-queen/birth-canalfull-term/stomachvagina.html +http://www.fashion-j.com/bs/013/013/19.html +http://www.fjtcm.edu.cn/Fujian_w/news/fjgsb/990311t/1-3.htm +http://www.kaos.dk/sex-riddle/k/a/k/i/s/z/r/d/ +http://www.kaos.dk/sex-riddle/k/a/k/i/s/z/r/f/ +http://www.tccomputers.com/cgi-bin/bp/41291345/products/specials/mbbundle.htm +http://www.tccomputers.com/cgi-bin/bp/41291345/services/insight.htm +http://www.tccomputers.com/cgi-bin/bp/41291345/products/batterybackups/batterybackups.htm +http://cartografia.comune.modena.it/Ril_Whip/menuogg/001-100/ME0068c.htm +http://library.bangor.ac.uk/search/cWS+5+V196a+2000/cws++++5+v196+a+2000/7,-1,0,B/frameset&F=cws+++21+e84+1989&5,,12 +http://mindit.netmind.com/proxy/http://www.exposure.aust.com/~promote1/auspalaeo/tectonix/tect1.htm +http://ftp.fi.debian.org/debian/dists/unstable/non-free/binary-i386/shells/?S=A +http://excite.de.netscape.com/unterhaltung/katalog/19344 +http://www.symatrixinc.com/website/website.nsf/0/3e40df86fb357cd5882568720079613f!OpenDocument&ExpandSection=25,20,21,29 +http://www.burstnet.com/ads/ad7826a-map.cgi/1708189811 +http://dic.empas.com/show.tsp/?s=b&q=CONSIDERABLE +http://www.kaos.dk/sex-riddle/k/a/k/i/p/g/t/c/ +http://www.kaos.dk/sex-riddle/k/a/k/i/p/g/t/h/ +http://www.kaos.dk/sex-riddle/k/a/k/i/p/g/t/n/ +http://www.kaos.dk/sex-riddle/k/a/k/i/p/g/t/x/ +http://www.cbe21.com.cn/xueke/dili/jiaoxuezs/ziliaojn/tupianhc/i0602.htm +http://babycenter.netscape.com/bbs/3788/thread530/message9.html +http://polygraph.ircache.net:8181/http_-2www.harborbay.com/home/webstuff/companyprofile.htm +http://dante.bdp.it/cgi-bin/poseidon_v2.0/reflect/poseidon/disc/bibl-uno/512098188/threadconfig +http://dante.bdp.it/cgi-bin/poseidon_v2.0/reflect/poseidon/disc/bibl-uno/512098188/newconfig +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=5,1,16,25,13 +http://www2.hgo.se/Kurskatalogen.nsf/a49e2126c83c4922412566f60052f831/f24cc45affc890eec12565d80055e0b9!OpenDocument&ExpandSection=28,1,16,25,13 +http://ftp.sunet.se/pub/lang/perl/CPAN/authors/id/R/RH/?D=A +http://www.geocities.co.jp/SilkRoad/1618/nixxki/010799.html +http://genforum.genealogy.com/cgi-genforum/forums/americanrev.cgi?4444 +http://in.egroups.com/message/djgppgames/358 +http://freehost.crazyhost.com/teengallery/apbh/panty.html +http://buffy.acmecity.com/xander/366/EDpt2.htm +http://www.tccomputers.com/cgi-bin/bp/505218695/promotional/deals.htm +http://www.tccomputers.com/cgi-bin/bp/505218695/products/cooling/cooling.htm +http://www.tccomputers.com/cgi-bin/bp/505218695/products/dvds/dvds.htm +http://www.tccomputers.com/cgi-bin/bp/505218695/products/mice/mice.htm +http://www.tccomputers.com/cgi-bin/bp/505218695/services/register.htm +http://www.foxsports.com/nba/scores/2000/000129_playbyplay_clewas.sml +http://pub1.ezboard.com/fcellofuncellistsbynightsemiprooramateur.showAddReplyScreenFromWeb?topicID=513.topic&index=9 +http://yp.gates96.com/0/22/30/81.html +http://yp.gates96.com/0/22/31/89.html +http://yp.gates96.com/0/22/32/1.html +http://yp.gates96.com/0/22/32/12.html +http://yp.gates96.com/0/22/32/48.html +http://yp.gates96.com/0/22/32/78.html +http://yp.gates96.com/0/22/34/48.html +http://yp.gates96.com/0/22/34/75.html +http://yp.gates96.com/0/22/34/85.html +http://yp.gates96.com/0/22/35/38.html +http://yp.gates96.com/0/22/35/73.html +http://yp.gates96.com/0/22/36/40.html +http://yp.gates96.com/0/22/36/92.html +http://yp.gates96.com/0/22/37/0.html +http://yp.gates96.com/0/22/37/61.html +http://yp.gates96.com/0/22/37/96.html +http://yp.gates96.com/0/22/39/13.html +http://yp.gates96.com/0/22/39/94.html +http://www.incestpornstories.com/underageflashing/plus-sizereal-size/beautiesasian/purpleanal-sex/maledomfantasy/high-schoolpretty/cherrybest-friends.html +http://variety.studiostore.com/browse/ELMOINGROU/TOY/s.2vzELAA2 +http://members.tripod.lycos.nl/BOGAERT/off2.htm +http://www.eveclub.com/cgi-bin/eveclub.front/972959555004/Catalog/2000019 +http://genforum.genealogy.com/cgi-genforum/forums/noel.cgi?662 +http://www.affiliate.hpstore.hp.co.uk/do/session/380888/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-expo.com/FR/REGISTRATION/entry.asp +http://yp.gates96.com/5/88/10/35.html +http://yp.gates96.com/5/88/10/44.html +http://yp.gates96.com/5/88/11/36.html +http://yp.gates96.com/5/88/13/1.html +http://yp.gates96.com/5/88/13/23.html +http://yp.gates96.com/5/88/13/77.html +http://yp.gates96.com/5/88/13/86.html +http://yp.gates96.com/5/88/14/47.html +http://yp.gates96.com/5/88/14/83.html +http://yp.gates96.com/5/88/15/11.html +http://yp.gates96.com/5/88/16/43.html +http://yp.gates96.com/5/88/16/86.html +http://yp.gates96.com/5/88/17/6.html +http://yp.gates96.com/5/88/17/12.html +http://yp.gates96.com/5/88/17/73.html +http://yp.gates96.com/5/88/18/1.html +http://yp.gates96.com/5/88/18/38.html +http://yp.gates96.com/5/88/18/47.html +http://yp.gates96.com/5/88/18/79.html +http://newnova.tucows.com/winme/adnload/138430_29763.html +http://yp.gates96.com/8/43/60/48.html +http://yp.gates96.com/8/43/60/55.html +http://yp.gates96.com/8/43/61/22.html +http://yp.gates96.com/8/43/62/40.html +http://yp.gates96.com/8/43/62/52.html +http://yp.gates96.com/8/43/62/94.html +http://yp.gates96.com/8/43/63/79.html +http://yp.gates96.com/8/43/64/73.html +http://yp.gates96.com/8/43/64/80.html +http://yp.gates96.com/8/43/66/26.html +http://yp.gates96.com/8/43/66/70.html +http://yp.gates96.com/8/43/67/16.html +http://yp.gates96.com/8/43/68/11.html +http://yp.gates96.com/8/43/69/74.html +http://www.fogdog.com/cedroID/ssd3040183354487/nav/products/winter_sports/1d/mid-weight_bottoms/ +http://www.fogdog.com/cedroID/ssd3040183354487/nav/products/winter_sports/1r/avalanche_safety/ +http://www.fogdog.com/cedroID/ssd3040183354487/boutique/marmot/ +http://www.affiliate.hpstore.hp.co.uk/do/session/380898/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.france.hp.com/Main/acheterhp/ +http://www.nd.edu/~dtl/cheg258/unix/unixhelp1.2/Pages/tasks_rm1.1.1.html +http://se.egroups.com/post/cyclesi?act=reply&messageNum=137 +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=22,0+18,0+22,0+9,4 +http://cidade.subportal.com/sn/Games/Action_Games/8120.html +http://wiem.onet.pl/wiem/0115d9-rp1.html +http://www.ferien-immobilien.de/detmold/Verkauf/Gemeinsam/Inserieren/Allgemeine-IB/Startseite/Gemeinsam/MarketingStrategie/Gemeinsam/erreichen.htm +http://retailer.gocollect.com/do/session/1912826/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/product_display/products/product_lines.asp +http://retailer.gocollect.com/do/session/1912826/vsid/2092/tid/2092/cid/569192/mid/1540/rid/1980/chid/2085/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLl0/url/http://www.gocollect.com/halloween/halloween.asp +http://www.iabusnet.org:90/forums/aca-1/dispatch.exe/survey/listUnseen/fol/100001/20,0/2542788 +http://www.dispatch.co.za/1998/06/25/easterncape/BISHO.HTM +http://pub24.ezboard.com/fsosatanfrm1.showMessage?topicID=48.topic +http://ftpsearch.belnet.be/ftp/packages/Linux-docs/howto/other-formats/INDEX +http://www.crosswinds.net/~mluotto/noframe/feedback/form2.htm +http://www.schoolweb.nl/studentensteden/Rotterdam/SVRGaudium/info.cfm +http://www.shopworks.com/index.cfm/action/directory/userid/0000BD9A-2F67-19FE-9038010B0A0ADCF2 +http://findmail.com/messages/masterhuen/802 +http://www.t-dialin.net/navkopf/service/websvkaa.htm +http://gallery2.simplenet.com/lobby/main/videocaps/ebaral/bigvalley/ebbva19.htm +http://gallery2.simplenet.com/lobby/main/videocaps/ebaral/bigvalley/ebbva31.htm +http://www.outpersonals.com/cgi-bin/w3com/pws/out/44hIVEhY5ZrKWoMKb0FtjCXhqcpntVLId5WTaJdeZmonn200jiiswYnK2vORJkjpm-x643ZCeLyy6kJnIAKa5rNx_42I13Ud9N03G9xPob7Hoci92HJhOlbEv4WsB85Au-cLXFlIHPd866jS +http://ftp.debian.org/debian/dists/Debian2.2r0/main/binary-all/editors/?D=A +http://ftp1.support.compaq.com/patches/public/Digital_UNIX/v3.2g/mailworks/2.0/?S=A +http://www.digitalhearth.com/Recipes/World_Cuisines/South_Asian/Indian/index5.html +http://ftp.gigabell.net/pub/Stormix/dists/rain/main/?M=A +http://www.stas.net/1/theparamanor/apartment.htm +http://www.netcom.com/~gfenzil/free.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/misc/misc/thoughts/math/legendes/pages_new.html +http://www.eleves.ens.fr:8080/home/madore/index.shtml.fr/lit/misc/misc/thoughts/math/legendes/misc/orders_mag.html +http://dandini.cranfield.ac.uk/vl=-39658948/cl=171/nw=1/rpsv/catchword/routledg/13606719/contp1-1.htm +http://genforum.genealogy.com/cgi-genforum/forums/pugsley.cgi?81 +http://www.users.globalnet.co.uk/~mmayes/pages/cross.htm +http://dic.empas.com/show.tsp/?s=d&q=%C4%A7%BD%C7 +http://www.jamba.de/KNet/_KNet-rHP8j1-lHd-13f16/browse.de/node.0/cde7f1uou +http://library.bangor.ac.uk/search/aHolmgren,+Nils+Fritiof,+1877-1954/aholmgren+nils+fritiof+1877+1954/7,1,1,B/marc&F=aholmlund+chris&1,1, +http://www.spiral.at/Katalog/Artikel/0181030/ +http://www.spiral.at/Katalog/Artikel/0181242/ +http://www.generation-formation.fr/navig.htm---o21zAo06L2o0Ol9A074fo6VJGezMkEeIgI8eOkn2ApvFFo6Td4ezyr6feZJPdspt6dsSAtdsNhJdspt6dsrvrdjlhkfbz.htm +http://www.nextmedia.com.hk/netgirl/sport/images/chelsea/ch-30.htm +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=9,5-9,0-15,0-17,0 +http://www.realize.com/i82.htm,qt=35665aa9=645a273f-1a-31fa805-1-0-0-0-- +http://www.eud.com/1998/06/21/21121AA.shtml +http://www.eud.com/1998/06/21/21414AA.shtml +http://www.eud.com/1998/06/21/21434AA.shtml +http://chemtech.chinamarket.com.cn/E/Showdetail_company/5569.html +http://chemtech.chinamarket.com.cn/E/Showdetail_company/1095.html +http://www.ferien-immobilien.de/baden-wuertemberg/konstanz/Verkauf/Private-IB/Allgemeine-IB/Startseite/Gemeinsam/Immolink/Gemeinsam/MarketingStrategie/inhalt.htm +http://www.ferien-immobilien.de/baden-wuertemberg/konstanz/Verkauf/Private-IB/Allgemeine-IB/Startseite/Gemeinsam/Immolink/Gemeinsam/versicherungen/gebaeude/deckungsumfang.htm +http://retailer.gocollect.com/do/session/1912886/vsid/2312/tid/2312/cid/573127/mid/1020/rid/2147/chid/2210/parser/yes/imtarget/ImMainFrame/imref/eqqLmwlGltt5tkdHlZlLiibLZqkKZljLlZe5ofpLqjXLpl4/url/http://www.gocollect.com/company_info/terms_and_conditions.asp +http://eagle.synet.edu.cn/mirror/www.tuc.org.uk/ +http://eagle.synet.edu.cn/mirror/dcarolco.lanminds.com/home/ +http://www.chez.com/carabanon/Pagecabanon.htm +http://poetry.lezlisoft.com/kikelet/spiritualitas/lelekszinpad.shtml +http://lateline.muzi.net/ll/fanti/81373.shtml +http://www.egroups.com/message/vacuum/1140 +http://www.egroups.com/message/vacuum/1153 +http://www.egroups.com/message/vacuum/1157 +http://no.egroups.com/message/-1friendsliste/401 +http://no.egroups.com/message/-1friendsliste/411 +http://pike-community.org/(base=/forums/show.html,explode=146,forum=7,t=972959520359311)/forums/show.html +http://pike-community.org/(base=/forums/show.html,explode=512,forum=7,t=972959520359311)/forums/show.html +http://pike-community.org/(base=/forums/show.html,forum=7,show=413,t=972959520359311)/forums/show.html +http://pike-community.org/(base=/forums/show.html,forum=7,show=423,t=972959520359311)/forums/show.html +http://pike-community.org/(base=/forums/show.html,forum=7,show=761,t=972959520359311)/forums/show.html +http://pike-community.org/(base=/forums/show.html,forum=7,show=777,t=972959520359311)/forums/show.html +http://pike-community.org/(base=/forums/show.html,forum=7,show=831,t=972959520359311)/forums/show.html +http://astro1.cnu.ac.kr/NetBBS/Bbs.dll/bulletin/qry/zka/B2-kC2Jo/qqa/r +http://www.gbnf.com/genealog2/brothers/html/d0049/I1011.HTM +http://www.intellicast.com/Golf/World/UnitedStates/Midwest/Ohio/Zanesville/CurrentWinds/ +http://www.nada.kth.se/systemgruppen/docs/javadoc/jdk-1.3/docs/api/javax/swing/text/class-use/TabSet.html +http://www.my-cat.de/hunde/zucht/file24.htm +http://194.128.65.4/pa/cm199899/cmwib/wb981128/edms.htm +http://www.gutenberg2000.de/sagen/austria/tirol/adasbub.htm +http://www1.onelist.com/message/osaki/22 +http://www.highwired.net/ESchoolDrive/JumpPage/1,5565,25179-46,00.html +http://pcmagazin.de/download/library/deADW-wc.htm +http://www.affiliate.hpstore.hp.co.uk/do/session/380873/vsid/1148/tid/1148/cid/74115/mid/1001/rid/1003/chid/1050/parser/yes/imref/eqqLmwlGltt5tkeHmjbHumlLkZl5jlcHol4/url/http://www.hp-creativeworld.com/creativeworld.asp?lang=f +http://cscns.csc.gifu.gifu.jp/pushcorn-kit/tanigumi/paged/0300214020000147.html +http://cscns.csc.gifu.gifu.jp/pushcorn-kit/tanigumi/paged/0300214020002363.html +http://cscns.csc.gifu.gifu.jp/pushcorn-kit/tanigumi/paged/0300214020001617.html +http://cpan.nitco.com/modules/by-module/String/MLEHMANN/?N=D +http://www.rge.com/pub/tex/language/ethiopia/ethtex/lqh_fonts/ +http://130.158.208.53/WWW/PDB2/PCD4711/htmls/41.html +http://www.thisislancashire.co.uk/lancashire/archive/1997/05/15/LEIGH0VQ.html +http://www.thisislancashire.co.uk/lancashire/archive/1997/05/15/LEIGH10VQ.html +http://southwind.tukids.tucows.com/mac/parents/adnload/72310_26093.html +http://ftp1.support.compaq.com/public/vms/vax/v7.2/dsnlink/2.2/dsnlinke022.a-dcx_vaxexe +http://wynnsystems.com/i.I_5aGd/search/listCompanies.html +http://www.pobladores.com/territorios/juegos/Zhief_Fantasy_World/info +http://www.pobladores.com/territorios/juegos/Zhief_Fantasy_World/pagina/9 +http://www.aebius.com/rpm2html/contrib/libc5/i386/usr_sbin_Tree.html +http://info.rutgers.edu/cgi-bin/RUInfo/TallyStats/name=WebRequest&exec=buildlimit&limit=9,0-22,0-0,0-9,4 +http://polygraph.ircache.net:8181/services/define/http_-2www.fastcounter.com/noframes/specials.htm +http://polygraph.ircache.net:8181/services/define/http_-2www.fastcounter.com/noframes/sitebuilder.htm +http://www.jamba.nl/KNet/_KNet-7YT8j1-nD4-pxan/browse.nl/node.0/cdmvcam7k +http://www.outdoorwire.com/content/lists/jeepoffroad/200010/msg00234.html?{LoadingFrameset} +http://www-uk8.cricket.org/link_to_database/ARCHIVE/2000-01/ENG_IN_PAK/ENG_IN_PAK_OCT-DEC2000_ENG-SQUAD.html +http://www-uk8.cricket.org/link_to_database/ARCHIVE/CRICKET_NEWS/2000/OCT/057670_CI_25OCT2000.html +http://www.chaos.dk/sexriddle/c/c/e/k/ +http://ben.aspads.net/ex/c/190/608504034 +http://forum.rai.it/aca-finestre/dispatch.cgi/FORUM/folderFrame/100001/0/alpha/2040958 +http://www.teacherformation.org/html/od/facilitators.cfm/task1,help/discussion_id,2/xid,5237/yid,3113916 +http://www.mirror.edu.cn/res/www.isoc.org/inet98/proceedings/7d/ +http://www.sumthin.nu/archives/bugtraq/Nov_1998/msg00058.html +http://proxy.tiscover.com/1Root/Kontinent/6/Staat/7/Bundesland/20/Regionen/regionen_az...2.html +http://www.streetprices.com/products/sortdetailbylowprice/SP142252.html +http://www.streetprices.com/products/sortdetailby1day/SP142252.html +http://pp3.shef.ac.uk:4040/form/path=1,+%3A%22countryName%3DGB%40organizationName%3DUniversity+of+Sheffield%40organizationalUnitName%3DFinance%40commonName%3DS+Green%22 +http://travelocity-dest.excite.com/DestGuides/0,1840,TRAVELOCITY|2662|3|1|239114,00.html +http://www.maastrek.de/maas/4a73999ddfd2d79be20a/1/0/5 +http://aol.weather.com/weather/cities/us_pa_fairview.html +http://aol.weather.com/weather/cities/us_pa_fort_loudon.html +http://javatest.a-net.nl/servlet/pedit.Main/http://www.tigerden.com/junkmail/compladdr.html +http://ftp.dti.ad.jp/pub/windows/forest/file/backup/press1/?M=A +http://www.contest.edu.tw/85/endshow/5/baseball/news/97feb/0225t_1c.html +http://www.contest.edu.tw/85/endshow/5/baseball/news/97feb/0225c_3c.html +http://www.contest.edu.tw/85/endshow/5/baseball/news/97feb/0217c_2c.html +http://www.contest.edu.tw/85/endshow/5/baseball/news/97feb/0216c_play.html +http://www.contest.edu.tw/85/endshow/5/baseball/news/97feb/0214co_1c.html +http://preview.egroups.com/messages/decoratingplusnews/6 +http://astro1.chungnam.ac.kr/NetBBS/Bbs.dll/bulletin/rcm/zka/B2-kC23n/qqatt/^ \ No newline at end of file diff --git a/external/sourcesdk/bitbuf.cpp b/external/sourcesdk/bitbuf.cpp index 7aaf4fa..c29dd38 100644 --- a/external/sourcesdk/bitbuf.cpp +++ b/external/sourcesdk/bitbuf.cpp @@ -1,148 +1,329 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// +//====== Copyright (c) 2014, Valve Corporation, All rights reserved. ========// // -// Purpose: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// $NoKeywords: $ +// Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. // -//=============================================================================// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +// THE POSSIBILITY OF SUCH DAMAGE. +//===========================================================================// +#include +#include #include "sourcesdk/bitbuf.h" -#include -#include -#include -// FIXME: Can't use this until we get multithreaded allocations in tier0 working for tools -// This is used by VVIS and fails to link -// NOTE: This must be the last file included!!! -//#include "tier0/memdbgon.h" +const uint32 bf_read::s_nMaskTable[33] = { + 0, + ( 1 << 1 ) - 1, + ( 1 << 2 ) - 1, + ( 1 << 3 ) - 1, + ( 1 << 4 ) - 1, + ( 1 << 5 ) - 1, + ( 1 << 6 ) - 1, + ( 1 << 7 ) - 1, + ( 1 << 8 ) - 1, + ( 1 << 9 ) - 1, + ( 1 << 10 ) - 1, + ( 1 << 11 ) - 1, + ( 1 << 12 ) - 1, + ( 1 << 13 ) - 1, + ( 1 << 14 ) - 1, + ( 1 << 15 ) - 1, + ( 1 << 16 ) - 1, + ( 1 << 17 ) - 1, + ( 1 << 18 ) - 1, + ( 1 << 19 ) - 1, + ( 1 << 20 ) - 1, + ( 1 << 21 ) - 1, + ( 1 << 22 ) - 1, + ( 1 << 23 ) - 1, + ( 1 << 24 ) - 1, + ( 1 << 25 ) - 1, + ( 1 << 26 ) - 1, + ( 1 << 27 ) - 1, + ( 1 << 28 ) - 1, + ( 1 << 29 ) - 1, + ( 1 << 30 ) - 1, + 0x7fffffff, + 0xffffffff, +}; -#ifdef _X360 -// mandatory ... wary of above comment and isolating, tier0 is built as MT though -#include "tier0/memdbgon.h" -#endif - -#if _WIN32 -#define FAST_BIT_SCAN 1 -#if _X360 -#define CountLeadingZeros(x) _CountLeadingZeros(x) -inline unsigned int CountTrailingZeros( unsigned int elem ) +int bf_read::GetNumBitsRead( void ) const { - // this implements CountTrailingZeros() / BitScanForward() - unsigned int mask = elem-1; - unsigned int comp = ~elem; - elem = mask & comp; - return (32 - _CountLeadingZeros(elem)); -} -#else -#include -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward) + if ( ! m_pData ) // pesky null ptr bitbufs. these happen. + return 0; -inline unsigned int CountLeadingZeros(unsigned int x) -{ - unsigned long firstBit; - if ( _BitScanReverse(&firstBit,x) ) - return 31 - firstBit; - return 32; -} -inline unsigned int CountTrailingZeros(unsigned int elem) -{ - unsigned long out; - if ( _BitScanForward(&out, elem) ) - return out; - return 32; + int nCurOfs = ( ( uintptr_t( m_pDataIn ) - uintptr_t( m_pData ) ) / 4 ) - 1; + nCurOfs *= 32; + nCurOfs += ( 32 - m_nBitsAvail ); + int nAdjust = 8 * ( m_nDataBytes & 3 ); + return MIN( nCurOfs + nAdjust, m_nDataBits ); } -#endif -#else -#define FAST_BIT_SCAN 0 -#endif - -inline int BitForBitnum(int bitnum) +int bf_read::GetNumBytesRead( void ) const { - return GetBitForBitnum(bitnum); + return ( ( GetNumBitsRead() + 7 ) >> 3 ); } -// #define BB_PROFILING - -unsigned long g_LittleBits[32]; - -// Precalculated bit masks for WriteUBitLong. Using these tables instead of -// doing the calculations gives a 33% speedup in WriteUBitLong. -unsigned long g_BitWriteMasks[32][33]; - -// (1 << i) - 1 -unsigned long g_ExtraMasks[33]; - -class CBitWriteMasksInit +void bf_read::GrabNextDWord( bool bOverFlowImmediately ) { -public: - CBitWriteMasksInit() + if ( m_pDataIn == m_pBufferEnd ) { - for( unsigned int startbit=0; startbit < 32; startbit++ ) + m_nBitsAvail = 1; // so that next read will run out of words + m_nInBufWord = 0; + m_pDataIn++; // so seek count increments like old + if ( bOverFlowImmediately ) { - for( unsigned int nBitsLeft=0; nBitsLeft < 33; nBitsLeft++ ) - { - unsigned int endbit = startbit + nBitsLeft; - g_BitWriteMasks[startbit][nBitsLeft] = BitForBitnum(startbit) - 1; - if(endbit < 32) - g_BitWriteMasks[startbit][nBitsLeft] |= ~(BitForBitnum(endbit) - 1); - } + SetOverflowFlag(); + } + } + else + if ( m_pDataIn > m_pBufferEnd ) + { + SetOverflowFlag(); + m_nInBufWord = 0; + } + else + { + assert( reinterpret_cast< uintptr_t >( m_pDataIn ) + 3 < reinterpret_cast< uintptr_t >( m_pBufferEnd ) ); + m_nInBufWord = *( m_pDataIn++ ); + } +} + +void bf_read::FetchNext( void ) +{ + m_nBitsAvail = 32; + GrabNextDWord( false ); +} + +int bf_read::ReadOneBit( void ) +{ + int nRet = m_nInBufWord & 1; + if ( --m_nBitsAvail == 0 ) + { + FetchNext(); + } + else + { + m_nInBufWord >>= 1; + } + return nRet; +} + +unsigned int bf_read::ReadUBitLong( int numbits ) +{ + if ( m_nBitsAvail >= numbits ) + { + unsigned int nRet = m_nInBufWord & s_nMaskTable[ numbits ]; + m_nBitsAvail -= numbits; + if ( m_nBitsAvail ) + { + m_nInBufWord >>= numbits; + } + else + { + FetchNext(); + } + return nRet; + } + else + { + // need to merge words + unsigned int nRet = m_nInBufWord; + numbits -= m_nBitsAvail; + GrabNextDWord( true ); + if ( m_bOverflow ) + return 0; + nRet |= ( ( m_nInBufWord & s_nMaskTable[ numbits ] ) << m_nBitsAvail ); + m_nBitsAvail = 32 - numbits; + m_nInBufWord >>= numbits; + return nRet; + } +} + +unsigned int bf_read::PeekUBitLong( int numbits ) +{ + bf_read copy = *this; + + if ( m_nBitsAvail >= numbits ) + { + unsigned int nRet = m_nInBufWord & s_nMaskTable[ numbits ]; + m_nBitsAvail -= numbits; + if ( m_nBitsAvail ) + { + m_nInBufWord >>= numbits; + } + else + { + FetchNext(); } - for ( unsigned int maskBit=0; maskBit < 32; maskBit++ ) - g_ExtraMasks[maskBit] = BitForBitnum(maskBit) - 1; - g_ExtraMasks[32] = ~0ul; - - for ( unsigned int littleBit=0; littleBit < 32; littleBit++ ) - StoreLittleDWord( &g_LittleBits[littleBit], 0, 1u<>= numbits; - -// ---------------------------------------------------------------------------------------- // -// bf_write -// ---------------------------------------------------------------------------------------- // - -bf_write::bf_write() -{ - m_pData = NULL; - m_nDataBytes = 0; - m_nDataBits = -1; // set to -1 so we generate overflow on any operation - m_iCurBit = 0; - m_bOverflow = false; - m_bAssertOnOverflow = true; - m_pDebugName = NULL; - m_errorHandler = NULL; + *this = copy; + return nRet; + } } -bf_write::bf_write( void *pData, int nBytes, int nBits ) +int bf_read::ReadSBitLong( int numbits ) { - StartWriting( pData, nBytes, 0, nBits ); - m_bAssertOnOverflow = true; - m_pDebugName = NULL; - m_errorHandler = NULL; + int nRet = ReadUBitLong( numbits ); + // sign extend + return ( nRet << ( 32 - numbits ) ) >> ( 32 - numbits ); } -bf_write::bf_write( const char *pDebugName, void *pData, int nBytes, int nBits ) +#ifdef _WIN32 +#pragma warning(push) +#pragma warning(disable : 4715) // disable warning on not all cases + // returning a value. throwing default: + // in measurably reduces perf in bit + // packing benchmark +#endif +unsigned int bf_read::ReadUBitVar( void ) { - StartWriting( pData, nBytes, 0, nBits ); - m_bAssertOnOverflow = true; - m_pDebugName = pDebugName; - m_errorHandler = NULL; + unsigned int ret = ReadUBitLong( 6 ); + switch( ret & ( 16 | 32 ) ) + { + case 16: + ret = ( ret & 15 ) | ( ReadUBitLong( 4 ) << 4 ); + assert( ret >= 16); + break; + + case 32: + ret = ( ret & 15 ) | ( ReadUBitLong( 8 ) << 4 ); + assert( ret >= 256); + break; + case 48: + ret = ( ret & 15 ) | ( ReadUBitLong( 32 - 4 ) << 4 ); + assert( ret >= 4096 ); + break; + } + return ret; +} +#ifdef _WIN32 +#pragma warning(pop) +#endif + +int bf_read::ReadChar( void ) +{ + return ReadSBitLong( sizeof( char ) << 3 ); } -void bf_write::StartWriting( void *pData, int nBytes, int iStartBit, int nBits ) +int bf_read::ReadByte( void ) { - // Make sure it's dword aligned and padded. - Assert( (nBytes % 4) == 0 ); - Assert(((unsigned long)pData & 3) == 0); + return ReadUBitLong( sizeof( unsigned char ) << 3 ); +} - // The writing code will overrun the end of the buffer if it isn't dword aligned, so truncate to force alignment - nBytes &= ~3; +int bf_read::ReadShort( void ) +{ + return ReadSBitLong( sizeof( short ) << 3 ); +} - m_pData = (unsigned long*)pData; +int bf_read::ReadWord( void ) +{ + return ReadUBitLong( sizeof( unsigned short ) << 3 ); +} + +int bf_read::ReadLong( void ) +{ + return ReadUBitLong( sizeof( int32_t ) << 3 ); +} + +float bf_read::ReadFloat( void ) +{ + return ReadBitFloat(); +} + +bool bf_read::Seek( int nPosition ) +{ + bool bSucc = true; + if ( nPosition < 0 || nPosition > m_nDataBits ) + { + SetOverflowFlag(); + bSucc = false; + nPosition = m_nDataBits; + } + int nHead = m_nDataBytes & 3; // non-multiple-of-4 bytes at head of buffer. We put the "round off" + // at the head to make reading and detecting the end efficient. + + int nByteOfs = nPosition / 8; + if ( ( m_nDataBytes < 4 ) || ( nHead && ( nByteOfs < nHead ) ) ) + { + // partial first dword + unsigned char const *pPartial = ( unsigned char const *) m_pData; + if ( m_pData ) + { + m_nInBufWord = *( pPartial++ ); + if ( nHead > 1 ) + { + m_nInBufWord |= ( *pPartial++ ) << 8; + } + if ( nHead > 2 ) + { + m_nInBufWord |= ( *pPartial++ ) << 16; + } + } + m_pDataIn = ( uint32 const * ) pPartial; + m_nInBufWord >>= ( nPosition & 31 ); + m_nBitsAvail = ( nHead << 3 ) - ( nPosition & 31 ); + } + else + { + int nAdjPosition = nPosition - ( nHead << 3 ); + m_pDataIn = reinterpret_cast< uint32 const * > ( reinterpret_cast< unsigned char const * >( m_pData ) + ( ( nAdjPosition / 32 ) << 2 ) + nHead ); + if ( m_pData ) + { + m_nBitsAvail = 32; + GrabNextDWord(); + } + else + { + m_nInBufWord = 0; + m_nBitsAvail = 1; + } + m_nInBufWord >>= ( nAdjPosition & 31 ); + m_nBitsAvail = MIN( m_nBitsAvail, 32 - ( nAdjPosition & 31 ) ); // in case grabnextdword overflowed + } + return bSucc; +} + + +void bf_read::StartReading( const void *pData, int nBytes, int iStartBit, int nBits ) +{ +// Make sure it's dword aligned and padded. + assert( ( ( unsigned long )pData & 3 ) == 0 ); + m_pData = ( uint32 * ) pData; + m_pDataIn = m_pData; m_nDataBytes = nBytes; if ( nBits == -1 ) @@ -151,892 +332,65 @@ void bf_write::StartWriting( void *pData, int nBytes, int iStartBit, int nBits ) } else { - Assert( nBits <= nBytes*8 ); + assert( nBits <= nBytes * 8 ); m_nDataBits = nBits; } - - m_iCurBit = iStartBit; m_bOverflow = false; -} - -void bf_write::Reset() -{ - m_iCurBit = 0; - m_bOverflow = false; -} - - -void bf_write::SetAssertOnOverflow( bool bAssert ) -{ - m_bAssertOnOverflow = bAssert; -} - - -const char* bf_write::GetDebugName() -{ - return m_pDebugName; -} - - -void bf_write::SetDebugName( const char *pDebugName ) -{ - m_pDebugName = pDebugName; -} - -void bf_write::SetErrorHandler(IBitBufErrorHandler* handler) -{ - m_errorHandler = handler; -} - -bool bf_write::CallErrorHandler(BitBufErrorType errorType) -{ - if (m_errorHandler) + m_pBufferEnd = reinterpret_cast< uint32 const * > ( reinterpret_cast< unsigned char const * >( m_pData ) + nBytes ); + if ( m_pData ) { - return m_errorHandler->HandleError(errorType, GetDebugName()); + Seek( iStartBit ); } - return false; } -void bf_write::SeekToBit( int bitPos ) +bool bf_read::ReadString( char *pStr, int maxLen, bool bLine, int *pOutNumChars ) { - m_iCurBit = bitPos; -} + assert( maxLen != 0 ); - -// Sign bit comes first -void bf_write::WriteSBitLong( int data, int numbits ) -{ - // Force the sign-extension bit to be correct even in the case of overflow. - int nValue = data; - int nPreserveBits = ( 0x7FFFFFFF >> ( 32 - numbits ) ); - int nSignExtension = ( nValue >> 31 ) & ~nPreserveBits; - nValue &= nPreserveBits; - nValue |= nSignExtension; - - AssertMsg2( nValue == data, "WriteSBitLong: 0x%08x does not fit in %d bits", data, numbits ); - - WriteUBitLong( nValue, numbits, false ); -} - -void bf_write::WriteVarInt32( uint32 data ) -{ - // Check if align and we have room, slow path if not - if ( (m_iCurBit & 7) == 0 && (m_iCurBit + bitbuf::kMaxVarint32Bytes * 8 ) <= m_nDataBits) + bool bTooSmall = false; + int iChar = 0; + while(1) { - uint8 *target = ((uint8*)m_pData) + (m_iCurBit>>3); + char val = ReadChar(); + if ( val == 0 ) + break; + else if ( bLine && val == '\n' ) + break; - target[0] = static_cast(data | 0x80); - if ( data >= (1 << 7) ) + if ( iChar < ( maxLen - 1 ) ) { - target[1] = static_cast((data >> 7) | 0x80); - if ( data >= (1 << 14) ) - { - target[2] = static_cast((data >> 14) | 0x80); - if ( data >= (1 << 21) ) - { - target[3] = static_cast((data >> 21) | 0x80); - if ( data >= (1 << 28) ) - { - target[4] = static_cast(data >> 28); - m_iCurBit += 5 * 8; - return; - } - else - { - target[3] &= 0x7F; - m_iCurBit += 4 * 8; - return; - } - } - else - { - target[2] &= 0x7F; - m_iCurBit += 3 * 8; - return; - } - } - else - { - target[1] &= 0x7F; - m_iCurBit += 2 * 8; - return; - } + pStr[ iChar ] = val; + ++iChar; } else { - target[0] &= 0x7F; - m_iCurBit += 1 * 8; - return; - } - } - else // Slow path - { - while ( data > 0x7F ) - { - WriteUBitLong( (data & 0x7F) | 0x80, 8 ); - data >>= 7; - } - WriteUBitLong( data & 0x7F, 8 ); - } -} - -void bf_write::WriteVarInt64( uint64 data ) -{ - // Check if align and we have room, slow path if not - if ( (m_iCurBit & 7) == 0 && (m_iCurBit + bitbuf::kMaxVarintBytes * 8 ) <= m_nDataBits ) - { - uint8 *target = ((uint8*)m_pData) + (m_iCurBit>>3); - - // Splitting into 32-bit pieces gives better performance on 32-bit - // processors. - uint32 part0 = static_cast(data ); - uint32 part1 = static_cast(data >> 28); - uint32 part2 = static_cast(data >> 56); - - int size; - - // Here we can't really optimize for small numbers, since the data is - // split into three parts. Cheking for numbers < 128, for instance, - // would require three comparisons, since you'd have to make sure part1 - // and part2 are zero. However, if the caller is using 64-bit integers, - // it is likely that they expect the numbers to often be very large, so - // we probably don't want to optimize for small numbers anyway. Thus, - // we end up with a hardcoded binary search tree... - if ( part2 == 0 ) - { - if ( part1 == 0 ) - { - if ( part0 < (1 << 14) ) - { - if ( part0 < (1 << 7) ) - { - size = 1; goto size1; - } - else - { - size = 2; goto size2; - } - } - else - { - if ( part0 < (1 << 21) ) - { - size = 3; goto size3; - } - else - { - size = 4; goto size4; - } - } - } - else - { - if ( part1 < (1 << 14) ) - { - if ( part1 < (1 << 7) ) - { - size = 5; goto size5; - } - else - { - size = 6; goto size6; - } - } - else - { - if ( part1 < (1 << 21) ) - { - size = 7; goto size7; - } - else - { - size = 8; goto size8; - } - } - } - } - else - { - if ( part2 < (1 << 7) ) - { - size = 9; goto size9; - } - else - { - size = 10; goto size10; - } - } - - AssertFatalMsg( false, "Can't get here." ); - - size10: target[9] = static_cast((part2 >> 7) | 0x80); - size9 : target[8] = static_cast((part2 ) | 0x80); - size8 : target[7] = static_cast((part1 >> 21) | 0x80); - size7 : target[6] = static_cast((part1 >> 14) | 0x80); - size6 : target[5] = static_cast((part1 >> 7) | 0x80); - size5 : target[4] = static_cast((part1 ) | 0x80); - size4 : target[3] = static_cast((part0 >> 21) | 0x80); - size3 : target[2] = static_cast((part0 >> 14) | 0x80); - size2 : target[1] = static_cast((part0 >> 7) | 0x80); - size1 : target[0] = static_cast((part0 ) | 0x80); - - target[size-1] &= 0x7F; - m_iCurBit += size * 8; - } - else // slow path - { - while ( data > 0x7F ) - { - WriteUBitLong( (data & 0x7F) | 0x80, 8 ); - data >>= 7; - } - WriteUBitLong( data & 0x7F, 8 ); - } -} - -void bf_write::WriteSignedVarInt32( int32 data ) -{ - WriteVarInt32( bitbuf::ZigZagEncode32( data ) ); -} - -void bf_write::WriteSignedVarInt64( int64 data ) -{ - WriteVarInt64( bitbuf::ZigZagEncode64( data ) ); -} - -int bf_write::ByteSizeVarInt32( uint32 data ) -{ - int size = 1; - while ( data > 0x7F ) { - size++; - data >>= 7; - } - return size; -} - -int bf_write::ByteSizeVarInt64( uint64 data ) -{ - int size = 1; - while ( data > 0x7F ) { - size++; - data >>= 7; - } - return size; -} - -int bf_write::ByteSizeSignedVarInt32( int32 data ) -{ - return ByteSizeVarInt32( bitbuf::ZigZagEncode32( data ) ); -} - -int bf_write::ByteSizeSignedVarInt64( int64 data ) -{ - return ByteSizeVarInt64( bitbuf::ZigZagEncode64( data ) ); -} - -void bf_write::WriteBitLong(unsigned int data, int numbits, bool bSigned) -{ - if(bSigned) - WriteSBitLong((int)data, numbits); - else - WriteUBitLong(data, numbits); -} - -bool bf_write::WriteBits(const void *pInData, int nBits) -{ -#if defined( BB_PROFILING ) - VPROF( "bf_write::WriteBits" ); -#endif - - unsigned char *pOut = (unsigned char*)pInData; - int nBitsLeft = nBits; - - // Bounds checking.. - if (GetNumBitsLeft() < nBits) - { - const bool recovered = CallErrorHandler(BITBUFERROR_BUFFER_OVERRUN); - if (!recovered || (recovered && (GetNumBitsLeft() < nBits))) - { - SetOverflowFlag(); - return false; + bTooSmall = true; } } - // Align output to dword boundary - while (((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8) - { + // Make sure it's null-terminated. + assert( iChar < maxLen ); + pStr[ iChar ] = 0; - WriteUBitLong( *pOut, 8, false ); - ++pOut; - nBitsLeft -= 8; - } - - if ( IsPC() && (nBitsLeft >= 32) && (m_iCurBit & 7) == 0 ) + if ( pOutNumChars ) { - // current bit is byte aligned, do block copy - int numbytes = nBitsLeft >> 3; - int numbits = numbytes << 3; - - memcpy( (char*)m_pData+(m_iCurBit>>3), pOut, numbytes ); - pOut += numbytes; - nBitsLeft -= numbits; - m_iCurBit += numbits; + *pOutNumChars = iChar; } - // X360TBD: Can't write dwords in WriteBits because they'll get swapped - if ( IsPC() && nBitsLeft >= 32 ) - { - unsigned long iBitsRight = (m_iCurBit & 31); - unsigned long iBitsLeft = 32 - iBitsRight; - unsigned long bitMaskLeft = g_BitWriteMasks[iBitsRight][32]; - unsigned long bitMaskRight = g_BitWriteMasks[0][iBitsRight]; - - unsigned long *pData = &m_pData[m_iCurBit>>5]; - - // Read dwords. - while(nBitsLeft >= 32) - { - unsigned long curData = *(unsigned long*)pOut; - pOut += sizeof(unsigned long); - - *pData &= bitMaskLeft; - *pData |= curData << iBitsRight; - - pData++; - - if ( iBitsLeft < 32 ) - { - curData >>= iBitsLeft; - *pData &= bitMaskRight; - *pData |= curData; - } - - nBitsLeft -= 32; - m_iCurBit += 32; - } - } - - - // write remaining bytes - while ( nBitsLeft >= 8 ) - { - WriteUBitLong( *pOut, 8, false ); - ++pOut; - nBitsLeft -= 8; - } - - // write remaining bits - if ( nBitsLeft ) - { - WriteUBitLong( *pOut, nBitsLeft, false ); - } - - return !IsOverflowed(); -} - - -bool bf_write::WriteBitsFromBuffer( bf_read *pIn, int nBits ) -{ - // This could be optimized a little by - while ( nBits > 32 ) - { - WriteUBitLong( pIn->ReadUBitLong( 32 ), 32 ); - nBits -= 32; - } - - WriteUBitLong( pIn->ReadUBitLong( nBits ), nBits ); - return !IsOverflowed() && !pIn->IsOverflowed(); -} - - -void bf_write::WriteBitAngle( float fAngle, int numbits ) -{ - int d; - unsigned int mask; - unsigned int shift; - - shift = BitForBitnum(numbits); - mask = shift - 1; - - d = (int)( (fAngle / 360.0) * shift ); - d &= mask; - - WriteUBitLong((unsigned int)d, numbits); -} - -void bf_write::WriteBitCoordMP( const float f, bool bIntegral, bool bLowPrecision ) -{ -#if defined( BB_PROFILING ) - VPROF( "bf_write::WriteBitCoordMP" ); -#endif - int signbit = (f <= -( bLowPrecision ? COORD_RESOLUTION_LOWPRECISION : COORD_RESOLUTION )); - int intval = (int)std::abs(f); - int fractval = bLowPrecision ? - ( std::abs((int)(f*COORD_DENOMINATOR_LOWPRECISION)) & (COORD_DENOMINATOR_LOWPRECISION-1) ) : - ( std::abs((int)(f*COORD_DENOMINATOR)) & (COORD_DENOMINATOR-1) ); - - bool bInBounds = intval < (1 << COORD_INTEGER_BITS_MP ); - - unsigned int bits, numbits; - - if ( bIntegral ) - { - // Integer encoding: in-bounds bit, nonzero bit, optional sign bit + integer value bits - if ( intval ) - { - // Adjust the integers from [1..MAX_COORD_VALUE] to [0..MAX_COORD_VALUE-1] - --intval; - bits = intval * 8 + signbit * 4 + 2 + bInBounds; - numbits = 3 + (bInBounds ? COORD_INTEGER_BITS_MP : COORD_INTEGER_BITS); - } - else - { - bits = bInBounds; - numbits = 2; - } - } - else - { - // Float encoding: in-bounds bit, integer bit, sign bit, fraction value bits, optional integer value bits - if ( intval ) - { - // Adjust the integers from [1..MAX_COORD_VALUE] to [0..MAX_COORD_VALUE-1] - --intval; - bits = intval * 8 + signbit * 4 + 2 + bInBounds; - bits += bInBounds ? (fractval << (3+COORD_INTEGER_BITS_MP)) : (fractval << (3+COORD_INTEGER_BITS)); - numbits = 3 + (bInBounds ? COORD_INTEGER_BITS_MP : COORD_INTEGER_BITS) - + (bLowPrecision ? COORD_FRACTIONAL_BITS_MP_LOWPRECISION : COORD_FRACTIONAL_BITS); - } - else - { - bits = fractval * 8 + signbit * 4 + 0 + bInBounds; - numbits = 3 + (bLowPrecision ? COORD_FRACTIONAL_BITS_MP_LOWPRECISION : COORD_FRACTIONAL_BITS); - } - } - - WriteUBitLong( bits, numbits ); -} - -void bf_write::WriteBitCoord (const float f) -{ -#if defined( BB_PROFILING ) - VPROF( "bf_write::WriteBitCoord" ); -#endif - int signbit = (f <= -COORD_RESOLUTION); - int intval = (int)std::abs(f); - int fractval = std::abs((int)(f*COORD_DENOMINATOR)) & (COORD_DENOMINATOR-1); - - - // Send the bit flags that indicate whether we have an integer part and/or a fraction part. - WriteOneBit( intval ); - WriteOneBit( fractval ); - - if ( intval || fractval ) - { - // Send the sign bit - WriteOneBit( signbit ); - - // Send the integer if we have one. - if ( intval ) - { - // Adjust the integers from [1..MAX_COORD_VALUE] to [0..MAX_COORD_VALUE-1] - intval--; - WriteUBitLong( (unsigned int)intval, COORD_INTEGER_BITS ); - } - - // Send the fraction if we have one - if ( fractval ) - { - WriteUBitLong( (unsigned int)fractval, COORD_FRACTIONAL_BITS ); - } - } -} - -void bf_write::WriteBitVec3Coord( const Vector& fa ) -{ - int xflag, yflag, zflag; - - xflag = (fa[0] >= COORD_RESOLUTION) || (fa[0] <= -COORD_RESOLUTION); - yflag = (fa[1] >= COORD_RESOLUTION) || (fa[1] <= -COORD_RESOLUTION); - zflag = (fa[2] >= COORD_RESOLUTION) || (fa[2] <= -COORD_RESOLUTION); - - WriteOneBit( xflag ); - WriteOneBit( yflag ); - WriteOneBit( zflag ); - - if ( xflag ) - WriteBitCoord( fa[0] ); - if ( yflag ) - WriteBitCoord( fa[1] ); - if ( zflag ) - WriteBitCoord( fa[2] ); -} - -void bf_write::WriteBitNormal( float f ) -{ - int signbit = (f <= -NORMAL_RESOLUTION); - - // NOTE: Since +/-1 are valid values for a normal, I'm going to encode that as all ones - unsigned int fractval = std::abs( (int)(f*NORMAL_DENOMINATOR) ); - - // clamp.. - if (fractval > NORMAL_DENOMINATOR) - fractval = NORMAL_DENOMINATOR; - - // Send the sign bit - WriteOneBit( signbit ); - - // Send the fractional component - WriteUBitLong( fractval, NORMAL_FRACTIONAL_BITS ); -} - -void bf_write::WriteBitVec3Normal( const Vector& fa ) -{ - int xflag, yflag; - - xflag = (fa[0] >= NORMAL_RESOLUTION) || (fa[0] <= -NORMAL_RESOLUTION); - yflag = (fa[1] >= NORMAL_RESOLUTION) || (fa[1] <= -NORMAL_RESOLUTION); - - WriteOneBit( xflag ); - WriteOneBit( yflag ); - - if ( xflag ) - WriteBitNormal( fa[0] ); - if ( yflag ) - WriteBitNormal( fa[1] ); - - // Write z sign bit - int signbit = (fa[2] <= -NORMAL_RESOLUTION); - WriteOneBit( signbit ); -} - -void bf_write::WriteBitAngles( const QAngle& fa ) -{ - // FIXME: - Vector tmp( fa.x, fa.y, fa.z ); - WriteBitVec3Coord( tmp ); -} - -void bf_write::WriteChar(int val) -{ - WriteSBitLong(val, sizeof(char) << 3); -} - -void bf_write::WriteByte(int val) -{ - WriteUBitLong(val, sizeof(unsigned char) << 3); -} - -void bf_write::WriteShort(int val) -{ - WriteSBitLong(val, sizeof(short) << 3); -} - -void bf_write::WriteWord(int val) -{ - WriteUBitLong(val, sizeof(unsigned short) << 3); -} - -void bf_write::WriteLong(long val) -{ - WriteSBitLong(val, sizeof(long) << 3); -} - -void bf_write::WriteLongLong(int64 val) -{ - uint *pLongs = (uint*)&val; - - // Insert the two DWORDS according to network endian - const short endianIndex = 0x0100; - byte *idx = (byte*)&endianIndex; - WriteUBitLong(pLongs[*idx++], sizeof(long) << 3); - WriteUBitLong(pLongs[*idx], sizeof(long) << 3); -} - -void bf_write::WriteFloat(float val) -{ - // Pre-swap the float, since WriteBits writes raw data - LittleFloat( &val, &val ); - - WriteBits(&val, sizeof(val) << 3); -} - -bool bf_write::WriteBytes( const void *pBuf, int nBytes ) -{ - return WriteBits(pBuf, nBytes << 3); -} - -bool bf_write::WriteString(const char *pStr) -{ - if(pStr) - { - do - { - WriteChar( *pStr ); - ++pStr; - } while( *(pStr-1) != 0 ); - } - else - { - WriteChar( 0 ); - } - - return !IsOverflowed(); -} - -// ---------------------------------------------------------------------------------------- // -// bf_read -// ---------------------------------------------------------------------------------------- // - -bf_read::bf_read() -{ - m_pData = NULL; - m_nDataBytes = 0; - m_nDataBits = -1; // set to -1 so we overflow on any operation - m_iCurBit = 0; - m_bOverflow = false; - m_bAssertOnOverflow = true; - m_pDebugName = NULL; - m_errorHandler = NULL; -} - -bf_read::bf_read( const void *pData, int nBytes, int nBits ) -{ - StartReading( pData, nBytes, 0, nBits ); - m_bAssertOnOverflow = true; - m_pDebugName = NULL; - m_errorHandler = NULL; -} - -bf_read::bf_read( const char *pDebugName, const void *pData, int nBytes, int nBits ) -{ - StartReading( pData, nBytes, 0, nBits ); - m_bAssertOnOverflow = true; - m_pDebugName = pDebugName; - m_errorHandler = NULL; -} - -void bf_read::StartReading( const void *pData, int nBytes, int iStartBit, int nBits ) -{ - // Make sure we're dword aligned. - Assert(((size_t)pData & 3) == 0); - - m_pData = (unsigned char*)pData; - m_nDataBytes = nBytes; - - if ( nBits == -1 ) - { - m_nDataBits = m_nDataBytes << 3; - } - else - { - Assert( nBits <= nBytes*8 ); - m_nDataBits = nBits; - } - - m_iCurBit = iStartBit; - m_bOverflow = false; -} - -void bf_read::Reset() -{ - m_iCurBit = 0; - m_bOverflow = false; -} - -void bf_read::SetAssertOnOverflow( bool bAssert ) -{ - m_bAssertOnOverflow = bAssert; -} - -void bf_read::SetDebugName( const char *pName ) -{ - m_pDebugName = pName; -} - -void bf_read::SetErrorHandler(IBitBufErrorHandler* handler) -{ - m_errorHandler = handler; -} - -bool bf_read::CallErrorHandler(BitBufErrorType errorType) -{ - if (m_errorHandler) - { - return m_errorHandler->HandleError(errorType, GetDebugName()); - } - return false; -} - -void bf_read::SetOverflowFlag() -{ - if ( m_bAssertOnOverflow ) - { - Assert( false ); - } - m_bOverflow = true; -} - -unsigned int bf_read::CheckReadUBitLong(int numbits) -{ - // Ok, just read bits out. - int i, nBitValue; - unsigned int r = 0; - - for(i=0; i < numbits; i++) - { - nBitValue = ReadOneBitNoCheck(); - r |= nBitValue << i; - } - m_iCurBit -= numbits; - - return r; -} - -void bf_read::ReadBits(void *pOutData, int nBits) -{ -#if defined( BB_PROFILING ) - VPROF( "bf_read::ReadBits" ); -#endif - - unsigned char *pOut = (unsigned char*)pOutData; - int nBitsLeft = nBits; - - - // align output to dword boundary - while( ((size_t)pOut & 3) != 0 && nBitsLeft >= 8 ) - { - *pOut = (unsigned char)ReadUBitLong(8); - ++pOut; - nBitsLeft -= 8; - } - - // X360TBD: Can't read dwords in ReadBits because they'll get swapped - if ( IsPC() ) - { - // read dwords - while ( nBitsLeft >= 32 ) - { - *((unsigned long*)pOut) = ReadUBitLong(32); - pOut += sizeof(unsigned long); - nBitsLeft -= 32; - } - } - - // read remaining bytes - while ( nBitsLeft >= 8 ) - { - *pOut = ReadUBitLong(8); - ++pOut; - nBitsLeft -= 8; - } - - // read remaining bits - if ( nBitsLeft ) - { - *pOut = ReadUBitLong(nBitsLeft); - } - -} - -int bf_read::ReadBitsClamped_ptr(void *pOutData, size_t outSizeBytes, size_t nBits) -{ - size_t outSizeBits = outSizeBytes * 8; - size_t readSizeBits = nBits; - int skippedBits = 0; - if ( readSizeBits > outSizeBits ) - { - // Should we print a message when we clamp the data being read? Only - // in debug builds I think. - AssertMsg( 0, "Oversized network packet received, and clamped." ); - readSizeBits = outSizeBits; - skippedBits = (int)( nBits - outSizeBits ); - // What should we do in this case, which should only happen if nBits - // is negative for some reason? - //if ( skippedBits < 0 ) - // return 0; - } - - ReadBits( pOutData, readSizeBits ); - SeekRelative( skippedBits ); - - // Return the number of bits actually read. - return (int)readSizeBits; -} - -float bf_read::ReadBitAngle( int numbits ) -{ - float fReturn; - int i; - float shift; - - shift = (float)( BitForBitnum(numbits) ); - - i = ReadUBitLong( numbits ); - fReturn = static_cast(i * (360.0 / shift)); - - return fReturn; -} - -unsigned int bf_read::PeekUBitLong( int numbits ) -{ - unsigned int r; - int i, nBitValue; -#ifdef BIT_VERBOSE - int nShifts = numbits; -#endif - - bf_read savebf; - - savebf = *this; // Save current state info - - r = 0; - for(i=0; i < numbits; i++) - { - nBitValue = ReadOneBit(); - - // Append to current stream - if ( nBitValue ) - { - r |= BitForBitnum(i); - } - } - - *this = savebf; - -#ifdef BIT_VERBOSE - Con_Printf( "PeekBitLong: %i %i\n", nShifts, (unsigned int)r ); -#endif - - return r; -} - -unsigned int bf_read::ReadUBitLongNoInline( int numbits ) -{ - return ReadUBitLong( numbits ); -} - -unsigned int bf_read::ReadUBitVarInternal( int encodingType ) -{ - m_iCurBit -= 4; - // int bits = { 4, 8, 12, 32 }[ encodingType ]; - int bits = 4 + encodingType*4 + (((2 - encodingType) >> 31) & 16); - return ReadUBitLong( bits ); -} - -// Append numbits least significant bits from data to the current bit stream -int bf_read::ReadSBitLong( int numbits ) -{ - unsigned int r = ReadUBitLong(numbits); - unsigned int s = 1 << (numbits-1); - if (r >= s) - { - // sign-extend by removing sign bit and then subtracting sign bit again - r = r - s - s; - } - return r; + return !IsOverflowed() && !bTooSmall; } +// Read 1-5 bytes in order to extract a 32-bit unsigned value from the +// stream. 7 data bits are extracted from each byte with the 8th bit used +// to indicate whether the loop should continue. +// This allows variable size numbers to be stored with tolerable +// efficiency. Numbers sizes that can be stored for various numbers of +// encoded bits are: +// 8-bits: 0-127 +// 16-bits: 128-16383 +// 24-bits: 16384-2097151 +// 32-bits: 2097152-268435455 +// 40-bits: 268435456-0xFFFFFFFF uint32 bf_read::ReadVarInt32() { uint32 result = 0; @@ -1050,9 +404,9 @@ uint32 bf_read::ReadVarInt32() return result; } b = ReadUBitLong( 8 ); - result |= (b & 0x7F) << (7 * count); + result |= ( b & 0x7F ) << ( 7 * count ); ++count; - } while (b & 0x80); + } while ( b & 0x80 ); return result; } @@ -1077,33 +431,105 @@ uint64 bf_read::ReadVarInt64() return result; } -int32 bf_read::ReadSignedVarInt32() +void bf_read::ReadBits( void *pOutData, int nBits ) { - uint32 value = ReadVarInt32(); - return bitbuf::ZigZagDecode32( value ); + unsigned char *pOut = ( unsigned char* )pOutData; + int nBitsLeft = nBits; + + + // align output to dword boundary + while( ( ( uintptr_t )pOut & 3 ) != 0 && nBitsLeft >= 8 ) + { + *pOut = ( unsigned char )ReadUBitLong( 8 ); + ++pOut; + nBitsLeft -= 8; + } + + // read dwords + while ( nBitsLeft >= 32 ) + { + *( ( uint32_t* )pOut ) = ReadUBitLong( 32 ); + pOut += sizeof( uint32_t ); + nBitsLeft -= 32; + } + + // read remaining bytes + while ( nBitsLeft >= 8 ) + { + *pOut = ReadUBitLong( 8 ); + ++pOut; + nBitsLeft -= 8; + } + + // read remaining bits + if ( nBitsLeft ) + { + *pOut = ReadUBitLong( nBitsLeft ); + } + } -int64 bf_read::ReadSignedVarInt64() +bool bf_read::ReadBytes( void *pOut, int nBytes ) { - uint64 value = ReadVarInt64(); - return bitbuf::ZigZagDecode64( value ); + ReadBits( pOut, nBytes << 3 ); + return !IsOverflowed(); } -unsigned int bf_read::ReadBitLong(int numbits, bool bSigned) -{ - if(bSigned) - return (unsigned int)ReadSBitLong(numbits); - else - return ReadUBitLong(numbits); +#define BITS_PER_INT 32 +inline int GetBitForBitnum( int bitNum ) +{ + static int bitsForBitnum[] = + { + ( 1 << 0 ), + ( 1 << 1 ), + ( 1 << 2 ), + ( 1 << 3 ), + ( 1 << 4 ), + ( 1 << 5 ), + ( 1 << 6 ), + ( 1 << 7 ), + ( 1 << 8 ), + ( 1 << 9 ), + ( 1 << 10 ), + ( 1 << 11 ), + ( 1 << 12 ), + ( 1 << 13 ), + ( 1 << 14 ), + ( 1 << 15 ), + ( 1 << 16 ), + ( 1 << 17 ), + ( 1 << 18 ), + ( 1 << 19 ), + ( 1 << 20 ), + ( 1 << 21 ), + ( 1 << 22 ), + ( 1 << 23 ), + ( 1 << 24 ), + ( 1 << 25 ), + ( 1 << 26 ), + ( 1 << 27 ), + ( 1 << 28 ), + ( 1 << 29 ), + ( 1 << 30 ), + ( 1 << 31 ), + }; + + return bitsForBitnum[ (bitNum) & (BITS_PER_INT-1) ]; } +float bf_read::ReadBitAngle( int numbits ) +{ + float shift = (float)( GetBitForBitnum(numbits) ); + + int i = ReadUBitLong( numbits ); + float fReturn = (float)i * (360.0f / shift); + + return fReturn; +} // Basic Coordinate Routines (these contain bit-field size AND fixed point scaling constants) float bf_read::ReadBitCoord (void) { -#if defined( BB_PROFILING ) - VPROF( "bf_read::ReadBitCoord" ); -#endif int intval=0,fractval=0,signbit=0; float value = 0.0; @@ -1132,7 +558,7 @@ float bf_read::ReadBitCoord (void) } // Calculate the correct floating point value - value = intval + static_cast((float)fractval * COORD_RESOLUTION); + value = intval + ((float)fractval * COORD_RESOLUTION); // Fixup the sign if negative. if ( signbit ) @@ -1142,149 +568,97 @@ float bf_read::ReadBitCoord (void) return value; } -float bf_read::ReadBitCoordMP( bool bIntegral, bool bLowPrecision ) +float bf_read::ReadBitCoordMP( EBitCoordType coordType ) { -#if defined( BB_PROFILING ) - VPROF( "bf_read::ReadBitCoordMP" ); -#endif - // BitCoordMP float encoding: inbounds bit, integer bit, sign bit, optional int bits, float bits - // BitCoordMP integer encoding: inbounds bit, integer bit, optional sign bit, optional int bits. - // int bits are always encoded as (value - 1) since zero is handled by the integer bit + bool bIntegral = ( coordType == kCW_Integral ); + bool bLowPrecision = ( coordType == kCW_LowPrecision ); - // With integer-only encoding, the presence of the third bit depends on the second - int flags = ReadUBitLong(3 - bIntegral); - enum { INBOUNDS=1, INTVAL=2, SIGN=4 }; + int intval=0,fractval=0,signbit=0; + float value = 0.0; + + bool bInBounds = ReadOneBit() ? true : false; if ( bIntegral ) { - if ( flags & INTVAL ) + // Read the required integer and fraction flags + intval = ReadOneBit(); + // If we got either parse them, otherwise it's a zero. + if ( intval ) { - // Read the third bit and the integer portion together at once - unsigned int bits = ReadUBitLong( (flags & INBOUNDS) ? COORD_INTEGER_BITS_MP+1 : COORD_INTEGER_BITS+1 ); - // Remap from [0,N] to [1,N+1] - int intval = (bits >> 1) + 1; - return static_cast((bits & 1) ? -intval : intval); - } - return 0.f; - } - - static const float mul_table[4] = - { - 1.f/(1<> COORD_INTEGER_BITS_MP; - uint fracbits = bits >> COORD_INTEGER_BITS; - - uint intmaskMP = ((1<((float)fractval * NORMAL_RESOLUTION); + float value = (float)fractval * NORMAL_RESOLUTION; // Fixup the sign if negative. if ( signbit ) @@ -1331,26 +705,26 @@ void bf_read::ReadBitVec3Normal( Vector& fa ) int yflag = ReadOneBit(); if (xflag) - fa[0] = ReadBitNormal(); + fa.x = ReadBitNormal(); else - fa[0] = 0.0f; + fa.x = 0.0f; if (yflag) - fa[1] = ReadBitNormal(); + fa.y = ReadBitNormal(); else - fa[1] = 0.0f; + fa.y = 0.0f; // The first two imply the third (but not its sign) int znegative = ReadOneBit(); - float fafafbfb = fa[0] * fa[0] + fa[1] * fa[1]; + float fafafbfb = fa.x * fa.x + fa.y * fa.y; if (fafafbfb < 1.0f) - fa[2] = std::sqrt( 1.0f - fafafbfb ); + fa.z = sqrt( 1.0f - fafafbfb ); else - fa[2] = 0.0f; + fa.z = 0.0f; if (znegative) - fa[2] = -fa[2]; + fa.z = -fa.z; } void bf_read::ReadBitAngles( QAngle& fa ) @@ -1360,150 +734,9 @@ void bf_read::ReadBitAngles( QAngle& fa ) fa.Init( tmp.x, tmp.y, tmp.z ); } -int64 bf_read::ReadLongLong() +float bf_read::ReadBitFloat( void ) { - int64 retval; - uint *pLongs = (uint*)&retval; - - // Read the two DWORDs according to network endian - const short endianIndex = 0x0100; - byte *idx = (byte*)&endianIndex; - pLongs[*idx++] = ReadUBitLong(sizeof(long) << 3); - pLongs[*idx] = ReadUBitLong(sizeof(long) << 3); - - return retval; + uint32 nvalue = ReadUBitLong( 32 ); + return *( ( float * ) &nvalue ); } -float bf_read::ReadFloat() -{ - float ret; - Assert( sizeof(ret) == 4 ); - ReadBits(&ret, 32); - - // Swap the float, since ReadBits reads raw data - LittleFloat( &ret, &ret ); - return ret; -} - -bool bf_read::ReadBytes(void *pOut, int nBytes) -{ - ReadBits(pOut, nBytes << 3); - return !IsOverflowed(); -} - -bool bf_read::ReadString( char *pStr, int maxLen, bool bLine, int *pOutNumChars ) -{ - Assert( maxLen != 0 ); - - bool bTooSmall = false; - int iChar = 0; - while(1) - { - char val = ReadChar(); - if ( val == 0 ) - break; - else if ( bLine && val == '\n' ) - break; - - if ( iChar < (maxLen-1) ) - { - pStr[iChar] = val; - ++iChar; - } - else - { - bTooSmall = true; - } - } - - // Make sure it's null-terminated. - Assert( iChar < maxLen ); - pStr[iChar] = 0; - - if ( pOutNumChars ) - *pOutNumChars = iChar; - - return !IsOverflowed() && !bTooSmall; -} - - -char* bf_read::ReadAndAllocateString( bool *pOverflow ) -{ - char str[2048]; - - int nChars; - bool bOverflow = !ReadString( str, sizeof( str ), false, &nChars ); - if ( pOverflow ) - *pOverflow = bOverflow; - - // Now copy into the output and return it; - char *pRet = new char[ nChars + 1 ]; - for ( int i=0; i <= nChars; i++ ) - pRet[i] = str[i]; - - return pRet; -} - -void bf_read::ExciseBits( int startbit, int bitstoremove ) -{ - int endbit = startbit + bitstoremove; - int remaining_to_end = m_nDataBits - endbit; - - bf_write temp; - temp.StartWriting( (void *)m_pData, m_nDataBits << 3, startbit ); - - Seek( endbit ); - - for ( int i = 0; i < remaining_to_end; i++ ) - { - temp.WriteOneBit( ReadOneBit() ); - } - - Seek( startbit ); - - m_nDataBits -= bitstoremove; - m_nDataBytes = m_nDataBits >> 3; -} - -int bf_read::CompareBitsAt( int offset, bf_read * __restrict other, int otherOffset, int numbits ) -{ - extern unsigned long g_ExtraMasks[33]; - - if ( numbits == 0 ) - return 0; - - int overflow1 = offset + numbits > m_nDataBits; - int overflow2 = otherOffset + numbits > other->m_nDataBits; - - int x = overflow1 | overflow2; - if ( x != 0 ) - return x; - - unsigned int iStartBit1 = offset & 31u; - unsigned int iStartBit2 = otherOffset & 31u; - unsigned long *pData1 = (unsigned long*)m_pData + (offset >> 5); - unsigned long *pData2 = (unsigned long*)other->m_pData + (otherOffset >> 5); - unsigned long *pData1End = pData1 + ((offset + numbits - 1) >> 5); - unsigned long *pData2End = pData2 + ((otherOffset + numbits - 1) >> 5); - - while ( numbits > 32 ) - { - x = LoadLittleDWord( (unsigned long*)pData1, 0 ) >> iStartBit1; - x ^= LoadLittleDWord( (unsigned long*)pData1, 1 ) << (32 - iStartBit1); - x ^= LoadLittleDWord( (unsigned long*)pData2, 0 ) >> iStartBit2; - x ^= LoadLittleDWord( (unsigned long*)pData2, 1 ) << (32 - iStartBit2); - if ( x != 0 ) - { - return x; - } - ++pData1; - ++pData2; - numbits -= 32; - } - - x = LoadLittleDWord( (unsigned long*)pData1, 0 ) >> iStartBit1; - x ^= LoadLittleDWord( (unsigned long*)pData1End, 0 ) << (32 - iStartBit1); - x ^= LoadLittleDWord( (unsigned long*)pData2, 0 ) >> iStartBit2; - x ^= LoadLittleDWord( (unsigned long*)pData2End, 0 ) << (32 - iStartBit2); - return x & g_ExtraMasks[ numbits ]; -} diff --git a/external/sourcesdk/common.cpp b/external/sourcesdk/common.cpp index 4a8b165..50c74e3 100644 --- a/external/sourcesdk/common.cpp +++ b/external/sourcesdk/common.cpp @@ -1,6 +1,7 @@ #include "sourcesdk/common.h" -#include "snappy/snappy.h" +#include "snappy.h" +#include "snappy-sinksource.h" #include static const uint32 INVALID = static_cast(-1); @@ -44,7 +45,7 @@ uint32 COM_BufferToBufferDecompress(uint8* dest, uint32 destLen, const uint8* sr uint32 COM_GetUncompressedSize(const uint8* data, uint32 numBytes) { - size_t uncompressedLength = INVALID; + uint32 uncompressedLength = INVALID; if (numBytes > 4) { const uint32 magic = U8ToU32(data); @@ -55,7 +56,8 @@ uint32 COM_GetUncompressedSize(const uint8* data, uint32 numBytes) if (magic == SNAPPY_ID) { - snappy::GetUncompressedLength(reinterpret_cast(data + 4), numBytes - 4, &uncompressedLength); + snappy::ByteArraySource source = {reinterpret_cast(data + 4), numBytes - 4}; + snappy::GetUncompressedLength(&source, &uncompressedLength); } } return static_cast(uncompressedLength); diff --git a/external/sourcesdk/include/sourcesdk/bitbuf.h b/external/sourcesdk/include/sourcesdk/bitbuf.h index ea48964..2cbe5f1 100644 --- a/external/sourcesdk/include/sourcesdk/bitbuf.h +++ b/external/sourcesdk/include/sourcesdk/bitbuf.h @@ -1,57 +1,55 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// +//====== Copyright (c) 2014, Valve Corporation, All rights reserved. ========// // -// Purpose: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: // -// $NoKeywords: $ +// Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. // -//=============================================================================// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +// THE POSSIBILITY OF SUCH DAMAGE. +//===========================================================================// -// NOTE: bf_read is guaranteed to return zeros if it overflows. - -#pragma once +#ifndef DEMOFILEBITBUF_H +#define DEMOFILEBITBUF_H #include "valve_support.h" -//----------------------------------------------------------------------------- -// Forward declarations. -//----------------------------------------------------------------------------- +// OVERALL Coordinate Size Limits used in COMMON.C MSG_*BitCoord() Routines (and someday the HUD) +#define COORD_INTEGER_BITS 14 +#define COORD_FRACTIONAL_BITS 5 +#define COORD_DENOMINATOR (1<<(COORD_FRACTIONAL_BITS)) +#define COORD_RESOLUTION (1.0f/(COORD_DENOMINATOR)) -class Vector; -class QAngle; +// Special threshold for networking multiplayer origins +#define COORD_INTEGER_BITS_MP 11 +#define COORD_FRACTIONAL_BITS_MP_LOWPRECISION 3 +#define COORD_DENOMINATOR_LOWPRECISION (1<<(COORD_FRACTIONAL_BITS_MP_LOWPRECISION)) +#define COORD_RESOLUTION_LOWPRECISION (1.0f/(COORD_DENOMINATOR_LOWPRECISION)) -//----------------------------------------------------------------------------- -// You can define a handler function that will be called in case of -// out-of-range values and overruns here. -// -// NOTE: the handler is only called in debug mode. -// -// Call SetBitBufErrorHandler to install a handler. -//----------------------------------------------------------------------------- +#define NORMAL_FRACTIONAL_BITS 11 +#define NORMAL_DENOMINATOR ( (1<<(NORMAL_FRACTIONAL_BITS)) - 1 ) +#define NORMAL_RESOLUTION (1.0f/(NORMAL_DENOMINATOR)) -typedef enum +enum EBitCoordType { - BITBUFERROR_VALUE_OUT_OF_RANGE=0, // Tried to write a value with too few bits. - BITBUFERROR_BUFFER_OVERRUN, // Was about to overrun a buffer. - - BITBUFERROR_NUM_ERRORS -} BitBufErrorType; - -class IBitBufErrorHandler -{ -public: - virtual bool HandleError(BitBufErrorType errorType, const char *pDebugName) = 0; + kCW_None, + kCW_LowPrecision, + kCW_Integral }; -//----------------------------------------------------------------------------- -// Helpers. -//----------------------------------------------------------------------------- - -inline int BitByte( int bits ) -{ - // return PAD_NUMBER( bits, 8 ) >> 3; - return (bits + 7) >> 3; -} - //----------------------------------------------------------------------------- // namespaced helpers //----------------------------------------------------------------------------- @@ -107,497 +105,110 @@ namespace bitbuf const int kMaxVarint32Bytes = 5; } -//----------------------------------------------------------------------------- -// Used for serialization -//----------------------------------------------------------------------------- - -class bf_write -{ -public: - bf_write(); - - // nMaxBits can be used as the number of bits in the buffer. - // It must be <= nBytes*8. If you leave it at -1, then it's set to nBytes * 8. - bf_write( void *pData, int nBytes, int nMaxBits = -1 ); - bf_write( const char *pDebugName, void *pData, int nBytes, int nMaxBits = -1 ); - - // Start writing to the specified buffer. - // nMaxBits can be used as the number of bits in the buffer. - // It must be <= nBytes*8. If you leave it at -1, then it's set to nBytes * 8. - void StartWriting( void *pData, int nBytes, int iStartBit = 0, int nMaxBits = -1 ); - - // Restart buffer writing. - void Reset(); - - // Get the base pointer. - unsigned char* GetBasePointer() { return (unsigned char*) m_pData; } - - // Enable or disable assertion on overflow. 99% of the time, it's a bug that we need to catch, - // but there may be the occasional buffer that is allowed to overflow gracefully. - void SetAssertOnOverflow( bool bAssert ); - - // This can be set to assign a name that gets output if the buffer overflows. - const char* GetDebugName(); - void SetDebugName( const char *pDebugName ); - - void SetErrorHandler(IBitBufErrorHandler* handler); - bool CallErrorHandler(BitBufErrorType errorType); - -// Seek to a specific position. -public: - - void SeekToBit( int bitPos ); - - -// Bit functions. -public: - - void WriteOneBit(int nValue); - void WriteOneBitNoCheck(int nValue); - void WriteOneBitAt( int iBit, int nValue ); - - // Write signed or unsigned. Range is only checked in debug. - void WriteUBitLong( unsigned int data, int numbits, bool bCheckRange=true ); - void WriteSBitLong( int data, int numbits ); - - // Tell it whether or not the data is unsigned. If it's signed, - // cast to unsigned before passing in (it will cast back inside). - void WriteBitLong(unsigned int data, int numbits, bool bSigned); - - // Write a list of bits in. - bool WriteBits(const void *pIn, int nBits); - - // writes an unsigned integer with variable bit length - void WriteUBitVar( unsigned int data ); - - // writes a varint encoded integer - void WriteVarInt32( uint32 data ); - void WriteVarInt64( uint64 data ); - void WriteSignedVarInt32( int32 data ); - void WriteSignedVarInt64( int64 data ); - int ByteSizeVarInt32( uint32 data ); - int ByteSizeVarInt64( uint64 data ); - int ByteSizeSignedVarInt32( int32 data ); - int ByteSizeSignedVarInt64( int64 data ); - - // Copy the bits straight out of pIn. This seeks pIn forward by nBits. - // Returns an error if this buffer or the read buffer overflows. - bool WriteBitsFromBuffer( class bf_read *pIn, int nBits ); - - void WriteBitAngle( float fAngle, int numbits ); - void WriteBitCoord (const float f); - void WriteBitCoordMP( const float f, bool bIntegral, bool bLowPrecision ); - void WriteBitFloat(float val); - void WriteBitVec3Coord( const Vector& fa ); - void WriteBitNormal( float f ); - void WriteBitVec3Normal( const Vector& fa ); - void WriteBitAngles( const QAngle& fa ); - - -// Byte functions. -public: - - void WriteChar(int val); - void WriteByte(int val); - void WriteShort(int val); - void WriteWord(int val); - void WriteLong(long val); - void WriteLongLong(int64 val); - void WriteFloat(float val); - bool WriteBytes( const void *pBuf, int nBytes ); - - // Returns false if it overflows the buffer. - bool WriteString(const char *pStr); - - -// Status. -public: - - // How many bytes are filled in? - int GetNumBytesWritten() const; - int GetNumBitsWritten() const; - int GetMaxNumBits() const; - int GetNumBitsLeft() const; - int GetNumBytesLeft() const; - unsigned char* GetData(); - const unsigned char* GetData() const; - - // Has the buffer overflowed? - bool CheckForOverflow(int nBits); - inline bool IsOverflowed() const {return m_bOverflow;} - - void SetOverflowFlag(); - - -public: - // The current buffer. - unsigned long* __restrict m_pData; - int m_nDataBytes; - int m_nDataBits; - - // Where we are in the buffer. - int m_iCurBit; - -private: - - // Errors? - bool m_bOverflow; - - bool m_bAssertOnOverflow; - const char *m_pDebugName; - IBitBufErrorHandler* m_errorHandler; -}; - - -//----------------------------------------------------------------------------- -// Inlined methods -//----------------------------------------------------------------------------- - -// How many bytes are filled in? -inline int bf_write::GetNumBytesWritten() const -{ - return BitByte(m_iCurBit); -} - -inline int bf_write::GetNumBitsWritten() const -{ - return m_iCurBit; -} - -inline int bf_write::GetMaxNumBits() const -{ - return m_nDataBits; -} - -inline int bf_write::GetNumBitsLeft() const -{ - return m_nDataBits - m_iCurBit; -} - -inline int bf_write::GetNumBytesLeft() const -{ - return GetNumBitsLeft() >> 3; -} - -inline unsigned char* bf_write::GetData() -{ - return (unsigned char*) m_pData; -} - -inline const unsigned char* bf_write::GetData() const -{ - return (unsigned char*) m_pData; -} - -inline bool bf_write::CheckForOverflow(int nBits) -{ - if (GetNumBitsLeft() < nBits) - { - const bool recovered = CallErrorHandler(BITBUFERROR_BUFFER_OVERRUN); - if (!recovered || (recovered && GetNumBitsLeft() < nBits)) - { - SetOverflowFlag(); - } - } - - return m_bOverflow; -} - -inline void bf_write::SetOverflowFlag() -{ -#ifdef DBGFLAG_ASSERT - if ( m_bAssertOnOverflow ) - { - Assert( false ); - } -#endif - m_bOverflow = true; -} - -inline void bf_write::WriteOneBitNoCheck(int nValue) -{ -#if __i386__ - if(nValue) - m_pData[m_iCurBit >> 5] |= 1u << (m_iCurBit & 31); - else - m_pData[m_iCurBit >> 5] &= ~(1u << (m_iCurBit & 31)); -#else - extern unsigned long g_LittleBits[32]; - if(nValue) - m_pData[m_iCurBit >> 5] |= g_LittleBits[m_iCurBit & 31]; - else - m_pData[m_iCurBit >> 5] &= ~g_LittleBits[m_iCurBit & 31]; -#endif - - ++m_iCurBit; -} - -inline void bf_write::WriteOneBit(int nValue) -{ - if( m_iCurBit >= m_nDataBits ) - { - const bool recovered = CallErrorHandler(BITBUFERROR_BUFFER_OVERRUN); - if (!recovered || (recovered && (m_iCurBit >= m_nDataBits))) - { - SetOverflowFlag(); - return; - } - } - WriteOneBitNoCheck( nValue ); -} - - -inline void bf_write::WriteOneBitAt( int iBit, int nValue ) -{ - if( iBit >= m_nDataBits ) - { - const bool recovered = CallErrorHandler(BITBUFERROR_BUFFER_OVERRUN); - if (!recovered || (recovered && (iBit >= m_nDataBits))) - { - SetOverflowFlag(); - return; - } - } - -#if __i386__ - if(nValue) - m_pData[iBit >> 5] |= 1u << (iBit & 31); - else - m_pData[iBit >> 5] &= ~(1u << (iBit & 31)); -#else - extern unsigned long g_LittleBits[32]; - if(nValue) - m_pData[iBit >> 5] |= g_LittleBits[iBit & 31]; - else - m_pData[iBit >> 5] &= ~g_LittleBits[iBit & 31]; -#endif -} - -inline void bf_write::WriteUBitLong( unsigned int curData, int numbits, bool bCheckRange ) -{ -#ifdef _DEBUG - // Make sure it doesn't overflow. - if ( bCheckRange && numbits < 32 ) - { - if ( curData >= (unsigned long)(1 << numbits) ) - { - CallErrorHandler(BITBUFERROR_VALUE_OUT_OF_RANGE); - } - } - Assert( numbits >= 0 && numbits <= 32 ); -#endif - - if ( GetNumBitsLeft() < numbits ) - { - const bool recovered = CallErrorHandler(BITBUFERROR_BUFFER_OVERRUN); - if (!recovered || (recovered && (GetNumBitsLeft() < numbits))) - { - SetOverflowFlag(); - return; - } - } - - int iCurBitMasked = m_iCurBit & 31; - int iDWord = m_iCurBit >> 5; - m_iCurBit += numbits; - - // Mask in a dword. - assert( (iDWord*4 + sizeof(long)) <= (unsigned int)m_nDataBytes ); - unsigned long * __restrict pOut = &m_pData[iDWord]; - - // Rotate data into dword alignment - curData = (curData << iCurBitMasked) | (curData >> (32 - iCurBitMasked)); - - // Calculate bitmasks for first and second word - unsigned int temp = 1 << (numbits-1); - unsigned int mask1 = (temp*2-1) << iCurBitMasked; - unsigned int mask2 = (temp-1) >> (31 - iCurBitMasked); - - // Only look beyond current word if necessary (avoid access violation) - int i = mask2 & 1; - unsigned long dword1 = LoadLittleDWord( pOut, 0 ); - unsigned long dword2 = LoadLittleDWord( pOut, i ); - - // Drop bits into place - dword1 ^= ( mask1 & ( curData ^ dword1 ) ); - dword2 ^= ( mask2 & ( curData ^ dword2 ) ); - - // Note reversed order of writes so that dword1 wins if mask2 == 0 && i == 0 - StoreLittleDWord( pOut, i, dword2 ); - StoreLittleDWord( pOut, 0, dword1 ); -} - -// writes an unsigned integer with variable bit length -inline void bf_write::WriteUBitVar( unsigned int data ) -{ - /* Reference: - if ( data < 0x10u ) - WriteUBitLong( 0, 2 ), WriteUBitLong( data, 4 ); - else if ( data < 0x100u ) - WriteUBitLong( 1, 2 ), WriteUBitLong( data, 8 ); - else if ( data < 0x1000u ) - WriteUBitLong( 2, 2 ), WriteUBitLong( data, 12 ); - else - WriteUBitLong( 3, 2 ), WriteUBitLong( data, 32 ); - */ - // a < b ? -1 : 0 translates into a CMP, SBB instruction pair - // with no flow control. should also be branchless on consoles. - int n = (data < 0x10u ? -1 : 0) + (data < 0x100u ? -1 : 0) + (data < 0x1000u ? -1 : 0); - WriteUBitLong( data*4 + n + 3, 6 + n*4 + 12 ); - if ( data >= 0x1000u ) - { - WriteUBitLong( data >> 16, 16 ); - } -} - -// write raw IEEE float bits in little endian form -inline void bf_write::WriteBitFloat(float val) -{ - long intVal; - - Assert(sizeof(long) == sizeof(float)); - Assert(sizeof(float) == 4); - - intVal = *((long*)&val); - WriteUBitLong( intVal, 32 ); -} - -//----------------------------------------------------------------------------- -// This is useful if you just want a buffer to write into on the stack. -//----------------------------------------------------------------------------- - -template -class old_bf_write_static : public bf_write -{ -public: - inline old_bf_write_static() : bf_write(m_StaticData, SIZE) {} - - char m_StaticData[SIZE]; -}; - - - -//----------------------------------------------------------------------------- -// Used for unserialization -//----------------------------------------------------------------------------- - class bf_read { + uint32 m_nInBufWord; + int m_nBitsAvail; + uint32 const *m_pDataIn; + uint32 const *m_pBufferEnd; + uint32 const *m_pData; + + bool m_bOverflow; + int m_nDataBits; + size_t m_nDataBytes; + + static const uint32 s_nMaskTable[ 33 ]; // 0 1 3 7 15 .. + public: - bf_read(); - - // nMaxBits can be used as the number of bits in the buffer. - // It must be <= nBytes*8. If you leave it at -1, then it's set to nBytes * 8. - bf_read( const void *pData, int nBytes, int nBits = -1 ); - bf_read( const char *pDebugName, const void *pData, int nBytes, int nBits = -1 ); - - // Start reading from the specified buffer. - // pData's start address must be dword-aligned. - // nMaxBits can be used as the number of bits in the buffer. - // It must be <= nBytes*8. If you leave it at -1, then it's set to nBytes * 8. - void StartReading( const void *pData, int nBytes, int iStartBit = 0, int nBits = -1 ); - - // Restart buffer reading. - void Reset(); - - // Enable or disable assertion on overflow. 99% of the time, it's a bug that we need to catch, - // but there may be the occasional buffer that is allowed to overflow gracefully. - void SetAssertOnOverflow( bool bAssert ); - - // This can be set to assign a name that gets output if the buffer overflows. - const char* GetDebugName() const { return m_pDebugName; } - void SetDebugName( const char *pName ); - - void SetErrorHandler(IBitBufErrorHandler* handler); - bool CallErrorHandler(BitBufErrorType errorType); - - void ExciseBits( int startbit, int bitstoremove ); - - -// Bit functions. -public: + bf_read( const void *pData, int nBytes, int nBits = -1 ) + { + m_bOverflow = false; + m_nDataBits = -1; + m_nDataBytes = 0; + StartReading( pData, nBytes, 0, nBits ); + } - // Returns 0 or 1. - int ReadOneBit(); + bf_read( void ) + { + m_bOverflow = false; + m_nDataBits = -1; + m_nDataBytes = 0; + } + void SetOverflowFlag( void ) + { + m_bOverflow = true; + } -protected: + bool IsOverflowed( void ) const + { + return m_bOverflow; + } - unsigned int CheckReadUBitLong(int numbits); // For debugging. - int ReadOneBitNoCheck(); // Faster version, doesn't check bounds and is inlined. - bool CheckForOverflow(int nBits); - - -public: - - // Get the base pointer. - const unsigned char* GetBasePointer() { return m_pData; } - - inline int TotalBytesAvailable( void ) const + int Tell( void ) const + { + return GetNumBitsRead(); + } + + size_t TotalBytesAvailable( void ) const { return m_nDataBytes; } - // Read a list of bits in. - void ReadBits(void *pOut, int nBits); - // Read a list of bits in, but don't overrun the destination buffer. - // Returns the number of bits read into the buffer. The remaining - // bits are skipped over. - int ReadBitsClamped_ptr(void *pOut, size_t outSizeBytes, size_t nBits); - // Helper 'safe' template function that infers the size of the destination - // array. This version of the function should be preferred. - // Usage: char databuffer[100]; - // ReadBitsClamped( dataBuffer, msg->m_nLength ); - template - int ReadBitsClamped( T (&pOut)[N], size_t nBits ) + int GetNumBitsLeft( void ) const { - return ReadBitsClamped_ptr( pOut, N * sizeof(T), nBits ); + return m_nDataBits - Tell(); } - - float ReadBitAngle( int numbits ); - unsigned int ReadUBitLong( int numbits ); - unsigned int ReadUBitLongNoInline( int numbits ); - unsigned int PeekUBitLong( int numbits ); - int ReadSBitLong( int numbits ); + int GetNumBytesLeft( void ) const + { + return GetNumBitsLeft() >> 3; + } - // reads an unsigned integer with variable bit length - unsigned int ReadUBitVar(); - unsigned int ReadUBitVarInternal( int encodingType ); + bool Seek( int nPosition ); - // reads a varint encoded integer - uint32 ReadVarInt32(); - uint64 ReadVarInt64(); - int32 ReadSignedVarInt32(); - int64 ReadSignedVarInt64(); + bool SeekRelative( int nOffset ) + { + return Seek( GetNumBitsRead() + nOffset ); + } - // You can read signed or unsigned data with this, just cast to - // a signed int if necessary. - unsigned int ReadBitLong(int numbits, bool bSigned); + unsigned char const * GetBasePointer() + { + return reinterpret_cast< unsigned char const *>( m_pData ); + } - float ReadBitCoord(); - float ReadBitCoordMP( bool bIntegral, bool bLowPrecision ); - float ReadBitFloat(); - float ReadBitNormal(); - void ReadBitVec3Coord( Vector& fa ); - void ReadBitVec3Normal( Vector& fa ); - void ReadBitAngles( QAngle& fa ); + void StartReading( const void *pData, int nBytes, int iStartBit = 0, int nBits = -1 ); - // Faster for comparisons but do not fully decode float values - unsigned int ReadBitCoordBits(); - unsigned int ReadBitCoordMPBits( bool bIntegral, bool bLowPrecision ); + int GetNumBitsRead( void ) const; + int GetNumBytesRead( void ) const; -// Byte functions (these still read data in bit-by-bit). -public: - - inline int ReadChar() { return (char)ReadUBitLong(8); } - inline int ReadByte() { return ReadUBitLong(8); } - inline int ReadShort() { return (short)ReadUBitLong(16); } - inline int ReadWord() { return ReadUBitLong(16); } - inline long ReadLong() { return ReadUBitLong(32); } - int64 ReadLongLong(); - float ReadFloat(); - bool ReadBytes(void *pOut, int nBytes); + void GrabNextDWord( bool bOverFlowImmediately = false ); + void FetchNext( void ); + unsigned int ReadUBitLong( int numbits ); + int ReadSBitLong( int numbits ); + unsigned int ReadUBitVar( void ); + unsigned int PeekUBitLong( int numbits ); + bool ReadBytes( void *pOut, int nBytes ); + + // Returns 0 or 1. + int ReadOneBit( void ); + int ReadLong( void ); + int ReadChar( void ); + int ReadByte( void ); + int ReadShort( void ); + int ReadWord( void ); + float ReadFloat( void ); + void ReadBits( void *pOut, int nBits ); + + float ReadBitCoord(); + float ReadBitCoordMP( EBitCoordType coordType ); + float ReadBitCellCoord( int bits, EBitCoordType coordType ); + float ReadBitNormal(); + void ReadBitVec3Coord( Vector& fa ); + void ReadBitVec3Normal( Vector& fa ); + void ReadBitAngles( QAngle& fa ); + float ReadBitAngle( int numbits ); + float ReadBitFloat( void ); // Returns false if bufLen isn't large enough to hold the // string in the buffer. @@ -612,199 +223,17 @@ public: // pOutNumChars is set to the number of characters left in pStr when the routine is // complete (this will never exceed bufLen-1). // - bool ReadString( char *pStr, int bufLen, bool bLine=false, int *pOutNumChars=NULL ); + bool ReadString( char *pStr, int bufLen, bool bLine=false, int *pOutNumChars = NULL ); - // Reads a string and allocates memory for it. If the string in the buffer - // is > 2048 bytes, then pOverflow is set to true (if it's not NULL). - char* ReadAndAllocateString( bool *pOverflow = 0 ); - - // Returns nonzero if any bits differ - int CompareBits( bf_read * __restrict other, int bits ); - int CompareBitsAt( int offset, bf_read * __restrict other, int otherOffset, int bits ); - -// Status. -public: - int GetNumBytesLeft() const; - int GetNumBytesRead() const; - int GetNumBitsLeft() const; - int GetNumBitsRead() const; - - // Has the buffer overflowed? - inline bool IsOverflowed() const {return m_bOverflow;} - - inline bool Seek(int iBit); // Seek to a specific bit. - inline bool SeekRelative(int iBitDelta); // Seek to an offset from the current position. - - // Called when the buffer is overflowed. - void SetOverflowFlag(); - - -public: - - // The current buffer. - const unsigned char* __restrict m_pData; - int m_nDataBytes; - int m_nDataBits; - - // Where we are in the buffer. - int m_iCurBit; - - -private: - // Errors? - bool m_bOverflow; - - // For debugging.. - bool m_bAssertOnOverflow; - - const char *m_pDebugName; - IBitBufErrorHandler* m_errorHandler; + // reads a varint encoded integer + uint32 ReadVarInt32(); + uint64 ReadVarInt64(); + int32 ReadSignedVarInt32() { return bitbuf::ZigZagDecode32( ReadVarInt32() ); } + int64 ReadSignedVarInt64() { return bitbuf::ZigZagDecode64( ReadVarInt64() ); } }; -//----------------------------------------------------------------------------- -// Inlines. -//----------------------------------------------------------------------------- - -inline int bf_read::GetNumBytesRead() const -{ - return BitByte(m_iCurBit); -} - -inline int bf_read::GetNumBitsLeft() const -{ - return m_nDataBits - m_iCurBit; -} - -inline int bf_read::GetNumBytesLeft() const -{ - return GetNumBitsLeft() >> 3; -} - -inline int bf_read::GetNumBitsRead() const -{ - return m_iCurBit; -} - -inline bool bf_read::Seek(int iBit) -{ - if(iBit < 0 || iBit > m_nDataBits) - { - SetOverflowFlag(); - m_iCurBit = m_nDataBits; - return false; - } - else - { - m_iCurBit = iBit; - return true; - } -} - -// Seek to an offset from the current position. -inline bool bf_read::SeekRelative(int iBitDelta) -{ - return Seek(m_iCurBit+iBitDelta); -} - -inline bool bf_read::CheckForOverflow(int nBits) -{ - if (GetNumBitsLeft() < nBits) - { - const bool recovered = CallErrorHandler(BITBUFERROR_BUFFER_OVERRUN); - if (!recovered || (recovered && (GetNumBitsLeft() < nBits))) - { - SetOverflowFlag(); - } - } - - return m_bOverflow; -} - -inline int bf_read::ReadOneBitNoCheck() -{ - int ret; - if (is_little_endian()) - { - unsigned int value = ((unsigned long * __restrict)m_pData)[m_iCurBit >> 5] >> (m_iCurBit & 31); - ret = value & 1; - } - else - { - unsigned char value = m_pData[m_iCurBit >> 3] >> (m_iCurBit & 7); - ret = value & 1; - } - ++m_iCurBit; - return ret; -} - -inline int bf_read::ReadOneBit() -{ - if( GetNumBitsLeft() <= 0 ) - { - const bool recovered = CallErrorHandler(BITBUFERROR_BUFFER_OVERRUN); - if (!recovered || (recovered && (GetNumBitsLeft() <= 0))) - { - SetOverflowFlag(); - return 0; - } - } - return ReadOneBitNoCheck(); -} - -inline float bf_read::ReadBitFloat() -{ - union { uint32 u; float f; } c = { ReadUBitLong(32) }; - return c.f; -} - -inline unsigned int bf_read::ReadUBitVar() -{ - // six bits: low 2 bits for encoding + first 4 bits of value - unsigned int sixbits = ReadUBitLong(6); - unsigned int encoding = sixbits & 3; - if ( encoding ) - { - // this function will seek back four bits and read the full value - return ReadUBitVarInternal( encoding ); - } - return sixbits >> 2; -} - -inline unsigned int bf_read::ReadUBitLong( int numbits ) -{ - Assert( numbits > 0 && numbits <= 32 ); - - if ( GetNumBitsLeft() < numbits ) - { - const bool recovered = CallErrorHandler(BITBUFERROR_BUFFER_OVERRUN); - if (!recovered || (recovered && (GetNumBitsLeft() < numbits))) - { - SetOverflowFlag(); - return 0; - } - } - - unsigned int iStartBit = m_iCurBit & 31u; - int iLastBit = m_iCurBit + numbits - 1; - unsigned int iWordOffset1 = m_iCurBit >> 5; - unsigned int iWordOffset2 = iLastBit >> 5; - m_iCurBit += numbits; - -#if __i386__ - unsigned int bitmask = (2 << (numbits-1)) - 1; -#else - extern unsigned long g_ExtraMasks[33]; - unsigned int bitmask = g_ExtraMasks[numbits]; +#ifndef MIN +#define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) #endif - unsigned int dw1 = LoadLittleDWord( (unsigned long* __restrict)m_pData, iWordOffset1 ) >> iStartBit; - unsigned int dw2 = LoadLittleDWord( (unsigned long* __restrict)m_pData, iWordOffset2 ) << (32 - iStartBit); - - return (dw1 | dw2) & bitmask; -} - -inline int bf_read::CompareBits( bf_read * __restrict other, int numbits ) -{ - return (ReadUBitLong(numbits) != other->ReadUBitLong(numbits)); -} - +#endif \ No newline at end of file diff --git a/external/sourcesdk/include/sourcesdk/valve_support.h b/external/sourcesdk/include/sourcesdk/valve_support.h index c185989..72fd82b 100644 --- a/external/sourcesdk/include/sourcesdk/valve_support.h +++ b/external/sourcesdk/include/sourcesdk/valve_support.h @@ -7,16 +7,18 @@ #include #include "vector.h" -using uint64 = std::uint64_t; -using uint32 = std::uint32_t; -using uint16 = std::uint16_t; -using uint8 = std::uint8_t; -using int64 = std::int64_t; -using int32 = std::int32_t; -using int16 = std::int16_t; -using int8 = std::int8_t; -using uint = unsigned int; -using byte = char; +using uint64 = uint64_t; +using uint32 = uint32_t; +using uint16 = uint16_t; +using uint8 = uint8_t; +using int64 = int64_t; +using int32 = int32_t; +using int16 = int16_t; +using int8 = int8_t; +using uint = uint32_t; +using byte = uint8_t; +using uintp = uintptr_t; +using intp = intptr_t; #if defined(_M_IX86) #define __i386__ 1 @@ -32,135 +34,46 @@ using byte = char; #define AssertMsg2(x, ...) assert(x) #define AssertFatalMsg(x, ...) assert(x) +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) + #define Q_memcpy memcpy -inline bool is_little_endian() -{ - union { - uint32 i; - uint8 c[4]; - } bint = { 0x01020304 }; - - return bint.c[0] == 4; -} - -// OVERALL Coordinate Size Limits used in COMMON.C MSG_*BitCoord() Routines (and someday the HUD) -#define COORD_INTEGER_BITS 14 -#define COORD_FRACTIONAL_BITS 5 -#define COORD_DENOMINATOR (1<<(COORD_FRACTIONAL_BITS)) -#define COORD_RESOLUTION (1.0/(COORD_DENOMINATOR)) - -// Special threshold for networking multiplayer origins -#define COORD_INTEGER_BITS_MP 11 -#define COORD_FRACTIONAL_BITS_MP_LOWPRECISION 3 -#define COORD_DENOMINATOR_LOWPRECISION (1<<(COORD_FRACTIONAL_BITS_MP_LOWPRECISION)) -#define COORD_RESOLUTION_LOWPRECISION (1.0/(COORD_DENOMINATOR_LOWPRECISION)) - -#define NORMAL_FRACTIONAL_BITS 11 -#define NORMAL_DENOMINATOR ( (1<<(NORMAL_FRACTIONAL_BITS)) - 1 ) -#define NORMAL_RESOLUTION (1.0/(NORMAL_DENOMINATOR)) - template inline T DWordSwapC( T dw ) { - uint32 temp; - temp = *((uint32 *)&dw) >> 24; - temp |= ((*((uint32 *)&dw) & 0x00FF0000) >> 8); - temp |= ((*((uint32 *)&dw) & 0x0000FF00) << 8); - temp |= ((*((uint32 *)&dw) & 0x000000FF) << 24); - return *((T*)&temp); + uint32 temp; + + static_assert( sizeof( T ) == sizeof(uint32) ); + + temp = *((uint32 *)&dw) >> 24; + temp |= ((*((uint32 *)&dw) & 0x00FF0000) >> 8); + temp |= ((*((uint32 *)&dw) & 0x0000FF00) << 8); + temp |= ((*((uint32 *)&dw) & 0x000000FF) << 24); + + return *((T*)&temp); } +#define DWordSwap DWordSwapC +#define BigLong( val ) DWordSwap( val ) -#if defined( _MSC_VER ) && !defined( PLATFORM_WINDOWS_PC64 ) - #define DWordSwap DWordSwapAsm - #pragma warning(push) - #pragma warning (disable:4035) // no return value - template - inline T DWordSwapAsm( T dw ) - { - __asm - { - mov eax, dw - bswap eax - } - } - #pragma warning(pop) -#else - #define DWordSwap DWordSwapC -#endif -inline unsigned long LoadLittleDWord(const unsigned long *base, unsigned int dwordIndex) +#define LittleDWord( val ) ( val ) + +inline uint32 LoadLittleDWord( uint32 *base, unsigned int dwordIndex ) { - return (is_little_endian() ? base[dwordIndex] : (DWordSwap(base[dwordIndex]))); + return LittleDWord( base[dwordIndex] ); } -inline void StoreLittleDWord(unsigned long *base, unsigned int dwordIndex, unsigned long dword) +inline void StoreLittleDWord( uint32 *base, unsigned int dwordIndex, uint32 dword ) { - base[dwordIndex] = (is_little_endian() ? dword : (DWordSwap(dword))); + base[dwordIndex] = LittleDWord(dword); } -// If a swapped float passes through the fpu, the bytes may get changed. -// Prevent this by swapping floats as DWORDs. -#define SafeSwapFloat( pOut, pIn ) (*((uint*)pOut) = DWordSwap( *((uint*)pIn) )) - inline void LittleFloat(float* pOut, float* pIn) { - if (is_little_endian()) - { - *pOut = *pIn; - } - else - { - SafeSwapFloat(pOut, pIn); - } + *pOut = *pIn; } -inline long BigLong(long val) -{ - return is_little_endian() ? DWordSwap(val) : val; -} - -#define BITS_PER_INT 32 - -inline int GetBitForBitnum( int bitNum ) -{ - static int bitsForBitnum[] = - { - ( 1 << 0 ), - ( 1 << 1 ), - ( 1 << 2 ), - ( 1 << 3 ), - ( 1 << 4 ), - ( 1 << 5 ), - ( 1 << 6 ), - ( 1 << 7 ), - ( 1 << 8 ), - ( 1 << 9 ), - ( 1 << 10 ), - ( 1 << 11 ), - ( 1 << 12 ), - ( 1 << 13 ), - ( 1 << 14 ), - ( 1 << 15 ), - ( 1 << 16 ), - ( 1 << 17 ), - ( 1 << 18 ), - ( 1 << 19 ), - ( 1 << 20 ), - ( 1 << 21 ), - ( 1 << 22 ), - ( 1 << 23 ), - ( 1 << 24 ), - ( 1 << 25 ), - ( 1 << 26 ), - ( 1 << 27 ), - ( 1 << 28 ), - ( 1 << 29 ), - ( 1 << 30 ), - ( 1 << 31 ), - }; - return bitsForBitnum[ (bitNum) & (BITS_PER_INT-1) ]; -} #ifndef _WIN32 #define _strnicmp strncasecmp diff --git a/premake/celt.lua b/premake/celt.lua index c1740c0..4d56a4a 100644 --- a/premake/celt.lua +++ b/premake/celt.lua @@ -7,16 +7,6 @@ group "external" language "C" location (_ACTION .. "/" .. project().name) - -- disable sse and sse2 for valve binary compat. - -- the osx build of vaudio_celt uses sse2 - configuration "windows" - buildoptions "/arch:IA32" - configuration "linux" - buildoptions "-mfpmath=387" - configuration "macosx" - buildoptions { "-mfpmath=sse", "-msse2" } - configuration {} - defines { "CUSTOM_MODES", diff --git a/premake/json_checker.lua b/premake/json_checker.lua deleted file mode 100644 index 3cd3ac9..0000000 --- a/premake/json_checker.lua +++ /dev/null @@ -1,20 +0,0 @@ - -local base_dir = (solution().basedir .. "/external/json_checker/") - -group "external" - project "json_checker" - kind "StaticLib" - language "C++" - location (_ACTION .. "/" .. project().name) - - includedirs - { - base_dir .. "include/" - } - files - { - base_dir .. "**.h", - base_dir .. "**.cpp" - } - project "*" -group "" diff --git a/premake/premake5.lua b/premake/premake5.lua index f90a400..22cf36a 100644 --- a/premake/premake5.lua +++ b/premake/premake5.lua @@ -4,15 +4,12 @@ solution "demboyz" location (_ACTION) targetdir "../bin" startproject "demboyz" - configurations { "Debug", "Release" } - platforms "x32" + configurations { "Release", "Debug" } flags { "MultiProcessorCompile", "Symbols" } - defines "_CRT_SECURE_NO_WARNINGS" configuration "Debug" defines { "DEBUG" } configuration "Release" - defines { "NDEBUG" } optimize "Full" configuration {} @@ -20,7 +17,8 @@ solution "demboyz" kind "ConsoleApp" language "C++" configuration "gmake" - buildoptions { "-std=c++11" } + buildoptions { "-std=c++17 -Wall" } + linkoptions { "-flto -no-pie -Wall" } configuration {} files { @@ -29,23 +27,23 @@ solution "demboyz" } includedirs { - "../external/json_checker/include", - "../external/cbase64-1.1/include", "../external/sourcesdk/include", - "../external/rapidjson-1.0.2/include", - "../external/snappy-1.1.3/include", "../external/celt-e18de77/include", + "../external/SILK_SDK_SRC_FLP_v1.0.9/interface", + "/usr/include/opus", "../demboyz" } links { - "json_checker", "sourcesdk", - "celt" + "snappy", + "celt", + "opusenc", + "SKP_SILK_SDK" } project "*" - dofile "json_checker.lua" dofile "snappy.lua" dofile "sourcesdk.lua" dofile "celt.lua" + dofile "silk.lua" diff --git a/premake/silk.lua b/premake/silk.lua new file mode 100644 index 0000000..9b84256 --- /dev/null +++ b/premake/silk.lua @@ -0,0 +1,20 @@ + +local base_dir = (solution().basedir .. "/external/SILK_SDK_SRC_FLP_v1.0.9//") + +group "external" + project "SKP_SILK_SDK" + kind "StaticLib" + language "C" + location (_ACTION .. "/" .. project().name) + + includedirs + { + base_dir .. "interface/" + } + files + { + + base_dir .. "src/*.c" + } + project "*" +group "" diff --git a/premake/snappy.lua b/premake/snappy.lua index ae729c7..5ad615a 100644 --- a/premake/snappy.lua +++ b/premake/snappy.lua @@ -1,5 +1,5 @@ -local base_dir = (solution().basedir .. "/external/snappy-1.1.3/") +local base_dir = (solution().basedir .. "/external/snappy-1.1.9/") group "external" project "snappy" @@ -9,12 +9,13 @@ group "external" includedirs { - base_dir .. "include/" + base_dir } files { - base_dir .. "**.h", - base_dir .. "**.cc" + base_dir .. "snappy.cc", + base_dir .. "snappy-sinksource.cc", + base_dir .. "snappy-stubs-internal.cc" } project "*" group "" diff --git a/premake/sourcesdk.lua b/premake/sourcesdk.lua index 2984cb0..d69482f 100644 --- a/premake/sourcesdk.lua +++ b/premake/sourcesdk.lua @@ -13,7 +13,7 @@ group "external" includedirs { base_dir .. "include/", - external_dir .. "snappy-1.1.3/include/" + external_dir .. "snappy-1.1.9/" } files {