/components/libFLAC/float.c
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2004-2009 Josh Coalson
* Copyright (C) 2011-2016 Xiph.Org Foundation
*
* 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 the Xiph.org Foundation 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 FOUNDATION 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.
*/
const FLAC__fixedpoint FLAC__FP_ZERO = 0;
const FLAC__fixedpoint FLAC__FP_ONE_HALF = 0x00008000;
const FLAC__fixedpoint FLAC__FP_ONE = 0x00010000;
const FLAC__fixedpoint FLAC__FP_LN2 = 45426;
const FLAC__fixedpoint FLAC__FP_E = 178145;
/* Lookup tables for Knuth's logarithm algorithm */
static const FLAC__uint32 log2_lookup = ;
static const FLAC__uint64 log2_lookup_wide[] = {
{
/*
* 32 fraction bits
*/
/* undefined */ 0x00000000,
/* lg(2/1) = */ FLAC__U64L(0x100000000),
/* lg(4/3) = */ FLAC__U64L(0x6a3fe5c6),
/* lg(8/7) = */ FLAC__U64L(0x31513015),
/* lg(16/15) = */ FLAC__U64L(0x17d60497),
/* lg(32/31) = */ FLAC__U64L(0x0bb9ca65),
/* lg(64/63) = */ FLAC__U64L(0x05d0fba2),
/* lg(128/127) = */ FLAC__U64L(0x02e58f74),
/* lg(256/255) = */ FLAC__U64L(0x01720d9c),
/* lg(512/511) = */ FLAC__U64L(0x00b8d875),
/* lg(1024/1023) = */ FLAC__U64L(0x005c60aa),
/* lg(2048/2047) = */ FLAC__U64L(0x002e2d72),
/* lg(4096/4095) = */ FLAC__U64L(0x00171600),
/* lg(8192/8191) = */ FLAC__U64L(0x000b8ad2),
/* lg(16384/16383) = */ FLAC__U64L(0x0005c55d),
/* lg(32768/32767) = */ FLAC__U64L(0x0002e2ac)
},
{
/*
* 48 fraction bits
*/
/* undefined */ 0x00000000,
/* lg(2/1) = */ FLAC__U64L(0x1000000000000),
/* lg(4/3) = */ FLAC__U64L(0x6a3fe5c60429),
/* lg(8/7) = */ FLAC__U64L(0x315130157f7a),
/* lg(16/15) = */ FLAC__U64L(0x17d60496cfbb),
/* lg(32/31) = */ FLAC__U64L(0xbb9ca64ecac),
/* lg(64/63) = */ FLAC__U64L(0x5d0fba187cd),
/* lg(128/127) = */ FLAC__U64L(0x2e58f7441ee),
/* lg(256/255) = */ FLAC__U64L(0x1720d9c06a8),
/* lg(512/511) = */ FLAC__U64L(0xb8d8752173),
/* lg(1024/1023) = */ FLAC__U64L(0x5c60aa252e),
/* lg(2048/2047) = */ FLAC__U64L(0x2e2d71b0d8),
/* lg(4096/4095) = */ FLAC__U64L(0x1716001719),
/* lg(8192/8191) = */ FLAC__U64L(0xb8ad1de1b),
/* lg(16384/16383) = */ FLAC__U64L(0x5c55d640d),
/* lg(32768/32767) = */ FLAC__U64L(0x2e2abcf52)
}
};
FLAC__uint32
/* defined FLAC__INTEGER_ONLY_LIBRARY */