Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: opus/silk/resampler_rom.c

Issue 11196031: Add copy of opus library in deps/third_party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « opus/silk/resampler_rom.h ('k') | opus/silk/resampler_structs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /***********************************************************************
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions
5 are met:
6 - Redistributions of source code must retain the above copyright notice,
7 this list of conditions and the following disclaimer.
8 - Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution.
11 - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 names of specific contributors, may be used to endorse or promote
13 products derived from this software without specific prior written
14 permission.
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 POSSIBILITY OF SUCH DAMAGE.
26 ***********************************************************************/
27
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31
32 /* Filter coefficients for IIR/FIR polyphase resampling *
33 * Total size: 179 Words (358 Bytes) */
34
35 #include "resampler_private.h"
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: */
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]) */
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)) */
48 const opus_int16 silk_resampler_up2_hq_notch[ 4 ] = { 9634, -7012, 7209, 304 74 };
49
50 /* 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 ] = {
52 -20694, -13867,
53 -49, 64, 17, -157, 353, -496, 163, 11047, 22205,
54 -39, 6, 91, -170, 186, 23, -896, 6336, 19928,
55 -19, -36, 102, -89, -24, 328, -951, 2568, 15909,
56 };
57
58 silk_DWORD_ALIGN const opus_int16 silk_Resampler_2_3_COEFS[ 2 + 2 * RESAMPLER_DO WN_ORDER_FIR0 / 2 ] = {
59 -14457, -14019,
60 64, 128, -122, 36, 310, -768, 584, 9267, 17733,
61 12, 128, 18, -142, 288, -117, -865, 4123, 14459,
62 };
63
64 silk_DWORD_ALIGN const opus_int16 silk_Resampler_1_2_COEFS[ 2 + RESAMPLER_DOWN_O RDER_FIR1 / 2 ] = {
65 616, -14323,
66 -10, 39, 58, -46, -84, 120, 184, -315, -541, 1284, 5380, 9024,
67 };
68
69 silk_DWORD_ALIGN const opus_int16 silk_Resampler_1_3_COEFS[ 2 + RESAMPLER_DOWN_O RDER_FIR2 / 2 ] = {
70 16102, -15162,
71 -13, 0, 20, 26, 5, -31, -43, -4, 65, 90, 7, -157, -248, -44, 593, 1583, 2612, 3271,
72 };
73
74 silk_DWORD_ALIGN const opus_int16 silk_Resampler_1_4_COEFS[ 2 + RESAMPLER_DOWN_O RDER_FIR2 / 2 ] = {
75 22500, -15099,
76 3, -14, -20, -15, 2, 25, 37, 25, -16, -71, -107, -79, 50, 292, 623, 982, 1288, 1464,
77 };
78
79 silk_DWORD_ALIGN const opus_int16 silk_Resampler_1_6_COEFS[ 2 + RESAMPLER_DOWN_O RDER_FIR2 / 2 ] = {
80 27540, -15257,
81 17, 12, 8, 1, -10, -22, -30, -32, -22, 3, 44, 100, 168, 243, 317, 381, 429, 455,
82 };
83
84 silk_DWORD_ALIGN const opus_int16 silk_Resampler_2_3_COEFS_LQ[ 2 + 2 * 2 ] = {
85 -2797, -6507,
86 4697, 10739,
87 1567, 8276,
88 };
89
90 /* Table with interplation fractions of 1/24, 3/24, 5/24, ... , 23/24 : 23/24 (4 6 Words) */
91 silk_DWORD_ALIGN const opus_int16 silk_resampler_frac_FIR_12[ 12 ][ RESAMPLER_OR DER_FIR_12 / 2 ] = {
92 { 189, -600, 617, 30567 },
93 { 117, -159, -1070, 29704 },
94 { 52, 221, -2392, 28276 },
95 { -4, 529, -3350, 26341 },
96 { -48, 758, -3956, 23973 },
97 { -80, 905, -4235, 21254 },
98 { -99, 972, -4222, 18278 },
99 { -107, 967, -3957, 15143 },
100 { -103, 896, -3487, 11950 },
101 { -91, 773, -2865, 8798 },
102 { -71, 611, -2143, 5784 },
103 { -46, 425, -1375, 2996 },
104 };
OLDNEW
« no previous file with comments | « opus/silk/resampler_rom.h ('k') | opus/silk/resampler_structs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698