|
97 | 97 | fprintf(fh, '/* SRC table */\n'); |
98 | 98 | switch ctype |
99 | 99 | case 'float' |
100 | | - fprintf(fh, 'const %s fir_one = 1.0;\n', vtype); |
101 | | - fprintf(fh, 'const struct src_stage src_double_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, 1.0, &fir_one };\n'); |
102 | | - fprintf(fh, 'const struct src_stage src_double_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0.0, &fir_one };\n'); |
| 100 | + fprintf(fh, 'static const %s fir_one = 1.0;\n', vtype); |
| 101 | + fprintf(fh, 'static const struct src_stage src_double_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, 1.0, &fir_one };\n'); |
| 102 | + fprintf(fh, 'static const struct src_stage src_double_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0.0, &fir_one };\n'); |
103 | 103 | case 'int16' |
104 | 104 | scale16 = 2^15; |
105 | | - fprintf(fh, 'const %s fir_one = %d;\n', vtype, round(scale16*0.5)); |
106 | | - fprintf(fh, 'const struct src_stage src_int16_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); |
107 | | - fprintf(fh, 'const struct src_stage src_int16_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); |
| 105 | + fprintf(fh, 'static const %s fir_one = %d;\n', vtype, round(scale16*0.5)); |
| 106 | + fprintf(fh, 'static const struct src_stage src_int16_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); |
| 107 | + fprintf(fh, 'static const struct src_stage src_int16_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); |
108 | 108 | case 'int24' |
109 | 109 | scale24 = 2^23; |
110 | | - fprintf(fh, 'const %s fir_one = %d;\n', vtype, round(scale24*0.5)); |
111 | | - fprintf(fh, 'const struct src_stage src_int24_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); |
112 | | - fprintf(fh, 'const struct src_stage src_int24_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); |
| 110 | + fprintf(fh, 'static const %s fir_one = %d;\n', vtype, round(scale24*0.5)); |
| 111 | + fprintf(fh, 'static const struct src_stage src_int24_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); |
| 112 | + fprintf(fh, 'static const struct src_stage src_int24_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); |
113 | 113 | case 'int32' |
114 | 114 | scale32 = 2^31; |
115 | | - fprintf(fh, 'const %s fir_one = %d;\n', vtype, round(scale32*0.5)); |
116 | | - fprintf(fh, 'const struct src_stage src_int32_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); |
117 | | - fprintf(fh, 'const struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); |
| 115 | + fprintf(fh, 'static const %s fir_one = %d;\n', vtype, round(scale32*0.5)); |
| 116 | + fprintf(fh, 'static const struct src_stage src_int32_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };\n'); |
| 117 | + fprintf(fh, 'static const struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };\n'); |
118 | 118 | otherwise |
119 | 119 | error('Unknown coefficient type!'); |
120 | 120 | end |
121 | 121 |
|
122 | | -fprintf(fh, 'const int src_in_fs[%d] = {', n_in); |
| 122 | +fprintf(fh, 'static const int src_in_fs[%d] = {', n_in); |
123 | 123 | j = 1; |
124 | 124 | for i=1:n_in |
125 | 125 | fprintf(fh, ' %d', fs_in(i)); |
|
134 | 134 | end |
135 | 135 | fprintf(fh, '};\n'); |
136 | 136 |
|
137 | | -fprintf(fh, 'const int src_out_fs[%d] = {', n_out); |
| 137 | +fprintf(fh, 'static const int src_out_fs[%d] = {', n_out); |
138 | 138 | j = 1; |
139 | 139 | for i=1:n_out |
140 | 140 | fprintf(fh, ' %d', fs_out(i)); |
|
150 | 150 | fprintf(fh, '};\n'); |
151 | 151 |
|
152 | 152 | for n = 1:2 |
153 | | - fprintf(fh, 'const struct src_stage * const src_table%d[%d][%d] = {\n', ... |
| 153 | + fprintf(fh, 'static const struct src_stage * const src_table%d[%d][%d] = {\n', ... |
154 | 154 | n, n_out, n_in); |
155 | 155 | i = 1; |
156 | 156 | for b = 1:n_out |
|
0 commit comments