[svn] / branches / release-1_0-branch / xvidcore / examples / xvid_decraw.c Repository:
ViewVC logotype

Diff of /branches/release-1_0-branch/xvidcore/examples/xvid_decraw.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1418, Sat Apr 10 10:05:47 2004 UTC revision 1433, Thu Apr 15 22:39:30 2004 UTC
# Line 20  Line 20 
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.4 2004-04-15 22:39:30 edgomez Exp $
24   *   *
25   ****************************************************************************/   ****************************************************************************/
26    
# Line 79  Line 79 
79   ****************************************************************************/   ****************************************************************************/
80    
81  static double msecond();  static double msecond();
 static int write_pgm(char *filename,  
                                          unsigned char *image);  
82  static int dec_init(int use_assembler);  static int dec_init(int use_assembler);
83  static int dec_main(unsigned char *istream,  static int dec_main(unsigned char *istream,
84                                          unsigned char *ostream,                                          unsigned char *ostream,
# Line 88  Line 86 
86                                          xvid_dec_stats_t *xvid_dec_stats);                                          xvid_dec_stats_t *xvid_dec_stats);
87  static int dec_stop();  static int dec_stop();
88  static void usage();  static void usage();
89    static int write_image(char *prefix, unsigned char *image);
90    static int write_pnm(char *filename, unsigned char *image);
91    static int write_tga(char *filename, unsigned char *image);
92    
93  const char * type2str(int type)  const char * type2str(int type)
94  {  {
# Line 178  Line 178 
178                  }                  }
179          }          }
180    
181    #if defined(_MSC_VER)
182            if (ARG_INPUTFILE==NULL) {
183                    fprintf(stderr, "Warning: MSVC build does not read EOF correctly from stdin. Use the -i switch.\n\n");
184            }
185    #endif
186    
187  /*****************************************************************************  /*****************************************************************************
188   * Values checking   * Values checking
189   ****************************************************************************/   ****************************************************************************/
# Line 337  Line 343 
343                          sprintf(filename, "%sdec%05d", filepath, filenr);                          sprintf(filename, "%sdec%05d", filepath, filenr);
344                          if(write_image(filename, out_buffer)) {                          if(write_image(filename, out_buffer)) {
345                                  fprintf(stderr,                                  fprintf(stderr,
346                                                  "Error writing decoded PGM frame %s\n",                                                  "Error writing decoded frame %s\n",
347                                                  filename);                                                  filename);
348                          }                          }
349                  }                  }
# Line 378  Line 384 
384                          sprintf(filename, "%sdec%05d", filepath, filenr);                          sprintf(filename, "%sdec%05d", filepath, filenr);
385                          if(write_image(filename, out_buffer)) {                          if(write_image(filename, out_buffer)) {
386                                  fprintf(stderr,                                  fprintf(stderr,
387                                                  "Error writing decoded PGM frame %s\n",                                                  "Error writing decoded frame %s\n",
388                                                  filename);                                                  filename);
389                          }                          }
390                  }                  }
# Line 391  Line 397 
397   *     Calculate totals and averages for output, print results   *     Calculate totals and averages for output, print results
398   ****************************************************************************/   ****************************************************************************/
399    
400            if (filenr>0) {
401          totalsize    /= filenr;          totalsize    /= filenr;
402          totaldectime /= filenr;          totaldectime /= filenr;
   
403          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",
404                     totaldectime, 1000/totaldectime, (int)totalsize);                     totaldectime, 1000/totaldectime, (int)totalsize);
405            }else{
406                    printf("Nothing was decoded!\n");
407            }
408    
409  /*****************************************************************************  /*****************************************************************************
410   *      XviD PART  Stop   *      XviD PART  Stop
# Line 458  Line 467 
467   *              output functions   *              output functions
468   ****************************************************************************/   ****************************************************************************/
469    
470  int write_image(char *prefix, unsigned char *image)  static int write_image(char *prefix, unsigned char *image)
471  {  {
472          char filename[1024];          char filename[1024];
473          char *ext;          char *ext;
# Line 486  Line 495 
495          return(ret);          return(ret);
496  }  }
497    
498  int write_tga(char *filename, unsigned char *image)  static int write_tga(char *filename, unsigned char *image)
499  {  {
500          FILE * f;          FILE * f;
501          char hdr[18];          char hdr[18];
# Line 567  Line 576 
576          return(0);          return(0);
577  }  }
578    
579  int write_pnm(char *filename, unsigned char *image)  static int write_pnm(char *filename, unsigned char *image)
580  {  {
581          FILE * f;          FILE * f;
582    
# Line 606  Line 615 
615    
616          return 0;          return 0;
617  }  }
618    
619  /*****************************************************************************  /*****************************************************************************
620   * Routines for decoding: init decoder, use, and stop decoder   * Routines for decoding: init decoder, use, and stop decoder
621   ****************************************************************************/   ****************************************************************************/

Legend:
Removed from v.1418  
changed lines
  Added in v.1433

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4