h->mb.b_lossless = 1;
h->param.analyse.b_transform_8x8 = 0;
h->param.i_cqm_preset = X264_CQM_FLAT;
+ h->param.psz_cqm_file = NULL;
h->param.rc.f_ip_factor = 1;
h->param.rc.f_pb_factor = 1;
h->param.analyse.b_psnr = 0;
/* Load stat file and init 2pass algo */
if( h->param.rc.b_stat_read )
{
- int stats_size;
char *p, *stats_in;
- FILE *stats_file;
/* read 1st pass stats */
assert( h->param.rc.psz_stat_in );
- stats_file = fopen( h->param.rc.psz_stat_in, "rb");
- if(!stats_file)
+ stats_in = x264_slurp_file( h->param.rc.psz_stat_in );
+ if( !stats_in )
{
x264_log(h, X264_LOG_ERROR, "ratecontrol_init: can't open stats file\n");
return -1;
}
- // FIXME: error checking
- fseek(stats_file, 0, SEEK_END);
- stats_size = ftell(stats_file);
- fseek(stats_file, 0, SEEK_SET);
- stats_in = x264_malloc(stats_size+10);
- fread(stats_in, 1, stats_size, stats_file);
- fclose(stats_file);
/* find number of pics */
p = stats_in;
/*****************************************************************************
- * matroska.c:
+ * matroska.h:
*****************************************************************************
* Copyright (C) 2005 x264 project
* $Id: $
case OPT_SEEK:
opt->i_seek = atoi( optarg );
break;
- case'o':
+ case 'o':
if( !strncasecmp(optarg + strlen(optarg) - 4, ".mp4", 4) )
{
#ifdef MP4_OUTPUT
return -1;
#endif
}
- else if( !strncasecmp(optarg + strlen(optarg) - 4, ".mkv", 4) )
- {
- p_open_outfile = open_file_mkv;
+ else if( !strncasecmp(optarg + strlen(optarg) - 4, ".mkv", 4) )
+ {
+ p_open_outfile = open_file_mkv;
p_write_nalu = write_nalu_mkv;
p_set_outfile_param = set_param_mkv;
p_set_eop = set_eop_mkv;
p_close_outfile = close_file_mkv;
- }
+ }
if( !strcmp(optarg, "-") )
opt->hout = stdout;
else if( p_open_outfile( optarg, &opt->hout ) )
if( dw > 0 && dh > 0 )
{
- int64_t a = dw, b = dh;
+ int64_t a = dw, b = dh;
for (;;)
{
b = c;
}
- dw /= b;
- dh /= b;
+ dw /= b;
+ dh /= b;
}
p_mkv->d_width = (int)dw;
if( !p_mkv->b_writing_frame )
{
if( mk_startFrame(p_mkv->w) < 0 )
- return -1;
+ return -1;
p_mkv->b_writing_frame = 1;
}
psize = i_size - 4 ;
dsize[1] = psize >> 8;
dsize[2] = psize;
if( mk_addFrameData(p_mkv->w, dsize, 3) < 0 ||
- mk_addFrameData(p_mkv->w, p_nalu + 4, i_size - 4) < 0 )
- return -1;
+ mk_addFrameData(p_mkv->w, p_nalu + 4, i_size - 4) < 0 )
+ return -1;
break;
default:
int i_cqm_preset;
char *psz_cqm_file; /* JM format */
- int8_t cqm_4iy[16]; /* used only if i_cqm_preset == X264_CQM_CUSTOM */
- int8_t cqm_4ic[16];
- int8_t cqm_4py[16];
- int8_t cqm_4pc[16];
- int8_t cqm_8iy[64];
- int8_t cqm_8py[64];
+ uint8_t cqm_4iy[16]; /* used only if i_cqm_preset == X264_CQM_CUSTOM */
+ uint8_t cqm_4ic[16];
+ uint8_t cqm_4py[16];
+ uint8_t cqm_4pc[16];
+ uint8_t cqm_8iy[64];
+ uint8_t cqm_8py[64];
/* Log */
void (*pf_log)( void *, int i_level, const char *psz, va_list );