22 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
23 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 |
* |
* |
25 |
* $Id: xvid_encraw.c,v 1.49 2011-02-03 15:01:14 Isibaar Exp $ |
* $Id$ |
26 |
* |
* |
27 |
****************************************************************************/ |
****************************************************************************/ |
28 |
|
|
1063 |
totalenctime = MAX(totalenctime, enc_data[k].totalenctime); |
totalenctime = MAX(totalenctime, enc_data[k].totalenctime); |
1064 |
|
|
1065 |
for (i=0; i < 3; i++) totalPSNR[i] += enc_data[k].totalPSNR[i]; |
for (i=0; i < 3; i++) totalPSNR[i] += enc_data[k].totalPSNR[i]; |
1066 |
for (i=0; i < 8; i++) { |
for (i=0; i < 7; i++) { |
1067 |
int l; |
int l; |
1068 |
framestats[i].count += enc_data[k].framestats[i].count; |
framestats[i].count += enc_data[k].framestats[i].count; |
1069 |
framestats[i].size += enc_data[k].framestats[i].size; |
framestats[i].size += enc_data[k].framestats[i].size; |
1210 |
PAVIFILE avi_in = NULL; |
PAVIFILE avi_in = NULL; |
1211 |
PAVISTREAM avi_in_stream = NULL; |
PAVISTREAM avi_in_stream = NULL; |
1212 |
PGETFRAME get_frame = NULL; |
PGETFRAME get_frame = NULL; |
|
BITMAPINFOHEADER myBitmapInfoHeader; |
|
1213 |
#else |
#else |
1214 |
#define get_frame NULL |
#define get_frame NULL |
1215 |
#endif |
#endif |
1220 |
AVISTREAMINFO myAVIStreamInfo; |
AVISTREAMINFO myAVIStreamInfo; |
1221 |
#endif |
#endif |
1222 |
#if defined(XVID_AVI_INPUT) || defined(XVID_AVI_OUTPUT) |
#if defined(XVID_AVI_INPUT) || defined(XVID_AVI_OUTPUT) |
1223 |
|
BITMAPINFOHEADER myBitmapInfoHeader; |
1224 |
if (ARG_NUM_APP_THREADS > 1) |
if (ARG_NUM_APP_THREADS > 1) |
1225 |
CoInitializeEx(0, COINIT_MULTITHREADED); |
CoInitializeEx(0, COINIT_MULTITHREADED); |
1226 |
AVIFileInit(); |
AVIFileInit(); |
1830 |
#ifdef XVID_AVI_OUTPUT |
#ifdef XVID_AVI_OUTPUT |
1831 |
fprintf(stderr, " -avi string: save an AVI file for the complete sequence\n"); |
fprintf(stderr, " -avi string: save an AVI file for the complete sequence\n"); |
1832 |
#endif |
#endif |
1833 |
|
#ifdef XVID_MKV_OUTPUT |
1834 |
fprintf(stderr, " -mkv string: save a MKV file for the complete sequence\n"); |
fprintf(stderr, " -mkv string: save a MKV file for the complete sequence\n"); |
1835 |
|
#endif |
1836 |
fprintf(stderr, "\n"); |
fprintf(stderr, "\n"); |
1837 |
fprintf(stderr, "BFrames options:\n"); |
fprintf(stderr, "BFrames options:\n"); |
1838 |
fprintf(stderr, " -max_bframes integer: max bframes (2)\n"); |
fprintf(stderr, " -max_bframes integer: max bframes (2)\n"); |
1938 |
return (1); |
return (1); |
1939 |
|
|
1940 |
fscanf(handle, "%d %d %d", &xsize, &ysize, &depth); |
fscanf(handle, "%d %d %d", &xsize, &ysize, &depth); |
1941 |
|
fread(&dummy, 1, 1, handle); |
1942 |
if ((xsize > 4096) || (ysize > 4096*3/2) || (depth != 255)) { |
if ((xsize > 4096) || (ysize > 4096*3/2) || (depth != 255)) { |
1943 |
fprintf(stderr, "%d %d %d\n", xsize, ysize, depth); |
fprintf(stderr, "%d %d %d\n", xsize, ysize, depth); |
1944 |
return (2); |
return (2); |
1956 |
unsigned char *image) |
unsigned char *image) |
1957 |
{ |
{ |
1958 |
int i; |
int i; |
|
char dummy; |
|
1959 |
|
|
1960 |
unsigned char *y = image; |
unsigned char *y = image; |
1961 |
unsigned char *u = image + XDIM * YDIM; |
unsigned char *u = image + XDIM * YDIM; |
1976 |
v += XDIM / 2; |
v += XDIM / 2; |
1977 |
} |
} |
1978 |
|
|
|
/* I don't know why, but this seems needed */ |
|
|
fread(&dummy, 1, 1, handle); |
|
|
|
|
1979 |
return (0); |
return (0); |
1980 |
} |
} |
1981 |
#else |
#else |