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

Data Structures

struct  volnorm_parameters_s
 
struct  post_plugin_volnorm_s
 

Macros

#define NSAMPLES   128
 
#define MIN_SAMPLE_SIZE   32000
 
#define MUL_INIT   1.0
 
#define MUL_MIN   0.1
 
#define MUL_MAX   5.0
 
#define MID_S16   (SHRT_MAX * 0.25)
 
#define MID_FLOAT   (INT_MAX * 0.25)
 
#define SIL_S16   (SHRT_MAX * 0.01)
 
#define SIL_FLOAT   (INT_MAX * 0.01)
 
#define SMOOTH_MUL   0.06
 
#define SMOOTH_LASTAVG   0.06
 
#define clamp(a, min, max)   (((a)>(max))?(max):(((a)<(min))?(min):(a)))
 

Typedefs

typedef struct post_plugin_volnorm_s post_plugin_volnorm_t
 
typedef struct volnorm_parameters_s volnorm_parameters_t
 

Functions

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 int volnorm_port_open (xine_audio_port_t *port_gen, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode)
 
static void volnorm_port_close (xine_audio_port_t *port_gen, xine_stream_t *stream)
 
static void method1_int16 (post_plugin_volnorm_t *this, audio_buffer_t *buf)
 
static void method1_float (post_plugin_volnorm_t *this, audio_buffer_t *buf)
 
static void method2_int16 (post_plugin_volnorm_t *this, audio_buffer_t *buf)
 
static void method2_float (post_plugin_volnorm_t *this, audio_buffer_t *buf)
 
static void volnorm_port_put_buffer (xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
 
static void volnorm_dispose (post_plugin_t *this_gen)
 
static post_plugin_tvolnorm_open_plugin (post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target)
 
void * volnorm_init_plugin (xine_t *xine, const void *data)
 

Macro Definition Documentation

◆ clamp

#define clamp ( a,
min,
max )   (((a)>(max))?(max):(((a)<(min))?(min):(a)))

◆ MID_FLOAT

#define MID_FLOAT   (INT_MAX * 0.25)

Referenced by method1_float(), and method2_float().

◆ MID_S16

#define MID_S16   (SHRT_MAX * 0.25)

◆ MIN_SAMPLE_SIZE

#define MIN_SAMPLE_SIZE   32000

Referenced by method2_float(), and method2_int16().

◆ MUL_INIT

#define MUL_INIT   1.0

Referenced by volnorm_open_plugin().

◆ MUL_MAX

#define MUL_MAX   5.0

◆ MUL_MIN

#define MUL_MIN   0.1

◆ NSAMPLES

#define NSAMPLES   128

Referenced by method2_float(), and method2_int16().

◆ SIL_FLOAT

#define SIL_FLOAT   (INT_MAX * 0.01)

Referenced by method1_float(), and method2_float().

◆ SIL_S16

#define SIL_S16   (SHRT_MAX * 0.01)

Referenced by method1_int16(), and method2_int16().

◆ SMOOTH_LASTAVG

#define SMOOTH_LASTAVG   0.06

Referenced by method1_float(), and method1_int16().

◆ SMOOTH_MUL

#define SMOOTH_MUL   0.06

Referenced by method1_float(), and method1_int16().

Typedef Documentation

◆ post_plugin_volnorm_t

◆ volnorm_parameters_t

Function Documentation

◆ get_help()

static char * get_help ( void )
static

References _.

Referenced by volnorm_open_plugin().

◆ get_param_descr()

static xine_post_api_descr_t * get_param_descr ( void )
static

Referenced by volnorm_open_plugin().

◆ get_parameters()

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

◆ method1_float()

static void method1_float ( post_plugin_volnorm_t * this,
audio_buffer_t * buf )
static

◆ method1_int16()

static void method1_int16 ( post_plugin_volnorm_t * this,
audio_buffer_t * buf )
static

◆ method2_float()

static void method2_float ( post_plugin_volnorm_t * this,
audio_buffer_t * buf )
static

◆ method2_int16()

static void method2_int16 ( post_plugin_volnorm_t * this,
audio_buffer_t * buf )
static

◆ set_parameters()

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

◆ volnorm_dispose()

static void volnorm_dispose ( post_plugin_t * this_gen)
static

References _x_post_dispose().

Referenced by volnorm_open_plugin().

◆ volnorm_init_plugin()

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

◆ volnorm_open_plugin()

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

◆ volnorm_port_close()

static void volnorm_port_close ( xine_audio_port_t * port_gen,
xine_stream_t * stream )
static

◆ volnorm_port_open()

static int volnorm_port_open ( xine_audio_port_t * port_gen,
xine_stream_t * stream,
uint32_t bits,
uint32_t rate,
int mode )
static

◆ volnorm_port_put_buffer()

static void volnorm_port_put_buffer ( xine_audio_port_t * port_gen,
audio_buffer_t * buf,
xine_stream_t * stream )
static