diff options
Diffstat (limited to 'apps/codecs/libtremor/framing.c')
-rw-r--r-- | apps/codecs/libtremor/framing.c | 27 |
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 | ||
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 | ||