annotate src/opus-1.3/silk/resampler_rom.c @ 156:1bf23f5aebc4

Opus build for Windows (MinGW)
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 25 Jan 2019 13:49:03 +0000
parents 4664ac0c1032
children
rev   line source
cannam@154 1 /***********************************************************************
cannam@154 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
cannam@154 3 Redistribution and use in source and binary forms, with or without
cannam@154 4 modification, are permitted provided that the following conditions
cannam@154 5 are met:
cannam@154 6 - Redistributions of source code must retain the above copyright notice,
cannam@154 7 this list of conditions and the following disclaimer.
cannam@154 8 - Redistributions in binary form must reproduce the above copyright
cannam@154 9 notice, this list of conditions and the following disclaimer in the
cannam@154 10 documentation and/or other materials provided with the distribution.
cannam@154 11 - Neither the name of Internet Society, IETF or IETF Trust, nor the
cannam@154 12 names of specific contributors, may be used to endorse or promote
cannam@154 13 products derived from this software without specific prior written
cannam@154 14 permission.
cannam@154 15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
cannam@154 16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
cannam@154 17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
cannam@154 18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
cannam@154 19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
cannam@154 20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
cannam@154 21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
cannam@154 22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
cannam@154 23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
cannam@154 24 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
cannam@154 25 POSSIBILITY OF SUCH DAMAGE.
cannam@154 26 ***********************************************************************/
cannam@154 27
cannam@154 28 #ifdef HAVE_CONFIG_H
cannam@154 29 #include "config.h"
cannam@154 30 #endif
cannam@154 31
cannam@154 32 /* Filter coefficients for IIR/FIR polyphase resampling *
cannam@154 33 * Total size: 179 Words (358 Bytes) */
cannam@154 34
cannam@154 35 #include "resampler_private.h"
cannam@154 36
cannam@154 37 /* Matlab code for the notch filter coefficients: */
cannam@154 38 /* B = [1, 0.147, 1]; A = [1, 0.107, 0.89]; G = 0.93; freqz(G * B, A, 2^14, 16e3); axis([0, 8000, -10, 1]) */
cannam@154 39 /* 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)) */
cannam@154 40 /* const opus_int16 silk_resampler_up2_hq_notch[ 4 ] = { 9634, -7012, 7209, 30474 }; */
cannam@154 41
cannam@154 42 /* Tables with IIR and FIR coefficients for fractional downsamplers (123 Words) */
cannam@154 43 silk_DWORD_ALIGN const opus_int16 silk_Resampler_3_4_COEFS[ 2 + 3 * RESAMPLER_DOWN_ORDER_FIR0 / 2 ] = {
cannam@154 44 -20694, -13867,
cannam@154 45 -49, 64, 17, -157, 353, -496, 163, 11047, 22205,
cannam@154 46 -39, 6, 91, -170, 186, 23, -896, 6336, 19928,
cannam@154 47 -19, -36, 102, -89, -24, 328, -951, 2568, 15909,
cannam@154 48 };
cannam@154 49
cannam@154 50 silk_DWORD_ALIGN const opus_int16 silk_Resampler_2_3_COEFS[ 2 + 2 * RESAMPLER_DOWN_ORDER_FIR0 / 2 ] = {
cannam@154 51 -14457, -14019,
cannam@154 52 64, 128, -122, 36, 310, -768, 584, 9267, 17733,
cannam@154 53 12, 128, 18, -142, 288, -117, -865, 4123, 14459,
cannam@154 54 };
cannam@154 55
cannam@154 56 silk_DWORD_ALIGN const opus_int16 silk_Resampler_1_2_COEFS[ 2 + RESAMPLER_DOWN_ORDER_FIR1 / 2 ] = {
cannam@154 57 616, -14323,
cannam@154 58 -10, 39, 58, -46, -84, 120, 184, -315, -541, 1284, 5380, 9024,
cannam@154 59 };
cannam@154 60
cannam@154 61 silk_DWORD_ALIGN const opus_int16 silk_Resampler_1_3_COEFS[ 2 + RESAMPLER_DOWN_ORDER_FIR2 / 2 ] = {
cannam@154 62 16102, -15162,
cannam@154 63 -13, 0, 20, 26, 5, -31, -43, -4, 65, 90, 7, -157, -248, -44, 593, 1583, 2612, 3271,
cannam@154 64 };
cannam@154 65
cannam@154 66 silk_DWORD_ALIGN const opus_int16 silk_Resampler_1_4_COEFS[ 2 + RESAMPLER_DOWN_ORDER_FIR2 / 2 ] = {
cannam@154 67 22500, -15099,
cannam@154 68 3, -14, -20, -15, 2, 25, 37, 25, -16, -71, -107, -79, 50, 292, 623, 982, 1288, 1464,
cannam@154 69 };
cannam@154 70
cannam@154 71 silk_DWORD_ALIGN const opus_int16 silk_Resampler_1_6_COEFS[ 2 + RESAMPLER_DOWN_ORDER_FIR2 / 2 ] = {
cannam@154 72 27540, -15257,
cannam@154 73 17, 12, 8, 1, -10, -22, -30, -32, -22, 3, 44, 100, 168, 243, 317, 381, 429, 455,
cannam@154 74 };
cannam@154 75
cannam@154 76 silk_DWORD_ALIGN const opus_int16 silk_Resampler_2_3_COEFS_LQ[ 2 + 2 * 2 ] = {
cannam@154 77 -2797, -6507,
cannam@154 78 4697, 10739,
cannam@154 79 1567, 8276,
cannam@154 80 };
cannam@154 81
cannam@154 82 /* Table with interplation fractions of 1/24, 3/24, 5/24, ... , 23/24 : 23/24 (46 Words) */
cannam@154 83 silk_DWORD_ALIGN const opus_int16 silk_resampler_frac_FIR_12[ 12 ][ RESAMPLER_ORDER_FIR_12 / 2 ] = {
cannam@154 84 { 189, -600, 617, 30567 },
cannam@154 85 { 117, -159, -1070, 29704 },
cannam@154 86 { 52, 221, -2392, 28276 },
cannam@154 87 { -4, 529, -3350, 26341 },
cannam@154 88 { -48, 758, -3956, 23973 },
cannam@154 89 { -80, 905, -4235, 21254 },
cannam@154 90 { -99, 972, -4222, 18278 },
cannam@154 91 { -107, 967, -3957, 15143 },
cannam@154 92 { -103, 896, -3487, 11950 },
cannam@154 93 { -91, 773, -2865, 8798 },
cannam@154 94 { -71, 611, -2143, 5784 },
cannam@154 95 { -46, 425, -1375, 2996 },
cannam@154 96 };