main.c
721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdio.h>
int atoi( char * );
int parse_trace;
int num_tok;
#include "huf.h"
#include "huf_proto.h"
#include "mpeg_proto.h"
main(int argc, char **argv)
{
int stream;
num_tok = 0;
parse_trace = 0;
if( argc > 1 )
stream = mpeg_open_stream( argv[1] );
else
stream = mpeg_open_stream( "bits.file" );
mpeg_start_saving_tokens( stream, "tokens.out" );
parse_trace = 0;
if( argc > 2 ) {
parse_trace = 1;
if( atoi( argv[2] ) >= 0 )
mpeg_set_trace_file( stderr );
else
mpeg_set_trace_file( stdout );
};
huf_set_trace(0);
if( argc > 3 )
huf_set_trace(1);
while( mpeg_process_next_picture( stream ) >= 0 )
;
mpeg_close_stream( stream );
}