ultrafast superfast veryfast faster fast medium slow slower very slow placebo
这是x264中preset 对编码速度设置的借口, 一开始对placebo 不理解 后来查字典发现 placebo是一个单词,有安慰剂,宽慰话,为死者所诵的悼词的意思,难怪是最慢的意思呢,而ultra有过激的意思,ultrafast 就是过激的快,难怪是作为最快的设置。
关于多线程并行编码 i_lookahead_threads,默认是X264_THREADS_AUTO 自动的时候,threads = cpu数 ,因为b_sliced_threads 不是1还是0, 2/2 = 3/2 =1,
else if( !strncasecmp( s, "zerolatency", 11 ) ) // tune 设置zerolatency,b_sliced_threads 就是1,否则为0
{
param->rc.i_lookahead = 0;
param->i_sync_lookahead = 0;
param->i_bframe = 0;
param->b_sliced_threads = 1;
param->b_vfr_input = 0;
param->rc.b_mb_tree = 0;
}
if( h->param.i_threads == X264_THREADS_AUTO )
{
h->param.i_threads = x264_cpu_num_processors() * (h->param.b_sliced_threads?2:3)/2;
/* Avoid too many threads as they don't improve performance and
* complicate VBV. Capped at an arbitrary 2 rows per thread. */
int max_threads = X264_MAX( 1, (h->param.i_height+15)/16 / 2 );
h->param.i_threads = X264_MIN( h->param.i_threads, max_threads );
}