21 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
* |
* |
24 |
* $Id: xvid_encraw.c,v 1.22 2005-10-07 15:02:28 suxen_drol Exp $ |
* $Id: xvid_encraw.c,v 1.23 2006-01-17 19:06:25 Isibaar Exp $ |
25 |
* |
* |
26 |
****************************************************************************/ |
****************************************************************************/ |
27 |
|
|
128 |
static int NUM_ZONES = 0; |
static int NUM_ZONES = 0; |
129 |
|
|
130 |
/* Maximum number of frames to encode */ |
/* Maximum number of frames to encode */ |
131 |
#define ABS_MAXFRAMENR 9999 |
#define ABS_MAXFRAMENR -1 /* no limit */ |
132 |
|
|
133 |
static int ARG_STATS = 0; |
static int ARG_STATS = 0; |
134 |
static int ARG_DUMP = 0; |
static int ARG_DUMP = 0; |
431 |
return (-1); |
return (-1); |
432 |
} |
} |
433 |
|
|
434 |
if (ARG_MAXFRAMENR <= 0) { |
if (ARG_MAXFRAMENR == 0) { |
435 |
fprintf(stderr, "Wrong number of frames\n"); |
fprintf(stderr, "Wrong number of frames\n"); |
436 |
return (-1); |
return (-1); |
437 |
} |
} |
445 |
ARG_INPUTTYPE==2) |
ARG_INPUTTYPE==2) |
446 |
{ |
{ |
447 |
AVISTREAMINFO avi_info; |
AVISTREAMINFO avi_info; |
448 |
|
FILE *avi_fp = fopen(ARG_INPUTFILE, "rb"); |
449 |
|
if (avi_fp == NULL) { |
450 |
|
fprintf(stderr, "Couldn't open file '%s'!\n", ARG_INPUTFILE); |
451 |
|
return (-1); |
452 |
|
} |
453 |
|
fclose(avi_fp); |
454 |
|
|
455 |
AVIFileInit(); |
AVIFileInit(); |
456 |
if (AVIStreamOpenFromFile(&avi_stream, ARG_INPUTFILE, streamtypeVIDEO, 0, OF_READ, NULL) != AVIERR_OK) { |
if (AVIStreamOpenFromFile(&avi_stream, ARG_INPUTFILE, streamtypeVIDEO, 0, OF_READ, NULL) != AVIERR_OK) { |
473 |
return (-1); |
return (-1); |
474 |
} |
} |
475 |
|
|
476 |
|
|
477 |
|
if (ARG_MAXFRAMENR<0) |
478 |
|
ARG_MAXFRAMENR = avi_info.dwLength; |
479 |
|
else |
480 |
ARG_MAXFRAMENR = min(ARG_MAXFRAMENR, avi_info.dwLength); |
ARG_MAXFRAMENR = min(ARG_MAXFRAMENR, avi_info.dwLength); |
481 |
|
|
482 |
XDIM = avi_info.rcFrame.right - avi_info.rcFrame.left; |
XDIM = avi_info.rcFrame.right - avi_info.rcFrame.left; |
560 |
char *type; |
char *type; |
561 |
int sse[3]; |
int sse[3]; |
562 |
|
|
563 |
if (input_num >= ARG_MAXFRAMENR) { |
if (input_num >= ARG_MAXFRAMENR && ARG_MAXFRAMENR > 0) { |
564 |
result = 1; |
result = 1; |
565 |
} |
} |
566 |
|
|