MythTV  master
Macros | Functions | Variables
filters.c File Reference
#include "filters.h"
#include "graphic.h"
#include "goom_tools.h"
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <inttypes.h>
#include "altivec.h"
Include dependency graph for filters.c:

Go to the source code of this file.

Macros

#define USE_ASM
 
#define USE_ASM
 
#define EFFECT_DISTORS   4
 
#define EFFECT_DISTORS_SL   2
 
#define BUFFPOINTNB   16
 
#define BUFFPOINTMASK   0xffff
 
#define BUFFINCR   0xff
 
#define sqrtperte   16
 
#define PERTEMASK   0xf
 
#define PERTEDEC   4
 
#define ShiftRight(_x, _s)   (((_x)<0) ? -(-(_x)>>(_s)) : ((_x)>>(_s)))
 
#define INTERLACE_INCR   16
 
#define INTERLACE_ADD   9
 
#define INTERLACE_AND   0xf
 

Functions

void c_zoom (unsigned int *expix1, unsigned int *expix2, unsigned int prevX, unsigned int prevY, const signed int *brutS, const signed int *brutD)
 
static void select_zoom_filter (void)
 
void zoom_filter_xmmx (int prevX, int prevY, unsigned int *expix1, unsigned int *expix2, int *brutS, int *brutD, int buffratio, int precalCoef[16][16])
 
int zoom_filter_xmmx_supported (void)
 
void zoom_filter_mmx (int prevX, int prevY, unsigned int *expix1, unsigned int *expix2, int *brutS, int *brutD, int buffratio, int precalCoef[16][16])
 
int zoom_filter_mmx_supported (void)
 
const void ppc_zoom (unsigned int *frompixmap, unsigned int *topixmap, unsigned int sizex, unsigned int sizey, unsigned int *brutS, unsigned int *brutD, unsigned int buffratio, int precalCoef[16][16])
 
void generatePrecalCoef (void)
 
void calculatePXandPY (int x, int y, int *px, int *py)
 
void setPixelRGB (Uint *buffer, Uint x, Uint y, Color c)
 
void setPixelRGB_ (Uint *buffer, Uint x, Color c)
 
void getPixelRGB (const Uint *buffer, Uint x, Uint y, Color *c)
 
void getPixelRGB_ (const Uint *buffer, Uint x, Color *c)
 
void setAsmUse (int useIt)
 
int getAsmUse (void)
 
void zoomFilterFastRGB (Uint *pix1, Uint *pix2, ZoomFilterData *zf, Uint resx, Uint resy, int switchIncr, float switchMult)
 
void pointFilter (Uint *pix1, Color c, float t1, float t2, float t3, float t4, Uint cycle)
 

Variables

volatile guint32 resolx
 
volatile guint32 c_resoly
 
static int zf_use_xmmx = 0
 
static int zf_use_mmx = 0
 
guint32 mmx_zoom_size
 
unsigned int useAltivec
 
unsigned int * coeffs = 0
 
unsigned int * freecoeffs = 0
 
signed int * brutS = 0
 
signed int * freebrutS = 0
 
signed int * brutD = 0
 
signed int * freebrutD = 0
 
signed int * brutT = 0
 
signed int * freebrutT = 0
 
guint32expix1 = 0
 
guint32expix2 = 0
 
guint32 zoom_width
 
unsigned int prevX = 0
 
unsigned int prevY = 0
 
static int sintable [0x10000]
 
static int vitesse = 127
 
static char theMode = AMULETTE_MODE
 
static int waveEffect = 0
 
static int hypercosEffect = 0
 
static int vPlaneEffect = 0
 
static int hPlaneEffect = 0
 
static char noisify = 2
 
static int middleX
 
static int middleY
 
int buffratio = 0
 modif by jeko : fixedpoint : buffration = (16:16) (donc 0<=buffration<=2^16) More...
 
static int * firedec = 0
 
int precalCoef [16][16]
 modif d'optim by Jeko : precalcul des 4 coefs résultant des 2 pos More...
 
static int use_asm = 1
 

Macro Definition Documentation

◆ USE_ASM [1/2]

#define USE_ASM

Definition at line 27 of file filters.c.

◆ USE_ASM [2/2]

#define USE_ASM

Definition at line 27 of file filters.c.

◆ EFFECT_DISTORS

#define EFFECT_DISTORS   4

Definition at line 30 of file filters.c.

◆ EFFECT_DISTORS_SL

#define EFFECT_DISTORS_SL   2

