Open Mokosha opened 11 years ago
He calculates the euclidean distance of the 3D vector and then 1D PSNR on that: diff_for_psnr=sqrt(diff_r^2+diff_g^2+diff_b^2)
I'm having a hard time reproducing the results even using that method. If I understand you correctly, I need to change my PSNR code from this to:
double t = 0;
for(uint32 c = 0; c < 3; c++) {
double diff = (r[3] * r[c] - u[3] * u[c]);
t += diff * diff;
}
mse += sqrt(t);
...?
Here are the two images in question, I fixed a small bug in my PSNR calculation, so that it now reports RGB PSNR weighted by alpha. The two images from the example above are the following:
Raw:
BPTC Compressed:
The results from FasTC and the Mali ASTC encoder are:
$ ./astcenc -compare kodim05.png kodim05-bptc.png -showpsnr
PSNR (LDR-RGBA): 43.378936 dB
Alpha-Weighted PSNR: 43.378936 dB
PSNR (LDR-RGB): 42.159781 dB
$ CLTool/compare kodim05-bptc.png ../test/kodim05.png
PSNR: 42.140
SSIM: 0.996602052
This makes sense since kodim05-bptc.png has a few non max-alpha pixels (since it provided better compression overall), and we're using a slightly different algorithm than the ASTC encoder. However, it doesn't account for the multiple dBs of error vs. PVRTexTool.
For example:
However, in PVRTexTool, we get: