mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-11-24 07:25:42 +01:00
Fix debug image comparison to make sure that the difference in our images takes into account alpha.
This commit is contained in:
parent
b1ccdb1359
commit
42e75a5e4c
@ -1508,16 +1508,17 @@ namespace BC7C
|
|||||||
uint8* unCompData = (uint8 *)unComp;
|
uint8* unCompData = (uint8 *)unComp;
|
||||||
|
|
||||||
double diffSum = 0.0;
|
double diffSum = 0.0;
|
||||||
for(int i = 0; i < 64; i+=4) {
|
for(int k = 0; k < 64; k+=4) {
|
||||||
double rdiff = sad(unCompData[i], inBuf[i]);
|
double rdiff = sad(unCompData[k], inBuf[k]);
|
||||||
double gdiff = sad(unCompData[i+1], inBuf[i+1]);
|
double gdiff = sad(unCompData[k+1], inBuf[k+1]);
|
||||||
double bdiff = sad(unCompData[i+2], inBuf[i+2]);
|
double bdiff = sad(unCompData[k+2], inBuf[k+2]);
|
||||||
double adiff = sad(unCompData[i+3], inBuf[i+3]);
|
double adiff = sad(unCompData[k+3], inBuf[k+3]);
|
||||||
diffSum += (rdiff + gdiff + bdiff + adiff) * ((unCompData[i+3] + inBuf[i+3])*0.5);
|
double avga = ((float(unCompData[k+3]) + float(inBuf[k+3]))*0.5)/255.0;
|
||||||
|
diffSum += (rdiff + gdiff + bdiff + adiff) * avga;
|
||||||
}
|
}
|
||||||
double blockError = double(diffSum) / 64.0;
|
double blockError = double(diffSum) / 64.0;
|
||||||
if(blockError > 50.0) {
|
if(blockError > 5.0) {
|
||||||
fprintf(stderr, "WARNING: Block error very high (%.2f)\n", blockError);
|
fprintf(stderr, "WARNING: Block error very high at <%d, %d>: (%.2f)\n", i, j, blockError);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user