mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(SoftFilter) Refactor HQ2x somewhat
This commit is contained in:
parent
390d198812
commit
6cd2cb4abe
@ -228,12 +228,10 @@ static uint16_t blend(unsigned colfmt, unsigned rule, uint16_t E, uint16_t A,
|
||||
mask = HQ2X_565_MASK;
|
||||
shift = HQ2X_565_SHIFT;
|
||||
break;
|
||||
#if 0
|
||||
case SOFTFILTER_FMT_RGB4444:
|
||||
mask = HQ2X_4444_MASK;
|
||||
shift = HQ2X_4444_SHIFT;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (rule)
|
||||
@ -346,7 +344,7 @@ static void hq2x_16bit_generic(unsigned width, unsigned height,
|
||||
}
|
||||
}
|
||||
|
||||
static void hq2x_work_cb_rgb565(void *data, void *thread_data)
|
||||
static void hq2x_work_cb_16bit(void *data, void *thread_data)
|
||||
{
|
||||
struct softfilter_thread_data *thr = (struct softfilter_thread_data*)thread_data;
|
||||
uint16_t *input = (uint16_t*)thr->in_data;
|
||||
@ -384,8 +382,11 @@ static void hq2x_generic_packets(void *data,
|
||||
thr->last = y_end == height;
|
||||
thr->colfmt = SOFTFILTER_FMT_RGB565;
|
||||
|
||||
if (filt->in_fmt == SOFTFILTER_FMT_RGB565)
|
||||
packets[i].work = hq2x_work_cb_rgb565;
|
||||
if (
|
||||
filt->in_fmt == SOFTFILTER_FMT_RGB565 ||
|
||||
filt->in_fmt == SOFTFILTER_FMT_RGB4444
|
||||
)
|
||||
packets[i].work = hq2x_work_cb_16bit;
|
||||
packets[i].thread_data = thr;
|
||||
}
|
||||
}
|
||||
|
@ -50,10 +50,15 @@ const struct softfilter_implementation *softfilter_get_implementation(softfilter
|
||||
|
||||
#define SOFTFILTER_API_VERSION 1
|
||||
|
||||
// Required base color formats
|
||||
|
||||
#define SOFTFILTER_FMT_NONE 0
|
||||
#define SOFTFILTER_FMT_RGB565 (1 << 0)
|
||||
#define SOFTFILTER_FMT_XRGB8888 (1 << 1)
|
||||
|
||||
// Optional color formats
|
||||
#define SOFTFILTER_FMT_RGB4444 (1 << 2)
|
||||
|
||||
#define SOFTFILTER_BPP_RGB565 2
|
||||
#define SOFTFILTER_BPP_XRGB8888 4
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user