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

Classes

struct  softfilter_thread_data
 
struct  filter_data
 

Macros

#define PHOSPHOR2X_SCALE   2
 
#define clamp8(x)   ((x) > 255 ? 255 : ((x < 0) ? 0 : (uint32_t)x))
 
#define clamp6(x)   ((x) > 63 ? 63 : ((x < 0) ? 0 : (uint32_t)x))
 
#define red_rgb565(x)   (((x) >> 10) & 0x3e)
 
#define green_rgb565(x)   (((x) >> 5) & 0x3f)
 
#define blue_rgb565(x)   (((x) << 1) & 0x3e)
 
#define red_xrgb8888(x)   (((x) >> 16) & 0xff)
 
#define green_xrgb8888(x)   (((x) >> 8) & 0xff)
 
#define blue_xrgb8888(x)   (((x) >> 0) & 0xff)
 
#define set_red_rgb565(var, x)   (var = ((var) & 0x07FF) | ((x&0x3e) << 10))
 
#define set_green_rgb565(var, x)   (var = ((var) & 0xF81F) | ((x&0x3f) << 5))
 
#define set_blue_rgb565(var, x)   (var = ((var) & 0xFFE0) | ((x&0x3e) >> 1))
 
#define set_red_xrgb8888(var, x)   (var = ((var) & 0x00ffff) | ((x) << 16))
 
#define set_green_xrgb8888(var, x)   (var = ((var) & 0xff00ff) | ((x) << 8))
 
#define set_blue_xrgb8888(var, x)   (var = ((var) & 0xffff00) | ((x) << 0))
 
#define blend_pixels_xrgb8888(a, b)   (((a >> 1) & 0x7f7f7f7f) + ((b >> 1) & 0x7f7f7f7f))
 
#define blend_pixels_rgb565(a, b)   (((a&0xF7DE) >> 1) + ((b&0xF7DE) >> 1))
 

Functions

static INLINE unsigned max_component_xrgb8888 (uint32_t color)
 
static INLINE unsigned max_component_rgb565 (uint32_t color)
 
static void blit_linear_line_xrgb8888 (uint32_t *out, const uint32_t *in, unsigned width)
 
static void blit_linear_line_rgb565 (uint16_t *out, const uint16_t *in, unsigned width)
 
static void bleed_phosphors_xrgb8888 (void *data, uint32_t *scanline, unsigned width)
 
static void bleed_phosphors_rgb565 (void *data, uint16_t *scanline, unsigned width)
 
static unsigned phosphor2x_generic_input_fmts (void)
 
static unsigned phosphor2x_generic_output_fmts (unsigned input_fmts)
 
static unsigned phosphor2x_generic_threads (void *data)
 
static voidphosphor2x_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 phosphor2x_generic_output (void *data, unsigned *out_width, unsigned *out_height, unsigned width, unsigned height)
 
static void phosphor2x_generic_destroy (void *data)
 
static void phosphor2x_generic_xrgb8888 (void *data, unsigned width, unsigned height, int first, int last, uint32_t *src, unsigned src_stride, uint32_t *dst, unsigned dst_stride)
 
static void phosphor2x_generic_rgb565 (void *data, unsigned width, unsigned height, int first, int last, uint16_t *src, unsigned src_stride, uint16_t *dst, unsigned dst_stride)
 
static void phosphor2x_work_cb_xrgb8888 (void *data, void *thread_data)
 
static void phosphor2x_work_cb_rgb565 (void *data, void *thread_data)
 
static void phosphor2x_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 phosphor2x_generic
 

Macro Definition Documentation

◆ blend_pixels_rgb565

#define blend_pixels_rgb565 (   a,
  b 
)    (((a&0xF7DE) >> 1) + ((b&0xF7DE) >> 1))

◆ blend_pixels_xrgb8888

#define blend_pixels_xrgb8888 (   a,
  b 
)    (((a >> 1) & 0x7f7f7f7f) + ((b >> 1) & 0x7f7f7f7f))

◆ blue_rgb565

#define blue_rgb565 (   x)    (((x) << 1) & 0x3e)

◆ blue_xrgb8888

#define blue_xrgb8888 (   x)    (((x) >> 0) & 0xff)

◆ clamp6

#define clamp6 (   x)    ((x) > 63 ? 63 : ((x < 0) ? 0 : (uint32_t)x))

◆ clamp8

#define clamp8 (   x)    ((x) > 255 ? 255 : ((x < 0) ? 0 : (uint32_t)x))

◆ green_rgb565

