summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libopus
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2012-09-22 12:01:01 +0200
committerNils Wallménius <nils@rockbox.org>2012-09-24 15:20:21 +0200
commitf49814214355913458f9f7635561365afa5bc7aa (patch)
tree08a049b9a379a8010b8c1ee0cc2b213cecf75c8d /lib/rbcodec/codecs/libopus
parentc555938ea0da97b2538530c1da9aeae4822bece7 (diff)
opus: #if 0 out some unused code
Change-Id: I16fa9b439f8da5b9b8a4f17040487b9535078ec5
Diffstat (limited to 'lib/rbcodec/codecs/libopus')
-rw-r--r--lib/rbcodec/codecs/libopus/celt/bands.c4
-rw-r--r--lib/rbcodec/codecs/libopus/celt/celt.c8
-rw-r--r--lib/rbcodec/codecs/libopus/celt/kiss_fft.c10
-rw-r--r--lib/rbcodec/codecs/libopus/celt/mdct.c2
-rw-r--r--lib/rbcodec/codecs/libopus/celt/pitch.c2
-rw-r--r--lib/rbcodec/codecs/libopus/opus_custom.h4
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)
-FRAC_MUL16(icos, FRAC_MUL16(icos, -2597) + 7932);
}
+#if 0
#ifdef FIXED_POINT
/* Compute the amplitude (sqrt energy) in each of the bands */
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
}
#endif /* FIXED_POINT */
+#endif
/* De-normalise the energy to produce the synthesis from the unit-energy bands */
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)
}
}
+#if 0
/* Decide whether we should spread the pulses in the current frame */
int spreading_decision(const CELTMode *m, celt_norm *X, int *average,
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,
#endif
return decision;
}
+#endif
#ifdef MEASURE_NORM_MSE
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 {
/* opus_val16 oldEBands[], Size = 2*channels*mode->nbEBands */
};
+#if 0
int celt_encoder_get_size(int channels)
{
CELTMode *mode = opus_custom_mode_create(48000, 960, NULL);
@@ -280,6 +281,7 @@ void opus_custom_encoder_destroy(CELTEncoder *st)
opus_free(st);
}
#endif /* CUSTOM_MODES */
+#endif
static inline opus_val16 SIG2WORD16(celt_sig x)
{
@@ -293,6 +295,7 @@ static inline opus_val16 SIG2WORD16(celt_sig x)
#endif
}
+#if 0
static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int C,
int overlap)
{
@@ -410,6 +413,7 @@ static void compute_mdcts(const CELTMode *mode, int shortBlocks, celt_sig * OPUS
} while (++c<C);
}
}
+#endif
/** Compute the IMDCT and apply window for all sub-frames and
all channels in a frame */
@@ -536,6 +540,7 @@ static const signed char tf_select_table[4][8] = {
{0, -2, 0, -3, 3, 0, 1,-1},
};
+#if 0
static opus_val32 l1_metric(const celt_norm *tmp, int N, int LM, int width)
{
int i, j;
@@ -737,6 +742,7 @@ static void tf_encode(int start, int end, int isTransient, int *tf_res, int LM,
tf_res[i] = tf_select_table[LM][4*isTransient+2*tf_select+tf_res[i]];
/*printf("%d %d ", isTransient, tf_select); for(i=0;i<end;i++)printf("%d ", tf_res[i]);printf("\n");*/
}
+#endif
static void tf_decode(int start, int end, int isTransient, int *tf_res, int LM, ec_dec *dec)
{
@@ -788,6 +794,7 @@ static void init_caps(const CELTMode *m,int *cap,int LM,int C)
}
}
+#if 0
static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X,
const opus_val16 *bandLogE, int end, int LM, int C, int N0)
{
@@ -1901,6 +1908,7 @@ bad_request:
va_end(ap);
return OPUS_UNIMPLEMENTED;
}
+#endif
/**********************************************************************/
/* */
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 @@
complex numbers. It also delares the kf_ internal functions.
*/
+#if 0
static void kf_bfly2(
kiss_fft_cpx * Fout,
const size_t fstride,
@@ -78,6 +79,7 @@ static void kf_bfly2(
}
}
}
+#endif
static void ki_bfly2(
kiss_fft_cpx * Fout,
@@ -110,6 +112,7 @@ static void ki_bfly2(
}
}
+#if 0
static void kf_bfly4(
kiss_fft_cpx * Fout,
const size_t fstride,
@@ -158,6 +161,7 @@ static void kf_bfly4(
}
}
}
+#endif
static void ki_bfly4(
kiss_fft_cpx * Fout,
@@ -206,6 +210,7 @@ static void ki_bfly4(
#ifndef RADIX_TWO_ONLY
+#if 0
static void kf_bfly3(
kiss_fft_cpx * Fout,
const size_t fstride,
@@ -257,6 +262,7 @@ static void kf_bfly3(
} while(--k);
}
}
+#endif
static void ki_bfly3(
kiss_fft_cpx * Fout,
@@ -308,6 +314,7 @@ static void ki_bfly3(
}
}
+#if 0
static void kf_bfly5(
kiss_fft_cpx * Fout,
const size_t fstride,
@@ -376,6 +383,7 @@ static void kf_bfly5(
}
}
}
+#endif
static void ki_bfly5(
kiss_fft_cpx * Fout,
@@ -609,6 +617,7 @@ void opus_fft_free(const kiss_fft_state *cfg)
#endif /* CUSTOM_MODES */
+#if 0
void opus_fft(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)
{
int m2, m;
@@ -667,6 +676,7 @@ void opus_fft(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fou
m = m2;
}
}
+#endif
void opus_ifft(const kiss_fft_state *st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)
{
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)
#endif /* CUSTOM_MODES */
+#if 0
/* Forward MDCT trashes the input array */
void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out,
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
}
RESTORE_STACK;
}
+#endif
void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out,
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
RESTORE_STACK;
}
+#if 0
static const int second_check[16] = {0, 0, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2};
opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
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,
*T0_=minperiod0;
return pg;
}
+#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);
* @param [in] channels <tt>int</tt>: Number of channels
* @returns size
*/
+# if 0
OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_size(
const OpusCustomMode *mode,
int channels
) OPUS_ARG_NONNULL(1);
+#endif
/** Creates a new encoder state. Each stream needs its own encoder
* state (can't be shared across simultaneous streams).
@@ -164,11 +166,13 @@ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encode
* @param [in] channels <tt>int</tt>: Number of channels
* @return OPUS_OK Success or @ref opus_errorcodes
*/
+#if 0
OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init(
OpusCustomEncoder *st,
const OpusCustomMode *mode,
int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
+#endif
/** Destroys a an encoder state.
* @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed.