Revert "Optimize png_read_plte"

This reverts commit 107b640bc0.
This commit is contained in:
twinaphex 2020-08-19 18:16:10 +02:00
parent ea5d134337
commit 7c19d4d009
1 changed files with 6 additions and 9 deletions

View File

@ -821,17 +821,14 @@ false_end:
static bool png_read_plte(uint8_t *buf,
uint32_t *buffer, unsigned entries)
{
uint8_t *buf_ptr = NULL;
uint32_t *buffer_ptr = NULL;
unsigned i;
for ( buf_ptr = &buf[0], buffer_ptr = &buffer[0]
; buffer_ptr < buffer + entries
; buf_ptr += 3, buffer_ptr++)
for (i = 0; i < entries; i++)
{
uint32_t r = *(buf_ptr);
uint32_t g = *(buf_ptr + 1);
uint32_t b = *(buf_ptr + 2);
*buffer_ptr = (r << 16) | (g << 8) | (b << 0) | (0xffu << 24);
uint32_t r = buf[3 * i + 0];
uint32_t g = buf[3 * i + 1];
uint32_t b = buf[3 * i + 2];
buffer[i] = (r << 16) | (g << 8) | (b << 0) | (0xffu << 24);
}
return true;