Initial Skype commit taken from FreeSwitch, which got it from the IETF draft.
[opus.git] / src / SKP_Silk_resample_rom.h
1 /***********************************************************************\r
2 Copyright (c) 2006-2010, Skype Limited. All rights reserved. \r
3 Redistribution and use in source and binary forms, with or without \r
4 modification, (subject to the limitations in the disclaimer below) \r
5 are permitted provided that the following conditions are met:\r
6 - Redistributions of source code must retain the above copyright notice,\r
7 this list of conditions and the following disclaimer.\r
8 - Redistributions in binary form must reproduce the above copyright \r
9 notice, this list of conditions and the following disclaimer in the \r
10 documentation and/or other materials provided with the distribution.\r
11 - Neither the name of Skype Limited, nor the names of specific \r
12 contributors, may be used to endorse or promote products derived from \r
13 this software without specific prior written permission.\r
14 NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED \r
15 BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \r
16 CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\r
17 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \r
18 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE \r
19 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \r
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF \r
22 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
23 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
26 ***********************************************************************/\r
27 \r
28 /*                                                                                                                                              *\r
29  * File Name:   SKP_Silk_resample_rom.h                                                         *\r
30  *                                                                                                                                              *\r
31  * Description: Header file for FIR resampling of                                               *\r
32  *                              32 and 44 kHz input                                                                     *\r
33  *                                                                      *\r
34  * Copyright 2007 (c), Skype Limited                                    *\r
35  * All rights reserved.                                                                                                 *\r
36  *                                                                                                                                              *\r
37  * Date: 070807                                                         *\r
38  *                                                                      */\r
39 \r
40 #ifndef _SKP_SILK_FIX_RESAMPLE_ROM_H_\r
41 #define _SKP_SILK_FIX_RESAMPLE_ROM_H_\r
42 \r
43 #include "SKP_Silk_typedef.h"\r
44 \r
45 #ifdef  __cplusplus\r
46 extern "C"\r
47 {\r
48 #endif\r
49 \r
50 #define SigProc_Resample_bw_1_4_NUM_INTERPOLATORS_LOG2                          7\r
51 #define SigProc_Resample_bw_1_4_NUM_INTERPOLATORS                                       (1 << SigProc_Resample_bw_1_4_NUM_INTERPOLATORS_LOG2)\r
52 #define SigProc_Resample_bw_1_4_NUM_FIR_COEFS                                           6 \r
53 \r
54 extern const SKP_int16 SigProc_Resample_bw_1_4_INTERPOL[SigProc_Resample_bw_1_4_NUM_INTERPOLATORS][SigProc_Resample_bw_1_4_NUM_FIR_COEFS];\r
55 \r
56 \r
57 #define SigProc_Resample_bw_80_441_NUM_INTERPOLATORS_LOG2                       6\r
58 #define SigProc_Resample_bw_80_441_NUM_INTERPOLATORS                            (1 << SigProc_Resample_bw_80_441_NUM_INTERPOLATORS_LOG2)\r
59 #define SigProc_Resample_bw_80_441_NUM_FIR_COEFS                                        4 \r
60 \r
61 extern const SKP_int16 SigProc_Resample_bw_80_441_INTERPOL[SigProc_Resample_bw_80_441_NUM_INTERPOLATORS][SigProc_Resample_bw_80_441_NUM_FIR_COEFS];\r
62 \r
63 #define SigProc_Resample_2_3_coarse_NUM_INTERPOLATORS                            2\r
64 #define SigProc_Resample_2_3_coarse_NUM_FIR_COEFS                                       32\r
65 \r
66 extern const SKP_int16 SigProc_Resample_2_3_coarse_INTERPOL[SigProc_Resample_2_3_coarse_NUM_INTERPOLATORS][SigProc_Resample_2_3_coarse_NUM_FIR_COEFS];\r
67 \r
68 #define SigProc_Resample_2_3_coarsest_NUM_INTERPOLATORS                          2\r
69 #define SigProc_Resample_2_3_coarsest_NUM_FIR_COEFS                                     10\r
70 \r
71 extern const SKP_int16 SigProc_Resample_2_3_coarsest_INTERPOL[SigProc_Resample_2_3_coarsest_NUM_INTERPOLATORS][SigProc_Resample_2_3_coarsest_NUM_FIR_COEFS];\r
72 \r
73 #define SigProc_Resample_3_2_coarse_NUM_INTERPOLATORS                            3\r
74 #define SigProc_Resample_3_2_coarse_NUM_FIR_COEFS                                        8\r
75 \r
76 extern const SKP_int16 SigProc_Resample_3_2_coarse_INTERPOL[SigProc_Resample_3_2_coarse_NUM_INTERPOLATORS][SigProc_Resample_3_2_coarse_NUM_FIR_COEFS];\r
77 \r
78 #define SigProc_Resample_147_40_NUM_INTERPOLATORS                                        147\r
79 #define SigProc_Resample_147_40_NUM_FIR_COEFS                                            20\r
80 \r
81 extern const SKP_int16 SigProc_Resample_147_40_INTERPOL[SigProc_Resample_147_40_NUM_INTERPOLATORS][SigProc_Resample_147_40_NUM_FIR_COEFS];\r
82 \r
83 #define SigProc_Resample_147_40_alt_NUM_INTERPOLATORS                            147\r
84 #define SigProc_Resample_147_40_alt_NUM_FIR_COEFS                                        10\r
85 \r
86 extern const SKP_int16 SigProc_Resample_147_40_alt_INTERPOL[SigProc_Resample_147_40_alt_NUM_INTERPOLATORS][SigProc_Resample_147_40_alt_NUM_FIR_COEFS];\r
87 \r
88 #define SigProc_Resample_147_40_coarse_NUM_INTERPOLATORS                         147\r
89 #define SigProc_Resample_147_40_coarse_NUM_FIR_COEFS                             16\r
90 \r
91 extern const SKP_int16 SigProc_Resample_147_40_coarse_INTERPOL[SigProc_Resample_147_40_coarse_NUM_INTERPOLATORS][SigProc_Resample_147_40_coarse_NUM_FIR_COEFS];\r
92 \r
93 #define SigProc_Resample_40_147_NUM_INTERPOLATORS                                        40\r
94 #define SigProc_Resample_40_147_NUM_FIR_COEFS                                            60\r
95 \r
96 extern const SKP_int16 SigProc_Resample_40_147_INTERPOL[SigProc_Resample_40_147_NUM_INTERPOLATORS][SigProc_Resample_40_147_NUM_FIR_COEFS];\r
97 \r
98 #define SigProc_Resample_40_147_coarse_NUM_INTERPOLATORS                         40\r
99 #define SigProc_Resample_40_147_coarse_NUM_FIR_COEFS                             30\r
100 \r
101 extern const SKP_int16 SigProc_Resample_40_147_coarse_INTERPOL[SigProc_Resample_40_147_coarse_NUM_INTERPOLATORS][SigProc_Resample_40_147_coarse_NUM_FIR_COEFS];\r
102 \r
103 #ifdef  __cplusplus\r
104 }\r
105 #endif\r
106 \r
107 #endif // _SKP_SILK_FIX_RESAMPLE_ROM_H_\r