diff --git a/libretro-common/formats/png/rpng_internal.h b/libretro-common/formats/png/rpng_internal.h index b1a50e6e38..fa7ebf57dc 100644 --- a/libretro-common/formats/png/rpng_internal.h +++ b/libretro-common/formats/png/rpng_internal.h @@ -23,9 +23,9 @@ #ifndef _RPNG_COMMON_H #define _RPNG_COMMON_H -#include -#include #include +#include +#include #undef GOTO_END_ERROR #define GOTO_END_ERROR() do { \ @@ -53,19 +53,4 @@ struct png_ihdr uint8_t interlace; }; -/* Paeth prediction filter. */ -static INLINE int paeth(int a, int b, int c) -{ - int p = a + b - c; - int pa = abs(p - a); - int pb = abs(p - b); - int pc = abs(p - c); - - if (pa <= pb && pa <= pc) - return a; - else if (pb <= pc) - return b; - return c; -} - #endif diff --git a/libretro-common/formats/png/test/Makefile b/libretro-common/formats/png/test/Makefile index dcf47ecd37..b11516459a 100644 --- a/libretro-common/formats/png/test/Makefile +++ b/libretro-common/formats/png/test/Makefile @@ -21,6 +21,7 @@ SOURCES_C := \ $(LIBRETRO_COMM_DIR)/file/archive_file.c \ $(LIBRETRO_COMM_DIR)/file/archive_file_zlib.c \ $(LIBRETRO_COMM_DIR)//file/file_path.c \ + $(LIBRETRO_COMM_DIR)//file/retro_stat.c \ $(LIBRETRO_COMM_DIR)/streams/file_stream.c \ $(LIBRETRO_COMM_DIR)/lists/string_list.c diff --git a/libretro-common/include/filters.h b/libretro-common/include/filters.h index 499e14dcc1..85d80be99f 100644 --- a/libretro-common/include/filters.h +++ b/libretro-common/include/filters.h @@ -33,6 +33,21 @@ static INLINE double sinc(double val) return sin(val) / val; } +/* Paeth prediction filter. */ +static INLINE int paeth(int a, int b, int c) +{ + int p = a + b - c; + int pa = abs(p - a); + int pb = abs(p - b); + int pc = abs(p - c); + + if (pa <= pb && pa <= pc) + return a; + else if (pb <= pc) + return b; + return c; +} + /* Modified Bessel function of first order. * Check Wiki for mathematical definition ... */ static INLINE double besseli0(double x)