Definition at line 31 of file filters.c.

◆ BUFFPOINTNB

#define BUFFPOINTNB   16

Definition at line 127 of file filters.c.

◆ BUFFPOINTMASK

#define BUFFPOINTMASK   0xffff

Definition at line 128 of file filters.c.

◆ BUFFINCR

#define BUFFINCR   0xff

Definition at line 129 of file filters.c.

◆ sqrtperte

#define sqrtperte   16

Definition at line 131 of file filters.c.

◆ PERTEMASK

#define PERTEMASK   0xf

Definition at line 133 of file filters.c.

◆ PERTEDEC

#define PERTEDEC   4

Definition at line 135 of file filters.c.

◆ ShiftRight

#define ShiftRight (   _x,
  _s 
)    (((_x)<0) ? -(-(_x)>>(_s)) : ((_x)>>(_s)))

Definition at line 141 of file filters.c.

◆ INTERLACE_INCR

#define INTERLACE_INCR   16

◆ INTERLACE_ADD

#define INTERLACE_ADD   9

◆ INTERLACE_AND

#define INTERLACE_AND   0xf

Function Documentation

◆ c_zoom()

void c_zoom ( unsigned int *  expix1,
unsigned int *  expix2,
unsigned int  prevX,
unsigned int  prevY,
const signed int *  brutS,
const signed int *  brutD 
)

Definition at line 409 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ select_zoom_filter()

static void select_zoom_filter ( void  )
static

Definition at line 51 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ zoom_filter_xmmx()

void zoom_filter_xmmx ( int  prevX,
int  prevY,
unsigned int *  expix1,
unsigned int *  expix2,
int *  brutS,
int *  brutD,
int  buffratio,
int  precalCoef[16][16] 
)

Definition at line 34 of file zoom_filter_xmmx.c.

Referenced by zoomFilterFastRGB().

◆ zoom_filter_xmmx_supported()

int zoom_filter_xmmx_supported ( void  )

Definition at line 30 of file zoom_filter_xmmx.c.

Referenced by select_zoom_filter().

◆ zoom_filter_mmx()

void zoom_filter_mmx ( int  prevX,
int  prevY,
unsigned int *  expix1,
unsigned int *  expix2,
int *  brutS,
int *  brutD,
int  buffratio,
int  precalCoef[16][16] 
)

Referenced by zoomFilterFastRGB().

◆ zoom_filter_mmx_supported()

int zoom_filter_mmx_supported ( void  )

Definition at line 20 of file zoom_filter_mmx.c.

Referenced by select_zoom_filter().

◆ ppc_zoom()

const void ppc_zoom ( unsigned int *  frompixmap,
unsigned int *  topixmap,
unsigned int  sizex,
unsigned int  sizey,
unsigned int *  brutS,
unsigned int *  brutD,
unsigned int  buffratio,
int  precalCoef[16][16] 
)

Referenced by zoomFilterFastRGB().

◆ generatePrecalCoef()

void generatePrecalCoef ( void  )

Definition at line 155 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ calculatePXandPY()

void calculatePXandPY ( int  x,
int  y,
int *  px,
int *  py 
)

Definition at line 204 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ setPixelRGB()

void setPixelRGB ( Uint buffer,
Uint  x,
Uint  y,
Color  c 
)

Definition at line 330 of file filters.c.

Referenced by pointFilter().

◆ setPixelRGB_()

void setPixelRGB_ ( Uint buffer,
Uint  x,
Color  c 
)

Definition at line 346 of file filters.c.

Referenced by c_zoom().

◆ getPixelRGB()

void getPixelRGB ( const Uint buffer,
Uint  x,
Uint  y,
Color c 
)
inline

Definition at line 361 of file filters.c.

◆ getPixelRGB_()

void getPixelRGB_ ( const Uint buffer,
Uint  x,
Color c 
)

Definition at line 382 of file filters.c.

Referenced by c_zoom().

◆ setAsmUse()

void setAsmUse ( int  useIt)

Definition at line 487 of file filters.c.

◆ getAsmUse()

int getAsmUse ( void  )

Definition at line 493 of file filters.c.

◆ zoomFilterFastRGB()

void zoomFilterFastRGB ( Uint pix1,
Uint pix2,
ZoomFilterData zf,
Uint  resx,
Uint  resy,
int  switchIncr,
float  switchMult 
)

Definition at line 501 of file filters.c.

Referenced by goom_update().

◆ pointFilter()

