summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor/framing.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2011-08-28 16:35:45 +0000
committerNils Wallménius <nils@rockbox.org>2011-08-28 16:35:45 +0000
commit12e159dcb4fe875ce76c4cbacf2c6672add27d46 (patch)
tree40068fe7b6eeb53740e05240b10d525ea5536af7 /apps/codecs/libtremor/framing.c
parent31567306e7f06a26e0c193eaf29793f3017f55f2 (diff)
downloadrockbox-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/codecs/libtremor/framing.c')
-rw-r--r--apps/codecs/libtremor/framing.c27
1 files changed, 15 insertions, 12 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
29int ogg_page_version(const ogg_page *og){ 29static 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
65long ogg_page_pageno(const ogg_page *og){ 65static 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/*
91int ogg_page_packets(const ogg_page *og){ 91int 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 */
211int ogg_stream_check(ogg_stream_state *os){ 211static 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/*
228int ogg_stream_destroy(ogg_stream_state *os){ 228int 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
280void ogg_page_checksum_set(ogg_page *og){ 280static 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/*
591int ogg_sync_destroy(ogg_sync_state *oy){ 592int 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*/
599int ogg_sync_check(ogg_sync_state *oy){ 600static 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
751int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){ 753int 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/*
1022void ogg_packet_clear(ogg_packet *op) { 1025void 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