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.25 2006-06-16 10:08:28 syskin Exp $ |
* $Id: xvid_encraw.c,v 1.26 2006-07-08 14:19:04 Skal Exp $ |
25 |
* |
* |
26 |
****************************************************************************/ |
****************************************************************************/ |
27 |
|
|
39 |
************************************************************************/ |
************************************************************************/ |
40 |
|
|
41 |
#include <stdio.h> |
#include <stdio.h> |
42 |
#include <io.h> |
//#include <io.h> |
43 |
#include <stdlib.h> |
#include <stdlib.h> |
44 |
#include <string.h> |
#include <string.h> |
45 |
#include <math.h> |
#include <math.h> |
196 |
static PAVIFILE avi_file = NULL; |
static PAVIFILE avi_file = NULL; |
197 |
static LPBITMAPINFOHEADER info_header = NULL; |
static LPBITMAPINFOHEADER info_header = NULL; |
198 |
static PGETFRAME get_frame = NULL; |
static PGETFRAME get_frame = NULL; |
199 |
|
#else |
200 |
|
#define get_frame NULL |
201 |
#endif |
#endif |
202 |
static char *ARG_TIMECODEFILE = NULL; |
static char *ARG_TIMECODEFILE = NULL; |
203 |
static int XDIM = 0; |
static int XDIM = 0; |
650 |
i++; |
i++; |
651 |
ARG_AVIOUTPUTFILE = argv[i]; |
ARG_AVIOUTPUTFILE = argv[i]; |
652 |
#else |
#else |
653 |
fprintf("Not compiled with AVI output support.\n"); |
fprintf( stderr, "Not compiled with AVI output support.\n"); |
654 |
return(-1); |
return(-1); |
655 |
#endif |
#endif |
656 |
} else if (strcmp("-mkv", argv[i]) == 0 && i < argc - 1) { |
} else if (strcmp("-mkv", argv[i]) == 0 && i < argc - 1) { |
967 |
} |
} |
968 |
|
|
969 |
/* Jump to the starting frame */ |
/* Jump to the starting frame */ |
970 |
if (ARG_INPUTTYPE < 2) |
if (ARG_INPUTTYPE == 0) |
971 |
fseek(in_file, ARG_STARTFRAMENR*IMAGE_SIZE(XDIM, YDIM), SEEK_SET); |
fseek(in_file, ARG_STARTFRAMENR*IMAGE_SIZE(XDIM, YDIM), SEEK_SET); |
972 |
|
|
973 |
/* now we know the sizes, so allocate memory */ |
/* now we know the sizes, so allocate memory */ |
974 |
if (get_frame == NULL) { |
if (get_frame == NULL) |
975 |
|
{ |
976 |
in_buffer = (unsigned char *) malloc(4*XDIM*YDIM); |
in_buffer = (unsigned char *) malloc(4*XDIM*YDIM); |
977 |
if (!in_buffer) |
if (!in_buffer) |
978 |
goto free_all_memory; |
goto free_all_memory; |