Revert "Optimize png_reverse_filter_copy_line_gray_alpha"

This reverts commit 710226504e.
This commit is contained in:
twinaphex 2020-08-19 18:16:42 +02:00
parent 7c19d4d009
commit e8170a4354
1 changed files with 10 additions and 6 deletions

View File

@ -299,16 +299,20 @@ static void png_reverse_filter_copy_line_gray_alpha(uint32_t *data,
const uint8_t *decoded, unsigned width,
unsigned bpp)
{
uint32_t *data_ptr = NULL;
unsigned i;
bpp /= 8;
for (data_ptr = &data[0]; data_ptr < data + width; data_ptr++)
for (i = 0; i < width; i++)
{
uint32_t gray = *(decoded);
uint32_t alpha = *(decoded + bpp);
decoded += (2 * bpp);
*data_ptr = (gray * 0x010101) | (alpha << 24);
uint32_t gray, alpha;
gray = *decoded;
decoded += bpp;
alpha = *decoded;
decoded += bpp;
data[i] = (gray * 0x010101) | (alpha << 24);
}
}