diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-01-04 02:01:18 -0600 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-04-23 14:23:04 +0000 |
commit | 14c6bb798d6bebc80f07e863236adbaf8d156a9c (patch) | |
tree | 551a4b641906c2626af844fa3239c1b2b1ff0ad3 /lib/rbcodec/codecs/libopus/celt/mathops.c | |
parent | 75d93937965ec4df70d37df6d4feea04577c996b (diff) | |
download | rockbox-14c6bb798d6bebc80f07e863236adbaf8d156a9c.tar.gz rockbox-14c6bb798d6bebc80f07e863236adbaf8d156a9c.zip |
Sync opus codec to upstream git
Change-Id: I0cfcc0005c4ad7bfbb1aaf454188ce70fb043dc1
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/mathops.c')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/mathops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/mathops.c b/lib/rbcodec/codecs/libopus/celt/mathops.c index 3f8c5dcc0e..6ee9b9e101 100644 --- a/lib/rbcodec/codecs/libopus/celt/mathops.c +++ b/lib/rbcodec/codecs/libopus/celt/mathops.c | |||
@@ -38,7 +38,8 @@ | |||
38 | #include "mathops.h" | 38 | #include "mathops.h" |
39 | 39 | ||
40 | /*Compute floor(sqrt(_val)) with exact arithmetic. | 40 | /*Compute floor(sqrt(_val)) with exact arithmetic. |
41 | This has been tested on all possible 32-bit inputs.*/ | 41 | _val must be greater than 0. |
42 | This has been tested on all possible 32-bit inputs greater than 0.*/ | ||
42 | unsigned isqrt32(opus_uint32 _val){ | 43 | unsigned isqrt32(opus_uint32 _val){ |
43 | unsigned b; | 44 | unsigned b; |
44 | unsigned g; | 45 | unsigned g; |
@@ -164,7 +165,7 @@ opus_val16 celt_cos_norm(opus_val32 x) | |||
164 | { | 165 | { |
165 | return _celt_cos_pi_2(EXTRACT16(x)); | 166 | return _celt_cos_pi_2(EXTRACT16(x)); |
166 | } else { | 167 | } else { |
167 | return NEG32(_celt_cos_pi_2(EXTRACT16(65536-x))); | 168 | return NEG16(_celt_cos_pi_2(EXTRACT16(65536-x))); |
168 | } | 169 | } |
169 | } else { | 170 | } else { |
170 | if (x&0x0000ffff) | 171 | if (x&0x0000ffff) |
@@ -182,7 +183,7 @@ opus_val32 celt_rcp(opus_val32 x) | |||
182 | int i; | 183 | int i; |
183 | opus_val16 n; | 184 | opus_val16 n; |
184 | opus_val16 r; | 185 | opus_val16 r; |
185 | celt_assert2(x>0, "celt_rcp() only defined for positive values"); | 186 | celt_sig_assert(x>0); |
186 | i = celt_ilog2(x); | 187 | i = celt_ilog2(x); |
187 | /* n is Q15 with range [0,1). */ | 188 | /* n is Q15 with range [0,1). */ |
188 | n = VSHR32(x,i-15)-32768; | 189 | n = VSHR32(x,i-15)-32768; |