void pointFilter ( Uint pix1,
Color  c,
float  t1,
float  t2,
float  t3,
float  t4,
Uint  cycle 
)

Definition at line 743 of file filters.c.

Referenced by goom_update().

Variable Documentation

◆ resolx

volatile guint32 resolx

Definition at line 65 of file goom_core.c.

Referenced by getPixelRGB(), getPixelRGB_(), pointFilter(), setPixelRGB(), and setPixelRGB_().

◆ c_resoly

volatile guint32 c_resoly

Definition at line 65 of file goom_core.c.

Referenced by calculatePXandPY(), getPixelRGB(), getPixelRGB_(), pointFilter(), and setPixelRGB_().

◆ zf_use_xmmx

int zf_use_xmmx = 0
static

Definition at line 48 of file filters.c.

Referenced by select_zoom_filter(), and zoomFilterFastRGB().

◆ zf_use_mmx

int zf_use_mmx = 0
static

Definition at line 49 of file filters.c.

Referenced by select_zoom_filter(), and zoomFilterFastRGB().

◆ mmx_zoom_size

guint32 mmx_zoom_size

Definition at line 82 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ useAltivec

unsigned int useAltivec

◆ coeffs

unsigned int* coeffs = 0

Definition at line 96 of file filters.c.

Referenced by zoom_filter_mmx().

◆ freecoeffs

unsigned int * freecoeffs = 0

Definition at line 96 of file filters.c.

◆ brutS

signed int* brutS = 0

Definition at line 98 of file filters.c.

Referenced by zoom_filter_mmx(), zoom_filter_xmmx(), and zoomFilterFastRGB().

◆ freebrutS

signed int * freebrutS = 0

Definition at line 98 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ brutD

signed int* brutD = 0

Definition at line 99 of file filters.c.

Referenced by zoom_filter_mmx(), zoom_filter_xmmx(), and zoomFilterFastRGB().

◆ freebrutD

signed int * freebrutD = 0

Definition at line 99 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ brutT

signed int* brutT = 0

Definition at line 100 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ freebrutT

signed int * freebrutT = 0

Definition at line 100 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ expix1

guint32* expix1 = 0

Definition at line 103 of file filters.c.

Referenced by zoom_filter_mmx(), zoom_filter_xmmx(), and zoomFilterFastRGB().

◆ expix2

guint32* expix2 = 0

Definition at line 104 of file filters.c.

Referenced by zoom_filter_mmx(), zoom_filter_xmmx(), and zoomFilterFastRGB().

◆ zoom_width

guint32 zoom_width

Definition at line 107 of file filters.c.

Referenced by zoomFilterFastRGB().

◆ prevX

unsigned int prevX = 0

Definition at line 109 of file filters.c.

Referenced by zoom_filter_mmx(), zoom_filter_xmmx(), and zoomFilterFastRGB().

◆ prevY

unsigned int prevY = 0

◆ sintable

int sintable[0x10000]
static

Definition at line 111 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ vitesse

int vitesse = 127
static

Definition at line 112 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ theMode

char theMode = AMULETTE_MODE
static

Definition at line 113 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ waveEffect

int waveEffect = 0
static

Definition at line 114 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ hypercosEffect

int hypercosEffect = 0
static

Definition at line 115 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ vPlaneEffect

int vPlaneEffect = 0
static

Definition at line 116 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ hPlaneEffect

int hPlaneEffect = 0
static

Definition at line 117 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ noisify

char noisify = 2
static

Definition at line 118 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ middleX

int middleX
static

Definition at line 119 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ middleY

int middleY
static

Definition at line 119 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ buffratio

int buffratio = 0

modif by jeko : fixedpoint : buffration = (16:16) (donc 0<=buffration<=2^16)

Definition at line 125 of file filters.c.

Referenced by c_zoom(), zoom_filter_mmx(), zoom_filter_xmmx(), and zoomFilterFastRGB().

◆ firedec

int* firedec = 0
static

Definition at line 137 of file filters.c.

Referenced by calculatePXandPY(), and zoomFilterFastRGB().

◆ precalCoef

int precalCoef[16][16]

modif d'optim by Jeko : precalcul des 4 coefs résultant des 2 pos

Definition at line 144 of file filters.c.

Referenced by c_zoom(), generatePrecalCoef(), zoom_filter_mmx(), zoom_filter_xmmx(), and zoomFilterFastRGB().

◆ use_asm

int use_asm = 1
static

Definition at line 485 of file filters.c.

Referenced by getAsmUse(), and setAsmUse().