Stricter estimate deviation limit

git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@173 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
This commit is contained in:
sinamas 2008-10-16 01:50:39 +00:00
parent f5faa3d139
commit efd990ffff

View File

@ -38,10 +38,10 @@ void FtEst::update(const usec_t t) {
long oldFtAvg = ftAvg;
ftAvg = (ftAvg * 31 + ft + 16) >> 5;
if (ftAvg > ((frameTime + (frameTime >> 5)) << COUNT_LOG2))
ftAvg = (frameTime + (frameTime >> 5)) << COUNT_LOG2;
else if (ftAvg < ((frameTime - (frameTime >> 5)) << COUNT_LOG2))
ftAvg = (frameTime - (frameTime >> 5)) << COUNT_LOG2;
if (ftAvg > ((frameTime + (frameTime >> 6)) << COUNT_LOG2))
ftAvg = (frameTime + (frameTime >> 6)) << COUNT_LOG2;
else if (ftAvg < ((frameTime - (frameTime >> 6)) << COUNT_LOG2))
ftAvg = (frameTime - (frameTime >> 6)) << COUNT_LOG2;
ftVar = (ftVar * 15 + std::abs(ftAvg - oldFtAvg) + 8) >> 4;
ft = 0;