From a283b7126189e0f001bbf56252a5103a3a955d3c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 19 Aug 2020 10:05:09 +0200 Subject: [PATCH] (RPNG) Optimize png_reverse_filter_adam7_deinterlace_pass --- libretro-common/formats/png/rpng.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libretro-common/formats/png/rpng.c b/libretro-common/formats/png/rpng.c index a3cc38949c..538ecf1aae 100644 --- a/libretro-common/formats/png/rpng.c +++ b/libretro-common/formats/png/rpng.c @@ -468,10 +468,13 @@ static void png_reverse_filter_adam7_deinterlace_pass(uint32_t *data, for (y = 0; y < pass_height; y++, data += ihdr->width * pass->stride_y, input += pass_width) { - uint32_t *out = data; + uint32_t *out = data; + const uint32_t *input_ptr = NULL; - for (x = 0; x < pass_width; x++, out += pass->stride_x) - *out = input[x]; + for ( input_ptr = &input[0] + ; input_ptr < input + pass_width + ; input_ptr++, out += pass->stride_x) + *out = *input_ptr; } }