Refactor pgn_reverse_filter_wrapper

This commit is contained in:
twinaphex 2015-02-26 19:45:25 +01:00
parent 4d9eb3f8d8
commit bb02411544

View File

@ -133,8 +133,11 @@ static int png_reverse_filter_wrapper(uint32_t *data, const struct png_ihdr *ihd
const uint8_t *inflate_buf, struct rpng_process_t *pngp,
const uint32_t *palette)
{
unsigned i;
bool cont = pngp->h < ihdr->height;
unsigned i, filter;
bool cont;
begin:
cont = pngp->h < ihdr->height;
if (!cont)
{
@ -142,14 +145,6 @@ static int png_reverse_filter_wrapper(uint32_t *data, const struct png_ihdr *ihd
return 1;
}
do
{
unsigned filter;
if (pngp->h < ihdr->height) {}
else
break;
filter = *inflate_buf++;
switch (filter)
@ -221,7 +216,8 @@ static int png_reverse_filter_wrapper(uint32_t *data, const struct png_ihdr *ihd
pngp->h++;
inflate_buf += pngp->pitch;
data += ihdr->width;
}while(1);
goto begin;
return 0;
error:
@ -313,6 +309,7 @@ static bool png_reverse_filter_adam7(uint32_t *data,
deinterlace_pass(data,
ihdr, tmp_data, pass_width, pass_height, &passes[pngp->pass]);
free(tmp_data);
}