#define green_rgb565 (   x)    (((x) >> 5) & 0x3f)

◆ green_xrgb8888

#define green_xrgb8888 (   x)    (((x) >> 8) & 0xff)

◆ PHOSPHOR2X_SCALE

#define PHOSPHOR2X_SCALE   2

◆ red_rgb565

#define red_rgb565 (   x)    (((x) >> 10) & 0x3e)

◆ red_xrgb8888

#define red_xrgb8888 (   x)    (((x) >> 16) & 0xff)

◆ set_blue_rgb565

#define set_blue_rgb565 (   var,
  x 
)    (var = ((var) & 0xFFE0) | ((x&0x3e) >> 1))

◆ set_blue_xrgb8888

#define set_blue_xrgb8888 (   var,
  x 
)    (var = ((var) & 0xffff00) | ((x) << 0))

◆ set_green_rgb565

#define set_green_rgb565 (   var,
  x 
)    (var = ((var) & 0xF81F) | ((x&0x3f) << 5))

◆ set_green_xrgb8888

#define set_green_xrgb8888 (   var,
  x 
)    (var = ((var) & 0xff00ff) | ((x) << 8))

◆ set_red_rgb565

#define set_red_rgb565 (   var,
  x 
)    (var = ((var) & 0x07FF) | ((x&0x3e) << 10))

◆ set_red_xrgb8888

#define set_red_xrgb8888 (   var,
  x 
)    (var = ((var) & 0x00ffff) | ((x) << 16))

Function Documentation

◆ bleed_phosphors_rgb565()

static void bleed_phosphors_rgb565 ( void data,
uint16_t scanline,
unsigned  width 
)
static
Here is the caller graph for this function:

◆ bleed_phosphors_xrgb8888()

static void bleed_phosphors_xrgb8888 ( void data,
uint32_t scanline,
unsigned  width 
)
static
Here is the caller graph for this function:

◆ blit_linear_line_rgb565()

static void blit_linear_line_rgb565 ( uint16_t out,
const uint16_t in,
unsigned  width 
)
static
Here is the caller graph for this function:

◆ blit_linear_line_xrgb8888()

static void blit_linear_line_xrgb8888 ( uint32_t out,
const uint32_t in,
unsigned  width 
)
static
Here is the caller graph for this function:

◆ max_component_rgb565()

static INLINE unsigned max_component_rgb565 ( uint32_t  color)
static
Here is the caller graph for this function:

◆ max_component_xrgb8888()

static INLINE unsigned max_component_xrgb8888 ( uint32_t  color)
static
Here is the caller graph for this function:

◆ phosphor2x_generic_create()

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

◆ phosphor2x_generic_destroy()

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

◆ phosphor2x_generic_input_fmts()

static unsigned phosphor2x_generic_input_fmts ( void  )
static

◆ phosphor2x_generic_output()

static void phosphor2x_generic_output ( void data,
unsigned *  out_width,
unsigned *  out_height,
unsigned  width,
unsigned  height 
)
static
Here is the call graph for this function:

◆ phosphor2x_generic_output_fmts()

static unsigned phosphor2x_generic_output_fmts ( unsigned  input_fmts)
static

◆ phosphor2x_generic_packets()

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

◆ phosphor2x_generic_rgb565()

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

◆ phosphor2x_generic_threads()

static unsigned phosphor2x_generic_threads ( void data)
static

◆ phosphor2x_generic_xrgb8888()

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

◆ phosphor2x_work_cb_rgb565()

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

◆ phosphor2x_work_cb_xrgb8888()

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

◆ softfilter_get_implementation()

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

Variable Documentation

◆ phosphor2x_generic

const struct softfilter_implementation phosphor2x_generic
static
Initial value:
= {
"Phosphor2x",
"phosphor2x",
}
static unsigned phosphor2x_generic_threads(void *data)
Definition: phosphor2x.c:225
#define SOFTFILTER_API_VERSION
Definition: softfilter.h:96
static void phosphor2x_generic_output(void *data, unsigned *out_width, unsigned *out_height, unsigned width, unsigned height)
Definition: phosphor2x.c:292
static void phosphor2x_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: phosphor2x.c:438
static unsigned phosphor2x_generic_input_fmts(void)
Definition: phosphor2x.c:215
static unsigned phosphor2x_generic_output_fmts(unsigned input_fmts)
Definition: phosphor2x.c:220
static void phosphor2x_generic_destroy(void *data)
Definition: phosphor2x.c:301
static void * phosphor2x_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: phosphor2x.c:231