20 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: xvid_decraw.c,v 1.10.2.2 2004-04-10 10:05:47 edgomez Exp $ |
* $Id: xvid_decraw.c,v 1.10.2.3 2004-04-15 10:04:55 suxen_drol Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
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 |
|
int write_image(char *prefix, unsigned char *image); |
92 |
|
int write_pnm(char *filename, unsigned char *image); |
93 |
|
int write_tga(char *filename, unsigned char *image); |
94 |
|
|
95 |
const char * type2str(int type) |
const char * type2str(int type) |
96 |
{ |
{ |
180 |
} |
} |
181 |
} |
} |
182 |
|
|
183 |
|
#if defined(_MSC_VER) |
184 |
|
if (ARG_INPUTFILE==NULL) { |
185 |
|
fprintf(stderr, "Warning: MSVC build does not read EOF correctly from stdin. Use the -i switch.\n\n"); |
186 |
|
} |
187 |
|
#endif |
188 |
|
|
189 |
/***************************************************************************** |
/***************************************************************************** |
190 |
* Values checking |
* Values checking |
191 |
****************************************************************************/ |
****************************************************************************/ |
386 |
sprintf(filename, "%sdec%05d", filepath, filenr); |
sprintf(filename, "%sdec%05d", filepath, filenr); |
387 |
if(write_image(filename, out_buffer)) { |
if(write_image(filename, out_buffer)) { |
388 |
fprintf(stderr, |
fprintf(stderr, |
389 |
"Error writing decoded PGM frame %s\n", |
"Error writing decoded frame %s\n", |
390 |
filename); |
filename); |
391 |
} |
} |
392 |
} |
} |
399 |
* Calculate totals and averages for output, print results |
* Calculate totals and averages for output, print results |
400 |
****************************************************************************/ |
****************************************************************************/ |
401 |
|
|
402 |
|
if (filenr>0) { |
403 |
totalsize /= filenr; |
totalsize /= filenr; |
404 |
totaldectime /= filenr; |
totaldectime /= filenr; |
|
|
|
405 |
printf("Avg: dectime(ms) =%7.2f, fps =%7.2f, length(bytes) =%7d\n", |
printf("Avg: dectime(ms) =%7.2f, fps =%7.2f, length(bytes) =%7d\n", |
406 |
totaldectime, 1000/totaldectime, (int)totalsize); |
totaldectime, 1000/totaldectime, (int)totalsize); |
407 |
|
}else{ |
408 |
|
printf("Nothing was decoded!\n"); |
409 |
|
} |
410 |
|
|
411 |
/***************************************************************************** |
/***************************************************************************** |
412 |
* XviD PART Stop |
* XviD PART Stop |