OLD | NEW |
1 /*********************************************************************** | 1 /*********************************************************************** |
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. | 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. |
3 Redistribution and use in source and binary forms, with or without | 3 Redistribution and use in source and binary forms, with or without |
4 modification, are permitted provided that the following conditions | 4 modification, are permitted provided that the following conditions |
5 are met: | 5 are met: |
6 - Redistributions of source code must retain the above copyright notice, | 6 - Redistributions of source code must retain the above copyright notice, |
7 this list of conditions and the following disclaimer. | 7 this list of conditions and the following disclaimer. |
8 - Redistributions in binary form must reproduce the above copyright | 8 - Redistributions in binary form must reproduce the above copyright |
9 notice, this list of conditions and the following disclaimer in the | 9 notice, this list of conditions and the following disclaimer in the |
10 documentation and/or other materials provided with the distribution. | 10 documentation and/or other materials provided with the distribution. |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #ifdef HAVE_CONFIG_H | 28 #ifdef HAVE_CONFIG_H |
29 #include "config.h" | 29 #include "config.h" |
30 #endif | 30 #endif |
31 | 31 |
32 /* Filter coefficients for IIR/FIR polyphase resampling * | 32 /* Filter coefficients for IIR/FIR polyphase resampling * |
33 * Total size: 179 Words (358 Bytes) */ | 33 * Total size: 179 Words (358 Bytes) */ |
34 | 34 |
35 #include "resampler_private.h" | 35 #include "resampler_private.h" |
36 | 36 |
37 /* Tables for 2x downsampler */ | |
38 const opus_int16 silk_resampler_down2_0 = 9872; | |
39 const opus_int16 silk_resampler_down2_1 = 39809 - 65536; | |
40 | |
41 /* Tables for 2x upsampler, high quality */ | |
42 const opus_int16 silk_resampler_up2_hq_0[ 3 ] = { 1746, 14986, 39083 - 65536 }; | |
43 const opus_int16 silk_resampler_up2_hq_1[ 3 ] = { 6854, 25769, 55542 - 65536 }; | |
44 | |
45 /* Matlab code for the notch filter coefficients: */ | 37 /* Matlab code for the notch filter coefficients: */ |
46 /* B = [1, 0.147, 1]; A = [1, 0.107, 0.89]; G = 0.93; freqz(G * B, A, 2^14, 16e
3); axis([0, 8000, -10, 1]) */ | 38 /* B = [1, 0.147, 1]; A = [1, 0.107, 0.89]; G = 0.93; freqz(G * B, A, 2^14, 16e
3); axis([0, 8000, -10, 1]) */ |
47 /* 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)) */ | 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)) */ |
48 const opus_int16 silk_resampler_up2_hq_notch[ 4 ] = { 9634, -7012, 7209, 304
74 }; | 40 /* const opus_int16 silk_resampler_up2_hq_notch[ 4 ] = { 9634, -7012, 7209,
30474 }; */ |
49 | 41 |
50 /* Tables with IIR and FIR coefficients for fractional downsamplers (123 Words)
*/ | 42 /* Tables with IIR and FIR coefficients for fractional downsamplers (123 Words)
*/ |
51 silk_DWORD_ALIGN const opus_int16 silk_Resampler_3_4_COEFS[ 2 + 3 * RESAMPLER_DO
WN_ORDER_FIR0 / 2 ] = { | 43 silk_DWORD_ALIGN const opus_int16 silk_Resampler_3_4_COEFS[ 2 + 3 * RESAMPLER_DO
WN_ORDER_FIR0 / 2 ] = { |
52 -20694, -13867, | 44 -20694, -13867, |
53 -49, 64, 17, -157, 353, -496, 163, 11047, 22205, | 45 -49, 64, 17, -157, 353, -496, 163, 11047, 22205, |
54 -39, 6, 91, -170, 186, 23, -896, 6336, 19928, | 46 -39, 6, 91, -170, 186, 23, -896, 6336, 19928, |
55 -19, -36, 102, -89, -24, 328, -951, 2568, 15909, | 47 -19, -36, 102, -89, -24, 328, -951, 2568, 15909, |
56 }; | 48 }; |
57 | 49 |
58 silk_DWORD_ALIGN const opus_int16 silk_Resampler_2_3_COEFS[ 2 + 2 * RESAMPLER_DO
WN_ORDER_FIR0 / 2 ] = { | 50 silk_DWORD_ALIGN const opus_int16 silk_Resampler_2_3_COEFS[ 2 + 2 * RESAMPLER_DO
WN_ORDER_FIR0 / 2 ] = { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 { -4, 529, -3350, 26341 }, | 87 { -4, 529, -3350, 26341 }, |
96 { -48, 758, -3956, 23973 }, | 88 { -48, 758, -3956, 23973 }, |
97 { -80, 905, -4235, 21254 }, | 89 { -80, 905, -4235, 21254 }, |
98 { -99, 972, -4222, 18278 }, | 90 { -99, 972, -4222, 18278 }, |
99 { -107, 967, -3957, 15143 }, | 91 { -107, 967, -3957, 15143 }, |
100 { -103, 896, -3487, 11950 }, | 92 { -103, 896, -3487, 11950 }, |
101 { -91, 773, -2865, 8798 }, | 93 { -91, 773, -2865, 8798 }, |
102 { -71, 611, -2143, 5784 }, | 94 { -71, 611, -2143, 5784 }, |
103 { -46, 425, -1375, 2996 }, | 95 { -46, 425, -1375, 2996 }, |
104 }; | 96 }; |
OLD | NEW |