RetroArch
Classes | Macros | Functions | Variables
super2xsai.c File Reference
#include "softfilter.h"
#include <stdlib.h>
Include dependency graph for super2xsai.c:

Classes

struct  softfilter_thread_data
 
struct  filter_data
 

Macros

#define SUPERTWOXSAI_SCALE   2
 
#define supertwoxsai_interpolate_xrgb8888(A, B)   ((((A) & 0xFEFEFEFE) >> 1) + (((B) & 0xFEFEFEFE) >> 1) + ((A) & (B) & 0x01010101))
 
#define supertwoxsai_interpolate2_xrgb8888(A, B, C, D)   ((((A) & 0xFCFCFCFC) >> 2) + (((B) & 0xFCFCFCFC) >> 2) + (((C) & 0xFCFCFCFC) >> 2) + (((D) & 0xFCFCFCFC) >> 2) + (((((A) & 0x03030303) + ((B) & 0x03030303) + ((C) & 0x03030303) + ((D) & 0x03030303)) >> 2) & 0x03030303))
 
#define supertwoxsai_interpolate_rgb565(A, B)   ((((A) & 0xF7DE) >> 1) + (((B) & 0xF7DE) >> 1) + ((A) & (B) & 0x0821));
 
#define supertwoxsai_interpolate2_rgb565(A, B, C, D)   ((((A) & 0xE79C) >> 2) + (((B) & 0xE79C) >> 2) + (((C) & 0xE79C) >> 2) + (((D) & 0xE79C) >> 2) + (((((A) & 0x1863) + ((B) & 0x1863) + ((C) & 0x1863) + ((D) & 0x1863)) >> 2) & 0x1863))
 
#define supertwoxsai_result(A, B, C, D)   (((A) != (C) || (A) != (D)) - ((B) != (C) || (B) != (D)))
 
#define supertwoxsai_declare_variables(typename_t, in, nextline)
 
#define supertwoxsai_function(result_cb, interpolate_cb, interpolate2_cb)
 

Functions

static unsigned supertwoxsai_generic_input_fmts (void)
 
static unsigned supertwoxsai_generic_output_fmts (unsigned input_fmts)
 
static unsigned supertwoxsai_generic_threads (void *data)
 
static voidsupertwoxsai_generic_create (const struct softfilter_config *config, unsigned in_fmt, unsigned out_fmt, unsigned max_width, unsigned max_height, unsigned threads, softfilter_simd_mask_t simd, void *userdata)
 
static void supertwoxsai_generic_output (void *data, unsigned *out_width, unsigned *out_height, unsigned width, unsigned height)
 
static void supertwoxsai_generic_destroy (void *data)
 
static void supertwoxsai_generic_xrgb8888 (unsigned width, unsigned height, int first, int last, uint32_t *src, unsigned src_stride, uint32_t *dst, unsigned dst_stride)
 
static void supertwoxsai_generic_rgb565 (unsigned width, unsigned height, int first, int last, uint16_t *src, unsigned src_stride, uint16_t *dst, unsigned dst_stride)
 
static void supertwoxsai_work_cb_rgb565 (void *data, void *thread_data)
 
static void supertwoxsai_work_cb_xrgb8888 (void *data, void *thread_data)
 
static void supertwoxsai_generic_packets (void *data, struct softfilter_work_packet *packets, void *output, size_t output_stride, const void *input, unsigned width, unsigned height, size_t input_stride)
 
const struct softfilter_implementationsoftfilter_get_implementation (softfilter_simd_mask_t simd)
 

Variables

static const struct softfilter_implementation supertwoxsai_generic
 

Macro Definition Documentation

◆ supertwoxsai_declare_variables

#define supertwoxsai_declare_variables (   typename_t,
  in,
  nextline 
)
Value:
typename_t product1a, product1b, product2a, product2b; \
const typename_t colorB0 = *(in - nextline - 1); \
const typename_t colorB1 = *(in - nextline + 0); \
const typename_t colorB2 = *(in - nextline + 1); \
const typename_t colorB3 = *(in - nextline + 2); \
const typename_t color4 = *(in - 1); \
const typename_t color5 = *(in + 0); \
const typename_t color6 = *(in + 1); \
const typename_t colorS2 = *(in + 2); \
const typename_t color1 = *(in + nextline - 1); \
const typename_t color2 = *(in + nextline + 0); \
const typename_t color3 = *(in + nextline + 1); \
const typename_t colorS1 = *(in + nextline + 2); \
const typename_t colorA0 = *(in + nextline + nextline - 1); \
const typename_t colorA1 = *(in + nextline + nextline + 0); \
const typename_t colorA2 = *(in + nextline + nextline + 1); \
const typename_t colorA3 = *(in + nextline + nextline + 2)
GLuint in
Definition: glext.h:10523

◆ supertwoxsai_function

#define supertwoxsai_function (   result_cb,
  interpolate_cb,
  interpolate2_cb 
)

◆ supertwoxsai_interpolate2_rgb565

#define supertwoxsai_interpolate2_rgb565 (   A,
  B,
  C,
 
)    ((((A) & 0xE79C) >> 2) + (((B) & 0xE79C) >> 2) + (((C) & 0xE79C) >> 2) + (((D) & 0xE79C) >> 2) + (((((A) & 0x1863) + ((B) & 0x1863) + ((C) & 0x1863) + ((D) & 0x1863)) >> 2) & 0x1863))

