Commit 4c8ccfe6 authored by Loren Merritt's avatar Loren Merritt

cosmetics



git-svn-id: svn://svn.videolan.org/x264/trunk@312 df754926-b1dd-0310-bc7b-ec298dee348c
parent ce3a4224
......@@ -389,6 +389,7 @@ static int x264_validate_parameters( x264_t *h )
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;
......
......@@ -263,25 +263,16 @@ int x264_ratecontrol_new( x264_t *h )
/* 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: $
......
......@@ -567,7 +567,7 @@ static int Parse( int argc, char **argv,
case OPT_SEEK:
opt->i_seek = atoi( optarg );
break;
case'o':
case 'o':
if( !strncasecmp(optarg + strlen(optarg) - 4, ".mp4", 4) )
{
#ifdef MP4_OUTPUT
......@@ -581,14 +581,14 @@ static int Parse( int argc, char **argv,
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 ) )
......@@ -1720,7 +1720,7 @@ static int set_param_mkv( hnd_t handle, x264_param_t *p_param )
if( dw > 0 && dh > 0 )
{
int64_t a = dw, b = dh;
int64_t a = dw, b = dh;
for (;;)
{
......@@ -1731,8 +1731,8 @@ static int set_param_mkv( hnd_t handle, x264_param_t *p_param )
b = c;
}
dw /= b;
dh /= b;
dw /= b;
dh /= b;
}
p_mkv->d_width = (int)dw;
......@@ -1781,7 +1781,7 @@ static int write_nalu_mkv( hnd_t handle, uint8_t *p_nalu, int i_size )
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 ;
......@@ -1789,8 +1789,8 @@ static int write_nalu_mkv( hnd_t handle, uint8_t *p_nalu, int i_size )
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:
......
......@@ -154,12 +154,12 @@ typedef struct
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 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment