diff options
author | Thom Johansen <thomj@rockbox.org> | 2007-11-06 17:10:17 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2007-11-06 17:10:17 +0000 |
commit | f5903789fb745d21644f93a82fd3e2404bb8ff65 (patch) | |
tree | c847ec2e48eb3ebc6343bb15f32558d7e302c280 | |
parent | 3eed6fc0251eb5cdce4eda39e036df76838fa60e (diff) | |
download | rockbox-f5903789fb745d21644f93a82fd3e2404bb8ff65.tar.gz rockbox-f5903789fb745d21644f93a82fd3e2404bb8ff65.zip |
Exclude some unneeded LSP code. Add some #endif clarification comments here and there.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15497 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/libspeex/cb_search.c | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/filters.c | 6 | ||||
-rw-r--r-- | apps/codecs/libspeex/lsp.c | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/ltp.c | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/nb_celp.c | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/quant_lsp.c | 8 | ||||
-rw-r--r-- | apps/codecs/libspeex/speex_header.c | 2 |
7 files changed, 18 insertions, 14 deletions
diff --git a/apps/codecs/libspeex/cb_search.c b/apps/codecs/libspeex/cb_search.c index 8afb8ab5f3..ecb3918298 100644 --- a/apps/codecs/libspeex/cb_search.c +++ b/apps/codecs/libspeex/cb_search.c | |||
@@ -512,7 +512,7 @@ int update_target | |||
512 | target[j]=SUB16(target[j],PSHR16(r2[j],2)); | 512 | target[j]=SUB16(target[j],PSHR16(r2[j],2)); |
513 | } | 513 | } |
514 | } | 514 | } |
515 | #endif | 515 | #endif /* SPEEX_DISABLE_ENCODER*/ |
516 | 516 | ||
517 | 517 | ||
518 | void split_cb_shape_sign_unquant( | 518 | void split_cb_shape_sign_unquant( |
@@ -600,7 +600,7 @@ int update_target | |||
600 | for (i=0;i<nsf;i++) | 600 | for (i=0;i<nsf;i++) |
601 | target[i]=0; | 601 | target[i]=0; |
602 | } | 602 | } |
603 | #endif | 603 | #endif /* SPEEX_DISABLE_ENCODER */ |
604 | 604 | ||
605 | 605 | ||
606 | void noise_codebook_unquant( | 606 | void noise_codebook_unquant( |
diff --git a/apps/codecs/libspeex/filters.c b/apps/codecs/libspeex/filters.c index 9c144ebffa..13adc9c009 100644 --- a/apps/codecs/libspeex/filters.c +++ b/apps/codecs/libspeex/filters.c | |||
@@ -157,7 +157,7 @@ void signal_div(const spx_word16_t *x, spx_word16_t *y, spx_word32_t scale, int | |||
157 | } | 157 | } |
158 | } | 158 | } |
159 | } | 159 | } |
160 | #endif | 160 | #endif /* SPEEX_DISABLE_ENCODER */ |
161 | 161 | ||
162 | #else | 162 | #else |
163 | 163 | ||
@@ -342,7 +342,7 @@ void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t | |||
342 | } | 342 | } |
343 | } | 343 | } |
344 | #endif | 344 | #endif |
345 | #endif | 345 | #endif /* SPEEX_DISABLE_ENCODER */ |
346 | 346 | ||
347 | #ifndef OVERRIDE_IIR_MEM16 | 347 | #ifndef OVERRIDE_IIR_MEM16 |
348 | void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack) | 348 | void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack) |
@@ -482,7 +482,7 @@ void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *y1 | |||
482 | y2[k] = EXTRACT16(SATURATE(PSHR32(y2k,15),32767)); | 482 | y2[k] = EXTRACT16(SATURATE(PSHR32(y2k,15),32767)); |
483 | } | 483 | } |
484 | } | 484 | } |
485 | #endif | 485 | #endif /* SPEEX_DISABLE_ENCODER */ |
486 | 486 | ||
487 | #ifndef OVERRIDE_QMF_SYNTH | 487 | #ifndef OVERRIDE_QMF_SYNTH |
488 | /* Re-synthesised a signal from the QMF low-band and high-band signals */ | 488 | /* Re-synthesised a signal from the QMF low-band and high-band signals */ |
diff --git a/apps/codecs/libspeex/lsp.c b/apps/codecs/libspeex/lsp.c index fcc12515c3..3973554cfb 100644 --- a/apps/codecs/libspeex/lsp.c +++ b/apps/codecs/libspeex/lsp.c | |||
@@ -134,6 +134,8 @@ Heavily modified by Jean-Marc Valin (c) 2002-2006 (fixed-point, | |||
134 | 134 | ||
135 | \*---------------------------------------------------------------------------*/ | 135 | \*---------------------------------------------------------------------------*/ |
136 | 136 | ||
137 | #ifndef SPEEX_DISABLE_ENCODER | ||
138 | |||
137 | #ifdef FIXED_POINT | 139 | #ifdef FIXED_POINT |
138 | 140 | ||
139 | #ifndef OVERRIDE_CHEB_POLY_EVA | 141 | #ifndef OVERRIDE_CHEB_POLY_EVA |
@@ -387,6 +389,8 @@ int lpc_to_lsp (spx_coef_t *a,int lpcrdr,spx_lsp_t *freq,int nb,spx_word16_t del | |||
387 | return(roots); | 389 | return(roots); |
388 | } | 390 | } |
389 | 391 | ||
392 | #endif /* SPEEX_DISABLE_ENCODER */ | ||
393 | |||
390 | /*---------------------------------------------------------------------------*\ | 394 | /*---------------------------------------------------------------------------*\ |
391 | 395 | ||
392 | FUNCTION....: lsp_to_lpc() | 396 | FUNCTION....: lsp_to_lpc() |
diff --git a/apps/codecs/libspeex/ltp.c b/apps/codecs/libspeex/ltp.c index 720baaad02..2f86b678d9 100644 --- a/apps/codecs/libspeex/ltp.c +++ b/apps/codecs/libspeex/ltp.c | |||
@@ -660,7 +660,7 @@ spx_word32_t *cumul_gain | |||
660 | #endif | 660 | #endif |
661 | return pitch; | 661 | return pitch; |
662 | } | 662 | } |
663 | #endif | 663 | #endif /* SPEEX_DISABLE_ENCODER */ |
664 | 664 | ||
665 | void pitch_unquant_3tap( | 665 | void pitch_unquant_3tap( |
666 | spx_word16_t exc[], /* Input excitation */ | 666 | spx_word16_t exc[], /* Input excitation */ |
@@ -812,7 +812,7 @@ spx_word32_t *cumul_gain | |||
812 | target[i]=EXTRACT16(SATURATE(SUB32(EXTEND32(target[i]),EXTEND32(res[i])),32700)); | 812 | target[i]=EXTRACT16(SATURATE(SUB32(EXTEND32(target[i]),EXTEND32(res[i])),32700)); |
813 | return start; | 813 | return start; |
814 | } | 814 | } |
815 | #endif | 815 | #endif /* SPEEX_DISABLE_ENCODER */ |
816 | 816 | ||
817 | /** Unquantize forced pitch delay and gain */ | 817 | /** Unquantize forced pitch delay and gain */ |
818 | void forced_pitch_unquant( | 818 | void forced_pitch_unquant( |
diff --git a/apps/codecs/libspeex/nb_celp.c b/apps/codecs/libspeex/nb_celp.c index 50e1b11372..4751068153 100644 --- a/apps/codecs/libspeex/nb_celp.c +++ b/apps/codecs/libspeex/nb_celp.c | |||
@@ -1024,7 +1024,7 @@ int nb_encode(void *state, void *vin, SpeexBits *bits) | |||
1024 | 1024 | ||
1025 | return 1; | 1025 | return 1; |
1026 | } | 1026 | } |
1027 | #endif | 1027 | #endif /* SPEEX_DISABLE_ENCODER */ |
1028 | 1028 | ||
1029 | static DecState global_decstate IBSS_ATTR; | 1029 | static DecState global_decstate IBSS_ATTR; |
1030 | 1030 | ||
@@ -1947,7 +1947,7 @@ int nb_encoder_ctl(void *state, int request, void *ptr) | |||
1947 | } | 1947 | } |
1948 | return 0; | 1948 | return 0; |
1949 | } | 1949 | } |
1950 | #endif | 1950 | #endif /* SPEEX_DISABLE_ENCODER */ |
1951 | 1951 | ||
1952 | int nb_decoder_ctl(void *state, int request, void *ptr) | 1952 | int nb_decoder_ctl(void *state, int request, void *ptr) |
1953 | { | 1953 | { |
diff --git a/apps/codecs/libspeex/quant_lsp.c b/apps/codecs/libspeex/quant_lsp.c index b8dcfcc088..9ab55cfcbd 100644 --- a/apps/codecs/libspeex/quant_lsp.c +++ b/apps/codecs/libspeex/quant_lsp.c | |||
@@ -210,7 +210,7 @@ void lsp_quant_nb(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits) | |||
210 | for (i=0;i<order;i++) | 210 | for (i=0;i<order;i++) |
211 | qlsp[i]=lsp[i]-qlsp[i]; | 211 | qlsp[i]=lsp[i]-qlsp[i]; |
212 | } | 212 | } |
213 | #endif | 213 | #endif /* SPEEX_DISABLE_ENCODER */ |
214 | 214 | ||
215 | void lsp_unquant_nb(spx_lsp_t *lsp, int order, SpeexBits *bits) | 215 | void lsp_unquant_nb(spx_lsp_t *lsp, int order, SpeexBits *bits) |
216 | { | 216 | { |
@@ -282,7 +282,7 @@ void lsp_quant_lbr(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits) | |||
282 | for (i=0;i<order;i++) | 282 | for (i=0;i<order;i++) |
283 | qlsp[i]=lsp[i]-qlsp[i]; | 283 | qlsp[i]=lsp[i]-qlsp[i]; |
284 | } | 284 | } |
285 | #endif | 285 | #endif /* SPEEX_DISABLE_ENCODER */ |
286 | 286 | ||
287 | void lsp_unquant_lbr(spx_lsp_t *lsp, int order, SpeexBits *bits) | 287 | void lsp_unquant_lbr(spx_lsp_t *lsp, int order, SpeexBits *bits) |
288 | { | 288 | { |
@@ -367,7 +367,7 @@ void lsp_quant_high(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits) | |||
367 | for (i=0;i<order;i++) | 367 | for (i=0;i<order;i++) |
368 | qlsp[i]=lsp[i]-qlsp[i]; | 368 | qlsp[i]=lsp[i]-qlsp[i]; |
369 | } | 369 | } |
370 | #endif | 370 | #endif /* SPEEX_DISABLE_ENCODER */ |
371 | 371 | ||
372 | void lsp_unquant_high(spx_lsp_t *lsp, int order, SpeexBits *bits) | 372 | void lsp_unquant_high(spx_lsp_t *lsp, int order, SpeexBits *bits) |
373 | { | 373 | { |
@@ -434,7 +434,7 @@ void lsp_quant_48k(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits) | |||
434 | for (i=0;i<order;i++) | 434 | for (i=0;i<order;i++) |
435 | qlsp[i]=lsp[i]-qlsp[i]; | 435 | qlsp[i]=lsp[i]-qlsp[i]; |
436 | } | 436 | } |
437 | #endif | 437 | #endif /* SPEEX_DISABLE_ENCODER */ |
438 | 438 | ||
439 | void lsp_unquant_48k(spx_lsp_t *lsp, int order, SpeexBits *bits) | 439 | void lsp_unquant_48k(spx_lsp_t *lsp, int order, SpeexBits *bits) |
440 | { | 440 | { |
diff --git a/apps/codecs/libspeex/speex_header.c b/apps/codecs/libspeex/speex_header.c index 1cb25ac2ff..6d1e010828 100644 --- a/apps/codecs/libspeex/speex_header.c +++ b/apps/codecs/libspeex/speex_header.c | |||
@@ -126,7 +126,7 @@ char *speex_header_to_packet(SpeexHeader *header, int *size) | |||
126 | *size = sizeof(SpeexHeader); | 126 | *size = sizeof(SpeexHeader); |
127 | return (char *)le_header; | 127 | return (char *)le_header; |
128 | } | 128 | } |
129 | #endif | 129 | #endif /* SPEEX_DISABLE_ENCODER */ |
130 | 130 | ||
131 | static SpeexHeader global_le_header; /* Avoid malloc */ | 131 | static SpeexHeader global_le_header; /* Avoid malloc */ |
132 | SpeexHeader *speex_packet_to_header(char *packet, int size) | 132 | SpeexHeader *speex_packet_to_header(char *packet, int size) |