summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2008-12-29 19:49:48 +0000
committerBertrik Sikken <bertrik@sikken.nl>2008-12-29 19:49:48 +0000
commit8e22f7f5b048cf7a46a3132cfbc9f2e38ccec076 (patch)
treec03dc8a4e2178274d6583662a23a5675223a6a98
parent6316e0ff53e0c8b3a1f2edf61fc54017eb997e20 (diff)
downloadrockbox-8e22f7f5b048cf7a46a3132cfbc9f2e38ccec076.tar.gz
rockbox-8e22f7f5b048cf7a46a3132cfbc9f2e38ccec076.zip
Make local functions static in codecs, where possible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19612 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/a52.c2
-rw-r--r--apps/codecs/ape.c16
-rw-r--r--apps/codecs/demac/libdemac/crc.c4
-rw-r--r--apps/codecs/flac.c6
-rw-r--r--apps/codecs/libfaad/pns.c2
-rw-r--r--apps/codecs/libm4a/demux.c2
-rw-r--r--apps/codecs/libwavpack/words.c2
-rw-r--r--apps/codecs/mod.c12
-rw-r--r--apps/codecs/mp3_enc.c26
-rw-r--r--apps/codecs/mpa.c4
-rw-r--r--apps/codecs/mpc.c10
-rw-r--r--apps/codecs/nsf.c2
12 files changed, 44 insertions, 44 deletions
diff --git a/apps/codecs/a52.c b/apps/codecs/a52.c
index f8eaef26fd..360a5862d7 100644
--- a/apps/codecs/a52.c
+++ b/apps/codecs/a52.c
@@ -43,7 +43,7 @@ static inline void output_audio(sample_t *samples)
43 ci->pcmbuf_insert(&samples[0], &samples[256], 256); 43 ci->pcmbuf_insert(&samples[0], &samples[256], 256);
44} 44}
45 45
46void a52_decode_data(uint8_t *start, uint8_t *end) 46static void a52_decode_data(uint8_t *start, uint8_t *end)
47{ 47{
48 static uint8_t *bufptr = buf; 48 static uint8_t *bufptr = buf;
49 static uint8_t *bufpos = buf + 7; 49 static uint8_t *bufpos = buf + 7;
diff --git a/apps/codecs/ape.c b/apps/codecs/ape.c
index 0419a6f6bd..dbe6e0fc9e 100644
--- a/apps/codecs/ape.c
+++ b/apps/codecs/ape.c
@@ -57,11 +57,11 @@ static int32_t decoded1[BLOCKS_PER_LOOP] IBSS_ATTR;
57 skip in that frame. 57 skip in that frame.
58*/ 58*/
59 59
60bool ape_calc_seekpos(struct ape_ctx_t* ape_ctx, 60static bool ape_calc_seekpos(struct ape_ctx_t* ape_ctx,
61 uint32_t new_sample, 61 uint32_t new_sample,
62 uint32_t* newframe, 62 uint32_t* newframe,
63 uint32_t* filepos, 63 uint32_t* filepos,
64 uint32_t* samplestoskip) 64 uint32_t* samplestoskip)
65{ 65{
66 uint32_t n; 66 uint32_t n;
67 67
@@ -82,9 +82,9 @@ bool ape_calc_seekpos(struct ape_ctx_t* ape_ctx,
82/* The resume offset is a value in bytes - we need to 82/* The resume offset is a value in bytes - we need to
83 turn it into a frame number and samplestoskip value */ 83 turn it into a frame number and samplestoskip value */
84 84
85void ape_resume(struct ape_ctx_t* ape_ctx, size_t resume_offset, 85static void ape_resume(struct ape_ctx_t* ape_ctx, size_t resume_offset,
86 uint32_t* currentframe, uint32_t* samplesdone, 86 uint32_t* currentframe, uint32_t* samplesdone,
87 uint32_t* samplestoskip, int* firstbyte) 87 uint32_t* samplestoskip, int* firstbyte)
88{ 88{
89 off_t newfilepos; 89 off_t newfilepos;
90 int64_t framesize; 90 int64_t framesize;
diff --git a/apps/codecs/demac/libdemac/crc.c b/apps/codecs/demac/libdemac/crc.c
index c23de7d043..816c6594f7 100644
--- a/apps/codecs/demac/libdemac/crc.c
+++ b/apps/codecs/demac/libdemac/crc.c
@@ -2,7 +2,7 @@
2 2
3libdemac - A Monkey's Audio decoder 3libdemac - A Monkey's Audio decoder
4 4
5$Id:$ 5$Id$
6 6
7Copyright (C) Dave Chapman 2007 7Copyright (C) Dave Chapman 2007
8 8
@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
24 24
25#include <inttypes.h> 25#include <inttypes.h>
26 26
27static uint32_t crctab32[] = 27static const uint32_t crctab32[] =
28{ 28{
29 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 29 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
30 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 30 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c
index cf3bbca65c..3a23d0b951 100644
--- a/apps/codecs/flac.c
+++ b/apps/codecs/flac.c
@@ -180,7 +180,7 @@ static bool flac_init(FLACContext* fc, int first_frame_offset)
180} 180}
181 181
182/* Synchronize to next frame in stream - adapted from libFLAC 1.1.3b2 */ 182/* Synchronize to next frame in stream - adapted from libFLAC 1.1.3b2 */
183bool frame_sync(FLACContext* fc) { 183static bool frame_sync(FLACContext* fc) {
184 unsigned int x = 0; 184 unsigned int x = 0;
185 bool cached = false; 185 bool cached = false;
186 186
@@ -232,7 +232,7 @@ bool frame_sync(FLACContext* fc) {
232} 232}
233 233
234/* Seek to sample - adapted from libFLAC 1.1.3b2+ */ 234/* Seek to sample - adapted from libFLAC 1.1.3b2+ */
235bool flac_seek(FLACContext* fc, uint32_t target_sample) { 235static bool flac_seek(FLACContext* fc, uint32_t target_sample) {
236 off_t orig_pos = ci->curpos; 236 off_t orig_pos = ci->curpos;
237 off_t pos = -1; 237 off_t pos = -1;
238 unsigned long lower_bound, upper_bound; 238 unsigned long lower_bound, upper_bound;
@@ -385,7 +385,7 @@ bool flac_seek(FLACContext* fc, uint32_t target_sample) {
385} 385}
386 386
387/* Seek to file offset */ 387/* Seek to file offset */
388bool flac_seek_offset(FLACContext* fc, uint32_t offset) { 388static bool flac_seek_offset(FLACContext* fc, uint32_t offset) {
389 unsigned unparseable_count; 389 unsigned unparseable_count;
390 bool got_a_frame = false; 390 bool got_a_frame = false;
391 391
diff --git a/apps/codecs/libfaad/pns.c b/apps/codecs/libfaad/pns.c
index 7727b22160..85de391101 100644
--- a/apps/codecs/libfaad/pns.c
+++ b/apps/codecs/libfaad/pns.c
@@ -51,7 +51,7 @@ static void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size,
51 51
52/* fixed point square root approximation */ 52/* fixed point square root approximation */
53/* !!!! ONLY WORKS FOR EVEN %REAL_BITS% !!!! */ 53/* !!!! ONLY WORKS FOR EVEN %REAL_BITS% !!!! */
54real_t fp_sqrt(real_t value) 54static real_t fp_sqrt(real_t value)
55{ 55{
56 real_t root = 0; 56 real_t root = 0;
57 57
diff --git a/apps/codecs/libm4a/demux.c b/apps/codecs/libm4a/demux.c
index e9b5c2c482..f0c6922ca6 100644
--- a/apps/codecs/libm4a/demux.c
+++ b/apps/codecs/libm4a/demux.c
@@ -83,7 +83,7 @@ static void read_chunk_ftyp(qtmovie_t *qtmovie, size_t chunk_len)
83 } 83 }
84} 84}
85 85
86uint32_t mp4ff_read_mp4_descr_length(stream_t* stream) 86static uint32_t mp4ff_read_mp4_descr_length(stream_t* stream)
87{ 87{
88 uint8_t b; 88 uint8_t b;
89 uint8_t numBytes = 0; 89 uint8_t numBytes = 0;
diff --git a/apps/codecs/libwavpack/words.c b/apps/codecs/libwavpack/words.c
index c7a8047d03..6da716119c 100644
--- a/apps/codecs/libwavpack/words.c
+++ b/apps/codecs/libwavpack/words.c
@@ -253,7 +253,7 @@ int read_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd)
253// currently implemented) this is calculated from the slow_level values and the 253// currently implemented) this is calculated from the slow_level values and the
254// bitrate accumulators. Note that the bitrate accumulators can be changing. 254// bitrate accumulators. Note that the bitrate accumulators can be changing.
255 255
256void update_error_limit (struct words_data *w, uint32_t flags) 256static void update_error_limit (struct words_data *w, uint32_t flags)
257{ 257{
258 int bitrate_0 = (w->bitrate_acc [0] += w->bitrate_delta [0]) >> 16; 258 int bitrate_0 = (w->bitrate_acc [0] += w->bitrate_delta [0]) >> 16;
259 259
diff --git a/apps/codecs/mod.c b/apps/codecs/mod.c
index c8ada66f18..91b5955b40 100644
--- a/apps/codecs/mod.c
+++ b/apps/codecs/mod.c
@@ -264,27 +264,27 @@ void mixer_playsample(int channel, int instrument)
264 modplayer.modchannel[channel].instrument = instrument; 264 modplayer.modchannel[channel].instrument = instrument;
265} 265}
266 266
267inline void mixer_stopsample(int channel) 267static inline void mixer_stopsample(int channel)
268{ 268{
269 mixer.channel[channel].channelactive = false; 269 mixer.channel[channel].channelactive = false;
270} 270}
271 271
272inline void mixer_continuesample(int channel) 272static inline void mixer_continuesample(int channel)
273{ 273{
274 mixer.channel[channel].channelactive = true; 274 mixer.channel[channel].channelactive = true;
275} 275}
276 276
277inline void mixer_setvolume(int channel, int volume) 277static inline void mixer_setvolume(int channel, int volume)
278{ 278{
279 mixer.channel[channel].volume = volume; 279 mixer.channel[channel].volume = volume;
280} 280}
281 281
282inline void mixer_setpanning(int channel, int panning) 282static inline void mixer_setpanning(int channel, int panning)
283{ 283{
284 mixer.channel[channel].panning = panning; 284 mixer.channel[channel].panning = panning;
285} 285}
286 286
287inline void mixer_setamigaperiod(int channel, int amigaperiod) 287static inline void mixer_setamigaperiod(int channel, int amigaperiod)
288{ 288{
289 /* Just to make sure we don't devide by zero 289 /* Just to make sure we don't devide by zero
290 * amigaperiod shouldn't 0 anyway - if it is the case 290 * amigaperiod shouldn't 0 anyway - if it is the case
@@ -1090,7 +1090,7 @@ void playeffect(int currenttick)
1090 } 1090 }
1091} 1091}
1092 1092
1093inline int clip(int i) 1093static inline int clip(int i)
1094{ 1094{
1095 if (i > 32767) return(32767); 1095 if (i > 32767) return(32767);
1096 else if (i < -32768) return(-32768); 1096 else if (i < -32768) return(-32768);
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index 18aa1bfe1a..94d4c2a5f3 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -1156,7 +1156,7 @@ void putbits(uint32_t val, uint32_t nbit)
1156/* of the Huffman tables as defined in the IS (Table B.7), and will not */ 1156/* of the Huffman tables as defined in the IS (Table B.7), and will not */
1157/* work with any arbitrary tables. */ 1157/* work with any arbitrary tables. */
1158/***************************************************************************/ 1158/***************************************************************************/
1159int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits ) 1159static int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits )
1160{ 1160{
1161 uint32_t i; 1161 uint32_t i;
1162 int max, table0, table1; 1162 int max, table0, table1;
@@ -1301,7 +1301,7 @@ int count_bigv(short *ix, uint32_t start, uint32_t end, int table0,
1301/* Function: Calculation of rzero, count1, address3 */ 1301/* Function: Calculation of rzero, count1, address3 */
1302/* (Partitions ix into big values, quadruples and zeros). */ 1302/* (Partitions ix into big values, quadruples and zeros). */
1303/*************************************************************************/ 1303/*************************************************************************/
1304int calc_runlen( short *ix, side_info_t *si ) 1304static int calc_runlen( short *ix, side_info_t *si )
1305{ 1305{
1306 int p, i, sum = 0; 1306 int p, i, sum = 0;
1307 1307
@@ -1347,7 +1347,7 @@ int calc_runlen( short *ix, side_info_t *si )
1347/*************************************************************************/ 1347/*************************************************************************/
1348/* Function: Quantization of the vector xr ( -> ix) */ 1348/* Function: Quantization of the vector xr ( -> ix) */
1349/*************************************************************************/ 1349/*************************************************************************/
1350int quantize_int(int *xr, short *ix, side_info_t *si) 1350static int quantize_int(int *xr, short *ix, side_info_t *si)
1351{ 1351{
1352 unsigned int i, idx, s, frac_pow[] = { 0x10000, 0xd745, 0xb505, 0x9838 }; 1352 unsigned int i, idx, s, frac_pow[] = { 0x10000, 0xd745, 0xb505, 0x9838 };
1353 1353
@@ -1379,7 +1379,7 @@ int quantize_int(int *xr, short *ix, side_info_t *si)
1379/*************************************************************************/ 1379/*************************************************************************/
1380/* subdivides the bigvalue region which will use separate Huffman tables */ 1380/* subdivides the bigvalue region which will use separate Huffman tables */
1381/*************************************************************************/ 1381/*************************************************************************/
1382void subdivide(side_info_t *si) 1382static void subdivide(side_info_t *si)
1383{ 1383{
1384 int scfb, count0, count1; 1384 int scfb, count0, count1;
1385 1385
@@ -1407,7 +1407,7 @@ void subdivide(side_info_t *si)
1407/*******************************************************************/ 1407/*******************************************************************/
1408/* Count the number of bits necessary to code the bigvalues region */ 1408/* Count the number of bits necessary to code the bigvalues region */
1409/*******************************************************************/ 1409/*******************************************************************/
1410int bigv_bitcount(short *ix, side_info_t *gi) 1410static int bigv_bitcount(short *ix, side_info_t *gi)
1411{ 1411{
1412 int b1=0, b2=0, b3=0; 1412 int b1=0, b2=0, b3=0;
1413 1413
@@ -1428,7 +1428,7 @@ int bigv_bitcount(short *ix, side_info_t *gi)
1428 return b1+b2+b3; 1428 return b1+b2+b3;
1429} 1429}
1430 1430
1431int quantize_and_count_bits(int *xr, short *ix, side_info_t *si) 1431static int quantize_and_count_bits(int *xr, short *ix, side_info_t *si)
1432{ 1432{
1433 int bits = 10000; 1433 int bits = 10000;
1434 1434
@@ -1445,7 +1445,7 @@ int quantize_and_count_bits(int *xr, short *ix, side_info_t *si)
1445/************************************************************************/ 1445/************************************************************************/
1446/* The code selects the best quantStep for a particular set of scalefacs*/ 1446/* The code selects the best quantStep for a particular set of scalefacs*/
1447/************************************************************************/ 1447/************************************************************************/
1448int inner_loop(int *xr, int max_bits, side_info_t *si) 1448static int inner_loop(int *xr, int max_bits, side_info_t *si)
1449{ 1449{
1450 int bits; 1450 int bits;
1451 1451
@@ -1469,7 +1469,7 @@ int inner_loop(int *xr, int max_bits, side_info_t *si)
1469 return bits; 1469 return bits;
1470} 1470}
1471 1471
1472void iteration_loop(int *xr, side_info_t *si, int gr_cnt) 1472static void iteration_loop(int *xr, side_info_t *si, int gr_cnt)
1473{ 1473{
1474 int remain, tar_bits, max_bits = cfg.mean_bits; 1474 int remain, tar_bits, max_bits = cfg.mean_bits;
1475 1475
@@ -1971,10 +1971,10 @@ static int find_samplerate_index(long freq, int *mp3_type)
1971 return i; 1971 return i;
1972} 1972}
1973 1973
1974bool init_mp3_encoder_engine(int sample_rate, 1974static bool init_mp3_encoder_engine(int sample_rate,
1975 int num_channels, 1975 int num_channels,
1976 int rec_mono_mode, 1976 int rec_mono_mode,
1977 struct encoder_config *enc_cfg) 1977 struct encoder_config *enc_cfg)
1978{ 1978{
1979 const bool stereo = num_channels > 1; 1979 const bool stereo = num_channels > 1;
1980 uint32_t avg_byte_per_frame; 1980 uint32_t avg_byte_per_frame;
@@ -2157,7 +2157,7 @@ static inline void byte_swap_frame32(uint32_t *dst, uint32_t *src,
2157} /* byte_swap_frame32 */ 2157} /* byte_swap_frame32 */
2158#endif /* ROCKBOX_LITTLE_ENDIAN */ 2158#endif /* ROCKBOX_LITTLE_ENDIAN */
2159 2159
2160void set_scale_facs(int *mdct_freq) 2160static void set_scale_facs(int *mdct_freq)
2161{ 2161{
2162 unsigned int i, is, ie, k, s; 2162 unsigned int i, is, ie, k, s;
2163 int max_freq_val, avrg_freq_val; 2163 int max_freq_val, avrg_freq_val;
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c
index 37a1afadfa..1a0b03c272 100644
--- a/apps/codecs/mpa.c
+++ b/apps/codecs/mpa.c
@@ -56,7 +56,7 @@ unsigned char mad_main_data[MAD_BUFFER_MDLEN] IBSS_ATTR;
56int mpeg_latency[3] = { 0, 481, 529 }; 56int mpeg_latency[3] = { 0, 481, 529 };
57int mpeg_framesize[3] = {384, 1152, 1152}; 57int mpeg_framesize[3] = {384, 1152, 1152};
58 58
59void init_mad(void) 59static void init_mad(void)
60{ 60{
61 ci->memset(&stream, 0, sizeof(struct mad_stream)); 61 ci->memset(&stream, 0, sizeof(struct mad_stream));
62 ci->memset(&frame, 0, sizeof(struct mad_frame)); 62 ci->memset(&frame, 0, sizeof(struct mad_frame));
@@ -85,7 +85,7 @@ void init_mad(void)
85 85
86} 86}
87 87
88int get_file_pos(int newtime) 88static int get_file_pos(int newtime)
89{ 89{
90 int pos = -1; 90 int pos = -1;
91 struct mp3entry *id3 = ci->id3; 91 struct mp3entry *id3 = ci->id3;
diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c
index 36a7469088..a227fb81cf 100644
--- a/apps/codecs/mpc.c
+++ b/apps/codecs/mpc.c
@@ -27,14 +27,14 @@ CODEC_HEADER
27mpc_decoder decoder IBSS_ATTR; 27mpc_decoder decoder IBSS_ATTR;
28 28
29/* Our implementations of the mpc_reader callback functions. */ 29/* Our implementations of the mpc_reader callback functions. */
30mpc_int32_t read_impl(void *data, void *ptr, mpc_int32_t size) 30static mpc_int32_t read_impl(void *data, void *ptr, mpc_int32_t size)
31{ 31{
32 struct codec_api *ci = (struct codec_api *)data; 32 struct codec_api *ci = (struct codec_api *)data;
33 33
34 return ((mpc_int32_t)(ci->read_filebuf(ptr, size))); 34 return ((mpc_int32_t)(ci->read_filebuf(ptr, size)));
35} 35}
36 36
37mpc_bool_t seek_impl(void *data, mpc_int32_t offset) 37static mpc_bool_t seek_impl(void *data, mpc_int32_t offset)
38{ 38{
39 struct codec_api *ci = (struct codec_api *)data; 39 struct codec_api *ci = (struct codec_api *)data;
40 40
@@ -43,21 +43,21 @@ mpc_bool_t seek_impl(void *data, mpc_int32_t offset)
43 return ci->seek_buffer(offset); 43 return ci->seek_buffer(offset);
44} 44}
45 45
46mpc_int32_t tell_impl(void *data) 46static mpc_int32_t tell_impl(void *data)
47{ 47{
48 struct codec_api *ci = (struct codec_api *)data; 48 struct codec_api *ci = (struct codec_api *)data;
49 49
50 return ci->curpos; 50 return ci->curpos;
51} 51}
52 52
53mpc_int32_t get_size_impl(void *data) 53static mpc_int32_t get_size_impl(void *data)
54{ 54{
55 struct codec_api *ci = (struct codec_api *)data; 55 struct codec_api *ci = (struct codec_api *)data;
56 56
57 return ci->filesize; 57 return ci->filesize;
58} 58}
59 59
60mpc_bool_t canseek_impl(void *data) 60static mpc_bool_t canseek_impl(void *data)
61{ 61{
62 (void)data; 62 (void)data;
63 63
diff --git a/apps/codecs/nsf.c b/apps/codecs/nsf.c
index c7239837eb..6beb8fe3e6 100644
--- a/apps/codecs/nsf.c
+++ b/apps/codecs/nsf.c
@@ -4294,7 +4294,7 @@ jammed:
4294 4294
4295/****************** rockbox interface ******************/ 4295/****************** rockbox interface ******************/
4296 4296
4297void set_codec_track(int t, int d) { 4297static void set_codec_track(int t, int d) {
4298 int track,fade,def=0; 4298 int track,fade,def=0;
4299 SetTrack(t); 4299 SetTrack(t);
4300 4300