param->b_aud = 0;
param->b_vfr_input = 1;
param->b_dts_compress = 0;
+ param->i_nal_hrd = X264_NAL_HRD_NONE;
+ param->b_tff = 1;
+ param->b_pic_struct = 0;
}
static int x264_param_apply_preset( x264_param_t *param, const char *preset )
}
else
{
- fprintf( stderr, "x264 [error]: invalid preset '%s'\n", preset );
+ x264_log( NULL, X264_LOG_ERROR, "invalid preset '%s'\n", preset );
return -1;
}
return 0;
param->i_sync_lookahead = 0;
param->i_bframe = 0;
param->b_sliced_threads = 1;
+ param->b_vfr_input = 0;
}
else if( !strncasecmp( s, "touhou", 6 ) )
{
}
else
{
- fprintf( stderr, "x264 [error]: invalid tune '%s'\n", s );
+ x264_log( NULL, X264_LOG_ERROR, "invalid tune '%s'\n", s );
x264_free( tmp );
return -1;
}
if( 0 )
{
psy_failure:
- fprintf( stderr, "x264 [warning]: only 1 psy tuning can be used: ignoring tune %s\n", s );
+ x264_log( NULL, X264_LOG_WARNING, "only 1 psy tuning can be used: ignoring tune %s\n", s );
}
s = strtok( NULL, ",./-+" );
}
void x264_param_apply_fastfirstpass( x264_param_t *param )
{
/* Set faster options in case of turbo firstpass. */
- if( param->rc.b_stat_read && !param->rc.b_stat_write )
+ if( param->rc.b_stat_write && !param->rc.b_stat_read )
{
param->i_frame_reference = 1;
param->analyse.b_transform_8x8 = 0;
param->analyse.i_weighted_pred = X264_WEIGHTP_NONE;
if( param->b_interlaced )
{
- fprintf( stderr, "x264 [error]: baseline profile doesn't support interlacing\n" );
+ x264_log( NULL, X264_LOG_ERROR, "baseline profile doesn't support interlacing\n" );
return -1;
}
}
}
else
{
- fprintf( stderr, "x264 [error]: invalid profile: %s\n", profile );
+ x264_log( NULL, X264_LOG_ERROR, "invalid profile: %s\n", profile );
return -1;
}
if( (param->rc.i_rc_method == X264_RC_CQP && param->rc.i_qp_constant == 0) ||
(param->rc.i_rc_method == X264_RC_CRF && param->rc.f_rf_constant == 0) )
{
- fprintf( stderr, "x264 [error]: %s profile doesn't support lossless\n", profile );
+ x264_log( NULL, X264_LOG_ERROR, "%s profile doesn't support lossless\n", profile );
return -1;
}
return 0;
p->i_cabac_init_idc = atoi(value);
OPT("interlaced")
p->b_interlaced = atobool(value);
+ OPT("tff")
+ p->b_interlaced = p->b_tff = atobool(value);
+ OPT("bff")
+ {
+ p->b_interlaced = atobool(value);
+ p->b_tff = !p->b_interlaced;
+ }
OPT("constrained-intra")
p->b_constrained_intra = atobool(value);
OPT("cqm")
p->rc.f_rf_constant = atof(value);
p->rc.i_rc_method = X264_RC_CRF;
}
+ OPT("crf-max")
+ p->rc.f_rf_constant_max = atof(value);
OPT("rc-lookahead")
p->rc.i_lookahead = atoi(value);
OPT2("qpmin", "qp-min")
p->b_annexb = atobool(value);
OPT("force-cfr")
p->b_vfr_input = !atobool(value);
+ OPT("nal-hrd")
+ b_error |= parse_enum( value, x264_nal_hrd_names, &p->i_nal_hrd );
+ OPT("pic-struct")
+ p->b_pic_struct = atobool(value);
else
return X264_PARAM_BAD_NAME;
#undef OPT
pic->img.i_stride[1] = i_width / 2;
pic->img.i_stride[2] = i_width / 2;
pic->param = NULL;
+ pic->i_pic_struct = PIC_STRUCT_AUTO;
return 0;
}
{
s += sprintf( s, "%dx%d ", p->i_width, p->i_height );
s += sprintf( s, "fps=%d/%d ", p->i_fps_num, p->i_fps_den );
+ s += sprintf( s, "timebase=%d/%d ", p->i_timebase_num, p->i_timebase_den );
}
s += sprintf( s, "cabac=%d", p->b_cabac );
s += sprintf( s, " slice_max_mbs=%d", p->i_slice_max_mbs );
s += sprintf( s, " nr=%d", p->analyse.i_noise_reduction );
s += sprintf( s, " decimate=%d", p->analyse.b_dct_decimate );
- s += sprintf( s, " mbaff=%d", p->b_interlaced );
+ s += sprintf( s, " interlaced=%s", p->b_interlaced ? p->b_tff ? "tff" : "bff" : "0" );
+
s += sprintf( s, " constrained_intra=%d", p->b_constrained_intra );
s += sprintf( s, " bframes=%d", p->i_bframe );
s += sprintf( s, " cplxblur=%.1f qblur=%.1f",
p->rc.f_complexity_blur, p->rc.f_qblur );
if( p->rc.i_vbv_buffer_size )
+ {
s += sprintf( s, " vbv_maxrate=%d vbv_bufsize=%d",
p->rc.i_vbv_max_bitrate, p->rc.i_vbv_buffer_size );
+ if( p->rc.i_rc_method == X264_RC_CRF )
+ s += sprintf( s, " crf-max=%f", p->rc.f_rf_constant_max );
+ }
}
else if( p->rc.i_rc_method == X264_RC_CQP )
s += sprintf( s, " qp=%d", p->rc.i_qp_constant );
s += sprintf( s, " zones" );
}
+ if( p->rc.i_vbv_buffer_size )
+ s += sprintf( s, " nal_hrd=%s", x264_nal_hrd_names[p->i_nal_hrd] );
return buf;
}