diff options
-rw-r--r-- | src/DSUtil/AudioTools.cpp | 2 | ||||
-rw-r--r-- | src/DSUtil/AudioTools.h | 2 | ||||
-rw-r--r-- | src/filters/transform/MpaDecFilter/AudioHelper.cpp | 13 |
3 files changed, 4 insertions, 13 deletions
diff --git a/src/DSUtil/AudioTools.cpp b/src/DSUtil/AudioTools.cpp index afca8dbcf..4c7a42d85 100644 --- a/src/DSUtil/AudioTools.cpp +++ b/src/DSUtil/AudioTools.cpp @@ -21,8 +21,6 @@ #include "stdafx.h" #include "AudioTools.h" -#define limit(a, x, b) if ((x) < (a)) { x = a; } else if ((x) > (b)) { x = b;} - void gain_uint8(const double factor, const size_t allsamples, uint8_t* pData) { uint8_t* end = pData + allsamples; diff --git a/src/DSUtil/AudioTools.h b/src/DSUtil/AudioTools.h index 479f3a054..ed154f192 100644 --- a/src/DSUtil/AudioTools.h +++ b/src/DSUtil/AudioTools.h @@ -35,6 +35,8 @@ #define INT24_PEAK 8388608 #define INT32_PEAK 2147483648 +#define limit(a, x, b) if ((x) < (a)) { x = a; } else if ((x) > (b)) { x = b;} + void gain_uint8(const double factor, const size_t allsamples, uint8_t* pData); void gain_int16(const double factor, const size_t allsamples, int16_t* pData); void gain_int24(const double factor, const size_t allsamples, BYTE* pData); diff --git a/src/filters/transform/MpaDecFilter/AudioHelper.cpp b/src/filters/transform/MpaDecFilter/AudioHelper.cpp index ae156710c..9daccdd0d 100644 --- a/src/filters/transform/MpaDecFilter/AudioHelper.cpp +++ b/src/filters/transform/MpaDecFilter/AudioHelper.cpp @@ -1,5 +1,5 @@ /* - * (C) 2012 see Authors.txt + * (C) 2012-2013 see Authors.txt * * This file is part of MPC-HC. * @@ -20,14 +20,7 @@ #include "stdafx.h" #include "AudioHelper.h" - -#define INT24_MAX 8388607i32 -#define INT24_MIN (-8388607i32 - 1) - -#define INT8_PEAK 128 -#define INT16_PEAK 32768 -#define INT24_PEAK 8388608 -#define INT32_PEAK 2147483648 +#include "../../../DSUtil/AudioTools.h" #define F16MAX ( float(INT16_MAX) / INT16_PEAK) #define F24MAX ( float(INT24_MAX) / INT24_PEAK) @@ -36,8 +29,6 @@ #define round_f(x) ((x) > 0 ? (x) + 0.5f : (x) - 0.5f) #define round_d(x) ((x) > 0 ? (x) + 0.5 : (x) - 0.5) -#define limit(a, x, b) if ((x) < (a)) { x = a; } else if ((x) > (b)) { x = b;} - HRESULT convert_to_int16(enum AVSampleFormat avsf, WORD nChannels, DWORD nSamples, BYTE* pIn, int16_t* pOut) { size_t allsamples = nSamples * nChannels; |