speedup La -> LA conversion in most cases

This commit is contained in:
homm 2016-05-26 15:22:01 +03:00
parent d1272b9b8a
commit b56d8f3f1f

View File

@ -140,11 +140,11 @@ la2lA(UINT8* out, const UINT8* in, int xsize)
unsigned int alpha, pixel;
for (x = 0; x < xsize; x++, in+=4) {
alpha = in[3];
if (alpha) {
pixel = CLIP((255 * in[0]) / alpha);
} else {
if (alpha == 255 || alpha == 0) {
pixel = in[0];
}
} else {
pixel = CLIP((255 * in[0]) / alpha);
}
*out++ = (UINT8) pixel;
*out++ = (UINT8) pixel;
*out++ = (UINT8) pixel;