// on top of the given settings (equivalent settings to the "faster" preset).
// Timings and SSIM measurements were done on a quadcore Haswell i5 3.2 GHz
// on the first 1000 frames of "Tears of Steel" in 1080p.
+//
+// Note that the two first and the two last are also used for extrapolation
+// should the desired time be outside the range. Thus, it is disadvantageous if
+// they are chosen so that the timings are too close to each other.
static const sc_preset_t presets[SC_PRESETS] = {
#define I4 X264_ANALYSE_I4x4
#define I8 X264_ANALYSE_I8x8
break;
t0 = t1;
}
- // linear interpolation between states
- set = i-1 + (target - t0) / (t1 - t0);
+ // exponential interpolation between states
+ set = i-1 + (log(target) - log(t0)) / (log(t1) - log(t0));
+ set = x264_clip3f( set, -5, (SC_PRESETS-1) + 5 );
// Even if our time estimations in the SC_PRESETS array are off
// this will push us towards our target fullness
set += (40 * (filled-0.75));