(Video filters) Cleanups

This commit is contained in:
libretroadmin 2023-01-07 05:23:50 +01:00
parent 3277d7b8fa
commit f82bc4e99c

View File

@ -228,17 +228,16 @@ void picoscale_upscale_rgb_snn_256_320x224_240(uint16_t *PICOSCALE_restrict di,
void picoscale_upscale_rgb_snn_256_320x192_240(uint16_t *PICOSCALE_restrict di, uint16_t ds,
const uint16_t *PICOSCALE_restrict si, uint16_t ss)
{
uint16_t y, j;
uint16_t y;
for (y = 0; y < 192; y += 4) // From 192 lines read 4 lines at a time, write 5 lines per loop, 5x48 = 240
for (y = 0; y < 192; y += 4) /* From 192 lines read 4 lines at a time, write 5 lines per loop, 5x48 = 240 */
{
// First two lines
/* First two lines */
PICOSCALE_H_UPSCALE_SNN_4_5(di, ds, si, ss, 256, PICOSCALE_F_NOP);
PICOSCALE_H_UPSCALE_SNN_4_5(di, ds, si, ss, 256, PICOSCALE_F_NOP);
// Blank line
/* Blank line */
di += ds;
// Next two lines
/* Next two lines */
PICOSCALE_H_UPSCALE_SNN_4_5(di, ds, si, ss, 256, PICOSCALE_F_NOP);
PICOSCALE_H_UPSCALE_SNN_4_5(di, ds, si, ss, 256, PICOSCALE_F_NOP);
@ -390,19 +389,15 @@ static void *picoscale_256x_320x240_generic_create(const struct softfilter_confi
unsigned threads, softfilter_simd_mask_t simd, void *userdata)
{
struct filter_data *filt = (struct filter_data*)calloc(1, sizeof(*filt));
(void)simd;
(void)config;
(void)userdata;
if (!filt) {
if (!filt)
return NULL;
}
/* Apparently the code is not thread-safe,
* so force single threaded operation... */
filt->workers = (struct softfilter_thread_data*)calloc(1, sizeof(struct softfilter_thread_data));
filt->threads = 1;
filt->in_fmt = in_fmt;
if (!filt->workers) {
if (!filt->workers)
{
free(filt);
return NULL;
}
@ -433,9 +428,8 @@ static void picoscale_256x_320x240_generic_output(void *data,
static void picoscale_256x_320x240_generic_destroy(void *data)
{
struct filter_data *filt = (struct filter_data*)data;
if (!filt) {
if (!filt)
return;
}
free(filt->workers);
free(filt);
}
@ -510,19 +504,18 @@ static void picoscale_256x_320x240_generic_packets(void *data,
* over threads and can cull some code. This only
* makes the tiniest performance difference, but
* every little helps when running on an o3DS... */
struct filter_data *filt = (struct filter_data*)data;
struct filter_data *filt = (struct filter_data*)data;
struct softfilter_thread_data *thr = (struct softfilter_thread_data*)&filt->workers[0];
thr->out_data = (uint8_t*)output;
thr->in_data = (const uint8_t*)input;
thr->out_data = (uint8_t*)output;
thr->in_data = (const uint8_t*)input;
thr->out_pitch = output_stride;
thr->in_pitch = input_stride;
thr->width = width;
thr->height = height;
thr->in_pitch = input_stride;
thr->width = width;
thr->height = height;
if (filt->in_fmt == SOFTFILTER_FMT_RGB565) {
packets[0].work = picoscale_256x_320x240_work_cb_rgb565;
}
if (filt->in_fmt == SOFTFILTER_FMT_RGB565)
packets[0].work = picoscale_256x_320x240_work_cb_rgb565;
packets[0].thread_data = thr;
}