mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(Video filters) Cleanups
This commit is contained in:
parent
3277d7b8fa
commit
f82bc4e99c
@ -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,
|
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)
|
const uint16_t *PICOSCALE_restrict si, uint16_t ss)
|
||||||
{
|
{
|
||||||
|
uint16_t y;
|
||||||
uint16_t y, j;
|
|
||||||
|
|
||||||
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);
|
||||||
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;
|
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);
|
||||||
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)
|
unsigned threads, softfilter_simd_mask_t simd, void *userdata)
|
||||||
{
|
{
|
||||||
struct filter_data *filt = (struct filter_data*)calloc(1, sizeof(*filt));
|
struct filter_data *filt = (struct filter_data*)calloc(1, sizeof(*filt));
|
||||||
(void)simd;
|
if (!filt)
|
||||||
(void)config;
|
|
||||||
(void)userdata;
|
|
||||||
|
|
||||||
if (!filt) {
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
/* Apparently the code is not thread-safe,
|
/* Apparently the code is not thread-safe,
|
||||||
* so force single threaded operation... */
|
* so force single threaded operation... */
|
||||||
filt->workers = (struct softfilter_thread_data*)calloc(1, sizeof(struct softfilter_thread_data));
|
filt->workers = (struct softfilter_thread_data*)calloc(1, sizeof(struct softfilter_thread_data));
|
||||||
filt->threads = 1;
|
filt->threads = 1;
|
||||||
filt->in_fmt = in_fmt;
|
filt->in_fmt = in_fmt;
|
||||||
if (!filt->workers) {
|
if (!filt->workers)
|
||||||
|
{
|
||||||
free(filt);
|
free(filt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -433,9 +428,8 @@ static void picoscale_256x_320x240_generic_output(void *data,
|
|||||||
static void picoscale_256x_320x240_generic_destroy(void *data)
|
static void picoscale_256x_320x240_generic_destroy(void *data)
|
||||||
{
|
{
|
||||||
struct filter_data *filt = (struct filter_data*)data;
|
struct filter_data *filt = (struct filter_data*)data;
|
||||||
if (!filt) {
|
if (!filt)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
free(filt->workers);
|
free(filt->workers);
|
||||||
free(filt);
|
free(filt);
|
||||||
}
|
}
|
||||||
@ -510,19 +504,18 @@ static void picoscale_256x_320x240_generic_packets(void *data,
|
|||||||
* over threads and can cull some code. This only
|
* over threads and can cull some code. This only
|
||||||
* makes the tiniest performance difference, but
|
* makes the tiniest performance difference, but
|
||||||
* every little helps when running on an o3DS... */
|
* 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];
|
struct softfilter_thread_data *thr = (struct softfilter_thread_data*)&filt->workers[0];
|
||||||
|
|
||||||
thr->out_data = (uint8_t*)output;
|
thr->out_data = (uint8_t*)output;
|
||||||
thr->in_data = (const uint8_t*)input;
|
thr->in_data = (const uint8_t*)input;
|
||||||
thr->out_pitch = output_stride;
|
thr->out_pitch = output_stride;
|
||||||
thr->in_pitch = input_stride;
|
thr->in_pitch = input_stride;
|
||||||
thr->width = width;
|
thr->width = width;
|
||||||
thr->height = height;
|
thr->height = height;
|
||||||
|
|
||||||
if (filt->in_fmt == SOFTFILTER_FMT_RGB565) {
|
if (filt->in_fmt == SOFTFILTER_FMT_RGB565)
|
||||||
packets[0].work = picoscale_256x_320x240_work_cb_rgb565;
|
packets[0].work = picoscale_256x_320x240_work_cb_rgb565;
|
||||||
}
|
|
||||||
packets[0].thread_data = thr;
|
packets[0].thread_data = thr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user