forked from len0rd/rockbox
Make local functions static in codecs, where possible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19612 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6316e0ff53
commit
8e22f7f5b0
12 changed files with 44 additions and 44 deletions
|
@ -43,7 +43,7 @@ static inline void output_audio(sample_t *samples)
|
|||
ci->pcmbuf_insert(&samples[0], &samples[256], 256);
|
||||
}
|
||||
|
||||
void a52_decode_data(uint8_t *start, uint8_t *end)
|
||||
static void a52_decode_data(uint8_t *start, uint8_t *end)
|
||||
{
|
||||
static uint8_t *bufptr = buf;
|
||||
static uint8_t *bufpos = buf + 7;
|
||||
|
|
|
@ -57,7 +57,7 @@ static int32_t decoded1[BLOCKS_PER_LOOP] IBSS_ATTR;
|
|||
skip in that frame.
|
||||
*/
|
||||
|
||||
bool ape_calc_seekpos(struct ape_ctx_t* ape_ctx,
|
||||
static bool ape_calc_seekpos(struct ape_ctx_t* ape_ctx,
|
||||
uint32_t new_sample,
|
||||
uint32_t* newframe,
|
||||
uint32_t* filepos,
|
||||
|
@ -82,7 +82,7 @@ bool ape_calc_seekpos(struct ape_ctx_t* ape_ctx,
|
|||
/* The resume offset is a value in bytes - we need to
|
||||
turn it into a frame number and samplestoskip value */
|
||||
|
||||
void ape_resume(struct ape_ctx_t* ape_ctx, size_t resume_offset,
|
||||
static void ape_resume(struct ape_ctx_t* ape_ctx, size_t resume_offset,
|
||||
uint32_t* currentframe, uint32_t* samplesdone,
|
||||
uint32_t* samplestoskip, int* firstbyte)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
libdemac - A Monkey's Audio decoder
|
||||
|
||||
$Id:$
|
||||
$Id$
|
||||
|
||||
Copyright (C) Dave Chapman 2007
|
||||
|
||||
|
@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
|
|||
|
||||
#include <inttypes.h>
|
||||
|
||||
static uint32_t crctab32[] =
|
||||
static const uint32_t crctab32[] =
|
||||
{
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
|
||||
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
|
||||
|
|
|
@ -180,7 +180,7 @@ static bool flac_init(FLACContext* fc, int first_frame_offset)
|
|||
}
|
||||
|
||||
/* Synchronize to next frame in stream - adapted from libFLAC 1.1.3b2 */
|
||||
bool frame_sync(FLACContext* fc) {
|
||||
static bool frame_sync(FLACContext* fc) {
|
||||
unsigned int x = 0;
|
||||
bool cached = false;
|
||||
|
||||
|
@ -232,7 +232,7 @@ bool frame_sync(FLACContext* fc) {
|
|||
}
|
||||
|
||||
/* Seek to sample - adapted from libFLAC 1.1.3b2+ */
|
||||
bool flac_seek(FLACContext* fc, uint32_t target_sample) {
|
||||
static bool flac_seek(FLACContext* fc, uint32_t target_sample) {
|
||||
off_t orig_pos = ci->curpos;
|
||||
off_t pos = -1;
|
||||
unsigned long lower_bound, upper_bound;
|
||||
|
@ -385,7 +385,7 @@ bool flac_seek(FLACContext* fc, uint32_t target_sample) {
|
|||
}
|
||||
|
||||
/* Seek to file offset */
|
||||
bool flac_seek_offset(FLACContext* fc, uint32_t offset) {
|
||||
static bool flac_seek_offset(FLACContext* fc, uint32_t offset) {
|
||||
unsigned unparseable_count;
|
||||
bool got_a_frame = false;
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ static void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size,
|
|||
|
||||
/* fixed point square root approximation */
|
||||
/* !!!! ONLY WORKS FOR EVEN %REAL_BITS% !!!! */
|
||||
real_t fp_sqrt(real_t value)
|
||||
static real_t fp_sqrt(real_t value)
|
||||
{
|
||||
real_t root = 0;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ static void read_chunk_ftyp(qtmovie_t *qtmovie, size_t chunk_len)
|
|||
}
|
||||
}
|
||||
|
||||
uint32_t mp4ff_read_mp4_descr_length(stream_t* stream)
|
||||
static uint32_t mp4ff_read_mp4_descr_length(stream_t* stream)
|
||||
{
|
||||
uint8_t b;
|
||||
uint8_t numBytes = 0;
|
||||
|
|
|
@ -253,7 +253,7 @@ int read_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd)
|
|||
// currently implemented) this is calculated from the slow_level values and the
|
||||
// bitrate accumulators. Note that the bitrate accumulators can be changing.
|
||||
|
||||
void update_error_limit (struct words_data *w, uint32_t flags)
|
||||
static void update_error_limit (struct words_data *w, uint32_t flags)
|
||||
{
|
||||
int bitrate_0 = (w->bitrate_acc [0] += w->bitrate_delta [0]) >> 16;
|
||||
|
||||
|
|
|
@ -264,27 +264,27 @@ void mixer_playsample(int channel, int instrument)
|
|||
modplayer.modchannel[channel].instrument = instrument;
|
||||
}
|
||||
|
||||
inline void mixer_stopsample(int channel)
|
||||
static inline void mixer_stopsample(int channel)
|
||||
{
|
||||
mixer.channel[channel].channelactive = false;
|
||||
}
|
||||
|
||||
inline void mixer_continuesample(int channel)
|
||||
static inline void mixer_continuesample(int channel)
|
||||
{
|
||||
mixer.channel[channel].channelactive = true;
|
||||
}
|
||||
|
||||
inline void mixer_setvolume(int channel, int volume)
|
||||
static inline void mixer_setvolume(int channel, int volume)
|
||||
{
|
||||
mixer.channel[channel].volume = volume;
|
||||
}
|
||||
|
||||
inline void mixer_setpanning(int channel, int panning)
|
||||
static inline void mixer_setpanning(int channel, int panning)
|
||||
{
|
||||
mixer.channel[channel].panning = panning;
|
||||
}
|
||||
|
||||
inline void mixer_setamigaperiod(int channel, int amigaperiod)
|
||||
static inline void mixer_setamigaperiod(int channel, int amigaperiod)
|
||||
{
|
||||
/* Just to make sure we don't devide by zero
|
||||
* amigaperiod shouldn't 0 anyway - if it is the case
|
||||
|
@ -1090,7 +1090,7 @@ void playeffect(int currenttick)
|
|||
}
|
||||
}
|
||||
|
||||
inline int clip(int i)
|
||||
static inline int clip(int i)
|
||||
{
|
||||
if (i > 32767) return(32767);
|
||||
else if (i < -32768) return(-32768);
|
||||
|
|
|
@ -1156,7 +1156,7 @@ void putbits(uint32_t val, uint32_t nbit)
|
|||
/* of the Huffman tables as defined in the IS (Table B.7), and will not */
|
||||
/* work with any arbitrary tables. */
|
||||
/***************************************************************************/
|
||||
int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits )
|
||||
static int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits )
|
||||
{
|
||||
uint32_t i;
|
||||
int max, table0, table1;
|
||||
|
@ -1301,7 +1301,7 @@ int count_bigv(short *ix, uint32_t start, uint32_t end, int table0,
|
|||
/* Function: Calculation of rzero, count1, address3 */
|
||||
/* (Partitions ix into big values, quadruples and zeros). */
|
||||
/*************************************************************************/
|
||||
int calc_runlen( short *ix, side_info_t *si )
|
||||
static int calc_runlen( short *ix, side_info_t *si )
|
||||
{
|
||||
int p, i, sum = 0;
|
||||
|
||||
|
@ -1347,7 +1347,7 @@ int calc_runlen( short *ix, side_info_t *si )
|
|||
/*************************************************************************/
|
||||
/* Function: Quantization of the vector xr ( -> ix) */
|
||||
/*************************************************************************/
|
||||
int quantize_int(int *xr, short *ix, side_info_t *si)
|
||||
static int quantize_int(int *xr, short *ix, side_info_t *si)
|
||||
{
|
||||
unsigned int i, idx, s, frac_pow[] = { 0x10000, 0xd745, 0xb505, 0x9838 };
|
||||
|
||||
|
@ -1379,7 +1379,7 @@ int quantize_int(int *xr, short *ix, side_info_t *si)
|
|||
/*************************************************************************/
|
||||
/* subdivides the bigvalue region which will use separate Huffman tables */
|
||||
/*************************************************************************/
|
||||
void subdivide(side_info_t *si)
|
||||
static void subdivide(side_info_t *si)
|
||||
{
|
||||
int scfb, count0, count1;
|
||||
|
||||
|
@ -1407,7 +1407,7 @@ void subdivide(side_info_t *si)
|
|||
/*******************************************************************/
|
||||
/* Count the number of bits necessary to code the bigvalues region */
|
||||
/*******************************************************************/
|
||||
int bigv_bitcount(short *ix, side_info_t *gi)
|
||||
static int bigv_bitcount(short *ix, side_info_t *gi)
|
||||
{
|
||||
int b1=0, b2=0, b3=0;
|
||||
|
||||
|
@ -1428,7 +1428,7 @@ int bigv_bitcount(short *ix, side_info_t *gi)
|
|||
return b1+b2+b3;
|
||||
}
|
||||
|
||||
int quantize_and_count_bits(int *xr, short *ix, side_info_t *si)
|
||||
static int quantize_and_count_bits(int *xr, short *ix, side_info_t *si)
|
||||
{
|
||||
int bits = 10000;
|
||||
|
||||
|
@ -1445,7 +1445,7 @@ int quantize_and_count_bits(int *xr, short *ix, side_info_t *si)
|
|||
/************************************************************************/
|
||||
/* The code selects the best quantStep for a particular set of scalefacs*/
|
||||
/************************************************************************/
|
||||
int inner_loop(int *xr, int max_bits, side_info_t *si)
|
||||
static int inner_loop(int *xr, int max_bits, side_info_t *si)
|
||||
{
|
||||
int bits;
|
||||
|
||||
|
@ -1469,7 +1469,7 @@ int inner_loop(int *xr, int max_bits, side_info_t *si)
|
|||
return bits;
|
||||
}
|
||||
|
||||
void iteration_loop(int *xr, side_info_t *si, int gr_cnt)
|
||||
static void iteration_loop(int *xr, side_info_t *si, int gr_cnt)
|
||||
{
|
||||
int remain, tar_bits, max_bits = cfg.mean_bits;
|
||||
|
||||
|
@ -1971,7 +1971,7 @@ static int find_samplerate_index(long freq, int *mp3_type)
|
|||
return i;
|
||||
}
|
||||
|
||||
bool init_mp3_encoder_engine(int sample_rate,
|
||||
static bool init_mp3_encoder_engine(int sample_rate,
|
||||
int num_channels,
|
||||
int rec_mono_mode,
|
||||
struct encoder_config *enc_cfg)
|
||||
|
@ -2157,7 +2157,7 @@ static inline void byte_swap_frame32(uint32_t *dst, uint32_t *src,
|
|||
} /* byte_swap_frame32 */
|
||||
#endif /* ROCKBOX_LITTLE_ENDIAN */
|
||||
|
||||
void set_scale_facs(int *mdct_freq)
|
||||
static void set_scale_facs(int *mdct_freq)
|
||||
{
|
||||
unsigned int i, is, ie, k, s;
|
||||
int max_freq_val, avrg_freq_val;
|
||||
|
|
|
@ -56,7 +56,7 @@ unsigned char mad_main_data[MAD_BUFFER_MDLEN] IBSS_ATTR;
|
|||
int mpeg_latency[3] = { 0, 481, 529 };
|
||||
int mpeg_framesize[3] = {384, 1152, 1152};
|
||||
|
||||
void init_mad(void)
|
||||
static void init_mad(void)
|
||||
{
|
||||
ci->memset(&stream, 0, sizeof(struct mad_stream));
|
||||
ci->memset(&frame, 0, sizeof(struct mad_frame));
|
||||
|
@ -85,7 +85,7 @@ void init_mad(void)
|
|||
|
||||
}
|
||||
|
||||
int get_file_pos(int newtime)
|
||||
static int get_file_pos(int newtime)
|
||||
{
|
||||
int pos = -1;
|
||||
struct mp3entry *id3 = ci->id3;
|
||||
|
|
|
@ -27,14 +27,14 @@ CODEC_HEADER
|
|||
mpc_decoder decoder IBSS_ATTR;
|
||||
|
||||
/* Our implementations of the mpc_reader callback functions. */
|
||||
mpc_int32_t read_impl(void *data, void *ptr, mpc_int32_t size)
|
||||
static mpc_int32_t read_impl(void *data, void *ptr, mpc_int32_t size)
|
||||
{
|
||||
struct codec_api *ci = (struct codec_api *)data;
|
||||
|
||||
return ((mpc_int32_t)(ci->read_filebuf(ptr, size)));
|
||||
}
|
||||
|
||||
mpc_bool_t seek_impl(void *data, mpc_int32_t offset)
|
||||
static mpc_bool_t seek_impl(void *data, mpc_int32_t offset)
|
||||
{
|
||||
struct codec_api *ci = (struct codec_api *)data;
|
||||
|
||||
|
@ -43,21 +43,21 @@ mpc_bool_t seek_impl(void *data, mpc_int32_t offset)
|
|||
return ci->seek_buffer(offset);
|
||||
}
|
||||
|
||||
mpc_int32_t tell_impl(void *data)
|
||||
static mpc_int32_t tell_impl(void *data)
|
||||
{
|
||||
struct codec_api *ci = (struct codec_api *)data;
|
||||
|
||||
return ci->curpos;
|
||||
}
|
||||
|
||||
mpc_int32_t get_size_impl(void *data)
|
||||
static mpc_int32_t get_size_impl(void *data)
|
||||
{
|
||||
struct codec_api *ci = (struct codec_api *)data;
|
||||
|
||||
return ci->filesize;
|
||||
}
|
||||
|
||||
mpc_bool_t canseek_impl(void *data)
|
||||
static mpc_bool_t canseek_impl(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
|
|
|
@ -4294,7 +4294,7 @@ jammed:
|
|||
|
||||
/****************** rockbox interface ******************/
|
||||
|
||||
void set_codec_track(int t, int d) {
|
||||
static void set_codec_track(int t, int d) {
|
||||
int track,fade,def=0;
|
||||
SetTrack(t);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue