xine-lib  1.2.10
window.h
Go to the documentation of this file.
1 /*=============================================================================
2  *
3  * This software has been released under the terms of the GNU Public
4  * license. See http://www.gnu.org/copyleft/gpl.html for details.
5  *
6  * Copyright 2001 Anders Johansson ajh@atri.curtin.edu.au
7  *
8  *=============================================================================
9  */
10 
11 /* Calculates a number of window functions. The following window
12  * functions are currently implemented: Boxcar, Triang, Hanning,
13  * Hamming, Blackman, Flattop and Kaiser. In the function call n is
14  * the number of filter taps and w the buffer in which the filter
15  * coefficients will be stored.
16  */
17 
18 #if !defined _DSP_H
19 # error "Never use <window.h> directly; include <dsp.h> instead"
20 #endif
21 
22 #ifndef _WINDOW_H
23 #define _WINDOW_H 1
24 
25 extern void boxcar(int n, _ftype_t* w);
26 extern void triang(int n, _ftype_t* w);
27 extern void hanning(int n, _ftype_t* w);
28 extern void hamming(int n,_ftype_t* w);
29 extern void blackman(int n,_ftype_t* w);
30 extern void flattop(int n,_ftype_t* w);
31 extern void kaiser(int n, _ftype_t* w,_ftype_t b);
32 
33 #endif
xine_s
Definition: xine_internal.h:80
_x_post_dec_usage
#define _x_post_dec_usage(port)
Definition: post.h:406
MUL_INIT
#define MUL_INIT
Definition: volnorm.c:57
xine_stream_s::xine
xine_t * xine
Definition: xine_internal.h:126
audio_buffer_s::num_frames
int num_frames
Definition: audio_out.h:150
method2_float
static void method2_float(post_plugin_volnorm_t *this, audio_buffer_t *buf)
Definition: volnorm.c:313
upmix_parameters_s::cut_off_freq
int cut_off_freq
Definition: upmix.c:78
post_plugin_volnorm_s::method
int method
Definition: volnorm.c:95
ao_format_s::mode
int mode
Definition: audio_out.h:137
START_PARAM_DESCR
#define START_PARAM_DESCR(param_t)
Definition: post.h:431
stretch_open_plugin
static post_plugin_t * stretch_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target)
Definition: stretch.c:600
post_in_s
Definition: post.h:134
xine_stream_s
Definition: xine_internal.h:123
hamming
void hamming(int n, _ftype_t *w)
metronom_clock_s::unregister_scr
void(* unregister_scr)(metronom_clock_t *self, scr_plugin_t *scr)
Definition: metronom.h:262
xine_post_api_t
Definition: xine.h:872
XINE_FINE_SPEED_NORMAL
#define XINE_FINE_SPEED_NORMAL
Definition: xine.h:372
XINE_MALLOC
#define XINE_MALLOC
Definition: attributes.h:139
PARAM_ITEM
PARAM_ITEM(POST_PARAM_TYPE_BOOL, preserve_pitch, PARAM_ITEM(NULL, PARAM_ITEM(0, 1, PARAM_ITEM(0, "Preserve pitch")
Definition: stretch.c:199
PARAM_ITEM
PARAM_ITEM(POST_PARAM_TYPE_INT, channel, NULL, -1, 5, 0, "Select channel to upmix (duplicate) to stereo") typedef struct post_plugin_upmix_mono_s post_plugin_upmix_mono_t
post_plugin_upmix_mono_s::channels
int channels
Definition: upmix_mono.c:63
scr_plugin_s
Definition: metronom.h:309
triang
void triang(int n, float *w)
Definition: window.c:50
_x_post_intercept_audio_port
post_audio_port_t * _x_post_intercept_audio_port(post_plugin_t *post, xine_audio_port_t *original, post_in_t **input, post_out_t **output)
Definition: post.c:993
xineutils.h
dsp.h
hanning
void hanning(int n, _ftype_t *w)
flattop
void flattop(int n, float *w)
Definition: window.c:129
stretchscr_s::scr
scr_plugin_t scr
Definition: stretch.c:51
set_parameters
static int set_parameters(xine_post_t *this_gen, const void *param_gen)
Definition: upmix.c:104
IIR
#define IIR(in, w, q, out)
Definition: upmix.c:67
xine_audio_port_s::close
void(* close)(xine_audio_port_t *self, xine_stream_t *stream)
Definition: audio_out.h:205
get_help
static char * get_help(void)
Definition: upmix.c:129
upmix_mono_parameters_s
Definition: upmix_mono.c:44
LOG_MODULE
#define LOG_MODULE
Definition: upmix_mono.c:33
kaiser
void kaiser(int n, float *w, float b)
Definition: window.c:192
stretch_parameters_t
struct stretch_parameters_s stretch_parameters_t
xine_list_push_back
void xine_list_push_back(xine_list_t *list, void *value)
Definition: list.c:162
post_plugin_upmix_mono_s::post
post_plugin_t post
Definition: upmix_mono.c:60
af_sub_s::w
float w[2][4]
Definition: upmix.c:60
xine_s::clock
metronom_clock_t * clock
Definition: xine_internal.h:97
AUDIO_FRAGMENT
#define AUDIO_FRAGMENT
Definition: stretch.c:38
stretchscr_s::stretch_factor
double * stretch_factor
Definition: stretch.c:57
upmix_mono_parameters_t
struct upmix_mono_parameters_s upmix_mono_parameters_t
stretchscr_get_priority
static int stretchscr_get_priority(scr_plugin_t *scr)
Definition: stretch.c:65
set_parameters
static int set_parameters(xine_post_t *this_gen, const void *param_gen)
Definition: stretch.c:235
post_audio_port_s::new_port
xine_audio_port_t new_port
Definition: post.h:302
upmix_mono_dispose
static void upmix_mono_dispose(post_plugin_t *this_gen)
Definition: upmix_mono.c:272
_x_extra_info_merge
void _x_extra_info_merge(extra_info_t *dst, extra_info_t *src)
Definition: xine.c:122
NSAMPLES
#define NSAMPLES
Definition: volnorm.c:48
upmix_port_put_buffer
static void upmix_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
Definition: upmix.c:283
stretch_init_plugin
void * stretch_init_plugin(xine_t *xine, const void *data)
Definition: stretch.c:655
MUL_MAX
#define MUL_MAX
Definition: volnorm.c:59
stretchscr_start
static void stretchscr_start(scr_plugin_t *scr, int64_t start_vpts)
Definition: stretch.c:121
audio_buffer_s::mem_size
int mem_size
Definition: audio_out.h:149
audio_buffer_s
Definition: audio_out.h:144
hanning
void hanning(int n, float *w)
Definition: window.c:71
metronom_clock_s::register_scr
int(* register_scr)(metronom_clock_t *self, scr_plugin_t *scr)
Definition: metronom.h:261
get_help
static char * get_help(void)
Definition: volnorm.c:140
_x_post_inc_usage
#define _x_post_inc_usage(port)
Definition: post.h:399
upmix_parameters_t
struct upmix_parameters_s upmix_parameters_t
af_sub_s
Definition: upmix.c:58
AO_CAP_MODE_STEREO
#define AO_CAP_MODE_STEREO
Definition: audio_out.h:283
volnorm_parameters_s::method
int method
Definition: volnorm.c:78
af_sub_s::k
float k
Definition: upmix.c:63
triang
void triang(int n, _ftype_t *w)
af_sub_s::q
float q[2][2]
Definition: upmix.c:61
post_plugin_upmix_mono_s
Definition: upmix_mono.c:59
post_plugin_volnorm_s::lastavg
float lastavg
Definition: volnorm.c:98
xine_video_port_s
Definition: video_out.h:176
post_plugin_upmix_t
struct post_plugin_upmix_s post_plugin_upmix_t
Definition: upmix.c:42
AO_CAP_MODE_5_1CHANNEL
#define AO_CAP_MODE_5_1CHANNEL
Definition: audio_out.h:297
post_class_s
Definition: post.h:45
xine_post_api_descr_t
Definition: xine.h:867
stretchscr_init
static stretchscr_t * stretchscr_init(double *stretch_factor)
Definition: stretch.c:161
POST_PARAM_TYPE_BOOL
#define POST_PARAM_TYPE_BOOL
Definition: xine.h:904
stretchscr_adjust
static void stretchscr_adjust(scr_plugin_t *scr, int64_t vpts)
Definition: stretch.c:107
post_audio_port_s::stream
xine_stream_t * stream
Definition: post.h:309
audio_buffer_s::mem
int16_t * mem
Definition: audio_out.h:148
set_parameters
static int set_parameters(xine_post_t *this_gen, const void *param_gen)
Definition: volnorm.c:111
audio_buffer_s::first_access_unit
uint32_t first_access_unit
Definition: audio_out.h:154
upmix_mono_port_open
static int upmix_mono_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode)
Definition: upmix_mono.c:113
_x_ao_mode2channels
int _x_ao_mode2channels(int mode)
Definition: audio_out.c:1082
szxform
int szxform(const float *a, const float *b, float Q, float fc, float fs, float *k, float *coef)
Definition: filter.c:417
RESAMPLE_MAX_CHANNELS
#define RESAMPLE_MAX_CHANNELS
Definition: resample.h:31
upmix_mono_port_put_buffer
static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
Definition: upmix_mono.c:151
MID_FLOAT
#define MID_FLOAT
Definition: volnorm.c:62
stretchscr_s::cur_time
struct timeval cur_time
Definition: stretch.c:53
post_audio_port_s::original_port
xine_audio_port_t * original_port
Definition: post.h:305
ao_format_s::rate
uint32_t rate
Definition: audio_out.h:136
get_help
static char * get_help(void)
Definition: upmix_mono.c:101
stretchscr_s
Definition: stretch.c:50
AO_CAP_FLOAT32
#define AO_CAP_FLOAT32
Definition: audio_out.h:314
stretchscr_s::xine_speed
int xine_speed
Definition: stretch.c:55
xine_stream_s::metronom
metronom_t * metronom
Definition: xine_internal.h:129
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)
Definition: volnorm.c:394
volnorm_parameters_s
Definition: volnorm.c:77
stretch_dispose
static void stretch_dispose(post_plugin_t *this_gen)
Definition: stretch.c:590
NULL
NULL
Definition: xine_plugin.c:78
blackman
void blackman(int n, float *w)
Definition: window.c:109
Q
#define Q
Definition: upmix.c:45
upmix_dispose
static void upmix_dispose(post_plugin_t *this_gen)
Definition: upmix.c:354
post_plugin_stretch_t
struct post_plugin_stretch_s post_plugin_stretch_t
Definition: stretch.c:188
audio_buffer_s::extra_info
extra_info_t * extra_info
Definition: audio_out.h:157
upmix_frames_2to51_any_to_float
static int upmix_frames_2to51_any_to_float(uint8_t *dst8, uint8_t *src8, int num_frames, int step_channel_in, af_sub_t *sub)
Definition: upmix.c:204
XINE_VERBOSITY_LOG
#define XINE_VERBOSITY_LOG
Definition: xine.h:425
_x_audio_out_resample_mono
void _x_audio_out_resample_mono(int16_t *last_sample, int16_t *input_samples, uint32_t in_samples, int16_t *output_samples, uint32_t out_samples)
Definition: resample.c:32
method2_int16
static void method2_int16(post_plugin_volnorm_t *this, audio_buffer_t *buf)
Definition: volnorm.c:263
_x_freep
static void _x_freep(void *ptr)
Definition: xineutils.h:263
stretch_process_fragment
static void stretch_process_fragment(post_audio_port_t *port, xine_stream_t *stream, extra_info_t *extra_info)
Definition: stretch.c:323
stretchscr_s::speed_factor
double speed_factor
Definition: stretch.c:56
stretchscr_s::cur_pts
int64_t cur_pts
Definition: stretch.c:54
get_param_descr
static xine_post_api_descr_t * get_param_descr(void)
Definition: upmix_mono.c:97
post_out_s
Definition: post.h:146
POST_PARAM_TYPE_DOUBLE
#define POST_PARAM_TYPE_DOUBLE
Definition: xine.h:900
_
#define _(String)
Definition: vcdplayer.h:39
post_plugin_upmix_mono_s::lock
pthread_mutex_t lock
Definition: upmix_mono.c:68
post_plugin_volnorm_s
Definition: volnorm.c:88
stretch_parameters_s::preserve_pitch
int preserve_pitch
Definition: stretch.c:191
upmix_parameters_s
Definition: upmix.c:77
stretchscr_exit
static void stretchscr_exit(scr_plugin_t *scr)
Definition: stretch.c:154
post_class_s::open_plugin
post_plugin_t *(* open_plugin)(post_class_t *this_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target)
Definition: post.h:50
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)
Definition: volnorm.c:158
stretchscr_s::lock
pthread_mutex_t lock
Definition: stretch.c:59
SMOOTH_LASTAVG
#define SMOOTH_LASTAVG
Definition: volnorm.c:71
post_plugin_upmix_mono_s::params_changed
int params_changed
Definition: upmix_mono.c:66
_ftype_t
#define _ftype_t
Definition: dsp.h:17
clamp
#define clamp(a, min, max)
Definition: volnorm.c:73
method1_float
static void method1_float(post_plugin_volnorm_t *this, audio_buffer_t *buf)
Definition: volnorm.c:226
upmix_mono_open_plugin
static post_plugin_t * upmix_mono_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target)
Definition: upmix_mono.c:281
post_plugin_volnorm_s::idx
int idx
Definition: volnorm.c:100
audio_filters.h
CLIP_INT16
#define CLIP_INT16(s)
Definition: stretch.c:40
metronom_clock_s::get_current_time
int64_t(* get_current_time)(metronom_clock_t *self)
Definition: metronom.h:239
ngettext
#define ngettext(Singular, Plural, IsPlural)
Definition: xineintl.h:44
volnorm_port_close
static void volnorm_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream)
Definition: volnorm.c:175
PARAM_ITEM
#define PARAM_ITEM(param_type, var, enumv, min, max, readonly, descr)
Definition: post.h:439
volnorm_init_plugin
void * volnorm_init_plugin(xine_t *xine, const void *data)
Definition: volnorm.c:448
stretchscr_set_pivot
static void stretchscr_set_pivot(stretchscr_t *this)
Definition: stretch.c:71
avg
#define avg(predictor, i)
Definition: motion_comp.c:97
xine_audio_port_s::open
int(* open)(xine_audio_port_t *, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode)
Definition: audio_out.h:187
MID_S16
#define MID_S16
Definition: volnorm.c:61
get_param_descr
static xine_post_api_descr_t * get_param_descr(void)
Definition: upmix.c:125
post_audio_port_s::rate
uint32_t rate
Definition: post.h:318
xine_audio_port_s::get_buffer
audio_buffer_t *(* get_buffer)(xine_audio_port_t *)
Definition: audio_out.h:193
get_parameters
static int get_parameters(xine_post_t *this_gen, void *param_gen)
Definition: stretch.c:246
audio_buffer_s::vpts
int64_t vpts
Definition: audio_out.h:152
stretchscr_set_speed
static int stretchscr_set_speed(scr_plugin_t *scr, int speed)
Definition: stretch.c:92
_x_audio_out_resample_stereo
void _x_audio_out_resample_stereo(int16_t *last_sample, int16_t *input_samples, uint32_t in_samples, int16_t *output_samples, uint32_t out_samples)
Definition: resample.c:70
volnorm_dispose
static void volnorm_dispose(post_plugin_t *this_gen)
Definition: volnorm.c:383
upmix_open_plugin
static post_plugin_t * upmix_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target)
Definition: upmix.c:365
audio_buffer_s::format
ao_format_t format
Definition: audio_out.h:161
SMOOTH_MUL
#define SMOOTH_MUL
Definition: volnorm.c:70
post.h
upmix_mono_init_plugin
void * upmix_mono_init_plugin(xine_t *xine, const void *data)
Definition: upmix_mono.c:333
get_param_descr
static xine_post_api_descr_t * get_param_descr(void)
Definition: stretch.c:257
boxcar
void boxcar(int n, _ftype_t *w)
method1_int16
static void method1_int16(post_plugin_volnorm_t *this, audio_buffer_t *buf)
Definition: volnorm.c:184
BIZ_EPSILON
#define BIZ_EPSILON
Definition: window.c:146
get_parameters
static int get_parameters(xine_post_t *this_gen, void *param_gen)
Definition: upmix.c:114
get_parameters
static int get_parameters(xine_post_t *this_gen, void *param_gen)
Definition: volnorm.c:123
post_audio_port_s
Definition: post.h:299
xine_post_in_s::name
const char * name
Definition: xine.h:724
get_param_descr
static xine_post_api_descr_t * get_param_descr(void)
Definition: volnorm.c:135
END_PARAM_DESCR
#define END_PARAM_DESCR(name)
Definition: post.h:443
stretch_port_close
static void stretch_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream)
Definition: stretch.c:302
set_parameters
static int set_parameters(xine_post_t *this_gen, const void *param_gen)
Definition: upmix_mono.c:75
post_audio_port_s::mode
uint32_t mode
Definition: post.h:319
xine_audio_port_s
Definition: audio_out.h:172
mode
enable disable number of frames of telecine pattern sync required before mode change make frames evenly spaced for film mode(24 fps)" ) PARAM_ITEM( POST_PARAM_TYPE_BOOL
besselizero
static float besselizero(float x)
Definition: window.c:148
post_plugin_volnorm_s::mul
float mul
Definition: volnorm.c:96
hamming
void hamming(int n, float *w)
Definition: window.c:90
MIN_SAMPLE_SIZE
#define MIN_SAMPLE_SIZE
Definition: volnorm.c:53
SIL_S16
#define SIL_S16
Definition: volnorm.c:66
_x_post_dispose
int _x_post_dispose(post_plugin_t *this)
Definition: post.c:1044
resample.h
_x_post_init
void _x_post_init(post_plugin_t *post, int num_audio_inputs, int num_video_inputs)
Definition: post.c:292
xine_monotonic_clock
int xine_monotonic_clock(struct timeval *tv, struct timezone *tz)
Definition: utils.c:727
post_plugin_volnorm_s::post
post_plugin_t post
Definition: volnorm.c:89
MUL_MIN
#define MUL_MIN
Definition: volnorm.c:58
biquad_t
Definition: upmix.c:48
volnorm_port_put_buffer
static void volnorm_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
Definition: volnorm.c:360
volnorm_parameters_t
struct volnorm_parameters_s volnorm_parameters_t
blackman
void blackman(int n, _ftype_t *w)
boxcar
void boxcar(int n, float *w)
Definition: window.c:30
post_plugin_volnorm_s::avg
float avg
Definition: volnorm.c:102
xine_audio_port_s::put_buffer
void(* put_buffer)(xine_audio_port_t *, audio_buffer_t *buf, xine_stream_t *stream)
Definition: audio_out.h:200
af_sub_s::fc
float fc
Definition: upmix.c:62
kaiser
void kaiser(int n, _ftype_t *w, _ftype_t b)
extra_info_s
Structure to pass information from input or demuxer plugins to output frames (past decoder).
Definition: buffer.h:317
stretch_port_open
static int stretch_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode)
Definition: stretch.c:273
xine_internal.h
stretch_port_put_buffer
static void stretch_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
Definition: stretch.c:480
post_plugin_volnorm_s::len
int len
Definition: volnorm.c:103
metronom_s::set_audio_rate
void(* set_audio_rate)(metronom_t *self, int64_t pts_per_smpls)
Definition: metronom.h:79
config.h
xine_post_s
Definition: xine.h:667
flattop
void flattop(int n, _ftype_t *w)
upmix_port_open
static int upmix_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode)
Definition: upmix.c:145
XINE_SPEED_PAUSE
#define XINE_SPEED_PAUSE
Definition: xine.h:364
xine_post_in_s
Definition: xine.h:721
post_plugin_s
Definition: post.h:80
xine_audio_port_s::get_capabilities
uint32_t(* get_capabilities)(xine_audio_port_t *)
Definition: audio_out.h:173
get_parameters
static int get_parameters(xine_post_t *this_gen, void *param_gen)
Definition: upmix_mono.c:86
xine_post_api_t::set_parameters
int(* set_parameters)(xine_post_t *self, const void *params)
Definition: xine.h:877
ao_format_s::bits
uint32_t bits
Definition: audio_out.h:135
audio_buffer_s::frame_header_count
uint32_t frame_header_count
Definition: audio_out.h:153
post_audio_port_s::post
post_plugin_t * post
Definition: post.h:326
INT32_MAX
#define INT32_MAX
Definition: goomsl_lex.c:68
upmix_mono_parameters_s::channel
int channel
Definition: upmix_mono.c:45
SIL_FLOAT
#define SIL_FLOAT
Definition: volnorm.c:67
upmix_init_plugin
void * upmix_init_plugin(xine_t *xine, const void *data)
Definition: upmix.c:418
post_audio_port_s::bits
uint32_t bits
Definition: post.h:317
post_plugin_volnorm_s::lock
pthread_mutex_t lock
Definition: volnorm.c:92
post_plugin_upmix_mono_s::params
upmix_mono_parameters_t params
Definition: upmix_mono.c:65
XINE_POST_DATA_PARAMETERS
#define XINE_POST_DATA_PARAMETERS
Definition: xine.h:851
input
static int input(void)
Definition: goomsl_lex.c:1495
stretch_parameters_s::factor
double factor
Definition: stretch.c:192
s_param
static const biquad_t s_param[2]
Definition: upmix.c:54
bits
#define bits
xprintf
#define xprintf(xine, verbose,...)
Definition: xineutils.h:664
af_sub_t
struct af_sub_s af_sub_t
get_help
static char * get_help(void)
Definition: stretch.c:261
PARAM_ITEM
PARAM_ITEM(POST_PARAM_TYPE_INT, cut_off_freq, NULL, 0, 500, 0, "cut_off_freq")
Definition: upmix.c:85
N_
#define N_(String)
Definition: xineintl.h:47
_x_post_rewire
static void _x_post_rewire(post_plugin_t *post)
Definition: post.h:373
stretchscr_get_current
static int64_t stretchscr_get_current(scr_plugin_t *scr)
Definition: stretch.c:134
POST_PARAM_TYPE_INT
#define POST_PARAM_TYPE_INT
Definition: xine.h:899
stretch_parameters_s
Definition: stretch.c:190