Thread: sync-lookahead
View Single Post
Old 3rd April 2013, 23:47   #10  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
looked up what changed and from the looks of it this:
Code:
 895     if( h->param.i_lookahead_threads == X264_THREADS_AUTO )
 896     {
 897         if( h->param.b_sliced_threads )
 898             h->param.i_lookahead_threads = h->param.i_threads;
 899         else
 900         {
 901             /* If we're using much slower lookahead settings than encoding settings, it helps a lot to use
 902              * more lookahead threads.  This typically happens in the first pass of a two-pass encode, so
 903              * try to guess at this sort of case.
 904              *
 905              * Tuned by a little bit of real encoding with the various presets. */
 906             int badapt = h->param.i_bframe_adaptive == X264_B_ADAPT_TRELLIS;
 907             int subme = X264_MIN( h->param.analyse.i_subpel_refine / 3, 3 ) + (h->param.analyse.i_subpel_refine > 1);
 908             int bframes = X264_MIN( (h->param.i_bframe - 1) / 3, 3 );
 909 
 910             /* [b-adapt 0/1 vs 2][quantized subme][quantized bframes] */
 911             static const uint8_t lookahead_thread_div[2][5][4] =
 912             {{{6,6,6,6}, {3,3,3,3}, {4,4,4,4}, {6,6,6,6}, {12,12,12,12}},
 913              {{3,2,1,1}, {2,1,1,1}, {4,3,2,1}, {6,4,3,2}, {12, 9, 6, 4}}};
 914 
 915             h->param.i_lookahead_threads = h->param.i_threads / lookahead_thread_div[badapt][subme][bframes];
 916             /* Since too many lookahead threads significantly degrades lookahead accuracy, limit auto
 917              * lookahead threads to about 8 macroblock rows high each at worst.  This number is chosen
 918              * pretty much arbitrarily. */
 919             h->param.i_lookahead_threads = X264_MIN( h->param.i_lookahead_threads, h->param.i_height / 128 );
 920         }
 921     }
source: http://git.videolan.org/?p=x264.git;...b808f9ae3189e1
should be the interesting part, for those who want to know how x264 calculated the lookahead threads now
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote