diff options
author | Nils Wallménius <nils@rockbox.org> | 2011-08-28 16:35:45 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2011-08-28 16:35:45 +0000 |
commit | 12e159dcb4fe875ce76c4cbacf2c6672add27d46 (patch) | |
tree | 40068fe7b6eeb53740e05240b10d525ea5536af7 /apps | |
parent | 31567306e7f06a26e0c193eaf29793f3017f55f2 (diff) | |
download | rockbox-12e159dcb4fe875ce76c4cbacf2c6672add27d46.tar.gz rockbox-12e159dcb4fe875ce76c4cbacf2c6672add27d46.zip |
libtremor: comment out some unused functions and mark some file local functions static, saves a few hundred bytes and might give a tiny speedup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30370 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/codecs/libtremor/framing.c | 27 | ||||
-rw-r--r-- | apps/codecs/libtremor/ogg.h | 22 |
2 files changed, 32 insertions, 17 deletions
diff --git a/apps/codecs/libtremor/framing.c b/apps/codecs/libtremor/framing.c index a40e8dec65..d67708f87a 100644 --- a/apps/codecs/libtremor/framing.c +++ b/apps/codecs/libtremor/framing.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | /* A complete description of Ogg framing exists in docs/framing.html */ | 27 | /* A complete description of Ogg framing exists in docs/framing.html */ |
28 | 28 | ||
29 | int ogg_page_version(const ogg_page *og){ | 29 | static int ogg_page_version(const ogg_page *og){ |
30 | return((int)(og->header[4])); | 30 | return((int)(og->header[4])); |
31 | } | 31 | } |
32 | 32 | ||
@@ -62,7 +62,7 @@ ogg_uint32_t ogg_page_serialno(const ogg_page *og){ | |||
62 | (og->header[17]<<24)); | 62 | (og->header[17]<<24)); |
63 | } | 63 | } |
64 | 64 | ||
65 | long ogg_page_pageno(const ogg_page *og){ | 65 | static long ogg_page_pageno(const ogg_page *og){ |
66 | return(og->header[18] | | 66 | return(og->header[18] | |
67 | (og->header[19]<<8) | | 67 | (og->header[19]<<8) | |
68 | (og->header[20]<<16) | | 68 | (og->header[20]<<16) | |
@@ -87,14 +87,14 @@ more page packet), the return will be: | |||
87 | ogg_page_packets(page) ==0, | 87 | ogg_page_packets(page) ==0, |
88 | ogg_page_continued(page) !=0 | 88 | ogg_page_continued(page) !=0 |
89 | */ | 89 | */ |
90 | 90 | /* | |
91 | int ogg_page_packets(const ogg_page *og){ | 91 | int ogg_page_packets(const ogg_page *og){ |
92 | int i,n=og->header[26],count=0; | 92 | int i,n=og->header[26],count=0; |
93 | for(i=0;i<n;i++) | 93 | for(i=0;i<n;i++) |
94 | if(og->header[27+i]<255)count++; | 94 | if(og->header[27+i]<255)count++; |
95 | return(count); | 95 | return(count); |
96 | } | 96 | } |
97 | 97 | */ | |
98 | 98 | ||
99 | #if 0 | 99 | #if 0 |
100 | /* helper to initialize lookup for direct-table CRC (illustrative; we | 100 | /* helper to initialize lookup for direct-table CRC (illustrative; we |
@@ -208,7 +208,7 @@ int ogg_stream_init(ogg_stream_state *os,int serialno){ | |||
208 | } | 208 | } |
209 | 209 | ||
210 | /* async/delayed error detection for the ogg_stream_state */ | 210 | /* async/delayed error detection for the ogg_stream_state */ |
211 | int ogg_stream_check(ogg_stream_state *os){ | 211 | static int ogg_stream_check(ogg_stream_state *os){ |
212 | if(!os || !os->body_data) return -1; | 212 | if(!os || !os->body_data) return -1; |
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
@@ -224,7 +224,7 @@ int ogg_stream_clear(ogg_stream_state *os){ | |||
224 | } | 224 | } |
225 | return(0); | 225 | return(0); |
226 | } | 226 | } |
227 | 227 | /* | |
228 | int ogg_stream_destroy(ogg_stream_state *os){ | 228 | int ogg_stream_destroy(ogg_stream_state *os){ |
229 | if(os){ | 229 | if(os){ |
230 | ogg_stream_clear(os); | 230 | ogg_stream_clear(os); |
@@ -232,7 +232,7 @@ int ogg_stream_destroy(ogg_stream_state *os){ | |||
232 | } | 232 | } |
233 | return(0); | 233 | return(0); |
234 | } | 234 | } |
235 | 235 | */ | |
236 | /* Helpers for ogg_stream_encode; this keeps the structure and | 236 | /* Helpers for ogg_stream_encode; this keeps the structure and |
237 | what's happening fairly clear */ | 237 | what's happening fairly clear */ |
238 | 238 | ||
@@ -277,7 +277,7 @@ static int _os_lacing_expand(ogg_stream_state *os,int needed){ | |||
277 | /* Direct table CRC; note that this will be faster in the future if we | 277 | /* Direct table CRC; note that this will be faster in the future if we |
278 | perform the checksum simultaneously with other copies */ | 278 | perform the checksum simultaneously with other copies */ |
279 | 279 | ||
280 | void ogg_page_checksum_set(ogg_page *og){ | 280 | static void ogg_page_checksum_set(ogg_page *og){ |
281 | if(og){ | 281 | if(og){ |
282 | ogg_uint32_t crc_reg=0; | 282 | ogg_uint32_t crc_reg=0; |
283 | int i; | 283 | int i; |
@@ -588,6 +588,7 @@ int ogg_sync_clear(ogg_sync_state *oy){ | |||
588 | return(0); | 588 | return(0); |
589 | } | 589 | } |
590 | 590 | ||
591 | /* | ||
591 | int ogg_sync_destroy(ogg_sync_state *oy){ | 592 | int ogg_sync_destroy(ogg_sync_state *oy){ |
592 | if(oy){ | 593 | if(oy){ |
593 | ogg_sync_clear(oy); | 594 | ogg_sync_clear(oy); |
@@ -595,8 +596,8 @@ int ogg_sync_destroy(ogg_sync_state *oy){ | |||
595 | } | 596 | } |
596 | return(0); | 597 | return(0); |
597 | } | 598 | } |
598 | 599 | */ | |
599 | int ogg_sync_check(ogg_sync_state *oy){ | 600 | static int ogg_sync_check(ogg_sync_state *oy){ |
600 | if(oy->storage<0) return -1; | 601 | if(oy->storage<0) return -1; |
601 | return 0; | 602 | return 0; |
602 | } | 603 | } |
@@ -748,6 +749,7 @@ long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og){ | |||
748 | Returns pointers into buffered data; invalidated by next call to | 749 | Returns pointers into buffered data; invalidated by next call to |
749 | _stream, _clear, _init, or _buffer */ | 750 | _stream, _clear, _init, or _buffer */ |
750 | 751 | ||
752 | #if 0 | ||
751 | int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){ | 753 | int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){ |
752 | 754 | ||
753 | if(ogg_sync_check(oy))return 0; | 755 | if(ogg_sync_check(oy))return 0; |
@@ -777,7 +779,7 @@ int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){ | |||
777 | 779 | ||
778 | } | 780 | } |
779 | } | 781 | } |
780 | 782 | #endif | |
781 | /* add the incoming page to the stream state; we decompose the page | 783 | /* add the incoming page to the stream state; we decompose the page |
782 | into packet segments here as well. */ | 784 | into packet segments here as well. */ |
783 | 785 | ||
@@ -1019,11 +1021,12 @@ int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op){ | |||
1019 | return _packetout(os,op,0); | 1021 | return _packetout(os,op,0); |
1020 | } | 1022 | } |
1021 | 1023 | ||
1024 | /* | ||
1022 | void ogg_packet_clear(ogg_packet *op) { | 1025 | void ogg_packet_clear(ogg_packet *op) { |
1023 | _ogg_free(op->packet); | 1026 | _ogg_free(op->packet); |
1024 | memset(op, 0, sizeof(*op)); | 1027 | memset(op, 0, sizeof(*op)); |
1025 | } | 1028 | } |
1026 | 1029 | */ | |
1027 | #ifdef _V_SELFTEST | 1030 | #ifdef _V_SELFTEST |
1028 | #include <stdio.h> | 1031 | #include <stdio.h> |
1029 | 1032 | ||
diff --git a/apps/codecs/libtremor/ogg.h b/apps/codecs/libtremor/ogg.h index 1ed08a5387..dcac0c22dd 100644 --- a/apps/codecs/libtremor/ogg.h +++ b/apps/codecs/libtremor/ogg.h | |||
@@ -126,9 +126,11 @@ extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits); | |||
126 | extern void oggpack_reset(oggpack_buffer *b); | 126 | extern void oggpack_reset(oggpack_buffer *b); |
127 | extern void oggpack_writeclear(oggpack_buffer *b); */ | 127 | extern void oggpack_writeclear(oggpack_buffer *b); */ |
128 | extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); | 128 | extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); |
129 | /* extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits); */ | 129 | /* |
130 | extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits); | ||
131 | extern long oggpack_look(oggpack_buffer *b,int bits); | ||
132 | */ | ||
130 | 133 | ||
131 | /* extern long oggpack_look(oggpack_buffer *b,int bits); */ | ||
132 | static inline long oggpack_look(oggpack_buffer *b,int bits){ | 134 | static inline long oggpack_look(oggpack_buffer *b,int bits){ |
133 | unsigned long ret; | 135 | unsigned long ret; |
134 | unsigned long m; | 136 | unsigned long m; |
@@ -182,7 +184,9 @@ static inline void oggpack_adv(oggpack_buffer *b,int bits){ | |||
182 | extern void oggpack_adv1(oggpack_buffer *b); | 184 | extern void oggpack_adv1(oggpack_buffer *b); |
183 | extern long oggpack_read(oggpack_buffer *b,int bits); | 185 | extern long oggpack_read(oggpack_buffer *b,int bits); |
184 | extern long oggpack_read1(oggpack_buffer *b); | 186 | extern long oggpack_read1(oggpack_buffer *b); |
185 | /* extern long oggpack_bytes(oggpack_buffer *b); */ | 187 | /* |
188 | extern long oggpack_bytes(oggpack_buffer *b); | ||
189 | */ | ||
186 | static inline long oggpack_bytes(oggpack_buffer *b){ | 190 | static inline long oggpack_bytes(oggpack_buffer *b){ |
187 | return(b->endbyte+(b->endbit+7)/8); | 191 | return(b->endbyte+(b->endbit+7)/8); |
188 | } | 192 | } |
@@ -223,13 +227,17 @@ extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og); | |||
223 | extern int ogg_sync_init(ogg_sync_state *oy); | 227 | extern int ogg_sync_init(ogg_sync_state *oy); |
224 | extern int ogg_sync_clear(ogg_sync_state *oy); | 228 | extern int ogg_sync_clear(ogg_sync_state *oy); |
225 | extern int ogg_sync_reset(ogg_sync_state *oy); | 229 | extern int ogg_sync_reset(ogg_sync_state *oy); |
230 | /* | ||
226 | extern int ogg_sync_destroy(ogg_sync_state *oy); | 231 | extern int ogg_sync_destroy(ogg_sync_state *oy); |
227 | extern int ogg_sync_check(ogg_sync_state *oy); | 232 | extern int ogg_sync_check(ogg_sync_state *oy); |
233 | */ | ||
228 | 234 | ||
229 | extern char *ogg_sync_buffer(ogg_sync_state *oy, long size); | 235 | extern char *ogg_sync_buffer(ogg_sync_state *oy, long size); |
230 | extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes); | 236 | extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes); |
231 | extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og); | 237 | extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og); |
238 | /* | ||
232 | extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og); | 239 | extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og); |
240 | */ | ||
233 | extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og); | 241 | extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og); |
234 | extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op); | 242 | extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op); |
235 | extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); | 243 | extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); |
@@ -240,23 +248,27 @@ extern int ogg_stream_init(ogg_stream_state *os,int serialno); | |||
240 | extern int ogg_stream_clear(ogg_stream_state *os); | 248 | extern int ogg_stream_clear(ogg_stream_state *os); |
241 | extern int ogg_stream_reset(ogg_stream_state *os); | 249 | extern int ogg_stream_reset(ogg_stream_state *os); |
242 | extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); | 250 | extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); |
251 | /* | ||
243 | extern int ogg_stream_destroy(ogg_stream_state *os); | 252 | extern int ogg_stream_destroy(ogg_stream_state *os); |
244 | extern int ogg_stream_check(ogg_stream_state *os); | 253 | extern int ogg_stream_check(ogg_stream_state *os); |
254 | */ | ||
245 | extern int ogg_stream_eos(ogg_stream_state *os); | 255 | extern int ogg_stream_eos(ogg_stream_state *os); |
246 | 256 | ||
257 | /* | ||
247 | extern void ogg_page_checksum_set(ogg_page *og); | 258 | extern void ogg_page_checksum_set(ogg_page *og); |
248 | |||
249 | extern int ogg_page_version(const ogg_page *og); | 259 | extern int ogg_page_version(const ogg_page *og); |
260 | */ | ||
250 | extern int ogg_page_continued(const ogg_page *og); | 261 | extern int ogg_page_continued(const ogg_page *og); |
251 | extern int ogg_page_bos(const ogg_page *og); | 262 | extern int ogg_page_bos(const ogg_page *og); |
252 | extern int ogg_page_eos(const ogg_page *og); | 263 | extern int ogg_page_eos(const ogg_page *og); |
253 | extern ogg_int64_t ogg_page_granulepos(const ogg_page *og); | 264 | extern ogg_int64_t ogg_page_granulepos(const ogg_page *og); |
254 | extern ogg_uint32_t ogg_page_serialno(const ogg_page *og); | 265 | extern ogg_uint32_t ogg_page_serialno(const ogg_page *og); |
266 | /* | ||
255 | extern long ogg_page_pageno(const ogg_page *og); | 267 | extern long ogg_page_pageno(const ogg_page *og); |
256 | extern int ogg_page_packets(const ogg_page *og); | 268 | extern int ogg_page_packets(const ogg_page *og); |
257 | 269 | ||
258 | extern void ogg_packet_clear(ogg_packet *op); | 270 | extern void ogg_packet_clear(ogg_packet *op); |
259 | 271 | */ | |
260 | 272 | ||
261 | #ifdef __cplusplus | 273 | #ifdef __cplusplus |
262 | } | 274 | } |