summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2011-06-01 10:28:26 +0000
committerNils Wallménius <nils@rockbox.org>2011-06-01 10:28:26 +0000
commit7c6056b352e35c5b12521b35ba193e13f75500be (patch)
treea53215338a7c78bd47ebb3afedf41c0489a97f4e /apps
parent05a1984eb32dd07bcf5d54c147ace4d6f56a00b4 (diff)
downloadrockbox-7c6056b352e35c5b12521b35ba193e13f75500be.tar.gz
rockbox-7c6056b352e35c5b12521b35ba193e13f75500be.tar.bz2
rockbox-7c6056b352e35c5b12521b35ba193e13f75500be.zip
FS#12140 by Sean Bartell, Make various codec stuff static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29942 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/au.c2
-rw-r--r--apps/codecs/lib/fft-ffmpeg.c12
-rw-r--r--apps/codecs/libalac/alac.c54
-rw-r--r--apps/codecs/libatrac/atrac3.c4
-rw-r--r--apps/codecs/libmusepack/mpc_decoder.c22
-rw-r--r--apps/codecs/libmusepack/mpcdec.h2
-rw-r--r--apps/codecs/libmusepack/requant.c2
-rw-r--r--apps/codecs/libspc/spc_codec.h16
-rw-r--r--apps/codecs/libspc/spc_emu.c18
-rw-r--r--apps/codecs/libtremor/res012.c8
-rw-r--r--apps/codecs/libtta/ttadec.c2
-rw-r--r--apps/codecs/spc.c4
-rw-r--r--apps/codecs/wav.c2
-rw-r--r--apps/codecs/wmapro.c3
14 files changed, 77 insertions, 74 deletions
diff --git a/apps/codecs/au.c b/apps/codecs/au.c
index e06f931cf9..ef308358f4 100644
--- a/apps/codecs/au.c
+++ b/apps/codecs/au.c
@@ -58,7 +58,7 @@ static const char support_formats[9][2] = {
{ AU_FORMAT_ALAW, 8 }, /* 27: G.711 ALAW */
};
-const struct pcm_entry au_codecs[] = {
+static const struct pcm_entry au_codecs[] = {
{ AU_FORMAT_MULAW, get_itut_g711_mulaw_codec },
{ AU_FORMAT_PCM, get_linear_pcm_codec },
{ AU_FORMAT_IEEE_FLOAT, get_ieee_float_codec },
diff --git a/apps/codecs/lib/fft-ffmpeg.c b/apps/codecs/lib/fft-ffmpeg.c
index a76f49fd1e..807f606038 100644
--- a/apps/codecs/lib/fft-ffmpeg.c
+++ b/apps/codecs/lib/fft-ffmpeg.c
@@ -276,8 +276,8 @@ static inline FFTComplex* TRANSFORM_ZERO(FFTComplex * z, unsigned int n)
#endif
/* z[0...8n-1], w[1...2n-1] */
-void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg) ICODE_ATTR_TREMOR_MDCT;
-void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg)
+static void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg) ICODE_ATTR_TREMOR_MDCT;
+static void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg)
{
register FFTComplex * z = z_arg;
register unsigned int STEP = STEP_arg;
@@ -318,8 +318,8 @@ void pass(FFTComplex *z_arg, unsigned int STEP_arg, unsigned int n_arg)
8192/16 (from "ff_cos_16") is 512 bytes.
i.e. for fft16, STEP = 8192/16 */
#define DECL_FFT(n,n2,n4)\
-void fft##n(FFTComplex *z) ICODE_ATTR_TREMOR_MDCT;\
-void fft##n(FFTComplex *z)\
+static void fft##n(FFTComplex *z) ICODE_ATTR_TREMOR_MDCT;\
+static void fft##n(FFTComplex *z)\
{\
fft##n2(z);\
fft##n4(z+n4*2);\
@@ -379,8 +379,8 @@ static void fft8_dispatch(FFTComplex *z)
}
#ifndef CONFIG_SMALL
-void fft16(FFTComplex *z) ICODE_ATTR_TREMOR_MDCT;
-void fft16(FFTComplex *z)
+static void fft16(FFTComplex *z) ICODE_ATTR_TREMOR_MDCT;
+static void fft16(FFTComplex *z)
{
fft8(z);
fft4(z+8);
diff --git a/apps/codecs/libalac/alac.c b/apps/codecs/libalac/alac.c
index 8a5c694994..7438e9436b 100644
--- a/apps/codecs/libalac/alac.c
+++ b/apps/codecs/libalac/alac.c
@@ -40,9 +40,9 @@
#define SIGNEXTEND24(val) (((signed)val<<8)>>8)
-int16_t predictor_coef_table[32] IBSS_ATTR;
-int16_t predictor_coef_table_a[32] IBSS_ATTR;
-int16_t predictor_coef_table_b[32] IBSS_ATTR;
+static int16_t predictor_coef_table[32] IBSS_ATTR;
+static int16_t predictor_coef_table_a[32] IBSS_ATTR;
+static int16_t predictor_coef_table_b[32] IBSS_ATTR;
/* Endian/aligment safe functions - only used in alac_set_info() */
@@ -578,16 +578,16 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
}
}
-void deinterlace_16(int32_t* buffer0,
- int32_t* buffer1,
- int numsamples,
- uint8_t interlacing_shift,
- uint8_t interlacing_leftweight) ICODE_ATTR_ALAC;
-void deinterlace_16(int32_t* buffer0,
- int32_t* buffer1,
- int numsamples,
- uint8_t interlacing_shift,
- uint8_t interlacing_leftweight)
+static void deinterlace_16(int32_t* buffer0,
+ int32_t* buffer1,
+ int numsamples,
+ uint8_t interlacing_shift,
+ uint8_t interlacing_leftweight) ICODE_ATTR_ALAC;
+static void deinterlace_16(int32_t* buffer0,
+ int32_t* buffer1,
+ int numsamples,
+ uint8_t interlacing_shift,
+ uint8_t interlacing_leftweight)
{
int i;
if (numsamples <= 0) return;
@@ -619,20 +619,20 @@ void deinterlace_16(int32_t* buffer0,
}
}
-void deinterlace_24(int32_t *buffer0, int32_t *buffer1,
- int uncompressed_bytes,
- int32_t *uncompressed_bytes_buffer0,
- int32_t *uncompressed_bytes_buffer1,
- int numsamples,
- uint8_t interlacing_shift,
- uint8_t interlacing_leftweight) ICODE_ATTR_ALAC;
-void deinterlace_24(int32_t *buffer0, int32_t *buffer1,
- int uncompressed_bytes,
- int32_t *uncompressed_bytes_buffer0,
- int32_t *uncompressed_bytes_buffer1,
- int numsamples,
- uint8_t interlacing_shift,
- uint8_t interlacing_leftweight)
+static void deinterlace_24(int32_t *buffer0, int32_t *buffer1,
+ int uncompressed_bytes,
+ int32_t *uncompressed_bytes_buffer0,
+ int32_t *uncompressed_bytes_buffer1,
+ int numsamples,
+ uint8_t interlacing_shift,
+ uint8_t interlacing_leftweight) ICODE_ATTR_ALAC;
+static void deinterlace_24(int32_t *buffer0, int32_t *buffer1,
+ int uncompressed_bytes,
+ int32_t *uncompressed_bytes_buffer0,
+ int32_t *uncompressed_bytes_buffer1,
+ int numsamples,
+ uint8_t interlacing_shift,
+ uint8_t interlacing_leftweight)
{
int i;
if (numsamples <= 0) return;
diff --git a/apps/codecs/libatrac/atrac3.c b/apps/codecs/libatrac/atrac3.c
index 711537fa96..bb52dd4cf0 100644
--- a/apps/codecs/libatrac/atrac3.c
+++ b/apps/codecs/libatrac/atrac3.c
@@ -474,8 +474,8 @@ static void inverseQuantizeSpectrum(int *mantissas, int32_t *pOut,
* @return outSubbands subband counter, fix for broken specification/files
*/
-int decodeSpectrum (GetBitContext *gb, int32_t *pOut) ICODE_ATTR_LARGE_IRAM;
-int decodeSpectrum (GetBitContext *gb, int32_t *pOut)
+static int decodeSpectrum (GetBitContext *gb, int32_t *pOut) ICODE_ATTR_LARGE_IRAM;
+static int decodeSpectrum (GetBitContext *gb, int32_t *pOut)
{
int numSubbands, codingMode, cnt, first, last, subbWidth;
int subband_vlc_index[32], SF_idxs[32];
diff --git a/apps/codecs/libmusepack/mpc_decoder.c b/apps/codecs/libmusepack/mpc_decoder.c
index eb0638524f..7bf7935d39 100644
--- a/apps/codecs/libmusepack/mpc_decoder.c
+++ b/apps/codecs/libmusepack/mpc_decoder.c
@@ -118,13 +118,15 @@ enum
//------------------------------------------------------------------------------
// forward declarations
//------------------------------------------------------------------------------
-void mpc_decoder_requantisierung (mpc_decoder *d)
- ICODE_ATTR_MPC_LARGE_IRAM;
-void mpc_decoder_read_bitstream_sv7(mpc_decoder * d, mpc_bits_reader * r)
- ICODE_ATTR_MPC_LARGE_IRAM;
-void mpc_decoder_read_bitstream_sv8(mpc_decoder * d, mpc_bits_reader * r,
- mpc_bool_t is_key_frame)
- ICODE_ATTR_MPC_SV8_BS_DEC;
+static void mpc_decoder_requantisierung (mpc_decoder *d)
+ ICODE_ATTR_MPC_LARGE_IRAM;
+static void mpc_decoder_read_bitstream_sv7(mpc_decoder * d,
+ mpc_bits_reader * r)
+ ICODE_ATTR_MPC_LARGE_IRAM;
+static void mpc_decoder_read_bitstream_sv8(mpc_decoder * d,
+ mpc_bits_reader * r,
+ mpc_bool_t is_key_frame)
+ ICODE_ATTR_MPC_SV8_BS_DEC;
//------------------------------------------------------------------------------
// macros
@@ -348,7 +350,7 @@ void mpc_decoder_decode_frame(mpc_decoder * d,
}
}
-void
+static void
mpc_decoder_requantisierung(mpc_decoder *d)
{
mpc_int32_t Band;
@@ -431,7 +433,7 @@ mpc_decoder_requantisierung(mpc_decoder *d)
}
}
-void mpc_decoder_read_bitstream_sv7(mpc_decoder * d, mpc_bits_reader * r)
+static void mpc_decoder_read_bitstream_sv7(mpc_decoder * d, mpc_bits_reader * r)
{
mpc_int32_t n, idx, Max_used_Band = 0;
@@ -580,7 +582,7 @@ void mpc_decoder_read_bitstream_sv7(mpc_decoder * d, mpc_bits_reader * r)
}
}
-void mpc_decoder_read_bitstream_sv8(mpc_decoder * d, mpc_bits_reader * r, mpc_bool_t is_key_frame)
+static void mpc_decoder_read_bitstream_sv8(mpc_decoder * d, mpc_bits_reader * r, mpc_bool_t is_key_frame)
{
mpc_int32_t n, Max_used_Band;
const mpc_can_data * Table, * Tables[2];
diff --git a/apps/codecs/libmusepack/mpcdec.h b/apps/codecs/libmusepack/mpcdec.h
index 68754dcbd2..85536e726a 100644
--- a/apps/codecs/libmusepack/mpcdec.h
+++ b/apps/codecs/libmusepack/mpcdec.h
@@ -139,7 +139,9 @@ MPC_API void mpc_decoder_exit(mpc_decoder *p_dec);
* by this factor. Useful for applying replay gain.
* @param scale_factor multiplicative scaling factor
*/
+/* rockbox: changed to static
MPC_API void mpc_decoder_scale_output(mpc_decoder *p_dec, double scale_factor);
+*/
MPC_API void mpc_decoder_decode_frame(mpc_decoder * d, mpc_bits_reader * r, mpc_frame_info * i);
diff --git a/apps/codecs/libmusepack/requant.c b/apps/codecs/libmusepack/requant.c
index ad26867204..5a113b0885 100644
--- a/apps/codecs/libmusepack/requant.c
+++ b/apps/codecs/libmusepack/requant.c
@@ -90,7 +90,7 @@ static mpc_uint32_t find_shift(double fval)
#define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,d->SCF_shift[N] = (mpc_uint8_t) find_shift(X));
-void
+static void
mpc_decoder_scale_output(mpc_decoder *d, double factor)
{
mpc_int32_t n; double f1, f2;
diff --git a/apps/codecs/libspc/spc_codec.h b/apps/codecs/libspc/spc_codec.h
index caa6860088..7f6b6e2e9f 100644
--- a/apps/codecs/libspc/spc_codec.h
+++ b/apps/codecs/libspc/spc_codec.h
@@ -433,14 +433,6 @@ struct Timer
int counter;
};
-void Timer_run_( struct Timer* t, long time ) ICODE_ATTR_SPC;
-
-static inline void Timer_run( struct Timer* t, long time )
-{
- if ( time >= t->next_tick )
- Timer_run_( t, time );
-}
-
struct Spc_Emu
{
uint8_t cycle_table [0x100];
@@ -490,14 +482,6 @@ static inline int DSP_read( struct Spc_Dsp* this, int i )
return this->r.reg [i];
}
-void SPC_run_dsp_( THIS, long time ) ICODE_ATTR_SPC;
-
-static inline void SPC_run_dsp( THIS, long time )
-{
- if ( time >= this->next_dsp )
- SPC_run_dsp_( this, time );
-}
-
int SPC_read( THIS, unsigned addr, long const time ) ICODE_ATTR_SPC;
void SPC_write( THIS, unsigned addr, int data, long const time ) ICODE_ATTR_SPC;
diff --git a/apps/codecs/libspc/spc_emu.c b/apps/codecs/libspc/spc_emu.c
index 0ad1329a6b..5ea5b0cdeb 100644
--- a/apps/codecs/libspc/spc_emu.c
+++ b/apps/codecs/libspc/spc_emu.c
@@ -32,7 +32,8 @@ struct cpu_ram_t ram IBSS_ATTR_SPC_LARGE_IRAM CACHEALIGN_ATTR;
/**************** Timers ****************/
-void Timer_run_( struct Timer* t, long time )
+static void Timer_run_( struct Timer* t, long time ) ICODE_ATTR_SPC;
+static void Timer_run_( struct Timer* t, long time )
{
/* when disabled, next_tick should always be in the future */
assert( t->enabled );
@@ -50,6 +51,12 @@ void Timer_run_( struct Timer* t, long time )
t->count = elapsed;
}
+static inline void Timer_run( struct Timer* t, long time )
+{
+ if ( time >= t->next_tick )
+ Timer_run_( t, time );
+}
+
/**************** SPC emulator ****************/
/* 1.024 MHz clock / 32000 samples per second */
@@ -179,7 +186,8 @@ int SPC_load_spc( THIS, const void* data, long size )
}
/**************** DSP interaction ****************/
-void SPC_run_dsp_( THIS, long time )
+static void SPC_run_dsp_( THIS, long time ) ICODE_ATTR_SPC;
+static void SPC_run_dsp_( THIS, long time )
{
/* divide by CLOCKS_PER_SAMPLE */
int count = ((time - this->next_dsp) >> 5) + 1;
@@ -189,6 +197,12 @@ void SPC_run_dsp_( THIS, long time )
DSP_run( &this->dsp, count, buf );
}
+static inline void SPC_run_dsp( THIS, long time )
+{
+ if ( time >= this->next_dsp )
+ SPC_run_dsp_( this, time );
+}
+
int SPC_read( THIS, unsigned addr, long const time )
{
int result = RAM [addr];
diff --git a/apps/codecs/libtremor/res012.c b/apps/codecs/libtremor/res012.c
index 79e3c23e15..e4ff440a6d 100644
--- a/apps/codecs/libtremor/res012.c
+++ b/apps/codecs/libtremor/res012.c
@@ -289,11 +289,11 @@ static int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl,
}
/* duplicate code here as speed is somewhat more important */
-int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
- ogg_int32_t **in,int *nonzero,int ch)
+static int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
+ ogg_int32_t **in,int *nonzero,int ch)
ICODE_ATTR_TREMOR_NOT_MDCT;
-int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
- ogg_int32_t **in,int *nonzero,int ch){
+static int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
+ ogg_int32_t **in,int *nonzero,int ch){
long i,k,l,s;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
diff --git a/apps/codecs/libtta/ttadec.c b/apps/codecs/libtta/ttadec.c
index 130cff8b41..aaefe736b9 100644
--- a/apps/codecs/libtta/ttadec.c
+++ b/apps/codecs/libtta/ttadec.c
@@ -53,7 +53,7 @@ static decoder tta[MAX_NCH] IBSS_ATTR; /* decoder state */
/* Rockbox speciffic: cache is defined in get_samples() (non static value) */
/* static int cache[MAX_NCH]; // decoder cache */
-tta_info *ttainfo IBSS_ATTR; /* currently playing file info */
+static tta_info *ttainfo IBSS_ATTR; /* currently playing file info */
static unsigned int fframes IBSS_ATTR; /* number of frames in file */
static unsigned int framelen IBSS_ATTR; /* the frame length in samples */
diff --git a/apps/codecs/spc.c b/apps/codecs/spc.c
index 80c28abbc1..6b21f9ad19 100644
--- a/apps/codecs/spc.c
+++ b/apps/codecs/spc.c
@@ -34,7 +34,7 @@ CODEC_HEADER
/**************** ID666 parsing ****************/
-struct {
+static struct {
unsigned char isBinary;
char song[32];
char game[32];
@@ -397,7 +397,7 @@ static inline void spc_play_send_samples(int32_t *samples)
#else /* !SPC_DUAL_CORE */
/** Implementations for single-core operation **/
-int32_t wav_chunk[WAV_CHUNK_SIZE*2] IBSS_ATTR;
+static int32_t wav_chunk[WAV_CHUNK_SIZE*2] IBSS_ATTR;
/* load a new program into emu */
static inline int load_spc_buffer(uint8_t *buf, size_t size)
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c
index 42bcc7081f..f6f83b174d 100644
--- a/apps/codecs/wav.c
+++ b/apps/codecs/wav.c
@@ -60,7 +60,7 @@ enum
WAVE_FORMAT_EXTENSIBLE = 0xFFFE
};
-const struct pcm_entry wave_codecs[] = {
+static const struct pcm_entry wave_codecs[] = {
{ WAVE_FORMAT_UNKNOWN, 0 },
{ WAVE_FORMAT_PCM, get_linear_pcm_codec },
{ WAVE_FORMAT_ADPCM, get_ms_adpcm_codec },
diff --git a/apps/codecs/wmapro.c b/apps/codecs/wmapro.c
index d451810216..17e311c5c0 100644
--- a/apps/codecs/wmapro.c
+++ b/apps/codecs/wmapro.c
@@ -25,7 +25,8 @@
CODEC_HEADER
-int32_t *dec[2]; /* pointers to the output buffers in WMAProDecodeCtx in wmaprodec.c */
+static int32_t *dec[2]; /* pointers to the output buffers in WMAProDecodeCtx in
+ wmaprodec.c */
/* this is the codec entry point */