summaryrefslogtreecommitdiff
path: root/apps/codecs/libspeex/modes_wb.c
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-11-01 21:30:51 +0000
committerThom Johansen <thomj@rockbox.org>2007-11-01 21:30:51 +0000
commitbf1b7f131c933b83afe62f01c200366e4e2e37f3 (patch)
treea9ab90e6a01df357b7a8649d8e626a47e1678f64 /apps/codecs/libspeex/modes_wb.c
parent6d88717f6949587908ec08affa07d06239c3bae1 (diff)
downloadrockbox-bf1b7f131c933b83afe62f01c200366e4e2e37f3.tar.gz
rockbox-bf1b7f131c933b83afe62f01c200366e4e2e37f3.zip
First attempt at ifdeffing out as much of the encoder stuff as possible from Speex. Gives a smaller binary and allows me to remove a couple more files from SOURCES.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15394 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspeex/modes_wb.c')
-rw-r--r--apps/codecs/libspeex/modes_wb.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/apps/codecs/libspeex/modes_wb.c b/apps/codecs/libspeex/modes_wb.c
index 862bd6fa31..e4c95a85bc 100644
--- a/apps/codecs/libspeex/modes_wb.c
+++ b/apps/codecs/libspeex/modes_wb.c
@@ -87,8 +87,13 @@ static const SpeexSubmode wb_submode1 = {
87 1, 87 1,
88 0, 88 0,
89 /*LSP quantization*/ 89 /*LSP quantization*/
90#ifndef SPEEX_DISABLE_ENCODER
90 lsp_quant_high, 91 lsp_quant_high,
91 lsp_unquant_high, 92 lsp_unquant_high,
93#else
94 NULL,
95 lsp_unquant_high,
96#endif
92 /*Pitch quantization*/ 97 /*Pitch quantization*/
93 NULL, 98 NULL,
94 NULL, 99 NULL,
@@ -107,6 +112,7 @@ static const SpeexSubmode wb_submode2 = {
107 0, 112 0,
108 1, 113 1,
109 0, 114 0,
115#ifndef SPEEX_DISABLE_ENCODER
110 /*LSP quantization*/ 116 /*LSP quantization*/
111 lsp_quant_high, 117 lsp_quant_high,
112 lsp_unquant_high, 118 lsp_unquant_high,
@@ -117,6 +123,18 @@ static const SpeexSubmode wb_submode2 = {
117 /*Innovation quantization*/ 123 /*Innovation quantization*/
118 split_cb_search_shape_sign, 124 split_cb_search_shape_sign,
119 split_cb_shape_sign_unquant, 125 split_cb_shape_sign_unquant,
126#else
127 /*LSP quantization*/
128 NULL,
129 lsp_unquant_high,
130 /*Pitch quantization*/
131 NULL,
132 NULL,
133 NULL,
134 /*Innovation quantization*/
135 NULL,
136 split_cb_shape_sign_unquant,
137#endif
120#ifdef DISABLE_WIDEBAND 138#ifdef DISABLE_WIDEBAND
121 NULL, 139 NULL,
122#else 140#else
@@ -132,6 +150,7 @@ static const SpeexSubmode wb_submode3 = {
132 0, 150 0,
133 1, 151 1,
134 0, 152 0,
153#ifndef SPEEX_DISABLE_ENCODER
135 /*LSP quantization*/ 154 /*LSP quantization*/
136 lsp_quant_high, 155 lsp_quant_high,
137 lsp_unquant_high, 156 lsp_unquant_high,
@@ -142,6 +161,18 @@ static const SpeexSubmode wb_submode3 = {
142 /*Innovation quantization*/ 161 /*Innovation quantization*/
143 split_cb_search_shape_sign, 162 split_cb_search_shape_sign,
144 split_cb_shape_sign_unquant, 163 split_cb_shape_sign_unquant,
164#else
165 /*LSP quantization*/
166 NULL,
167 lsp_unquant_high,
168 /*Pitch quantization*/
169 NULL,
170 NULL,
171 NULL,
172 /*Innovation quantization*/
173 NULL,
174 split_cb_shape_sign_unquant,
175#endif
145#ifdef DISABLE_WIDEBAND 176#ifdef DISABLE_WIDEBAND
146 NULL, 177 NULL,
147#else 178#else
@@ -156,6 +187,7 @@ static const SpeexSubmode wb_submode4 = {
156 0, 187 0,
157 1, 188 1,
158 1, 189 1,
190#ifndef SPEEX_DISABLE_ENCODER
159 /*LSP quantization*/ 191 /*LSP quantization*/
160 lsp_quant_high, 192 lsp_quant_high,
161 lsp_unquant_high, 193 lsp_unquant_high,
@@ -166,6 +198,18 @@ static const SpeexSubmode wb_submode4 = {
166 /*Innovation quantization*/ 198 /*Innovation quantization*/
167 split_cb_search_shape_sign, 199 split_cb_search_shape_sign,
168 split_cb_shape_sign_unquant, 200 split_cb_shape_sign_unquant,
201#else
202 /*LSP quantization*/
203 NULL,
204 lsp_unquant_high,
205 /*Pitch quantization*/
206 NULL,
207 NULL,
208 NULL,
209 /*Innovation quantization*/
210 NULL,
211 split_cb_shape_sign_unquant,
212#endif
169#ifdef DISABLE_WIDEBAND 213#ifdef DISABLE_WIDEBAND
170 NULL, 214 NULL,
171#else 215#else
@@ -195,7 +239,11 @@ static const SpeexSBMode sb_wb_mode = {
195 3, 239 3,
196 {1, 8, 2, 3, 4, 5, 5, 6, 6, 7, 7}, 240 {1, 8, 2, 3, 4, 5, 5, 6, 6, 7, 7},
197 {1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4}, 241 {1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4},
242#ifndef SPEEX_DISABLE_ENCODER
198 vbr_hb_thresh, 243 vbr_hb_thresh,
244#else
245 NULL,
246#endif
199 5 247 5
200}; 248};
201 249
@@ -206,6 +254,7 @@ const SpeexMode speex_wb_mode = {
206 "wideband (sub-band CELP)", 254 "wideband (sub-band CELP)",
207 1, 255 1,
208 4, 256 4,
257#ifndef SPEEX_DISABLE_ENCODER
209 &sb_encoder_init, 258 &sb_encoder_init,
210 &sb_encoder_destroy, 259 &sb_encoder_destroy,
211 &sb_encode, 260 &sb_encode,
@@ -214,6 +263,16 @@ const SpeexMode speex_wb_mode = {
214 &sb_decode, 263 &sb_decode,
215 &sb_encoder_ctl, 264 &sb_encoder_ctl,
216 &sb_decoder_ctl, 265 &sb_decoder_ctl,
266#else
267 NULL,
268 NULL,
269 NULL,
270 &sb_decoder_init,
271 &sb_decoder_destroy,
272 &sb_decode,
273 NULL,
274 &sb_decoder_ctl,
275#endif
217}; 276};
218 277
219 278
@@ -241,7 +300,11 @@ static const SpeexSBMode sb_uwb_mode = {
241 1, 300 1,
242 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 301 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
243 {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, 302 {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
303#ifndef SPEEX_DISABLE_ENCODER
244 vbr_uhb_thresh, 304 vbr_uhb_thresh,
305#else
306 NULL,
307#endif
245 2 308 2
246}; 309};
247 310
@@ -276,6 +339,7 @@ const SpeexMode speex_uwb_mode = {
276 "ultra-wideband (sub-band CELP)", 339 "ultra-wideband (sub-band CELP)",
277 2, 340 2,
278 4, 341 4,
342#ifndef SPEEX_DISABLE_ENCODER
279 &sb_encoder_init, 343 &sb_encoder_init,
280 &sb_encoder_destroy, 344 &sb_encoder_destroy,
281 &sb_encode, 345 &sb_encode,
@@ -284,6 +348,16 @@ const SpeexMode speex_uwb_mode = {
284 &sb_decode, 348 &sb_decode,
285 &sb_encoder_ctl, 349 &sb_encoder_ctl,
286 &sb_decoder_ctl, 350 &sb_decoder_ctl,
351#else
352 NULL,
353 NULL,
354 NULL,
355 &sb_decoder_init,
356 &sb_decoder_destroy,
357 &sb_decode,
358 NULL,
359 &sb_decoder_ctl,
360#endif
287}; 361};
288 362
289/* We have defined speex_lib_get_mode() as a macro in speex.h */ 363/* We have defined speex_lib_get_mode() as a macro in speex.h */