Mercurial > mplayer.hg
comparison libaf/af.h @ 24888:b2402b4f0afa
libaf: change filter input/output ratio calculations
Change the audio filters to use a double instead of rationals for the
ratio of output to input size. The rationals could overflow when
calculating the overall ratio of a filter chain and gave no real
advantage compared to doubles.
author | uau |
---|---|
date | Thu, 01 Nov 2007 06:52:01 +0000 |
parents | 484b8eaaf28f |
children | 4055d43fc406 |
comparison
equal
deleted
inserted
replaced
24887:484b8eaaf28f | 24888:b2402b4f0afa |
---|---|
63 void* setup; // setup data for this specific instance and filter | 63 void* setup; // setup data for this specific instance and filter |
64 af_data_t* data; // configuration for outgoing data stream | 64 af_data_t* data; // configuration for outgoing data stream |
65 struct af_instance_s* next; | 65 struct af_instance_s* next; |
66 struct af_instance_s* prev; | 66 struct af_instance_s* prev; |
67 double delay; // Delay caused by the filter [ms] | 67 double delay; // Delay caused by the filter [ms] |
68 frac_t mul; /* length multiplier: how much does this instance change | 68 double mul; /* length multiplier: how much does this instance change |
69 the length of the buffer. */ | 69 the length of the buffer. */ |
70 }af_instance_t; | 70 }af_instance_t; |
71 | 71 |
72 // Initialization flags | 72 // Initialization flags |
73 extern int* af_cpu_speed; | 73 extern int* af_cpu_speed; |
236 int af_resize_local_buffer(af_instance_t* af, af_data_t* data); | 236 int af_resize_local_buffer(af_instance_t* af, af_data_t* data); |
237 | 237 |
238 /* Helper function used to calculate the exact buffer length needed | 238 /* Helper function used to calculate the exact buffer length needed |
239 when buffers are resized. The returned length is >= than what is | 239 when buffers are resized. The returned length is >= than what is |
240 needed */ | 240 needed */ |
241 int af_lencalc(frac_t mul, af_data_t* data); | 241 int af_lencalc(double mul, af_data_t* data); |
242 | 242 |
243 /** | 243 /** |
244 * \brief convert dB to gain value | 244 * \brief convert dB to gain value |
245 * \param n number of values to convert | 245 * \param n number of values to convert |
246 * \param in [in] values in dB, <= -200 will become 0 gain | 246 * \param in [in] values in dB, <= -200 will become 0 gain |