aboutsummaryrefslogtreecommitdiff
path: root/guilib
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-03-26 09:40:55 +0000
committerjmarshallnz <jmarshallnz@svn>2010-03-26 09:40:55 +0000
commit6d22e83986fa752e550ff7ff839c0542eafb2860 (patch)
tree1bc683b44fa9d661ac3c64987999021eea11bc1f /guilib
parent8e0202aa7da1a2f6f23c631b96addb3bd28b91cc (diff)
added: Better debug logging of DXT compression MSE.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28826 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r--guilib/DDSImage.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/guilib/DDSImage.cpp b/guilib/DDSImage.cpp
index 2f3eb457b0..ee6263b0fb 100644
--- a/guilib/DDSImage.cpp
+++ b/guilib/DDSImage.cpp
@@ -145,7 +145,10 @@ bool CDDSImage::Compress(unsigned int width, unsigned int height, unsigned int p
double colorMSE, alphaMSE;
squish::ComputeMSE(brga, width, height, pitch, m_data, squish::kDxt1 | squish::kSourceBGRA, colorMSE, alphaMSE);
if (colorMSE < maxMSE && alphaMSE < maxMSE)
+ {
+ CLog::Log(LOGDEBUG, "%s - DXT1 error is: %2.2f:%2.2f", __FUNCTION__, colorMSE, alphaMSE);
return true;
+ }
Allocate(width, height, XB_FMT_DXT3);
@@ -169,9 +172,10 @@ bool CDDSImage::Compress(unsigned int width, unsigned int height, unsigned int p
double dxt5MSE;
unsigned char *data2 = new unsigned char[GetStorageRequirements(width, height, XB_FMT_DXT5)];
squish::CompressImage(brga, width, height, pitch, data2, squish::kDxt5 | squish::kSourceBGRA);
- squish::ComputeMSE(brga, width, height, pitch, data2, squish::kDxt5 | squish::kSourceBGRA, colorMSE, alphaMSE);
+ squish::ComputeMSE(brga, width, height, pitch, data2, squish::kDxt5 | squish::kSourceBGRA, colorMSE, dxt5MSE);
if (alphaMSE < maxMSE && alphaMSE < dxt5MSE)
{ // DXT3 passes and is best
+ CLog::Log(LOGDEBUG, "%s - DXT3 error is: %2.2f:%2.2f", __FUNCTION__, colorMSE, alphaMSE);
return true;
}
else if (dxt5MSE < maxMSE)
@@ -179,18 +183,20 @@ bool CDDSImage::Compress(unsigned int width, unsigned int height, unsigned int p
memcpy(&m_desc.pixelFormat.fourcc, "DXT5", 4);
delete[] m_data;
m_data = data2;
+ CLog::Log(LOGDEBUG, "%s - DXT5 error is: %2.2f:%2.2f", __FUNCTION__, colorMSE, dxt5MSE);
return true;
}
delete[] data2;
}
}
+ CLog::Log(LOGDEBUG, "%s - Failed to compress to DXT - error is: %2.2f:%2.2f", __FUNCTION__, colorMSE, alphaMSE);
return false;
}
else
{
double colorMSE, alphaMSE;
squish::ComputeMSE(brga, width, height, pitch, m_data, squish::kDxt1 | squish::kSourceBGRA, colorMSE, alphaMSE);
- CLog::Log(LOGDEBUG, "%s - DDS error is: %2.2f:%2.2f", __FUNCTION__, colorMSE, alphaMSE);
+ CLog::Log(LOGDEBUG, "%s - DXT1 error is: %2.2f:%2.2f", __FUNCTION__, colorMSE, alphaMSE);
}
return true;
}