mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-24 08:01:29 +00:00
Optimize xBRZ with ARGB a bit.
Alpha is quite common with PSP textures. Measured by Zenju to provide a 15% performance improvement in Visual Studio.
This commit is contained in:
parent
0982336565
commit
1075a394ce
@ -1145,7 +1145,11 @@ struct ColorDistanceARGB
|
||||
3. if a1 = 1, distance should be: 255 * (1 - a2) + a2 * distYCbCr()
|
||||
*/
|
||||
|
||||
return std::min(a1, a2) * distYCbCrBuffer->dist(pix1, pix2) + 255 * abs(a1 - a2);
|
||||
const double d = distYCbCrBuffer->dist(pix1, pix2);
|
||||
if (a1 > a2)
|
||||
return a2 * d + 255 * (a1 - a2);
|
||||
else
|
||||
return a1 * d + 255 * (a2 - a1);
|
||||
|
||||
//if (pix1 == pix2)
|
||||
// return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user