x264: improve the formula and update to r2397