--- xvid_encraw.c 2011/02/03 15:01:06 1.46.2.3 +++ xvid_encraw.c 2010/12/28 19:19:43 1.47 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid_encraw.c,v 1.46.2.3 2011/02/03 15:01:06 Isibaar Exp $ + * $Id: xvid_encraw.c,v 1.47 2010/12/28 19:19:43 Isibaar Exp $ * ****************************************************************************/ @@ -200,7 +200,7 @@ static char *ARG_PASS2 = 0; //static int ARG_QUALITY = ME_ELEMENTS - 1; static int ARG_QUALITY = 6; -static float ARG_FRAMERATE = 0.f; +static float ARG_FRAMERATE = 25.00f; static int ARG_DWRATE = 25; static int ARG_DWSCALE = 1; static int ARG_MAXFRAMENR = ABS_MAXFRAMENR; @@ -353,7 +353,7 @@ /* Is there a dumb Xvid coder ? */ if(ME_ELEMENTS != VOP_ELEMENTS) { - 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"); return(-1); } @@ -485,7 +485,7 @@ memset(&ZONES[NUM_ZONES], 0, sizeof(zone_t)); ZONES[NUM_ZONES].frame = startframe; - ZONES[NUM_ZONES].modifier = (int)(atof(options)*100); + ZONES[NUM_ZONES].modifier = (int)atof(options)*100; if (toupper(c)=='Q') ZONES[NUM_ZONES].mode = XVID_ZONE_QUANT; else if (toupper(c)=='W') @@ -536,7 +536,7 @@ else { ZONES[NUM_ZONES].mode = XVID_ZONE_WEIGHT; } - ZONES[NUM_ZONES].modifier = (int)(atof(argv[i+2])*100); + ZONES[NUM_ZONES].modifier = (int)atof(argv[i+2])*100; i++; ZONES[NUM_ZONES].frame = atoi(argv[i]); i++; @@ -563,12 +563,12 @@ int exponent; i++; ARG_FRAMERATE = (float) atof(argv[i]); - exponent = (int) strcspn(argv[i], "."); + exponent = (int)strcspn(argv[i], "."); if (exponent<(int)strlen(argv[i])) exponent=(int)pow(10.0, (int)(strlen(argv[i])-1-exponent)); else exponent=1; - ARG_DWRATE = (int)(atof(argv[i])*exponent); + ARG_DWRATE = (int)atof(argv[i])*exponent; ARG_DWSCALE = exponent; exponent = gcd(ARG_DWRATE, ARG_DWSCALE); ARG_DWRATE /= exponent; @@ -753,7 +753,7 @@ i++; else ARG_PROGRESS = 10; - } else if (strcmp("-help", argv[i]) == 0) { + } else if (strcmp("-help", argv[i])) { usage(); return (0); } else { @@ -916,7 +916,7 @@ if (ARG_MAXFRAMENR<0) ARG_MAXFRAMENR = avi_info.dwLength-ARG_STARTFRAMENR; else - ARG_MAXFRAMENR = min(ARG_MAXFRAMENR, (int) (avi_info.dwLength-ARG_STARTFRAMENR)); + ARG_MAXFRAMENR = min(ARG_MAXFRAMENR, (int)(avi_info.dwLength-ARG_STARTFRAMENR)); XDIM = avi_info.rcFrame.right - avi_info.rcFrame.left; YDIM = avi_info.rcFrame.bottom - avi_info.rcFrame.top; @@ -951,7 +951,8 @@ } if (ARG_FRAMERATE <= 0) { - ARG_FRAMERATE = 25.00f; /* default value */ + fprintf(stderr, "Wrong Framerate %f\n", ARG_FRAMERATE); + return (-1); } if (ARG_TARGETSIZE) { @@ -962,7 +963,7 @@ fprintf(stderr, "Parameter conflict: Do not specify both -bitrate and -size\n"); goto release_all; } else - ARG_BITRATE = (int) (((ARG_TARGETSIZE * 8) / (ARG_MAXFRAMENR / ARG_FRAMERATE)) * 1024); + ARG_BITRATE = (int)(((ARG_TARGETSIZE * 8) / (ARG_MAXFRAMENR / ARG_FRAMERATE)) * 1024); } /* Set constant quant to default if no bitrate given for single pass */ @@ -1409,7 +1410,7 @@ myAVIStreamInfo.dwRate = ARG_DWRATE; myAVIStreamInfo.dwLength = ARG_MAXFRAMENR; myAVIStreamInfo.dwQuality = 10000; - SetRect(&myAVIStreamInfo.rcFrame, 0, 0, XDIM, YDIM); + SetRect(&myAVIStreamInfo.rcFrame, 0, 0, YDIM, XDIM); if (avierr=AVIFileOpen(&myAVIFile, ARG_AVIOUTPUTFILE, OF_CREATE|OF_WRITE, NULL)) { fprintf(stderr, "AVIFileOpen failed opening output file %s, error code %d\n", ARG_AVIOUTPUTFILE, avierr); @@ -1838,7 +1839,7 @@ fprintf(stderr, " -bquant_offset integer: bframe quantizer offset (100)\n"); fprintf(stderr, "\n"); fprintf(stderr, "Rate control options:\n"); - fprintf(stderr, " -framerate float : target framerate (auto)\n"); + fprintf(stderr, " -framerate float : target framerate (25.0)\n"); fprintf(stderr, " -bitrate [integer] : target bitrate in kbps (700)\n"); fprintf(stderr, " -size integer : target size in kilobytes\n"); fprintf(stderr, " -single : single pass mode (default)\n"); @@ -2590,7 +2591,7 @@ ZONES[NUM_ZONES].frame = 0; ZONES[NUM_ZONES].mode = XVID_ZONE_QUANT; - ZONES[NUM_ZONES].modifier = (int) ARG_CQ; + ZONES[NUM_ZONES].modifier = (int)ARG_CQ; ZONES[NUM_ZONES].type = XVID_TYPE_AUTO; ZONES[NUM_ZONES].greyscale = 0; ZONES[NUM_ZONES].chroma_opt = 0;