/*****************************************************************************
* x264: top-level x264cli functions
*****************************************************************************
/*****************************************************************************
* x264: top-level x264cli functions
*****************************************************************************
+static const char * const chroma_format_names[] =
+{
+ [0] = "all",
+ [X264_CSP_I420] = "i420",
+ [X264_CSP_I422] = "i422",
+ [X264_CSP_I444] = "i444"
+};
static const char * const range_names[] = { "auto", "tv", "pc", 0 };
static const char * const range_names[] = { "auto", "tv", "pc", 0 };
- printf( "configuration: --bit-depth=%d --chroma-format=%s\n", x264_bit_depth, X264_CHROMA_FORMAT ? (output_csp_names[0]+1) : "all" );
+ printf( "x264 configuration: --bit-depth=%d --chroma-format=%s\n", X264_BIT_DEPTH, chroma_format_names[X264_CHROMA_FORMAT] );
+ printf( "libx264 configuration: --bit-depth=%d --chroma-format=%s\n", x264_bit_depth, chroma_format_names[x264_chroma_format] );
" - 2: row alternation - L and R are interlaced by row\n"
" - 3: side by side - L is on the left, R on the right\n"
" - 4: top bottom - L is on top, R on bottom\n"
" - 2: row alternation - L and R are interlaced by row\n"
" - 3: side by side - L is on the left, R on the right\n"
" - 4: top bottom - L is on top, R on bottom\n"
- " - 5: frame alternation - one view per frame\n" );
+ " - 5: frame alternation - one view per frame\n"
+ " - 6: mono - 2D frame without any frame packing\n"
+ " - 7: tile format - L is on top-left, R split across\n" );
H1( " --aq-strength <float> Reduces blocking and blurring in flat and\n"
" textured areas. [%.1f]\n", defaults->rc.f_aq_strength );
H1( "\n" );
H1( " --aq-strength <float> Reduces blocking and blurring in flat and\n"
" textured areas. [%.1f]\n", defaults->rc.f_aq_strength );
H1( "\n" );
+
+ H1( "Speedcontrol:\n" );
+ H1( "\n" );
+ H1( " --speed <float> Automatically adjust other options to achieve this\n" );
+ H1( " fraction of realtime.\n" );
+ H1( " --speed-bufsize <int> Averaging period for speed. (in frames) [%d]\n", defaults->sc.i_buffer_size );
+ H1( "\n" );
+
H1( "Analysis:\n" );
H1( "\n" );
H1( " -A, --partitions <string> Partitions to consider [\"p8x8,b8x8,i8x8,i4x4\"]\n"
H1( "Analysis:\n" );
H1( "\n" );
H1( " -A, --partitions <string> Partitions to consider [\"p8x8,b8x8,i8x8,i4x4\"]\n"
{ "cplxblur", required_argument, NULL, 0 },
{ "zones", required_argument, NULL, 0 },
{ "qpfile", required_argument, NULL, OPT_QPFILE },
{ "cplxblur", required_argument, NULL, 0 },
{ "zones", required_argument, NULL, 0 },
{ "qpfile", required_argument, NULL, OPT_QPFILE },
+ { "speed", required_argument, NULL, 0 },
+ { "speed-bufsize", required_argument, NULL, 0 },
{ "threads", required_argument, NULL, 0 },
{ "lookahead-threads", required_argument, NULL, 0 },
{ "sliced-threads", no_argument, NULL, 0 },
{ "threads", required_argument, NULL, 0 },
{ "lookahead-threads", required_argument, NULL, 0 },
{ "sliced-threads", no_argument, NULL, 0 },
/* force the output csp to what the user specified (or the default) */
param->i_csp = info->csp;
int csp = info->csp & X264_CSP_MASK;
/* force the output csp to what the user specified (or the default) */
param->i_csp = info->csp;
int csp = info->csp & X264_CSP_MASK;
param->i_csp = X264_CSP_I444;
else if( output_csp == X264_CSP_RGB && (csp < X264_CSP_BGR || csp > X264_CSP_RGB) )
param->i_csp = X264_CSP_RGB;
param->i_csp = X264_CSP_I444;
else if( output_csp == X264_CSP_RGB && (csp < X264_CSP_BGR || csp > X264_CSP_RGB) )
param->i_csp = X264_CSP_RGB;
- file_pos = ftell( opt->qpfile );
- qp = -1;
- ret = fscanf( opt->qpfile, "%d %c%*[ \t]%d\n", &num, &type, &qp );
+ int64_t file_pos = ftell( opt->qpfile );
+ int qp = -1;
+ int ret = fscanf( opt->qpfile, "%d %c%*[ \t]%d\n", &num, &type, &qp );
pic->i_type = X264_TYPE_AUTO;
pic->i_qpplus1 = X264_QP_AUTO;
if( num > i_frame || ret == EOF )
{
pic->i_type = X264_TYPE_AUTO;
pic->i_qpplus1 = X264_QP_AUTO;
if( num > i_frame || ret == EOF )
{
- fseek( opt->qpfile, file_pos, SEEK_SET );
+ if( file_pos < 0 || fseek( opt->qpfile, file_pos, SEEK_SET ) )
+ {
+ x264_cli_log( "x264", X264_LOG_ERROR, "qpfile seeking failed\n" );
+ fclose( opt->qpfile );
+ opt->qpfile = NULL;
+ }