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

Classes

struct  softfilter_thread_data
 
struct  filter_data
 

Macros

#define TWOXSAI_SCALE   2
 
#define twoxsai_interpolate_xrgb8888(A, B)   ((((A) & 0xFEFEFEFE) >> 1) + (((B) & 0xFEFEFEFE) >> 1) + ((A) & (B) & 0x01010101))
 
#define twoxsai_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 twoxsai_interpolate_rgb565(A, B)   ((((A) & 0xF7DE) >> 1) + (((B) & 0xF7DE) >> 1) + ((A) & (B) & 0x0821))
 
#define twoxsai_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 twoxsai_interpolate_4444(A, B)   (((A & 0xEEEE) >> 1) + ((B & 0xEEEE) >> 1) + (A & B & 0x1111))
 
#define twoxsai_interpolate2_4444(A, B, C, D)   (((A & 0xCCCC) >> 2) + ((B & 0xCCCC) >> 2) + ((C & 0xCCCC) >> 2) + ((D & 0xCCCC) >> 2) + ((((A & 0x3333) + (B & 0x3333) + (C & 0x3333) + (D & 0x3333)) >> 2) & 0x3333))
 
#define twoxsai_result(A, B, C, D)   (((A) != (C) || (A) != (D)) - ((B) != (C) || (B) != (D)));
 
#define twoxsai_declare_variables(typename_t, in, nextline)
 
#define twoxsai_function(result_cb, interpolate_cb, interpolate2_cb)
 

Functions

static unsigned twoxsai_generic_input_fmts (void)
 
static unsigned twoxsai_generic_output_fmts (unsigned input_fmts)
 
static unsigned twoxsai_generic_threads (void *data)
 
static voidtwoxsai_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 twoxsai_generic_output (void *data, unsigned *out_width, unsigned *out_height, unsigned width, unsigned height)
 
static void twoxsai_generic_destroy (void *data)
 
static void twoxsai_generic_xrgb8888 (unsigned width, unsigned height, int first, int last, uint32_t *src, unsigned src_stride, uint32_t *dst, unsigned dst_stride)
 
static void twoxsai_generic_rgb565 (unsigned width, unsigned height, int first, int last, uint16_t *src, unsigned src_stride, uint16_t *dst, unsigned dst_stride)
 
static void twoxsai_work_cb_rgb565 (void *data, void *thread_data)
 
static void twoxsai_work_cb_xrgb8888 (void *data, void *thread_data)
 
static void twoxsai_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 twoxsai_generic
 

Macro Definition Documentation

◆ twoxsai_declare_variables

#define twoxsai_declare_variables (   typename_t,
  in,
  nextline 
)
Value:
typename_t product, product1, product2; \
typename_t colorI = *(in - nextline - 1); \
typename_t colorE = *(in - nextline + 0); \
typename_t colorF = *(in - nextline + 1); \
typename_t colorJ = *(in - nextline + 2); \
typename_t colorG = *(in - 1); \
typename_t colorA = *(in + 0); \
typename_t colorB = *(in + 1); \
typename_t colorK = *(in + 2); \
typename_t colorH = *(in + nextline - 1); \
typename_t colorC = *(in + nextline + 0); \
typename_t colorD = *(in + nextline + 1); \
typename_t colorL = *(in + nextline + 2); \
typename_t colorM = *(in + nextline + nextline - 1); \
typename_t colorN = *(in + nextline + nextline + 0); \
typename_t colorO = *(in + nextline + nextline + 1);
GLuint in
Definition: glext.h:10523

◆ twoxsai_function

#define twoxsai_function (   result_cb,
  interpolate_cb,
  interpolate2_cb 
)

◆ twoxsai_interpolate2_4444

#define twoxsai_interpolate2_4444 (   A,
  B,
  C,
 
)    (((A & 0xCCCC) >> 2) + ((B & 0xCCCC) >> 2) + ((C & 0xCCCC) >> 2) + ((D & 0xCCCC) >> 2) + ((((A & 0x3333) + (B & 0x3333) + (C & 0x3333) + (D & 0x3333)) >> 2) & 0x3333))

◆ twoxsai_interpolate2_rgb565

#define twoxsai_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))

◆ twoxsai_interpolate2_xrgb8888

#define twoxsai_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))

◆ twoxsai_interpolate_4444

#define twoxsai_interpolate_4444 (   A,
  B 
)    (((A & 0xEEEE) >> 1) + ((B & 0xEEEE) >> 1) + (A & B & 0x1111))

◆ twoxsai_interpolate_rgb565

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

◆ twoxsai_interpolate_xrgb8888

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

◆ twoxsai_result

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

◆ TWOXSAI_SCALE

#define TWOXSAI_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:

◆ twoxsai_generic_create()

static void* twoxsai_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:

◆ twoxsai_generic_destroy()

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

◆ twoxsai_generic_input_fmts()

static unsigned twoxsai_generic_input_fmts ( void  )
static

◆ twoxsai_generic_output()

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

◆ twoxsai_generic_output_fmts()

static unsigned twoxsai_generic_output_fmts ( unsigned  input_fmts)
static

◆ twoxsai_generic_packets()

static void twoxsai_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:

◆ twoxsai_generic_rgb565()

static void twoxsai_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:

◆ twoxsai_generic_threads()

static unsigned twoxsai_generic_threads ( void data)
static

◆ twoxsai_generic_xrgb8888()

static void twoxsai_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:

◆ twoxsai_work_cb_rgb565()

static void twoxsai_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:

◆ twoxsai_work_cb_xrgb8888()

static void twoxsai_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

◆ twoxsai_generic

const struct softfilter_implementation twoxsai_generic
static
Initial value:
= {
"2xSaI",
"2xsai",
}
static unsigned twoxsai_generic_input_fmts(void)
Definition: 2xsai.c:49
static void twoxsai_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: 2xsai.c:323
static unsigned twoxsai_generic_threads(void *data)
Definition: 2xsai.c:59
#define SOFTFILTER_API_VERSION
Definition: softfilter.h:96
static unsigned twoxsai_generic_output_fmts(unsigned input_fmts)
Definition: 2xsai.c:54
static void twoxsai_generic_destroy(void *data)
Definition: 2xsai.c:97
static void * twoxsai_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: 2xsai.c:65
static void twoxsai_generic_output(void *data, unsigned *out_width, unsigned *out_height, unsigned width, unsigned height)
Definition: 2xsai.c:89