◆ supertwoxsai_interpolate2_xrgb8888

#define supertwoxsai_interpolate2_xrgb8888 (   A,
  B,
  C,
 
)    ((((A) & 0xFCFCFCFC) >> 2) + (((B) & 0xFCFCFCFC) >> 2) + (((C) & 0xFCFCFCFC) >> 2) + (((D) & 0xFCFCFCFC) >> 2) + (((((A) & 0x03030303) + ((B) & 0x03030303) + ((C) & 0x03030303) + ((D) & 0x03030303)) >> 2) & 0x03030303))

◆ supertwoxsai_interpolate_rgb565

#define supertwoxsai_interpolate_rgb565 (   A,
  B 
)    ((((A) & 0xF7DE) >> 1) + (((B) & 0xF7DE) >> 1) + ((A) & (B) & 0x0821));

◆ supertwoxsai_interpolate_xrgb8888

#define supertwoxsai_interpolate_xrgb8888 (   A,
  B 
)    ((((A) & 0xFEFEFEFE) >> 1) + (((B) & 0xFEFEFEFE) >> 1) + ((A) & (B) & 0x01010101))

◆ supertwoxsai_result

#define supertwoxsai_result (   A,
  B,
  C,
 
)    (((A) != (C) || (A) != (D)) - ((B) != (C) || (B) != (D)))

◆ SUPERTWOXSAI_SCALE

#define SUPERTWOXSAI_SCALE   2

Function Documentation

◆ softfilter_get_implementation()

const struct softfilter_implementation* softfilter_get_implementation ( softfilter_simd_mask_t  simd)
Here is the call graph for this function:

◆ supertwoxsai_generic_create()

static void* supertwoxsai_generic_create ( const struct softfilter_config config,
unsigned  in_fmt,
unsigned  out_fmt,
unsigned  max_width,
unsigned  max_height,
unsigned  threads,
softfilter_simd_mask_t  simd,
void userdata 
)
static
Here is the call graph for this function:

◆ supertwoxsai_generic_destroy()

static void supertwoxsai_generic_destroy ( void data)
static
Here is the call graph for this function:

◆ supertwoxsai_generic_input_fmts()

static unsigned supertwoxsai_generic_input_fmts ( void  )
static

◆ supertwoxsai_generic_output()

static void supertwoxsai_generic_output ( void data,
unsigned *  out_width,
unsigned *  out_height,
unsigned  width,
unsigned  height 
)
static

◆ supertwoxsai_generic_output_fmts()

static unsigned supertwoxsai_generic_output_fmts ( unsigned  input_fmts)
static

◆ supertwoxsai_generic_packets()

static void supertwoxsai_generic_packets ( void data,
struct softfilter_work_packet packets,
void output,
size_t  output_stride,
const void input,
unsigned  width,
unsigned  height,
size_t  input_stride 
)
static
Here is the call graph for this function:

◆ supertwoxsai_generic_rgb565()

static void supertwoxsai_generic_rgb565 ( unsigned  width,
unsigned  height,
int  first,
int  last,
uint16_t src,
unsigned  src_stride,
uint16_t dst,
unsigned  dst_stride 
)
static
Here is the caller graph for this function:

◆ supertwoxsai_generic_threads()

static unsigned supertwoxsai_generic_threads ( void data)
static

◆ supertwoxsai_generic_xrgb8888()

static void supertwoxsai_generic_xrgb8888 ( unsigned  width,
unsigned  height,
int  first,
int  last,
uint32_t src,
unsigned  src_stride,
uint32_t dst,
unsigned  dst_stride 
)
static
Here is the caller graph for this function:

◆ supertwoxsai_work_cb_rgb565()

static void supertwoxsai_work_cb_rgb565 ( void data,
void thread_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ supertwoxsai_work_cb_xrgb8888()

static void supertwoxsai_work_cb_xrgb8888 ( void data,
void thread_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ supertwoxsai_generic

const struct softfilter_implementation supertwoxsai_generic
static
Initial value:
= {
"Super2xSaI",
"super2xsai",
}
static void supertwoxsai_generic_packets(void *data, struct softfilter_work_packet *packets, void *output, size_t output_stride, const void *input, unsigned width, unsigned height, size_t input_stride)
Definition: super2xsai.c:293
#define SOFTFILTER_API_VERSION
Definition: softfilter.h:96
static unsigned supertwoxsai_generic_threads(void *data)
Definition: super2xsai.c:60
static void supertwoxsai_generic_destroy(void *data)
Definition: super2xsai.c:98
static void * supertwoxsai_generic_create(const struct softfilter_config *config, unsigned in_fmt, unsigned out_fmt, unsigned max_width, unsigned max_height, unsigned threads, softfilter_simd_mask_t simd, void *userdata)
Definition: super2xsai.c:66
static unsigned supertwoxsai_generic_input_fmts(void)
Definition: super2xsai.c:50
static unsigned supertwoxsai_generic_output_fmts(unsigned input_fmts)
Definition: super2xsai.c:55
static void supertwoxsai_generic_output(void *data, unsigned *out_width, unsigned *out_height, unsigned width, unsigned height)
Definition: super2xsai.c:91