mirror of
https://github.com/libretro/RetroArch
synced 2025-02-01 09:32:58 +00:00
(RPNG) cleanups
This commit is contained in:
parent
4d30df7a64
commit
483699357d
@ -23,9 +23,9 @@
|
|||||||
#ifndef _RPNG_COMMON_H
|
#ifndef _RPNG_COMMON_H
|
||||||
#define _RPNG_COMMON_H
|
#define _RPNG_COMMON_H
|
||||||
|
|
||||||
#include <retro_inline.h>
|
|
||||||
#include <formats/rpng.h>
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <filters.h>
|
||||||
|
#include <formats/rpng.h>
|
||||||
|
|
||||||
#undef GOTO_END_ERROR
|
#undef GOTO_END_ERROR
|
||||||
#define GOTO_END_ERROR() do { \
|
#define GOTO_END_ERROR() do { \
|
||||||
@ -53,19 +53,4 @@ struct png_ihdr
|
|||||||
uint8_t interlace;
|
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
|
#endif
|
||||||
|
@ -21,6 +21,7 @@ SOURCES_C := \
|
|||||||
$(LIBRETRO_COMM_DIR)/file/archive_file.c \
|
$(LIBRETRO_COMM_DIR)/file/archive_file.c \
|
||||||
$(LIBRETRO_COMM_DIR)/file/archive_file_zlib.c \
|
$(LIBRETRO_COMM_DIR)/file/archive_file_zlib.c \
|
||||||
$(LIBRETRO_COMM_DIR)//file/file_path.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)/streams/file_stream.c \
|
||||||
$(LIBRETRO_COMM_DIR)/lists/string_list.c
|
$(LIBRETRO_COMM_DIR)/lists/string_list.c
|
||||||
|
|
||||||
|
@ -33,6 +33,21 @@ static INLINE double sinc(double val)
|
|||||||
return sin(val) / 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.
|
/* Modified Bessel function of first order.
|
||||||
* Check Wiki for mathematical definition ... */
|
* Check Wiki for mathematical definition ... */
|
||||||
static INLINE double besseli0(double x)
|
static INLINE double besseli0(double x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user