Revert "Optimize png_reverse_filter_copy_line_rgba"

This reverts commit ad3c67f275.
This commit is contained in:
twinaphex 2020-08-19 18:16:57 +02:00
parent e8170a4354
commit ae0d63ccc0
1 changed files with 12 additions and 8 deletions

View File

@ -248,18 +248,22 @@ static void png_reverse_filter_copy_line_rgb(uint32_t *data,
static void png_reverse_filter_copy_line_rgba(uint32_t *data, static void png_reverse_filter_copy_line_rgba(uint32_t *data,
const uint8_t *decoded, unsigned width, unsigned bpp) const uint8_t *decoded, unsigned width, unsigned bpp)
{ {
uint32_t *data_ptr = NULL; unsigned i;
bpp /= 8; bpp /= 8;
for (data_ptr = &data[0]; data_ptr < data + width; data_ptr++) for (i = 0; i < width; i++)
{ {
uint32_t r = *(decoded); uint32_t r, g, b, a;
uint32_t g = *(decoded + bpp); r = *decoded;
uint32_t b = *(decoded + bpp + bpp); decoded += bpp;
uint32_t a = *(decoded + bpp + bpp + bpp); g = *decoded;
decoded += (4 * bpp); decoded += bpp;
*data_ptr = (a << 24) | (r << 16) | (g << 8) | (b << 0); b = *decoded;
decoded += bpp;
a = *decoded;
decoded += bpp;
data[i] = (a << 24) | (r << 16) | (g << 8) | (b << 0);
} }
} }