SH-3060 : Always use old byte range on low res (faster), reserve new byte range for high res.

meow-7.2.2
Merov Linden 2012-04-13 15:42:54 -07:00
parent 7d8fdf9a85
commit 8b3703bd03
2 changed files with 6 additions and 2 deletions

View File

@ -289,7 +289,7 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r
S32 bytes;
S32 new_bytes = sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor;
S32 old_bytes = (S32)((F32)(w*h*comp)*rate);
bytes = (LLImage::useNewByteRange() ? new_bytes : old_bytes);
bytes = (LLImage::useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes);
bytes = llmax(bytes, calcHeaderSizeJ2C());
return bytes;
}
@ -473,6 +473,7 @@ LLImageCompressionTester::LLImageCompressionTester() : LLMetricPerformanceTester
mTotalTimeDecompression = 0.0f;
mTotalTimeCompression = 0.0f;
mRunTimeDecompression = 0.0f;
}
LLImageCompressionTester::~LLImageCompressionTester()
@ -555,12 +556,14 @@ void LLImageCompressionTester::updateDecompressionStats(const S32 bytesIn, const
mTotalBytesInDecompression += bytesIn;
mRunBytesInDecompression += bytesIn;
mTotalBytesOutDecompression += bytesOut;
if (mRunBytesInDecompression > (1000000))
//if (mRunBytesInDecompression > (1000000))
if ((mTotalTimeDecompression - mRunTimeDecompression) >= (5.0f))
{
// Output everything
outputTestResults();
// Reset the decompression data of the run
mRunBytesInDecompression = 0;
mRunTimeDecompression = mTotalTimeDecompression;
}
}

View File

@ -163,6 +163,7 @@ class LLImageCompressionTester : public LLMetricPerformanceTesterBasic
//
F32 mTotalTimeDecompression; // Total time spent in computing decompression
F32 mTotalTimeCompression; // Total time spent in computing compression
F32 mRunTimeDecompression; // Time in this run (we output every 5 sec in decompress)
};
#endif