(SoftFilter) Add Super2xSaI filter (RGB565 only for now)
This commit is contained in:
parent
2b3624a864
commit
e693e93b57
|
@ -97,6 +97,8 @@ static softfilter_get_implementation_t softfilter_get_implementation_from_idx(un
|
|||
return darken_get_implementation;
|
||||
case SOFTFILTER_TWOXSAI:
|
||||
return twoxsai_get_implementation;
|
||||
case SOFTFILTER_SUPERTWOXSAI:
|
||||
return supertwoxsai_get_implementation;
|
||||
case SOFTFILTER_HQ2X:
|
||||
return hq2x_get_implementation;
|
||||
case SOFTFILTER_SCALE2X:
|
||||
|
|
|
@ -53,6 +53,7 @@ enum
|
|||
SOFTFILTER_DARKEN,
|
||||
SOFTFILTER_HQ2X,
|
||||
SOFTFILTER_TWOXSAI,
|
||||
SOFTFILTER_SUPERTWOXSAI,
|
||||
SOFTFILTER_SCALE2X,
|
||||
SOFTFILTER_LAST,
|
||||
};
|
||||
|
@ -60,6 +61,7 @@ enum
|
|||
#ifdef HAVE_FILTERS_BUILTIN
|
||||
const struct softfilter_implementation *hq2x_get_implementation(softfilter_simd_mask_t simd);
|
||||
const struct softfilter_implementation *twoxsai_get_implementation(softfilter_simd_mask_t simd);
|
||||
const struct softfilter_implementation *supertwoxsai_get_implementation(softfilter_simd_mask_t simd);
|
||||
const struct softfilter_implementation *twoxbr_get_implementation(softfilter_simd_mask_t simd);
|
||||
const struct softfilter_implementation *darken_get_implementation(softfilter_simd_mask_t simd);
|
||||
const struct softfilter_implementation *scale2x_get_implementation(softfilter_simd_mask_t simd);
|
||||
|
|
|
@ -152,9 +152,8 @@ static inline int result2_rgb565(uint16_t A, uint16_t B, uint16_t C, uint16_t D)
|
|||
return r;
|
||||
}
|
||||
|
||||
static void write2_rgb565(uint16_t *out, uint16_t val0, uint16_t val1)
|
||||
static void twoxsai_write2_rgb565(uint16_t *out, uint16_t val0, uint16_t val1)
|
||||
{
|
||||
/* TODO: swap this for big endian */
|
||||
*((uint32_t*)out) = ((uint32_t)(val0) | ((uint32_t)(val1) << 16));
|
||||
}
|
||||
|
||||
|
@ -286,8 +285,8 @@ static void twoxsai_generic_rgb565(unsigned width, unsigned height,
|
|||
product1 = interpolate_rgb565(colorA, colorC);
|
||||
}
|
||||
|
||||
write2_rgb565(out, colorA, product);
|
||||
write2_rgb565(out + dst_stride, product1, product2);
|
||||
twoxsai_write2_rgb565(out, colorA, product);
|
||||
twoxsai_write2_rgb565(out + dst_stride, product1, product2);
|
||||
|
||||
++in;
|
||||
out += 2;
|
||||
|
|
|
@ -38,7 +38,7 @@ ASMFLAGS := -INEON/asm
|
|||
asflags += -mfpu=neon
|
||||
endif
|
||||
|
||||
objects += 2xsai.so 2xbr.so darken.so hq2x.so scale2x.so
|
||||
objects += 2xsai.so super2xsai.so 2xbr.so darken.so hq2x.so scale2x.so
|
||||
|
||||
all: build;
|
||||
|
||||
|
|
|
@ -219,6 +219,8 @@ static uint16_t blend(unsigned colfmt, unsigned rule, uint16_t E, uint16_t A,
|
|||
{
|
||||
unsigned shift;
|
||||
uint32_t mask;
|
||||
|
||||
mask = 0;
|
||||
switch (colfmt)
|
||||
{
|
||||
case SOFTFILTER_FMT_RGB565:
|
||||
|
|
|
@ -478,6 +478,7 @@ FILTERS
|
|||
|
||||
#ifdef HAVE_FILTERS_BUILTIN
|
||||
#include "../gfx/filters/2xsai.c"
|
||||
#include "../gfx/filters/super2xsai.c"
|
||||
#include "../gfx/filters/2xbr.c"
|
||||
#include "../gfx/filters/darken.c"
|
||||
#include "../gfx/filters/hq2x.c"
|
||||
|
|
Loading…
Reference in New Issue