(audio resamplers) use INLINE keyword

This commit is contained in:
twinaphex 2015-02-19 04:00:58 +01:00
parent 9c8dc6c437
commit 0a0d38ff78
2 changed files with 12 additions and 10 deletions
audio/drivers_resampler

View File

@ -22,6 +22,7 @@
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#include <retro_inline.h>
/* Since SSE and NEON don't provide support for trigonometric functions
* we approximate those with polynoms
@ -407,18 +408,18 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
#define CC_RESAMPLER_IDENT "C"
#if (CC_RESAMPLER_PRECISION > 4)
static inline float cc_int(float x, float b)
static INLINE float cc_int(float x, float b)
{
float val = x * b * M_PI + sinf(x * b * M_PI);
return (val > M_PI) ? M_PI : (val < -M_PI) ? -M_PI : val;
}
static inline float cc_kernel(float x, float b)
static INLINE float cc_kernel(float x, float b)
{
return (cc_int(x + 0.5, b) - cc_int(x - 0.5, b)) / (2.0 * M_PI);
}
#else
static inline float cc_int(float x, float b)
static INLINE float cc_int(float x, float b)
{
float val = x * b;
#if (CC_RESAMPLER_PRECISION > 0)
@ -427,13 +428,13 @@ static inline float cc_int(float x, float b)
return (val > 0.5) ? 0.5 : (val < -0.5) ? -0.5 : val;
}
static inline float cc_kernel(float x, float b)
static INLINE float cc_kernel(float x, float b)
{
return (cc_int(x + 0.5, b) - cc_int(x - 0.5, b));
}
#endif
static inline void add_to(const audio_frame_float_t *source,
static INLINE void add_to(const audio_frame_float_t *source,
audio_frame_float_t *target, float ratio)
{
target->l += source->l * ratio;

View File

@ -24,6 +24,7 @@
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#include <retro_inline.h>
/* Rough SNR values for upsampling:
* LOWEST: 40 dB
@ -112,7 +113,7 @@ typedef struct rarch_sinc_resampler
float *main_buffer;
} rarch_sinc_resampler_t;
static inline double sinc(double val)
static INLINE double sinc(double val)
{
if (fabs(val) < 0.00001)
return 1.0;
@ -120,14 +121,14 @@ static inline double sinc(double val)
}
#if defined(SINC_WINDOW_LANCZOS)
static inline double window_function(double idx)
static INLINE double window_function(double idx)
{
return sinc(M_PI * idx);
}
#elif defined(SINC_WINDOW_KAISER)
/* Modified Bessel function of first order.
* Check Wiki for mathematical definition ... */
static inline double besseli0(double x)
static INLINE double besseli0(double x)
{
unsigned i;
double sum = 0.0;
@ -153,7 +154,7 @@ static inline double besseli0(double x)
return sum;
}
static inline double window_function(double idx)
static INLINE double window_function(double idx)
{
return besseli0(SINC_WINDOW_KAISER_BETA * sqrt(1 - idx * idx));
}
@ -242,7 +243,7 @@ static void aligned_free__(void *ptr)
}
#if !(defined(__AVX__) && ENABLE_AVX) && !defined(__SSE__)
static inline void process_sinc_C(rarch_sinc_resampler_t *resamp,
static INLINE void process_sinc_C(rarch_sinc_resampler_t *resamp,
float *out_buffer)
{
unsigned i;