diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-11-18 09:56:18 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-11-18 09:56:48 +0100 |
commit | 46ae64cd60166ead412bacc1bf03e9c8f8965e2c (patch) | |
tree | 9e592667ffa91e55491a66733e5e3d7de0b666c9 /thirdparty/opus/celt/mathops.h | |
parent | 974646309bfe09c48c8a72bf751b0ea6ad8b5bc5 (diff) |
Revert "Update opus to 1.3.1 and opusfile to 0.11"
This reverts commit e00426c512a7905f5f925d382c443bab7a0ca693.
The way we handle platform-specific intrinsics is not good, so the
current state will not compile on armv8. This commit also requires
SSE4.1 support, which is likely not a good idea for portable binaries.
We'll have to redo this with more caution after 3.2 is released, or
we might simply drop opus as we're only using it as dependency for
theora right now.
Fixes #33606.
Diffstat (limited to 'thirdparty/opus/celt/mathops.h')
-rw-r--r-- | thirdparty/opus/celt/mathops.h | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/thirdparty/opus/celt/mathops.h b/thirdparty/opus/celt/mathops.h index 5e86ff0dd2..a0525a9610 100644 --- a/thirdparty/opus/celt/mathops.h +++ b/thirdparty/opus/celt/mathops.h @@ -38,44 +38,11 @@ #include "entcode.h" #include "os_support.h" -#define PI 3.141592653f - /* Multiplies two 16-bit fractional values. Bit-exactness of this macro is important */ #define FRAC_MUL16(a,b) ((16384+((opus_int32)(opus_int16)(a)*(opus_int16)(b)))>>15) unsigned isqrt32(opus_uint32 _val); -/* CELT doesn't need it for fixed-point, by analysis.c does. */ -#if !defined(FIXED_POINT) || defined(ANALYSIS_C) -#define cA 0.43157974f -#define cB 0.67848403f -#define cC 0.08595542f -#define cE ((float)PI/2) -static OPUS_INLINE float fast_atan2f(float y, float x) { - float x2, y2; - x2 = x*x; - y2 = y*y; - /* For very small values, we don't care about the answer, so - we can just return 0. */ - if (x2 + y2 < 1e-18f) - { - return 0; - } - if(x2<y2){ - float den = (y2 + cB*x2) * (y2 + cC*x2); - return -x*y*(y2 + cA*x2) / den + (y<0 ? -cE : cE); - }else{ - float den = (x2 + cB*y2) * (x2 + cC*y2); - return x*y*(x2 + cA*y2) / den + (y<0 ? -cE : cE) - (x*y<0 ? -cE : cE); - } -} -#undef cA -#undef cB -#undef cC -#undef cE -#endif - - #ifndef OVERRIDE_CELT_MAXABS16 static OPUS_INLINE opus_val32 celt_maxabs16(const opus_val16 *x, int len) { @@ -113,6 +80,7 @@ static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len) #ifndef FIXED_POINT +#define PI 3.141592653f #define celt_sqrt(x) ((float)sqrt(x)) #define celt_rsqrt(x) (1.f/celt_sqrt(x)) #define celt_rsqrt_norm(x) (celt_rsqrt(x)) @@ -179,7 +147,7 @@ static OPUS_INLINE float celt_exp2(float x) /** Integer log in base2. Undefined for zero and negative numbers */ static OPUS_INLINE opus_int16 celt_ilog2(opus_int32 x) { - celt_sig_assert(x>0); + celt_assert2(x>0, "celt_ilog2() only defined for strictly positive numbers"); return EC_ILOG(x)-1; } #endif |