xine-lib 1.2.13-20230125hg15249
Data Structures | Macros | Typedefs | Functions | Variables
noise.c File Reference
#include "planar.h"
#include <xine/xine_internal.h>
#include <xine/post.h>
#include <xine/xineutils.h>
#include <math.h>
#include <pthread.h>

Data Structures

struct  noise_param_t
 
struct  noise_parameters_s
 

Macros

#define MAX_NOISE   4096
 
#define MAX_SHIFT   1024
 
#define MAX_RES   (MAX_NOISE-MAX_SHIFT)
 
#define RAND_N(range)   ((int) ((double)range*rand()/(RAND_MAX+1.0)))
 

Typedefs

typedef struct noise_param_t noise_param_t
 
typedef struct post_plugin_noise_s post_plugin_noise_t
 
typedef struct noise_parameters_s noise_parameters_t
 

Functions

static int8_t * initNoise (noise_param_t *fp)
 
static void lineNoise_C (uint8_t *dst, const uint8_t *src, const int8_t *noise, int len, int shift)
 
static void lineNoiseAvg_C (uint8_t *dst, const uint8_t *src, int len, int8_t **shift)
 
static void noise (uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int width, int height, noise_param_t *fp)
 
 PARAM_ITEM (PARAM_ITEM(POST_PARAM_TYPE_INT, luma_strength, PARAM_ITEM(NULL, PARAM_ITEM(0, PARAM_ITEM(100, PARAM_ITEM(0, "Amount of noise to add to luma channel")
 
static int set_parameters (xine_post_t *this_gen, const void *param_gen)
 
static int get_parameters (xine_post_t *this_gen, void *param_gen)
 
static xine_post_api_descr_tget_param_descr (void)
 
static char * get_help (void)
 
static void noise_dispose (post_plugin_t *this_gen)
 
static int noise_intercept_frame (post_video_port_t *port, vo_frame_t *frame)
 
static int noise_draw (vo_frame_t *frame, xine_stream_t *stream)
 
static post_plugin_tnoise_open_plugin (post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target)
 
void * noise_init_plugin (xine_t *xine, const void *data)
 

Variables

static int nonTempRandShift [(4096 - 1024)] = {-1}
 
static const int patt [4]
 
static const char *const enum_types [] = {"uniform", "gaussian", NULL}
 
static const char *const enum_quality [] = {"fixed", "temporal", "averaged temporal", NULL}
 

Macro Definition Documentation

◆ MAX_NOISE

#define MAX_NOISE   4096

Referenced by initNoise().

◆ MAX_RES

#define MAX_RES   (MAX_NOISE-MAX_SHIFT)

Referenced by initNoise().

◆ MAX_SHIFT

#define MAX_SHIFT   1024

Referenced by initNoise(), and noise().

◆ RAND_N

#define RAND_N ( range)    ((int) ((double)range*rand()/(RAND_MAX+1.0)))

Referenced by initNoise().

Typedef Documentation

◆ noise_param_t

typedef struct noise_param_t noise_param_t

◆ noise_parameters_t

◆ post_plugin_noise_t

typedef struct post_plugin_noise_s post_plugin_noise_t

Function Documentation

◆ get_help()

static char * get_help ( void )
static

References _.

Referenced by noise_open_plugin().

◆ get_param_descr()

static xine_post_api_descr_t * get_param_descr ( void )
static

Referenced by noise_open_plugin().

◆ get_parameters()

static int get_parameters ( xine_post_t * this_gen,
void * param_gen )
static

◆ initNoise()

static int8_t * initNoise ( noise_param_t * fp)
static

◆ lineNoise_C()

static void lineNoise_C ( uint8_t * dst,
const uint8_t * src,
const int8_t * noise,
int len,
int shift )
inlinestatic

References noise(), and v.

Referenced by noise_open_plugin().

◆ lineNoiseAvg_C()

static void lineNoiseAvg_C ( uint8_t * dst,
const uint8_t * src,
int len,
int8_t ** shift )
inlinestatic

Referenced by noise_open_plugin().

◆ noise()

static void noise ( uint8_t * dst,
const uint8_t * src,
int dstStride,
int srcStride,
int width,
int height,
noise_param_t * fp )
static

◆ noise_dispose()

static void noise_dispose ( post_plugin_t * this_gen)
static

◆ noise_draw()

static int noise_draw ( vo_frame_t * frame,
xine_stream_t * stream )
static

◆ noise_init_plugin()

void * noise_init_plugin ( xine_t * xine,
const void * data )

◆ noise_intercept_frame()

static int noise_intercept_frame ( post_video_port_t * port,
vo_frame_t * frame )
static

◆ noise_open_plugin()

static post_plugin_t * noise_open_plugin ( post_class_t * class_gen,
int inputs,
xine_audio_port_t ** audio_target,
xine_video_port_t ** video_target )
static

◆ PARAM_ITEM()

PARAM_ITEM ( PARAM_ITEM( POST_PARAM_TYPE_INT,
luma_strength ,
PARAM_ITEM( NULL,
PARAM_ITEM( 0,
PARAM_ITEM( 100,
PARAM_ITEM( 0,
"Amount of noise to add to luma channel"  )

◆ set_parameters()

static int set_parameters ( xine_post_t * this_gen,
const void * param_gen )
static

Variable Documentation

◆ enum_quality

const char* const enum_quality[] = {"fixed", "temporal", "averaged temporal", NULL}
static

◆ enum_types

const char* const enum_types[] = {"uniform", "gaussian", NULL}
static

◆ nonTempRandShift

int nonTempRandShift[(4096 - 1024)] = {-1}
static

Referenced by initNoise(), and noise().

◆ patt

const int patt[4]
static
Initial value:
= {
-1,0,1,0
}

Referenced by initNoise().