[cvs] / xvidcore / examples / xvid_encraw.c Repository:
ViewVC logotype

Diff of /xvidcore/examples/xvid_encraw.c

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

revision 1.46.2.3, Thu Feb 3 15:01:06 2011 UTC revision 1.47, Tue Dec 28 19:19:43 2010 UTC
# Line 200  Line 200 
200  static  char *ARG_PASS2 = 0;  static  char *ARG_PASS2 = 0;
201  //static int ARG_QUALITY = ME_ELEMENTS - 1;  //static int ARG_QUALITY = ME_ELEMENTS - 1;
202  static  int ARG_QUALITY = 6;  static  int ARG_QUALITY = 6;
203  static  float ARG_FRAMERATE = 0.f;  static  float ARG_FRAMERATE = 25.00f;
204  static  int ARG_DWRATE = 25;  static  int ARG_DWRATE = 25;
205  static  int ARG_DWSCALE = 1;  static  int ARG_DWSCALE = 1;
206  static  int ARG_MAXFRAMENR = ABS_MAXFRAMENR;  static  int ARG_MAXFRAMENR = ABS_MAXFRAMENR;
# Line 353  Line 353 
353    
354          /* Is there a dumb Xvid coder ? */          /* Is there a dumb Xvid coder ? */
355          if(ME_ELEMENTS != VOP_ELEMENTS) {          if(ME_ELEMENTS != VOP_ELEMENTS) {
356                  fprintf(stderr, "Presets' arrays should have the same number of elements -- Please file a bug to xvid-devel@xvid.org\n");                  fprintf(stderr, "Presets' arrays should have the same number of elements -- Please fill a bug to xvid-devel@xvid.org\n");
357                  return(-1);                  return(-1);
358          }          }
359    
# Line 485  Line 485 
485                                  memset(&ZONES[NUM_ZONES], 0, sizeof(zone_t));                                  memset(&ZONES[NUM_ZONES], 0, sizeof(zone_t));
486    
487                                  ZONES[NUM_ZONES].frame = startframe;                                  ZONES[NUM_ZONES].frame = startframe;
488                                  ZONES[NUM_ZONES].modifier = (int)(atof(options)*100);                                  ZONES[NUM_ZONES].modifier = (int)atof(options)*100;
489                                  if (toupper(c)=='Q')                                  if (toupper(c)=='Q')
490                                          ZONES[NUM_ZONES].mode = XVID_ZONE_QUANT;                                          ZONES[NUM_ZONES].mode = XVID_ZONE_QUANT;
491                                  else if (toupper(c)=='W')                                  else if (toupper(c)=='W')
# Line 536  Line 536 
536                          else {                          else {
537                                  ZONES[NUM_ZONES].mode = XVID_ZONE_WEIGHT;                                  ZONES[NUM_ZONES].mode = XVID_ZONE_WEIGHT;
538                          }                          }
539                          ZONES[NUM_ZONES].modifier = (int)(atof(argv[i+2])*100);                          ZONES[NUM_ZONES].modifier = (int)atof(argv[i+2])*100;
540                          i++;                          i++;
541              ZONES[NUM_ZONES].frame = atoi(argv[i]);              ZONES[NUM_ZONES].frame = atoi(argv[i]);
542                          i++;                          i++;
# Line 568  Line 568 
568                                  exponent=(int)pow(10.0, (int)(strlen(argv[i])-1-exponent));                                  exponent=(int)pow(10.0, (int)(strlen(argv[i])-1-exponent));
569                          else                          else
570                                  exponent=1;                                  exponent=1;
571                          ARG_DWRATE = (int)(atof(argv[i])*exponent);                          ARG_DWRATE = (int)atof(argv[i])*exponent;
572                          ARG_DWSCALE = exponent;                          ARG_DWSCALE = exponent;
573                          exponent = gcd(ARG_DWRATE, ARG_DWSCALE);                          exponent = gcd(ARG_DWRATE, ARG_DWSCALE);
574                          ARG_DWRATE /= exponent;                          ARG_DWRATE /= exponent;
# Line 753  Line 753 
753                                  i++;                                  i++;
754                          else                          else
755                                  ARG_PROGRESS = 10;                                  ARG_PROGRESS = 10;
756                  } else if (strcmp("-help", argv[i]) == 0) {                  } else if (strcmp("-help", argv[i])) {
757                          usage();                          usage();
758                          return (0);                          return (0);
759                  } else {                  } else {
# Line 951  Line 951 
951          }          }
952    
953          if (ARG_FRAMERATE <= 0) {          if (ARG_FRAMERATE <= 0) {
954                  ARG_FRAMERATE = 25.00f; /* default value */                  fprintf(stderr, "Wrong Framerate %f\n", ARG_FRAMERATE);
955                    return (-1);
956          }          }
957    
958          if (ARG_TARGETSIZE) {          if (ARG_TARGETSIZE) {
# Line 1409  Line 1410 
1410                          myAVIStreamInfo.dwRate = ARG_DWRATE;                          myAVIStreamInfo.dwRate = ARG_DWRATE;
1411                          myAVIStreamInfo.dwLength = ARG_MAXFRAMENR;                          myAVIStreamInfo.dwLength = ARG_MAXFRAMENR;
1412                          myAVIStreamInfo.dwQuality = 10000;                          myAVIStreamInfo.dwQuality = 10000;
1413                          SetRect(&myAVIStreamInfo.rcFrame, 0, 0, XDIM, YDIM);                          SetRect(&myAVIStreamInfo.rcFrame, 0, 0, YDIM, XDIM);
1414    
1415                          if (avierr=AVIFileOpen(&myAVIFile, ARG_AVIOUTPUTFILE, OF_CREATE|OF_WRITE, NULL)) {                          if (avierr=AVIFileOpen(&myAVIFile, ARG_AVIOUTPUTFILE, OF_CREATE|OF_WRITE, NULL)) {
1416                                  fprintf(stderr, "AVIFileOpen failed opening output file %s, error code %d\n", ARG_AVIOUTPUTFILE, avierr);                                  fprintf(stderr, "AVIFileOpen failed opening output file %s, error code %d\n", ARG_AVIOUTPUTFILE, avierr);
# Line 1838  Line 1839 
1839          fprintf(stderr, " -bquant_offset integer: bframe quantizer offset (100)\n");          fprintf(stderr, " -bquant_offset integer: bframe quantizer offset (100)\n");
1840          fprintf(stderr, "\n");          fprintf(stderr, "\n");
1841          fprintf(stderr, "Rate control options:\n");          fprintf(stderr, "Rate control options:\n");
1842          fprintf(stderr, " -framerate float               : target framerate (auto)\n");          fprintf(stderr, " -framerate float               : target framerate (25.0)\n");
1843          fprintf(stderr, " -bitrate   [integer]           : target bitrate in kbps (700)\n");          fprintf(stderr, " -bitrate   [integer]           : target bitrate in kbps (700)\n");
1844          fprintf(stderr, " -size      integer                     : target size in kilobytes\n");          fprintf(stderr, " -size      integer                     : target size in kilobytes\n");
1845      fprintf(stderr,     " -single                        : single pass mode (default)\n");      fprintf(stderr,     " -single                        : single pass mode (default)\n");

Legend:
Removed from v.1.46.2.3  
changed lines
  Added in v.1.47

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