mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-08 17:46:25 +01:00
Convert default resampler from libresample to libsoxr.
This commit is contained in:
41
lib-src/libsoxr/src/internal.h
Normal file
41
lib-src/libsoxr/src/internal.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* SoX Resampler Library Copyright (c) 2007-12 robs@users.sourceforge.net
|
||||
* Licence for this file: LGPL v2.1 See LICENCE for details. */
|
||||
|
||||
#if !defined soxr_internal_included
|
||||
#define soxr_internal_included
|
||||
|
||||
#include "soxr-config.h"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
#define min(a, b) ((a) <= (b) ? (a) : (b))
|
||||
#define max(a, b) ((a) >= (b) ? (a) : (b))
|
||||
|
||||
#define range_limit(x, lower, upper) (min(max(x, lower), upper))
|
||||
#define linear_to_dB(x) (log10(x) * 20)
|
||||
#define array_length(a) (sizeof(a)/sizeof(a[0]))
|
||||
#define sqr(a) ((a) * (a))
|
||||
|
||||
#if defined NDEBUG
|
||||
#ifdef __GNUC__
|
||||
void lsx_dummy(char const *, ...);
|
||||
#else
|
||||
static __inline void lsx_dummy(char const * x, ...) {}
|
||||
#endif
|
||||
#define lsx_debug if(0) lsx_dummy
|
||||
#else
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#ifdef __GNUC__
|
||||
__attribute__ ((unused))
|
||||
#endif
|
||||
static void lsx_debug(char const * fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
fputc('\n', stderr);
|
||||
va_end(args);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user