79 |
****************************************************************************/ |
****************************************************************************/ |
80 |
|
|
81 |
static double msecond(); |
static double msecond(); |
82 |
|
static int write_pgm(char *filename, |
83 |
|
unsigned char *image); |
84 |
static int dec_init(int use_assembler, int debug_level); |
static int dec_init(int use_assembler, int debug_level); |
85 |
static int dec_main(unsigned char *istream, |
static int dec_main(unsigned char *istream, |
86 |
unsigned char *ostream, |
unsigned char *ostream, |
88 |
xvid_dec_stats_t *xvid_dec_stats); |
xvid_dec_stats_t *xvid_dec_stats); |
89 |
static int dec_stop(); |
static int dec_stop(); |
90 |
static void usage(); |
static void usage(); |
91 |
static int write_image(char *prefix, unsigned char *image); |
int write_image(char *prefix, unsigned char *image); |
92 |
static int write_tga(char *filename, unsigned char *image); |
int write_pnm(char *filename, unsigned char *image); |
93 |
static int write_pnm(char *filename, unsigned char *image); |
int write_tga(char *filename, unsigned char *image); |
|
|
|
94 |
|
|
95 |
const char * type2str(int type) |
const char * type2str(int type) |
96 |
{ |
{ |
188 |
|
|
189 |
#if defined(_MSC_VER) |
#if defined(_MSC_VER) |
190 |
if (ARG_INPUTFILE==NULL) { |
if (ARG_INPUTFILE==NULL) { |
191 |
fprintf(stderr, "Warning: MSVC build does not read correctly from stdin. Use the -i switch.\n\n"); |
fprintf(stderr, "Warning: MSVC build does not read EOF correctly from stdin. Use the -i switch.\n\n"); |
192 |
} |
} |
193 |
#endif |
#endif |
194 |
|
|
351 |
sprintf(filename, "%sdec%05d", filepath, filenr); |
sprintf(filename, "%sdec%05d", filepath, filenr); |
352 |
if(write_image(filename, out_buffer)) { |
if(write_image(filename, out_buffer)) { |
353 |
fprintf(stderr, |
fprintf(stderr, |
354 |
"Error writing decoded frame %s\n", |
"Error writing decoded PGM frame %s\n", |
355 |
filename); |
filename); |
356 |
} |
} |
357 |
} |
} |
414 |
printf("Nothing was decoded!\n"); |
printf("Nothing was decoded!\n"); |
415 |
} |
} |
416 |
|
|
|
|
|
417 |
/***************************************************************************** |
/***************************************************************************** |
418 |
* XviD PART Stop |
* XviD PART Stop |
419 |
****************************************************************************/ |
****************************************************************************/ |
476 |
* output functions |
* output functions |
477 |
****************************************************************************/ |
****************************************************************************/ |
478 |
|
|
479 |
static int write_image(char *prefix, unsigned char *image) |
int write_image(char *prefix, unsigned char *image) |
480 |
{ |
{ |
481 |
char filename[1024]; |
char filename[1024]; |
482 |
char *ext; |
char *ext; |
504 |
return(ret); |
return(ret); |
505 |
} |
} |
506 |
|
|
507 |
static int write_tga(char *filename, unsigned char *image) |
int write_tga(char *filename, unsigned char *image) |
508 |
{ |
{ |
509 |
FILE * f; |
FILE * f; |
510 |
char hdr[18]; |
char hdr[18]; |