diff options
author | Nils Wallménius <nils@rockbox.org> | 2012-09-22 12:01:01 +0200 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-09-24 15:20:21 +0200 |
commit | f49814214355913458f9f7635561365afa5bc7aa (patch) | |
tree | 08a049b9a379a8010b8c1ee0cc2b213cecf75c8d | |
parent | c555938ea0da97b2538530c1da9aeae4822bece7 (diff) | |
download | rockbox-f49814214355913458f9f7635561365afa5bc7aa.tar.gz rockbox-f49814214355913458f9f7635561365afa5bc7aa.zip |
opus: #if 0 out some unused code
Change-Id: I16fa9b439f8da5b9b8a4f17040487b9535078ec5
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/bands.c | 4 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/celt.c | 8 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/kiss_fft.c | 10 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/mdct.c | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/pitch.c | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libopus/opus_custom.h | 4 |
6 files changed, 30 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/bands.c b/lib/rbcodec/codecs/libopus/celt/bands.c index 6e612980b6..c7cb0d5500 100644 --- a/lib/rbcodec/codecs/libopus/celt/bands.c +++ b/lib/rbcodec/codecs/libopus/celt/bands.c | |||
@@ -73,6 +73,7 @@ static int bitexact_log2tan(int isin,int icos) | |||
73 | -FRAC_MUL16(icos, FRAC_MUL16(icos, -2597) + 7932); | 73 | -FRAC_MUL16(icos, FRAC_MUL16(icos, -2597) + 7932); |
74 | } | 74 | } |
75 | 75 | ||
76 | #if 0 | ||
76 | #ifdef FIXED_POINT | 77 | #ifdef FIXED_POINT |
77 | /* Compute the amplitude (sqrt energy) in each of the bands */ | 78 | /* Compute the amplitude (sqrt energy) in each of the bands */ |
78 | void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int M) | 79 | void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int M) |
@@ -170,6 +171,7 @@ void normalise_bands(const CELTMode *m, const celt_sig * OPUS_RESTRICT freq, cel | |||
170 | } | 171 | } |
171 | 172 | ||
172 | #endif /* FIXED_POINT */ | 173 | #endif /* FIXED_POINT */ |
174 | #endif | ||
173 | 175 | ||
174 | /* De-normalise the energy to produce the synthesis from the unit-energy bands */ | 176 | /* De-normalise the energy to produce the synthesis from the unit-energy bands */ |
175 | void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X, celt_sig * OPUS_RESTRICT freq, const celt_ener *bandE, int end, int C, int M) | 177 | void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X, celt_sig * OPUS_RESTRICT freq, const celt_ener *bandE, int end, int C, int M) |
@@ -390,6 +392,7 @@ static void stereo_merge(celt_norm *X, celt_norm *Y, opus_val16 mid, int N) | |||
390 | } | 392 | } |
391 | } | 393 | } |
392 | 394 | ||
395 | #if 0 | ||
393 | /* Decide whether we should spread the pulses in the current frame */ | 396 | /* Decide whether we should spread the pulses in the current frame */ |
394 | int spreading_decision(const CELTMode *m, celt_norm *X, int *average, | 397 | int spreading_decision(const CELTMode *m, celt_norm *X, int *average, |
395 | int last_decision, int *hf_average, int *tapset_decision, int update_hf, | 398 | int last_decision, int *hf_average, int *tapset_decision, int update_hf, |
@@ -482,6 +485,7 @@ int spreading_decision(const CELTMode *m, celt_norm *X, int *average, | |||
482 | #endif | 485 | #endif |
483 | return decision; | 486 | return decision; |
484 | } | 487 | } |
488 | #endif | ||
485 | 489 | ||
486 | #ifdef MEASURE_NORM_MSE | 490 | #ifdef MEASURE_NORM_MSE |
487 | 491 | ||
diff --git a/lib/rbcodec/codecs/libopus/celt/celt.c b/lib/rbcodec/codecs/libopus/celt/celt.c index 8d42cc95b3..a4afb247b1 100644 --- a/lib/rbcodec/codecs/libopus/celt/celt.c +++ b/lib/rbcodec/codecs/libopus/celt/celt.c | |||
@@ -198,6 +198,7 @@ struct OpusCustomEncoder { | |||
198 | /* opus_val16 oldEBands[], Size = 2*channels*mode->nbEBands */ | 198 | /* opus_val16 oldEBands[], Size = 2*channels*mode->nbEBands */ |
199 | }; | 199 | }; |
200 | 200 | ||
201 | #if 0 | ||
201 | int celt_encoder_get_size(int channels) | 202 | int celt_encoder_get_size(int channels) |
202 | { | 203 | { |
203 | CELTMode *mode = opus_custom_mode_create(48000, 960, NULL); | 204 | CELTMode *mode = opus_custom_mode_create(48000, 960, NULL); |
@@ -280,6 +281,7 @@ void opus_custom_encoder_destroy(CELTEncoder *st) | |||
280 | opus_free(st); | 281 | opus_free(st); |
281 | } | 282 | } |
282 | #endif /* CUSTOM_MODES */ | 283 | #endif /* CUSTOM_MODES */ |
284 | #endif | ||
283 | 285 | ||
284 | static inline opus_val16 SIG2WORD16(celt_sig x) | 286 | static inline opus_val16 SIG2WORD16(celt_sig x) |
285 | { | 287 | { |
@@ -293,6 +295,7 @@ static inline opus_val16 SIG2WORD16(celt_sig x) | |||
293 | #endif | 295 | #endif |
294 | } | 296 | } |
295 | 297 | ||
298 | #if 0 | ||
296 | static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int C, | 299 | static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int C, |
297 | int overlap) | 300 | int overlap) |
298 | { | 301 | { |
@@ -410,6 +413,7 @@ static void compute_mdcts(const CELTMode *mode, int shortBlocks, celt_sig * OPUS | |||
410 | } while (++c<C); | 413 | } while (++c<C); |
411 | } | 414 | } |
412 | } | 415 | } |
416 | #endif | ||
413 | 417 | ||
414 | /** Compute the IMDCT and apply window for all sub-frames and | 418 | /** Compute the IMDCT and apply window for all sub-frames and |
415 | all channels in a frame */ | 419 | all channels in a frame */ |
@@ -536,6 +540,7 @@ static const signed char tf_select_table[4][8] = { | |||
536 | {0, -2, 0, -3, 3, 0, 1,-1}, | 540 | {0, -2, 0, -3, 3, 0, 1,-1}, |
537 | }; | 541 | }; |
538 | 542 | ||
543 | #if 0 | ||
539 | static opus_val32 l1_metric(const celt_norm *tmp, int N, int LM, int width) | 544 | static opus_val32 l1_metric(const celt_norm *tmp, int N, int LM, int width) |
540 | { | 545 | { |
541 | int i, j; | 546 | int i, j; |
@@ -737,6 +742,7 @@ static void tf_encode(int start, int end, int isTransient, int *tf_res, int LM, | |||
737 | tf_res[i] = tf_select_table[LM][4*isTransient+2*tf_select+tf_res[i]]; | 742 | tf_res[i] = tf_select_table[LM][4*isTransient+2*tf_select+tf_res[i]]; |
738 | /*printf("%d %d ", isTransient, tf_select); for(i=0;i<end;i++)printf("%d ", tf_res[i]);printf("\n");*/ | 743 | /*printf("%d %d ", isTransient, tf_select); for(i=0;i<end;i++)printf("%d ", tf_res[i]);printf("\n");*/ |
739 | } | 744 | } |
745 | #endif | ||
740 | 746 | ||
741 | static void tf_decode(int start, int end, int isTransient, int *tf_res, int LM, ec_dec *dec) | 747 | static void tf_decode(int start, int end, int isTransient, int *tf_res, int LM, ec_dec *dec) |
742 | { | 748 | { |
@@ -788,6 +794,7 @@ static void init_caps(const CELTMode *m,int *cap,int LM,int C) | |||
788 | } | 794 | } |
789 | } | 795 | } |
790 | 796 | ||
797 | #if 0 | ||
791 | static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X, | 798 | static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X, |
792 | const opus_val16 *bandLogE, int end, int LM, int C, int N0) | 799 | const opus_val16 *bandLogE, int end, int LM, int C, int N0) |
793 | { | 800 | { |
@@ -1901,6 +1908,7 @@ bad_request: | |||
1901 | va_end(ap); | 1908 | va_end(ap); |
1902 | return OPUS_UNIMPLEMENTED; | 1909 | return OPUS_UNIMPLEMENTED; |
1903 | } | 1910 | } |
1911 | #endif | ||
1904 | 1912 | ||
1905 | /**********************************************************************/ | 1913 | /**********************************************************************/ |
1906 | /* */ | 1914 | /* */ |
diff --git a/lib/rbcodec/codecs/libopus/celt/kiss_fft.c b/lib/rbcodec/codecs/libopus/celt/kiss_fft.c index 3ba075ab0c..01049d5344 100644 --- a/lib/rbcodec/codecs/libopus/celt/kiss_fft.c +++ b/lib/rbcodec/codecs/libopus/celt/kiss_fft.c | |||
@@ -46,6 +46,7 @@ | |||
46 | complex numbers. It also delares the kf_ internal functions. | 46 | complex numbers. It also delares the kf_ internal functions. |
47 | */ | 47 | */ |
48 | 48 | ||
49 | #if 0 | ||
49 | static void kf_bfly2( | 50 | static void kf_bfly2( |
50 | kiss_fft_cpx * Fout, | 51 | kiss_fft_cpx * Fout, |
51 | const size_t fstride, | 52 | const size_t fstride, |
@@ -78,6 +79,7 @@ static void kf_bfly2( | |||
78 | } | 79 | } |
79 | } | 80 | } |
80 | } | 81 | } |
82 | #endif | ||
81 | 83 | ||
82 | static void ki_bfly2( | 84 | static void ki_bfly2( |
83 | kiss_fft_cpx * Fout, | 85 | kiss_fft_cpx * Fout, |
@@ -110,6 +112,7 @@ static void ki_bfly2( | |||
110 | } | 112 | } |
111 | } | 113 | } |
112 | 114 | ||
115 | #if 0 | ||
113 | static void kf_bfly4( | 116 | static void kf_bfly4( |
114 | kiss_fft_cpx * Fout, | 117 | kiss_fft_cpx * Fout, |
115 | const size_t fstride, | 118 | const size_t fstride, |
@@ -158,6 +161,7 @@ static void kf_bfly4( | |||
158 | } | 161 | } |
159 | } | 162 | } |
160 | } | 163 | } |
164 | #endif | ||
161 | 165 | ||
162 | static void ki_bfly4( | 166 | static void ki_bfly4( |
163 | kiss_fft_cpx * Fout, | 167 | kiss_fft_cpx * Fout, |
@@ -206,6 +210,7 @@ static void ki_bfly4( | |||
206 | 210 | ||
207 | #ifndef RADIX_TWO_ONLY | 211 | #ifndef RADIX_TWO_ONLY |
208 | 212 | ||
213 | #if 0 | ||
209 | static void kf_bfly3( | 214 | static void kf_bfly3( |
210 | kiss_fft_cpx * Fout, | 215 | kiss_fft_cpx * Fout, |
211 | const size_t fstride, | 216 | const size_t fstride, |
@@ -257,6 +262,7 @@ static void kf_bfly3( | |||
257 | } while(--k); | 262 | } while(--k); |
258 | } | 263 | } |
259 | } | 264 | } |
265 | #endif | ||
260 | 266 | ||
261 | static void ki_bfly3( | 267 | static void ki_bfly3( |
262 | kiss_fft_cpx * Fout, | 268 | kiss_fft_cpx * Fout, |
@@ -308,6 +314,7 @@ static void ki_bfly3( | |||
308 | } | 314 | } |
309 | } | 315 | } |
310 | 316 | ||
317 | #if 0 | ||
311 | static void kf_bfly5( | 318 | static void kf_bfly5( |
312 | kiss_fft_cpx * Fout, | 319 | kiss_fft_cpx * Fout, |
313 | const size_t fstride, | 320 | const size_t fstride, |
@@ -376,6 +383,7 @@ static void kf_bfly5( | |||
376 | } | 383 | } |
377 | } | 384 | } |
378 | } | 385 | } |
386 | #endif | ||
379 | 387 | ||
380 | static void ki_bfly5( | 388 | static void ki_bfly5( |
381 | kiss_fft_cpx * Fout, | 389 | kiss_fft_cpx * Fout, |
@@ -609,6 +617,7 @@ void opus_fft_free(const kiss_fft_state *cfg) | |||
609 | 617 | ||
610 | #endif /* CUSTOM_MODES */ | 618 | #endif /* CUSTOM_MODES */ |
611 | 619 | ||
620 | #if 0 | ||
612 | void opus_fft(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout) | 621 | void opus_fft(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout) |
613 | { | 622 | { |
614 | int m2, m; | 623 | int m2, m; |
@@ -667,6 +676,7 @@ void opus_fft(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fou | |||
667 | m = m2; | 676 | m = m2; |
668 | } | 677 | } |
669 | } | 678 | } |
679 | #endif | ||
670 | 680 | ||
671 | void opus_ifft(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout) | 681 | void opus_ifft(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout) |
672 | { | 682 | { |
diff --git a/lib/rbcodec/codecs/libopus/celt/mdct.c b/lib/rbcodec/codecs/libopus/celt/mdct.c index abf4e79d8d..4b66c211cf 100644 --- a/lib/rbcodec/codecs/libopus/celt/mdct.c +++ b/lib/rbcodec/codecs/libopus/celt/mdct.c | |||
@@ -101,6 +101,7 @@ void clt_mdct_clear(mdct_lookup *l) | |||
101 | 101 | ||
102 | #endif /* CUSTOM_MODES */ | 102 | #endif /* CUSTOM_MODES */ |
103 | 103 | ||
104 | #if 0 | ||
104 | /* Forward MDCT trashes the input array */ | 105 | /* Forward MDCT trashes the input array */ |
105 | void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out, | 106 | void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out, |
106 | const opus_val16 *window, int overlap, int shift, int stride) | 107 | const opus_val16 *window, int overlap, int shift, int stride) |
@@ -205,6 +206,7 @@ void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar | |||
205 | } | 206 | } |
206 | RESTORE_STACK; | 207 | RESTORE_STACK; |
207 | } | 208 | } |
209 | #endif | ||
208 | 210 | ||
209 | void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out, | 211 | void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out, |
210 | const opus_val16 * OPUS_RESTRICT window, int overlap, int shift, int stride) | 212 | const opus_val16 * OPUS_RESTRICT window, int overlap, int shift, int stride) |
diff --git a/lib/rbcodec/codecs/libopus/celt/pitch.c b/lib/rbcodec/codecs/libopus/celt/pitch.c index 3bad8e46a7..1b7efd945d 100644 --- a/lib/rbcodec/codecs/libopus/celt/pitch.c +++ b/lib/rbcodec/codecs/libopus/celt/pitch.c | |||
@@ -280,6 +280,7 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR | |||
280 | RESTORE_STACK; | 280 | RESTORE_STACK; |
281 | } | 281 | } |
282 | 282 | ||
283 | #if 0 | ||
283 | static const int second_check[16] = {0, 0, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2}; | 284 | static const int second_check[16] = {0, 0, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2}; |
284 | opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod, | 285 | opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod, |
285 | int N, int *T0_, int prev_period, opus_val16 prev_gain) | 286 | int N, int *T0_, int prev_period, opus_val16 prev_gain) |
@@ -408,3 +409,4 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod, | |||
408 | *T0_=minperiod0; | 409 | *T0_=minperiod0; |
409 | return pg; | 410 | return pg; |
410 | } | 411 | } |
412 | #endif | ||
diff --git a/lib/rbcodec/codecs/libopus/opus_custom.h b/lib/rbcodec/codecs/libopus/opus_custom.h index e7861d6f0a..f8124009a2 100644 --- a/lib/rbcodec/codecs/libopus/opus_custom.h +++ b/lib/rbcodec/codecs/libopus/opus_custom.h | |||
@@ -132,10 +132,12 @@ OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(OpusCustomMode *mode); | |||
132 | * @param [in] channels <tt>int</tt>: Number of channels | 132 | * @param [in] channels <tt>int</tt>: Number of channels |
133 | * @returns size | 133 | * @returns size |
134 | */ | 134 | */ |
135 | # if 0 | ||
135 | OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_size( | 136 | OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_size( |
136 | const OpusCustomMode *mode, | 137 | const OpusCustomMode *mode, |
137 | int channels | 138 | int channels |
138 | ) OPUS_ARG_NONNULL(1); | 139 | ) OPUS_ARG_NONNULL(1); |
140 | #endif | ||
139 | 141 | ||
140 | /** Creates a new encoder state. Each stream needs its own encoder | 142 | /** Creates a new encoder state. Each stream needs its own encoder |
141 | * state (can't be shared across simultaneous streams). | 143 | * state (can't be shared across simultaneous streams). |
@@ -164,11 +166,13 @@ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encode | |||
164 | * @param [in] channels <tt>int</tt>: Number of channels | 166 | * @param [in] channels <tt>int</tt>: Number of channels |
165 | * @return OPUS_OK Success or @ref opus_errorcodes | 167 | * @return OPUS_OK Success or @ref opus_errorcodes |
166 | */ | 168 | */ |
169 | #if 0 | ||
167 | OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init( | 170 | OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init( |
168 | OpusCustomEncoder *st, | 171 | OpusCustomEncoder *st, |
169 | const OpusCustomMode *mode, | 172 | const OpusCustomMode *mode, |
170 | int channels | 173 | int channels |
171 | ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); | 174 | ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); |
175 | #endif | ||
172 | 176 | ||
173 | /** Destroys a an encoder state. | 177 | /** Destroys a an encoder state. |
174 | * @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed. | 178 | * @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed. |