forked from len0rd/rockbox
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
This commit is contained in:
parent
05a1984eb3
commit
7c6056b352
14 changed files with 77 additions and 74 deletions
|
@ -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 },
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue